- Cleanup; make headers more compact.

This commit is contained in:
ccremers 2006-03-16 16:15:14 +00:00
parent 84d7841d91
commit a35a618a27

View File

@ -1010,16 +1010,18 @@ drawRegularRuns (const System sys)
// rho, sigma, const // rho, sigma, const
void showLocal (Term told, Term tnew) /* true if it has printed
*/
int showLocal (Term told, Term tnew)
{ {
if (realTermVariable (tnew)) if (realTermVariable (tnew))
{ {
// Variables are mapped, maybe. But then we wonder whether they occur in reads.
termPrintRemap (told);
if (termOccursInRun (tnew, run)) if (termOccursInRun (tnew, run))
{ {
Term t; Term t;
// Variables are mapped, maybe. But then we wonder whether they occur in reads.
termPrintRemap (told);
t = deVar (tnew); t = deVar (tnew);
eprintf (" : "); eprintf (" : ");
if (realTermVariable (t)) if (realTermVariable (t))
@ -1052,23 +1054,34 @@ drawRegularRuns (const System sys)
} }
else else
{ {
eprintf (" is not read"); return false;
} }
} }
else else
{ {
termPrintRemap (tnew); termPrintRemap (tnew);
} }
eprintf ("\\l"); return true;
} }
void showLocals (Termlist tlold, Termlist tlnew, void showLocals (Termlist tlold, Termlist tlnew,
Term tavoid) Term tavoid, char *sep)
{ {
int printsep;
printsep = false;
while (tlold != NULL && tlnew != NULL) while (tlold != NULL && tlnew != NULL)
{ {
if (!isTermEqual (tlold->term, tavoid)) if (!isTermEqual (tlold->term, tavoid))
{ {
showLocal (tlold->term, tlnew->term); if (printsep)
{
eprintf (sep);
printsep = false;
}
printsep =
showLocal (tlold->term,
tlnew->term);
} }
tlold = tlold->next; tlold = tlold->next;
tlnew = tlnew->next; tlnew = tlnew->next;
@ -1078,32 +1091,30 @@ drawRegularRuns (const System sys)
if (termlistLength (sys->runs[run].rho) > 1) if (termlistLength (sys->runs[run].rho) > 1)
{ {
eprintf ("|"); eprintf ("|");
if (sys->runs[run].role->initiator)
{
eprintf ("Initiates with:\\l");
}
else
{
eprintf ("Responds to:\\l");
}
showLocals (sys->runs[run].protocol-> showLocals (sys->runs[run].protocol->
rolenames, sys->runs[run].rho, rolenames, sys->runs[run].rho,
sys->runs[run].role->nameterm); sys->runs[run].role->nameterm,
"\\l");
eprintf ("\\l");
} }
if (sys->runs[run].constants != NULL) if (sys->runs[run].constants != NULL)
{ {
eprintf ("|Creates:\\l"); eprintf ("|Create ");
showLocals (sys->runs[run].role-> showLocals (sys->runs[run].role->
declaredconsts, declaredconsts,
sys->runs[run].constants, NULL); sys->runs[run].constants, NULL,
",");
eprintf ("\\l");
} }
if (sys->runs[run].sigma != NULL) if (sys->runs[run].sigma != NULL)
{ {
eprintf ("|Variables:\\l"); eprintf ("|");
showLocals (sys->runs[run].role-> showLocals (sys->runs[run].role->
declaredvars, declaredvars,
sys->runs[run].sigma, NULL); sys->runs[run].sigma, NULL,
"\\l");
eprintf ("\\l");
} }
// close up // close up