- Fixed a bug in output overwrite for de-class code.

This commit is contained in:
ccremers 2006-03-31 12:24:32 +00:00
parent 4d7b744e1b
commit 8c03bba02a
3 changed files with 52 additions and 5 deletions

View File

@ -1732,6 +1732,36 @@ createNewTermGeneric (Termlist tl, Term t)
return termlistPrepend (tl, newterm); return termlistPrepend (tl, newterm);
} }
//! Construct a list of already used constants
Termlist
findUsedConstants (const System sys)
{
int run;
Termlist tl;
Termlist tlconst;
tl = NULL;
tlconst = NULL;
for (run = 0; run < sys->maxruns; run++)
{
tl = termlistAddBasics (tl, sys->runs[run].rho);
tl = termlistAddBasics (tl, sys->runs[run].sigma);
}
while (tl != NULL)
{
Term t;
t = tl->term;
if (!realTermVariable (t))
{
tlconst = termlistAddNew (tlconst, t);
}
tl = tl->next;
}
termlistDelete (tl);
return tlconst;
}
//! Create a new term with incremented run rumber, starting at sys->maxruns. //! Create a new term with incremented run rumber, starting at sys->maxruns.
/** /**
* This is a rather intricate function that tries to generate new terms of a * This is a rather intricate function that tries to generate new terms of a
@ -1812,7 +1842,7 @@ makeTraceConcrete (const System sys)
int run; int run;
changedvars = NULL; changedvars = NULL;
tlnew = NULL; tlnew = findUsedConstants (sys);
run = 0; run = 0;
while (run < sys->maxruns) while (run < sys->maxruns)

View File

@ -63,15 +63,30 @@ void
printVisualRun (int rid) printVisualRun (int rid)
{ {
int run; int run;
int displayi;
int displayr;
int display; int display;
display = 1; displayi = 0;
displayr = 0;
for (run = 0; run < rid; run++) for (run = 0; run < rid; run++)
{ {
if (sys->runs[run].protocol != INTRUDER) if (sys->runs[run].protocol != INTRUDER)
{ {
display++; displayr++;
} }
else
{
displayi++;
}
}
if (sys->runs[rid].protocol == INTRUDER)
{
display = sys->maxruns + displayi + 1;
}
else
{
display = displayr + 1;
} }
eprintf ("#%i", display); eprintf ("#%i", display);
} }

View File

@ -520,11 +520,13 @@ termlistAddRealVariables (Termlist tl, Term t)
Termlist Termlist
termlistAddBasic (Termlist tl, Term t) termlistAddBasic (Termlist tl, Term t)
{ {
t = deVar (t);
if (t == NULL) if (t == NULL)
return tl; return tl;
if (!isTermLeaf (t)) if (!realTermLeaf (t))
{ {
if (isTermEncrypt (t)) if (realTermEncrypt (t))
return termlistAddBasic (termlistAddBasic (tl, TermOp (t)), return termlistAddBasic (termlistAddBasic (tl, TermOp (t)),
TermKey (t)); TermKey (t));
else else