- Bug report: this should be fixed.

This commit is contained in:
ccremers 2006-03-15 08:33:09 +00:00
parent 16a59624fe
commit 2b9246bb64
7 changed files with 38 additions and 69 deletions

View File

@ -14,6 +14,7 @@
#include "specialterm.h" #include "specialterm.h"
#include "warshall.h" #include "warshall.h"
#include "hidelevel.h" #include "hidelevel.h"
#include "debug.h"
/* /*
Simple sys pointer as a global. Yields cleaner code although it's against programming standards. Simple sys pointer as a global. Yields cleaner code although it's against programming standards.

View File

@ -5,6 +5,7 @@
#include "arachne.h" #include "arachne.h"
#include "binding.h" #include "binding.h"
#include "depend.h" #include "depend.h"
#include "debug.h"
extern Protocol INTRUDER; // Pointers, to be set by the Init of arachne.c extern Protocol INTRUDER; // Pointers, to be set by the Init of arachne.c
extern Role I_M; // Same here. extern Role I_M; // Same here.
@ -1128,64 +1129,6 @@ drawIntruderChoices (const System sys)
termlistDelete (shown); termlistDelete (shown);
} }
//! Ranking info
void
showRanks (const System sys, int maxrank, int *ranks)
{
// Fourth, all ranking info
int myrank;
#ifdef DEBUG
{
int n;
eprintf ("/* ranks: %i\n", maxrank);
n = 0;
while (n < nodes)
{
eprintf ("%i ", ranks[n]);
n++;
}
eprintf ("\n*/\n\n");
}
#endif
myrank = 0;
while (myrank < maxrank)
{
int count;
int run;
int run1;
int ev1;
count = 0;
run = 0;
while (run < sys->maxruns)
{
if (sys->runs[run].protocol != INTRUDER)
{
int ev;
ev = 0;
while (ev < sys->runs[run].step)
{
if (myrank == ranks[eventNode (run, ev)])
{
if (count == 0)
eprintf ("\t{ rank = same; ");
count++;
eprintf ("r%ii%i; ", run, ev);
}
ev++;
}
}
run++;
}
if (count > 0)
eprintf ("}\t\t// rank %i\n", myrank);
myrank++;
}
}
//! Display the current semistate using dot output format. //! Display the current semistate using dot output format.
/** /**

View File

@ -8,6 +8,7 @@
#include <limits.h> #include <limits.h>
#include "hidelevel.h" #include "hidelevel.h"
#include "system.h" #include "system.h"
#include "debug.h"
extern Term TERM_Hidden; extern Term TERM_Hidden;

View File

@ -5,6 +5,7 @@
#include "substitution.h" #include "substitution.h"
#include "mgu.h" #include "mgu.h"
#include "type.h" #include "type.h"
#include "debug.h"
#include "specialterm.h" #include "specialterm.h"
/* /*

25
src/problem.spdl Normal file
View File

@ -0,0 +1,25 @@
// BAN modified version of the yahalom protocol
// Type flaw
usertype Server;
const a,b,c : Agent;
const s : Server;
secret k : Function;
protocol yahalomBan(A,B,S)
{
role B
{
const nb;
var na;
var kab;
read_1(A,B, A,na,B,S);
send_2(B,S, B,nb, {A,na}k(B,S) );
read_4(A,B, {A,kab,nb}k(B,S) , {nb}kab );
claim_6(B, Secret,kab);
}
}

View File

@ -78,13 +78,19 @@ correctLocalOrder (const System sys)
} }
else else
{ {
// not a read first? // not a read first? That's definitely impossible (can be caused by choices
globalError++; globalError++;
eprintf ("Error: term "); eprintf ("Error: term ");
termSubstPrint (t); termSubstPrint (t);
eprintf eprintf
(" from run %i should occur in run %i first in a READ event, but it occurs first in another event.\n", (" from run %i should occur in run %i first in a READ event, but it occurs first in event %i.\n",
r2, r1); r2, r1, e1);
eprintf ("It occurs first in ");
roledefPrint (eventRoledef (sys, r1, e1));
eprintf ("\n");
eprintf ("which starts with ");
roledefPrint (eventRoledef (sys, r1, 0));
eprintf ("\n");
globalError--; globalError--;
error ("Abort"); error ("Abort");
} }

View File

@ -93,11 +93,9 @@ 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->statesScenario = STATES0;
sys->interval = sys->states; //!< To keep in line with the states 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->explore = 1; // do explore the space sys->explore = 1; // do explore the space
cl = sys->claimlist; cl = sys->claimlist;
while (cl != NULL) while (cl != NULL)
@ -136,12 +134,6 @@ systemRuns (const System sys)
sys->lastChooseRun = run; sys->lastChooseRun = run;
} }
} }
#ifdef DEBUG
if (switches.scenario < 0)
{
warning ("Last run with a choose: %i", sys->lastChooseRun);
}
#endif
} }
//! Delete a system structure and clear used memory for all buffers. //! Delete a system structure and clear used memory for all buffers.