- Added scen_st to the output, which lists the number of states in the
specific scenario.
This commit is contained in:
parent
d75e3af55c
commit
15fcbf8090
13
src/main.c
13
src/main.c
@ -593,6 +593,15 @@ timersPrint (const System sys)
|
|||||||
statesPrintShort (sys);
|
statesPrintShort (sys);
|
||||||
eprintf ("\n");
|
eprintf ("\n");
|
||||||
|
|
||||||
|
/* scenario info */
|
||||||
|
|
||||||
|
if (sys->switchScenario > 0)
|
||||||
|
{
|
||||||
|
eprintf ("scen_st\t");
|
||||||
|
statesFormat (sys->statesScenario);
|
||||||
|
eprintf ("\n");
|
||||||
|
}
|
||||||
|
|
||||||
/* flag
|
/* flag
|
||||||
*
|
*
|
||||||
* L n Attack of length <n>
|
* L n Attack of length <n>
|
||||||
@ -651,13 +660,13 @@ timersPrint (const System sys)
|
|||||||
eprintf (":");
|
eprintf (":");
|
||||||
termPrint (cl_scan->label);
|
termPrint (cl_scan->label);
|
||||||
eprintf ("\t");
|
eprintf ("\t");
|
||||||
statesFormat (stderr, cl_scan->count);
|
statesFormat (cl_scan->count);
|
||||||
if (cl_scan->count > 0)
|
if (cl_scan->count > 0)
|
||||||
{
|
{
|
||||||
eprintf ("\t");
|
eprintf ("\t");
|
||||||
if (cl_scan->failed > 0)
|
if (cl_scan->failed > 0)
|
||||||
{
|
{
|
||||||
statesFormat (stderr, cl_scan->failed);
|
statesFormat (cl_scan->failed);
|
||||||
eprintf (" failed");
|
eprintf (" failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -202,16 +202,25 @@ executeStep (const System sys, const int run)
|
|||||||
/* we will explore this state, so count it. */
|
/* we will explore this state, so count it. */
|
||||||
sys->states = statesIncrease (sys->states);
|
sys->states = statesIncrease (sys->states);
|
||||||
|
|
||||||
|
/* what about scenario exploration? */
|
||||||
|
if (sys->switchScenario && sys->step+1 > sys->switchScenarioSize)
|
||||||
|
{
|
||||||
|
/* count states within scenario */
|
||||||
|
sys->statesScenario = statesIncrease (sys->statesScenario);
|
||||||
|
}
|
||||||
|
|
||||||
/* show progression */
|
/* show progression */
|
||||||
if (sys->switchS > 0)
|
if (sys->switchS > 0)
|
||||||
{
|
{
|
||||||
sys->interval = statesIncrease (sys->interval);
|
sys->interval = statesIncrease (sys->interval);
|
||||||
if (!statesSmallerThan (sys->interval, (unsigned long int) sys->switchS))
|
if (!statesSmallerThan (sys->interval, (unsigned long int) sys->switchS))
|
||||||
{
|
{
|
||||||
|
globalError++;
|
||||||
sys->interval = STATES0;
|
sys->interval = STATES0;
|
||||||
fprintf (stderr, "States ");
|
eprintf ("States ");
|
||||||
statesFormat (stderr, sys->states);
|
statesFormat (sys->states);
|
||||||
fprintf (stderr, " \r");
|
eprintf (" \r");
|
||||||
|
globalError--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
src/output.c
14
src/output.c
@ -529,7 +529,7 @@ void graphInit (const System sys)
|
|||||||
|
|
||||||
/* start with initial node 0 */
|
/* start with initial node 0 */
|
||||||
printf ("\tn");
|
printf ("\tn");
|
||||||
statesFormat (stdout, STATES0);
|
statesFormat (STATES0);
|
||||||
printf (" [shape=box,height=0.2,label=\"M0: ");
|
printf (" [shape=box,height=0.2,label=\"M0: ");
|
||||||
tl = knowledgeSet (sys->know);
|
tl = knowledgeSet (sys->know);
|
||||||
termlistPrint (tl);
|
termlistPrint (tl);
|
||||||
@ -560,7 +560,7 @@ void graphNode (const System sys)
|
|||||||
|
|
||||||
/* add node */
|
/* add node */
|
||||||
printf ("\tn");
|
printf ("\tn");
|
||||||
statesFormat (stdout, thisNode);
|
statesFormat (thisNode);
|
||||||
printf (" [");
|
printf (" [");
|
||||||
|
|
||||||
newtl = knowledgeNew (sys->traceKnow[index], sys->traceKnow[index+1]);
|
newtl = knowledgeNew (sys->traceKnow[index], sys->traceKnow[index+1]);
|
||||||
@ -595,9 +595,9 @@ void graphNode (const System sys)
|
|||||||
|
|
||||||
/* add edge */
|
/* add edge */
|
||||||
printf ("\tn");
|
printf ("\tn");
|
||||||
statesFormat (stdout, parentNode);
|
statesFormat (parentNode);
|
||||||
printf (" -> n");
|
printf (" -> n");
|
||||||
statesFormat (stdout, thisNode);
|
statesFormat (thisNode);
|
||||||
/* add label */
|
/* add label */
|
||||||
printf (" [label=\"");
|
printf (" [label=\"");
|
||||||
|
|
||||||
@ -641,7 +641,7 @@ void graphNodePath (const System sys, const int length, const char* nodepar)
|
|||||||
|
|
||||||
/* color node */
|
/* color node */
|
||||||
printf ("\tn");
|
printf ("\tn");
|
||||||
statesFormat (stdout, thisNode);
|
statesFormat (thisNode);
|
||||||
printf (" [%s];\n", nodepar);
|
printf (" [%s];\n", nodepar);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
@ -661,9 +661,9 @@ void graphEdgePath (const System sys, const int length, const char* edgepar)
|
|||||||
|
|
||||||
/* color edge */
|
/* color edge */
|
||||||
printf ("\tn");
|
printf ("\tn");
|
||||||
statesFormat (stdout, prevNode);
|
statesFormat (prevNode);
|
||||||
printf (" -> n");
|
printf (" -> n");
|
||||||
statesFormat (stdout, thisNode);
|
statesFormat (thisNode);
|
||||||
printf (" [%s];\n", edgepar);
|
printf (" [%s];\n", edgepar);
|
||||||
prevNode = thisNode;
|
prevNode = thisNode;
|
||||||
i++;
|
i++;
|
||||||
|
@ -31,10 +31,10 @@ statesSmallerThan (const states_t states, unsigned long int reflint)
|
|||||||
* Acts like a modified form of %g
|
* Acts like a modified form of %g
|
||||||
*/
|
*/
|
||||||
__inline__ void
|
__inline__ void
|
||||||
statesFormat (FILE* out, const states_t states)
|
statesFormat (const states_t states)
|
||||||
{
|
{
|
||||||
if (states < 1000000)
|
if (states < 1000000)
|
||||||
fprintf (out, "%lu", states);
|
eprintf ("%lu", states);
|
||||||
else
|
else
|
||||||
fprintf (out, "%.3e", statesDouble (states));
|
eprintf ("%.3e", statesDouble (states));
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,6 @@ typedef unsigned long int states_t;
|
|||||||
__inline__ states_t statesIncrease (const states_t states);
|
__inline__ states_t statesIncrease (const states_t states);
|
||||||
__inline__ double statesDouble (const states_t states);
|
__inline__ double statesDouble (const states_t states);
|
||||||
__inline__ int statesSmallerThan (const states_t states, unsigned long int reflint);
|
__inline__ int statesSmallerThan (const states_t states, unsigned long int reflint);
|
||||||
__inline__ void statesFormat (FILE* out, const states_t states);
|
__inline__ void statesFormat (const states_t states);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
14
src/system.c
14
src/system.c
@ -111,7 +111,8 @@ systemReset (const System sys)
|
|||||||
|
|
||||||
/* some initial counters */
|
/* some initial counters */
|
||||||
sys->states = statesIncrease (STATES0); //!< Initial state is not explored, so start counting at 1
|
sys->states = statesIncrease (STATES0); //!< Initial state is not explored, so start counting at 1
|
||||||
sys->interval = statesIncrease (STATES0); //!< To keep in line with the states
|
sys->statesScenario = STATES0;
|
||||||
|
sys->interval = sys->states; //!< To keep in line with the states
|
||||||
sys->claims = STATES0;
|
sys->claims = STATES0;
|
||||||
sys->failed = STATES0;
|
sys->failed = STATES0;
|
||||||
sys->countScenario = 0;
|
sys->countScenario = 0;
|
||||||
@ -205,20 +206,17 @@ systemDone (const System sys)
|
|||||||
void
|
void
|
||||||
statesPrintShort (const System sys)
|
statesPrintShort (const System sys)
|
||||||
{
|
{
|
||||||
if (globalError == 0)
|
statesFormat (sys->states);
|
||||||
statesFormat (stdout, sys->states);
|
|
||||||
else
|
|
||||||
statesFormat (stderr, sys->states);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Print the number of states.
|
//! Print the number of states.
|
||||||
void
|
void
|
||||||
statesPrint (const System sys)
|
statesPrint (const System sys)
|
||||||
{
|
{
|
||||||
statesFormat (stdout, sys->states);
|
statesFormat (sys->states);
|
||||||
printf (" states traversed.\n");
|
eprintf (" states traversed.\n");
|
||||||
if (globalLatex)
|
if (globalLatex)
|
||||||
printf("\n");
|
eprintf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Destroy a system memory block and system::runs
|
//! Destroy a system memory block and system::runs
|
||||||
|
@ -143,7 +143,8 @@ struct system
|
|||||||
int explore; //!< Boolean: explore states after actions or not.
|
int explore; //!< Boolean: explore states after actions or not.
|
||||||
|
|
||||||
/* counters */
|
/* counters */
|
||||||
states_t states;
|
states_t states; //!< States traversed
|
||||||
|
states_t statesScenario; //!< States traversed that are within the scenario, not the prefix
|
||||||
states_t interval; //!< Used to update state printing at certain intervals
|
states_t interval; //!< Used to update state printing at certain intervals
|
||||||
states_t claims; //!< Number of claims encountered.
|
states_t claims; //!< Number of claims encountered.
|
||||||
states_t failed; //!< Number of claims failed.
|
states_t failed; //!< Number of claims failed.
|
||||||
|
Loading…
Reference in New Issue
Block a user