Files
scyther/src/report.c
ccremers 1bdaf7b5d9 - Large rewrite of switch code. Instead of having switch parameters in
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.
2005-06-07 15:02:27 +00:00

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);
}