- Added a switch to number the limit of intruder actions.

Initial testing suggests it does not influence the number of states
  much for values of 2 and higher.
This commit is contained in:
ccremers 2005-08-21 21:38:32 +00:00
parent c330a5b719
commit e104dddbfb
3 changed files with 57 additions and 0 deletions

View File

@ -549,6 +549,31 @@ first_selectable_goal (List bl)
return bl;
}
//! Count intruder events
int
countIntruderActions ()
{
int count;
int run;
count = 0;
run = 0;
while (run < sys->maxruns)
{
if (sys->runs[run].protocol == INTRUDER)
{
// Only intruder roles
if (sys->runs[run].role != I_M)
{
// The M_0 (initial knowledge) events don't count.
count++;
}
}
run++;
}
return count;
}
//------------------------------------------------------------------------
// Proof reporting
//------------------------------------------------------------------------
@ -3098,6 +3123,23 @@ prune_bounds ()
if (enoughAttacks (sys))
return 1;
// Limit on intruder events count
if (switches.maxIntruderActions < INT_MAX)
{
// Only check if actually used
if (countIntruderActions () > switches.maxIntruderActions)
{
if (switches.output == PROOF)
{
indentPrint ();
eprintf
("Pruned: more than %i encrypt/decrypt events in the semitrace.\n",
switches.maxIntruderActions);
}
return 1;
}
}
// No pruning because of bounds
return 0;
}

View File

@ -65,6 +65,7 @@ switchesInit (int argc, char **argv)
// Arachne
switches.arachneSelector = 3; // default goal selection method
switches.maxIntruderActions = INT_MAX; // max number of encrypt/decrypt events
// Misc
switches.switchP = 0; // multi-purpose parameter
@ -543,6 +544,19 @@ switcher (const int process, int index)
}
}
if (detect (' ', "intruder-actions", 1))
{
if (!process)
{
/* fairly technical, untested pruning */
}
else
{
switches.maxIntruderActions = integer_argument ();
return index;
}
}
/* ==================
* External options
*/

View File

@ -44,6 +44,7 @@ struct switchdata
// Arachne
int arachneSelector; //!< Goal selection method for Arachne engine
int maxIntruderActions; //!< Maximum number of intruder actions in the semitrace (encrypt/decrypt)
// Misc
int switchP; //!< A multi-purpose integer parameter, passed to the partial order reduction method selected.