- Fixed the very annoying bug! The problem was in roleInstance for
Arachne. When a subst was carried out by an Rolename->compoundTerm substitution, the compound term was not duplicated, and this caused problems at roledef destruction.
This commit is contained in:
parent
ff224fee8a
commit
a3828a028f
@ -278,10 +278,11 @@ bind_new_run (const Goal goal, const Protocol p, const Role r,
|
||||
e_term2 = rd->message;
|
||||
#endif
|
||||
|
||||
iterate ();
|
||||
flag = iterate ();
|
||||
|
||||
goal.rd->bind_run = old_run;
|
||||
goal.rd->bind_index = old_index;
|
||||
|
||||
roleInstanceDestroy (sys);
|
||||
return flag;
|
||||
}
|
||||
|
@ -208,7 +208,9 @@ termMguSubTerm (Term t1, Term t2, int (*iterator) (),
|
||||
|
||||
flag = 1;
|
||||
t2 = deVar (t2);
|
||||
if (t2 != NULL && !isTermLeaf (t2))
|
||||
if (t2 != NULL)
|
||||
{
|
||||
if (!isTermLeaf (t2))
|
||||
{
|
||||
if (isTermTuple (t2))
|
||||
{
|
||||
@ -249,5 +251,6 @@ termMguSubTerm (Term t1, Term t2, int (*iterator) (),
|
||||
// Reset variables
|
||||
termlistSubstReset (tl);
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
10
src/system.c
10
src/system.c
@ -591,11 +591,12 @@ roleInstance (const System sys, const Protocol protocol, const Role role,
|
||||
Term newt, oldt;
|
||||
|
||||
oldt = scanfrom->term;
|
||||
newt = deVar (oldt);
|
||||
newt = oldt;
|
||||
if (realTermVariable (newt))
|
||||
{
|
||||
// Make new var for this run
|
||||
newt = makeTermType (VARIABLE, newt->left.symb, rid);
|
||||
newt->subst = oldt->subst;
|
||||
artefacts = termlistAdd (artefacts, newt);
|
||||
}
|
||||
// Add to agent list, possibly
|
||||
@ -689,13 +690,12 @@ roleInstance (const System sys, const Protocol protocol, const Role role,
|
||||
void
|
||||
roleInstanceDestroy (const System sys)
|
||||
{
|
||||
int runid;
|
||||
|
||||
runid = sys->maxruns - 1;
|
||||
if (runid >= 0)
|
||||
if (sys->maxruns > 0)
|
||||
{
|
||||
int runid;
|
||||
struct run myrun;
|
||||
|
||||
runid = sys->maxruns - 1;
|
||||
myrun = sys->runs[runid];
|
||||
|
||||
// Destroy roledef
|
||||
|
Loading…
Reference in New Issue
Block a user