- 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:
parent
c330a5b719
commit
e104dddbfb
@ -549,6 +549,31 @@ first_selectable_goal (List bl)
|
|||||||
return 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
|
// Proof reporting
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
@ -3098,6 +3123,23 @@ prune_bounds ()
|
|||||||
if (enoughAttacks (sys))
|
if (enoughAttacks (sys))
|
||||||
return 1;
|
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
|
// No pruning because of bounds
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,7 @@ switchesInit (int argc, char **argv)
|
|||||||
|
|
||||||
// Arachne
|
// Arachne
|
||||||
switches.arachneSelector = 3; // default goal selection method
|
switches.arachneSelector = 3; // default goal selection method
|
||||||
|
switches.maxIntruderActions = INT_MAX; // max number of encrypt/decrypt events
|
||||||
|
|
||||||
// Misc
|
// Misc
|
||||||
switches.switchP = 0; // multi-purpose parameter
|
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
|
* External options
|
||||||
*/
|
*/
|
||||||
|
@ -44,6 +44,7 @@ struct switchdata
|
|||||||
|
|
||||||
// Arachne
|
// Arachne
|
||||||
int arachneSelector; //!< Goal selection method for Arachne engine
|
int arachneSelector; //!< Goal selection method for Arachne engine
|
||||||
|
int maxIntruderActions; //!< Maximum number of intruder actions in the semitrace (encrypt/decrypt)
|
||||||
|
|
||||||
// Misc
|
// Misc
|
||||||
int switchP; //!< A multi-purpose integer parameter, passed to the partial order reduction method selected.
|
int switchP; //!< A multi-purpose integer parameter, passed to the partial order reduction method selected.
|
||||||
|
Loading…
Reference in New Issue
Block a user