- Fixed a bug in mgu.c (& instead of &&)
- scons shared=yes is now okay for Valgrind.
This commit is contained in:
parent
758cb88c8c
commit
54d857ca3c
@ -110,17 +110,19 @@ arachneDone ()
|
||||
#define isBound(rd) (rd->bind_run != INVALID)
|
||||
#define length step
|
||||
|
||||
#ifdef DEBUG
|
||||
//! Indent print
|
||||
void
|
||||
indentPrint ()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
int i;
|
||||
|
||||
for (i = 0; i < indentDepth; i++)
|
||||
eprintf ("| ");
|
||||
}
|
||||
#else
|
||||
eprintf (">> ");
|
||||
#endif
|
||||
}
|
||||
|
||||
//! Iterate but discard the info of the termlist
|
||||
int
|
||||
@ -384,15 +386,14 @@ bind_goal_regular (const Goal goal)
|
||||
}
|
||||
|
||||
// Bind to all possible sends or intruder node;
|
||||
return (iterate_role_sends (bind_this) &&
|
||||
add_intruder_goal_iterate (goal));
|
||||
return (iterate_role_sends (bind_this) && add_intruder_goal_iterate (goal));
|
||||
}
|
||||
|
||||
//! Bind an intruder goal to a regular run
|
||||
int
|
||||
bind_intruder_to_regular (const Goal goal)
|
||||
{
|
||||
int bind_this (Protocol p, Role r, Roledef rd, int index)
|
||||
int bind_this_f2 (Protocol p, Role r, Roledef rd, int index)
|
||||
{
|
||||
int element_f2 (Termlist substlist, Termlist keylist)
|
||||
{
|
||||
@ -427,8 +428,13 @@ bind_intruder_to_regular (const Goal goal)
|
||||
* or from a new one.
|
||||
*/
|
||||
|
||||
flag = bind_existing_run (goal, p, r, index) &&
|
||||
bind_new_run (goal, p, r, index);
|
||||
/**
|
||||
* This code has a major bug (memory destruction)
|
||||
* in both branches
|
||||
*@todo FIX!!
|
||||
*/
|
||||
flag = bind_existing_run (goal, p, r, index)
|
||||
&& bind_new_run (goal, p, r, index);
|
||||
|
||||
/**
|
||||
* deconstruct key list goals
|
||||
@ -444,11 +450,12 @@ bind_intruder_to_regular (const Goal goal)
|
||||
}
|
||||
|
||||
// Test for subterm unification
|
||||
return termMguSubTerm (goal.rd->message, rd->message, element_f2, sys->traceKnow[0]->inverses, NULL);
|
||||
return termMguSubTerm (goal.rd->message, rd->message, element_f2,
|
||||
sys->traceKnow[0]->inverses, NULL);
|
||||
}
|
||||
|
||||
// Bind to all possible sends?
|
||||
return iterate_role_sends (bind_this);
|
||||
return iterate_role_sends (bind_this_f2);
|
||||
}
|
||||
|
||||
//! Bind an intruder goal by intruder construction
|
||||
|
@ -198,7 +198,7 @@ termMguInTerm (Term t1, Term t2, int (*iterator) ())
|
||||
*/
|
||||
int
|
||||
termMguSubTerm (Term t1, Term t2, int (*iterator) (),
|
||||
const Termlist inverses, Termlist keylist)
|
||||
Termlist inverses, Termlist keylist)
|
||||
{
|
||||
int flag;
|
||||
Termlist tl;
|
||||
@ -230,7 +230,7 @@ termMguSubTerm (Term t1, Term t2, int (*iterator) (),
|
||||
|
||||
// Recurse
|
||||
flag =
|
||||
flag & termMguSubTerm (t1, t2->left.op, iterator, inverses,
|
||||
flag && termMguSubTerm (t1, t2->left.op, iterator, inverses,
|
||||
keylist_new);
|
||||
|
||||
termlistDelete (keylist_new);
|
||||
@ -242,7 +242,7 @@ termMguSubTerm (Term t1, Term t2, int (*iterator) (),
|
||||
if (tl != MGUFAIL)
|
||||
{
|
||||
// Iterate
|
||||
flag = flag & iterator (tl, keylist);
|
||||
flag = flag && iterator (tl, keylist);
|
||||
// Reset variables
|
||||
termlistSubstReset (tl);
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
Termlist termMguTerm (Term t1, Term t2);
|
||||
int termMguInTerm (Term t1, Term t2, int (*iterator) ());
|
||||
int termMguSubTerm (Term t1, Term t2, int (*iterator) (),
|
||||
const Termlist inverses, Termlist keylist);
|
||||
Termlist inverses, Termlist keylist);
|
||||
void termlistSubstReset (Termlist tl);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user