the (monstrously large) system structure, there is now a global
'switchdata' structure originating in switches.c. This makes it much
easier to see what's happening.
* Note: although this code has been tested, there might be some
hiccups, because doing multiple search&replace actions over all
files is bound to cause some problems.
77 lines
1.3 KiB
C
77 lines
1.3 KiB
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include "term.h"
|
|
#include "system.h"
|
|
#include "debug.h"
|
|
#include "output.h"
|
|
#include "switches.h"
|
|
|
|
extern int globalLatex;
|
|
|
|
/* reportQuit is called after each violation, because it might need to abort the process */
|
|
void
|
|
reportQuit (const System sys)
|
|
{
|
|
/* determine quit or not */
|
|
if (switches.prune >= 3)
|
|
{
|
|
indent ();
|
|
printf ("Quitting after %li claims, at the first violated claim.\n",
|
|
sys->claims);
|
|
sys->maxtracelength = 0;
|
|
}
|
|
}
|
|
|
|
void
|
|
reportStart (const System sys)
|
|
{
|
|
if (!switches.latex)
|
|
{
|
|
indent ();
|
|
printf ("<REPORT>\n");
|
|
indent ();
|
|
}
|
|
statesPrint (sys);
|
|
}
|
|
|
|
void
|
|
reportMid (const System sys)
|
|
{
|
|
indent ();
|
|
printf ("Trace length %i.\n", 1 + sys->step);
|
|
if (globalLatex)
|
|
printf ("\n");
|
|
tracePrint (sys);
|
|
}
|
|
|
|
|
|
void
|
|
reportEnd (const System sys)
|
|
{
|
|
if (!switches.latex)
|
|
{
|
|
indent ();
|
|
printf ("<REPORT>\n");
|
|
}
|
|
reportQuit (sys);
|
|
}
|
|
|
|
void
|
|
reportSecrecy (const System sys, Term t)
|
|
{
|
|
if (switches.output != ATTACK)
|
|
{
|
|
reportQuit (sys);
|
|
return;
|
|
}
|
|
reportStart (sys);
|
|
indent ();
|
|
printf ("Secrecy violation of $");
|
|
termPrint (t);
|
|
printf ("$\n");
|
|
if (globalLatex)
|
|
printf ("\n");
|
|
reportMid (sys);
|
|
reportEnd (sys);
|
|
}
|