- Previous entry was buggy; killing the roledef removed very extensive

parts of the tree. Solved by restoring it after recursing, which is
  waht should have happened in the first place.
- It's still a good improvement though.
This commit is contained in:
ccremers 2004-07-14 12:46:11 +00:00
parent 32c4183315
commit 27d3bb4061

View File

@ -193,7 +193,7 @@ executeStep (const System sys, const int run)
/** /**
* remove from a roledef that is instantiated, the uninteresting ends bits * remove from a roledef that is instantiated, the uninteresting ends bits
*/ */
void removeIrrelevant (const System sys, const int run, Roledef rd) Roledef removeIrrelevant (const System sys, const int run, Roledef rd)
{ {
Roledef rdkill; Roledef rdkill;
int killclaims; int killclaims;
@ -227,8 +227,7 @@ void removeIrrelevant (const System sys, const int run, Roledef rd)
*/ */
/* remove after rdkill */ /* remove after rdkill */
roledefDelete (rdkill->next); return rdkill;
rdkill->next = NULL;
} }
//! Explores the system state given by the next step of a run. //! Explores the system state given by the next step of a run.
@ -242,9 +241,11 @@ explorify (const System sys, const int run)
Roledef rd; Roledef rd;
int flag; int flag;
int myStep; int myStep;
Roledef roleCap, roleCapPart;
rd = runPointerGet (sys, run); rd = runPointerGet (sys, run);
myStep = sys->runs[run].step; myStep = sys->runs[run].step;
roleCap = NULL;
if (rd == NULL) if (rd == NULL)
{ {
@ -341,7 +342,7 @@ explorify (const System sys, const int run)
/* Special check 3: if after choosing, this run ends on (read|skippedclaim)*, we can remove that part already. /* Special check 3: if after choosing, this run ends on (read|skippedclaim)*, we can remove that part already.
*/ */
removeIrrelevant (sys, run, rd); roleCap = removeIrrelevant (sys, run, rd);
/* Special check x: if all agents in each run send only encrypted stuff, and all agents are trusted, /* Special check x: if all agents in each run send only encrypted stuff, and all agents are trusted,
* there is no way for the intruder to learn anything else than encrypted terms, so secrecy claims will not * there is no way for the intruder to learn anything else than encrypted terms, so secrecy claims will not
@ -362,6 +363,12 @@ explorify (const System sys, const int run)
} }
/* Apparently, all is well, and we can explore further */ /* Apparently, all is well, and we can explore further */
flag = 0;
if (roleCap != NULL)
{
roleCapPart = roleCap->next;
roleCap->next = NULL;
}
if (executeStep (sys, run)) if (executeStep (sys, run))
{ {
/* traverse the system after the step */ /* traverse the system after the step */
@ -370,9 +377,12 @@ explorify (const System sys, const int run)
sys->runs[run].step = myStep; // reset local index sys->runs[run].step = myStep; // reset local index
sys->step--; sys->step--;
indentSet (sys->step); indentSet (sys->step);
return flag;
} }
return 0; if (roleCap != NULL)
{
roleCap->next = roleCapPart;
}
return flag;
} }
int int