- Improved graph coloring etc.

This commit is contained in:
ccremers 2004-07-13 09:56:19 +00:00
parent 410a35f4f4
commit ae6b85f290
3 changed files with 21 additions and 8 deletions

View File

@ -211,12 +211,12 @@ explorify (const System sys, const int run)
/* be sure to do bookkeeping for the parent state */
unsigned long int parentBuffer;
parentBuffer = sys->traceNode[sys->step - 1];
sys->traceNode[sys->step - 1] = sys->statesLow;
parentBuffer = sys->traceNode[sys->step];
sys->traceNode[sys->step] = sys->statesLow;
flag = traverse (sys);
sys->traceNode[sys->step - 1] = parentBuffer;
sys->traceNode[sys->step] = parentBuffer;
}
else
{
@ -1048,7 +1048,7 @@ violateClaim (const System sys, int length, int claimev, Termlist reqt)
/* mark the path in the state graph? */
if (sys->switchStatespace)
{
graphPath (sys,"color=red");
graphPath (sys,"shape=doubleoctagon,color=red","color=red");
}
/* Copy the current trace to the buffer, if the new one is shorter than the previous one. */

View File

@ -550,7 +550,7 @@ void graphNode (const System sys)
else
{
/* no added knowledge */
printf ("point");
printf ("point,label=\"\"");
}
printf ("];\n");
@ -571,14 +571,26 @@ void graphNode (const System sys)
printf (";\n");
}
void graphPath (const System sys, const char* params)
void graphPath (const System sys, const char* nodepar, const char* edgepar)
{
int i;
i = 0;
while (i < sys->step)
{
printf ("\tn%li [%s];\n", sys->traceNode[i], params);
/* color node */
if (nodepar != NULL)
{
printf ("\tn%li [%s];\n", sys->traceNode[i], nodepar);
}
/* color edge */
if (edgepar != NULL)
{
printf ("\tn%li -> n%li [%s];\n",
sys->traceNode[i],
sys->traceNode[i+1],
edgepar);
}
i++;
}
}

View File

@ -8,6 +8,7 @@ void attackDisplay(const System sys);
void graphInit (const System sys);
void graphDone (const System sys);
void graphNode (const System sys);
void graphPath (const System sys, const char* params);
void graphPath (const System sys, const char* nodepar, const char*
edgepar);
#endif