- Fixed a bug in the pruning algorithm, where intruder runs were also

checked for agent lists, which is false.
This commit is contained in:
ccremers 2004-08-30 22:08:44 +00:00
parent b04bc86185
commit 5c90522c55
2 changed files with 33 additions and 14 deletions

View File

@ -1253,6 +1253,9 @@ bind_goal_new_intruder_run (const Binding b)
} }
//! Bind a regular goal //! Bind a regular goal
/**
* Problem child. Valgrind does not like it.
*/
int int
bind_goal_regular_run (const Binding b) bind_goal_regular_run (const Binding b)
{ {
@ -1292,7 +1295,7 @@ bind_goal_regular_run (const Binding b)
if (!termMguSubTerm if (!termMguSubTerm
(b->term, rd->message, test_sub_unification, sys->know->inverses, NULL)) (b->term, rd->message, test_sub_unification, sys->know->inverses, NULL))
{ {
int flag; int sflag;
// A good candidate // A good candidate
found++; found++;
@ -1317,11 +1320,11 @@ bind_goal_regular_run (const Binding b)
} }
indentDepth++; indentDepth++;
// Bind to existing run // Bind to existing run
flag = bind_existing_run (b, p, r, index); sflag = bind_existing_run (b, p, r, index);
// bind to new run // bind to new run
flag = flag && bind_new_run (b, p, r, index); sflag = sflag && bind_new_run (b, p, r, index);
indentDepth--; indentDepth--;
return flag; return sflag;
} }
else else
{ {
@ -1506,7 +1509,15 @@ prune_theorems ()
run = 1; run = 1;
while (run < sys->maxruns) while (run < sys->maxruns)
{ {
if (inTermlist (sys->untrusted, agentOfRun (sys, run))) if (sys->runs[run].protocol != INTRUDER)
{
Term actor;
actor = agentOfRun(sys, run);
eprintf ("Bla %i ", run);
termPrint (actor);
eprintf ("\n");
if (inTermlist (sys->untrusted, actor))
{ {
if (sys->output == PROOF) if (sys->output == PROOF)
{ {
@ -1514,6 +1525,7 @@ prune_theorems ()
eprintf ("Pruned because the actor of run %i is untrusted.\n", run); eprintf ("Pruned because the actor of run %i is untrusted.\n", run);
} }
} }
}
run++; run++;
} }
} }

View File

@ -339,6 +339,8 @@ agentOfRunRole (const System sys, const int run, const Term role)
Termlist agents = sys->runs[run].agents; Termlist agents = sys->runs[run].agents;
/* TODO stupid reversed order, lose that soon */ /* TODO stupid reversed order, lose that soon */
if (agents != NULL)
{
agents = termlistForward (agents); agents = termlistForward (agents);
while (agents != NULL && roles != NULL) while (agents != NULL && roles != NULL)
{ {
@ -349,6 +351,11 @@ agentOfRunRole (const System sys, const int run, const Term role)
agents = agents->prev; agents = agents->prev;
roles = roles->next; roles = roles->next;
} }
}
else
{
error ("Agent list for run %i is empty, so agentOfRunRole is not usable.", run);
}
return NULL; return NULL;
} }