From dcb1625c3a30eb965f7708ce62c74027294787b1 Mon Sep 17 00:00:00 2001 From: ccremers Date: Thu, 6 Jul 2006 15:54:14 +0000 Subject: [PATCH] - Changed my mind. --prune 0 : all attacks --prune 1 : select first attack --prune 2+: use heuristic (currently only 2 supported) --- src/cost.c | 32 ++++++++++++++++---------------- src/switches.c | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/cost.c b/src/cost.c index 71b4a39..71daa85 100644 --- a/src/cost.c +++ b/src/cost.c @@ -34,6 +34,22 @@ attackCost (const System sys) return 0; } if (switches.prune == 1) + { + // Select the first attack. + // Implied by having the cost of traces after finding an attack to be always higher. + // + if (sys->current_claim->failed > 0) + { + // we already have an attack + return INT_MAX; + } + else + { + // return some value relating to the cost (anything less than int_max will do) + return 1; + } + } + if (switches.prune == 2) { // Use nice heuristic cf. work of Gijs Hollestelle. Hand-picked parameters. int cost; @@ -51,21 +67,5 @@ attackCost (const System sys) return cost; } - if (switches.prune == 2) - { - // Select the first attack. - // Implied by having the cost of traces after finding an attack to be always higher. - // - if (sys->current_claim->failed > 0) - { - // we already have an attack - return INT_MAX; - } - else - { - // return some value relating to the cost (anything less than int_max will do) - return 1; - } - } error ("Unknown pruning method (cost function not found)"); } diff --git a/src/switches.c b/src/switches.c index 5eb248c..7ade2ea 100644 --- a/src/switches.c +++ b/src/switches.c @@ -41,7 +41,7 @@ switchesInit (int argc, char **argv) switches.tupling = 0; // Pruning and Bounding - switches.prune = 1; // default pruning method (use heuristic) + switches.prune = 2; // default pruning method (use nice heuristic) switches.maxproofdepth = INT_MAX; switches.maxtracelength = INT_MAX; switches.runs = 5; // default is 5 for usability, but -r 0 or --maxruns=0 will set it back to INT_MAX @@ -711,7 +711,7 @@ switcher (const int process, int index, int commandline) if (!process) { /* not very important - helptext (" --prune=", "pruning method when an attack is found [1]"); + helptext (" --prune=", "pruning method when an attack is found [2]"); */ } else