From puramihai at gmail.com Wed Mar 17 04:28:12 2010 From: puramihai at gmail.com (Pura Mihai) Date: Wed, 17 Mar 2010 10:28:12 +0200 Subject: [Avispa-users] Sending a set Message-ID: Good day, I want to model a protocol in witch agents add their identities to the message they forward. Example: S -> B: (S) B -> C: (S, B) C-> D: (S, B,C) I modeled the coresponding information as a set (IDs : (agent) set). Each of the roles will get as parameter a different IDs variable that was initialized with {}. The problem is that I found out from the documentation that sets are transmitted through reference. So when node B will modify its IDs variable and sent it to C, IDs of S will be modified too. How can I solve this problem? Mihai Pura -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail63.csoft.net/pipermail/avispa-users/attachments/20100317/edf85ef3/attachment.htm From puramihai at gmail.com Wed Mar 17 04:40:26 2010 From: puramihai at gmail.com (Pura Mihai) Date: Wed, 17 Mar 2010 10:40:26 +0200 Subject: [Avispa-users] Sending a set Example Message-ID: Here is the code for the role role node(N : agent, RouteN : (agent) set, Snd, Rcv : channel(dy)) played_by N def= local State : nat, RP : text, T,I : agent, Ni : text init State := 1 transition forwardrdp. State = 1 /\ Rcv(RP'.I'.T'.Ni'.RouteN') =|> State' := 1 /\ RouteN' := cons(N,RouteN') /\ Snd(RP'.I'.T'.Ni'.RouteN') end role /////////////////////////////////////////// So the agent needs to extract the set, add its identity to its contents, and then send the new set. It is an intermediary node in DSR routing protocol. Mihai Pura -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail63.csoft.net/pipermail/avispa-users/attachments/20100317/4b01c1d4/attachment.htm From puramihai at gmail.com Wed Mar 17 04:59:02 2010 From: puramihai at gmail.com (Pura Mihai) Date: Wed, 17 Mar 2010 10:59:02 +0200 Subject: [Avispa-users] Send a set over a channel Message-ID: I have just tested the approach suggested by Tigran S. Avanesov: role node(N : agent, RouteN : message, Snd, Rcv : channel(dy)) played_by N def= local State : nat, RP : text, T,I : agent, Ni : text init State := 1 transition forwardrdp. State = 1 /\ Rcv(RP'.I'.T'.Ni'.RouteN') =|> State' := 1 /\ Snd(RP'.I'.T'.Ni'.RouteN'.N) end role The problem is that in environment role I have several instances for the role node. And all these instances should do the same thing: receive the message, add their identities and then send the message to the next node. Using the above approach the message format changes for each forwarding. So the next node will not accept the forwarded message. For example: node(U,S2,R2) /\node(K,S4,R4) /\target(V,S3,R3) the second node will not accept de message Mihai -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail63.csoft.net/pipermail/avispa-users/attachments/20100317/d12f4089/attachment-0001.htm