Added helper protocol support.
This is not a full copy from the compromise branch. In particular, some counts (in arachne.c) are missing, as well as the modified dot output (dotout.c).
This commit is contained in:
parent
2e7328e0df
commit
4ec5ea4232
@ -939,13 +939,18 @@ claimAddAll (const System sys, const Protocol protocol, const Role role)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isHelperProtocol (protocol))
|
||||||
|
{
|
||||||
addSecrecyList (role->declaredconsts);
|
addSecrecyList (role->declaredconsts);
|
||||||
addSecrecyList (role->declaredvars);
|
addSecrecyList (role->declaredvars);
|
||||||
|
|
||||||
/* full non-injective agreement and ni-synch */
|
/* full non-injective agreement and ni-synch */
|
||||||
|
claimCreate (sys, protocol, role, CLAIM_Alive, NULL, NULL, -1);
|
||||||
|
claimCreate (sys, protocol, role, CLAIM_Weakagree, NULL, NULL, -1);
|
||||||
claimCreate (sys, protocol, role, CLAIM_Niagree, NULL, NULL, -1);
|
claimCreate (sys, protocol, role, CLAIM_Niagree, NULL, NULL, -1);
|
||||||
claimCreate (sys, protocol, role, CLAIM_Nisynch, NULL, NULL, -1);
|
claimCreate (sys, protocol, role, CLAIM_Nisynch, NULL, NULL, -1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//! Compile a role
|
//! Compile a role
|
||||||
/**
|
/**
|
||||||
@ -1028,8 +1033,11 @@ roleCompile (Term nameterm, Tac tc)
|
|||||||
|
|
||||||
if (switches.addreachableclaim)
|
if (switches.addreachableclaim)
|
||||||
{
|
{
|
||||||
claimCreate (sys, thisProtocol, thisRole, CLAIM_Reachable, NULL, NULL,
|
if (!isHelperProtocol (thisProtocol))
|
||||||
-1);
|
{
|
||||||
|
claimCreate (sys, thisProtocol, thisRole, CLAIM_Reachable, NULL,
|
||||||
|
NULL, -1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (switches.addallclaims)
|
if (switches.addallclaims)
|
||||||
{
|
{
|
||||||
|
27
src/system.c
27
src/system.c
@ -1290,11 +1290,14 @@ selfSession (const System sys, const int run)
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
selfResponder (const System sys, const int run)
|
selfResponder (const System sys, const int run)
|
||||||
|
{
|
||||||
|
if (!isHelperProtocol (sys->runs[run].protocol))
|
||||||
{
|
{
|
||||||
if (sys->runs[run].role->initiator)
|
if (sys->runs[run].role->initiator)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return selfSession (sys, run);
|
return selfSession (sys, run);
|
||||||
@ -1327,11 +1330,14 @@ selfResponders (const System sys)
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
selfInitiator (const System sys, const int run)
|
selfInitiator (const System sys, const int run)
|
||||||
|
{
|
||||||
|
if (!isHelperProtocol (sys->runs[run].protocol))
|
||||||
{
|
{
|
||||||
if (sys->runs[run].role->initiator)
|
if (sys->runs[run].role->initiator)
|
||||||
{
|
{
|
||||||
return selfSession (sys, run);
|
return selfSession (sys, run);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@ -1357,3 +1363,24 @@ selfInitiators (const System sys)
|
|||||||
}
|
}
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Check a protocol for being a helper protocol.
|
||||||
|
/**
|
||||||
|
* Special helper protocols start with an '@' conform the usage in Gijs
|
||||||
|
* Hollestelle's work.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
isHelperProtocol (Protocol p)
|
||||||
|
{
|
||||||
|
if (p != NULL)
|
||||||
|
{
|
||||||
|
if (p->nameterm != NULL)
|
||||||
|
{
|
||||||
|
if (TermSymb (p->nameterm)->text[0] == '@')
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
@ -208,6 +208,7 @@ int selfResponders (const System sys);
|
|||||||
int selfInitiator (const System sys, const int run);
|
int selfInitiator (const System sys, const int run);
|
||||||
int selfInitiators (const System sys);
|
int selfInitiators (const System sys);
|
||||||
int enoughAttacks (const System sys);
|
int enoughAttacks (const System sys);
|
||||||
|
int isHelperProtocol (Protocol p);
|
||||||
|
|
||||||
|
|
||||||
//! Equality for run structure naming
|
//! Equality for run structure naming
|
||||||
|
Loading…
Reference in New Issue
Block a user