- Extra checks:

* For incomplete protocols, better handling of dangling labels.
  * For termSubTerm better handling of NULL cases.
This commit is contained in:
ccremers 2005-08-11 12:56:36 +00:00
parent c8d2222c58
commit cee11bc0af
2 changed files with 70 additions and 39 deletions

View File

@ -503,6 +503,8 @@ arachne_runs_agree (const System sys, const Claimlist cl, const Termmap runs)
int run;
run = termmapGet (runs, role);
if (run != -1)
{
#ifdef DEBUG
if (run < 0 || run >= sys->maxruns)
{
@ -539,6 +541,11 @@ arachne_runs_agree (const System sys, const Claimlist cl, const Termmap runs)
}
return rd_res;
}
else
{
return NULL;
}
}
// Main
linfo = label_find (sys->labellist, labels->term);

View File

@ -237,6 +237,7 @@ isTermEqualFn (Term term1, Term term2)
/**
*@param t Term to be checked for a subterm.
*@param tsub Subterm.
* Note that if t is non-null and tsub is null, it is a valid subterm.
*@return True iff tsub is a subterm of t.
*/
int
@ -246,9 +247,29 @@ termSubTerm (Term t, Term tsub)
tsub = deVar (tsub);
if (isTermEqual (t, tsub))
{
return 1;
if (realTermLeaf (t))
}
else
{
if (t == NULL)
{
return 0;
}
else
{
if (tsub == NULL)
{
return 1;
}
else
{
if (realTermLeaf (t))
{
return 0;
}
else
{
if (realTermTuple (t))
return (termSubTerm (TermOp1 (t), tsub)
|| termSubTerm (TermOp2 (t), tsub));
@ -256,6 +277,10 @@ termSubTerm (Term t, Term tsub)
return (termSubTerm (TermOp (t), tsub)
|| termSubTerm (TermKey (t), tsub));
}
}
}
}
}
//! See if a term is an interm of another.
/**
@ -1301,7 +1326,6 @@ termPrintDiff (Term t1, Term t2)
}
}
}
}
}
}