- Added termlist iterator.
- Fixed role instance resetting role var substitutions.
This commit is contained in:
parent
0f470cf6a2
commit
fe960cfb6a
@ -656,6 +656,9 @@ roleInstance (const System sys, const Protocol protocol, const Role role,
|
|||||||
runs[rid].locals = tolist;
|
runs[rid].locals = tolist;
|
||||||
runs[rid].artefacts = artefacts;
|
runs[rid].artefacts = artefacts;
|
||||||
|
|
||||||
|
/* erase any substitutions in the role definition, as they are now copied */
|
||||||
|
termlistSubstReset (role->variables);
|
||||||
|
|
||||||
/* Determine symmetric run */
|
/* Determine symmetric run */
|
||||||
runs[rid].prevSymmRun = staticRunSymmetry (sys, rid); // symmetry reduction static analysis
|
runs[rid].prevSymmRun = staticRunSymmetry (sys, rid); // symmetry reduction static analysis
|
||||||
|
|
||||||
|
@ -774,3 +774,19 @@ termlistOrder (Termlist tl1, Termlist tl2)
|
|||||||
else
|
else
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//! Iterate over terms in termlist
|
||||||
|
/**
|
||||||
|
* Function gets terms
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
termlist_iterate (Termlist tl, int (*func) ())
|
||||||
|
{
|
||||||
|
while (tl != NULL)
|
||||||
|
{
|
||||||
|
if (!func (tl->term))
|
||||||
|
return 0;
|
||||||
|
tl = tl->next;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
@ -54,5 +54,6 @@ int validSubst (const int matchmode, const Term term);
|
|||||||
Term termFunction (Termlist fromlist, Termlist tolist, Term tx);
|
Term termFunction (Termlist fromlist, Termlist tolist, Term tx);
|
||||||
Termlist termlistForward (Termlist tl);
|
Termlist termlistForward (Termlist tl);
|
||||||
int termlistOrder (Termlist tl1, Termlist tl2);
|
int termlistOrder (Termlist tl1, Termlist tl2);
|
||||||
|
int termlist_iterate (Termlist tl, int (*func) ());
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user