- Modified some scripts, in particular to get compareheuristics to work

with the new versions of Scyther.
This commit is contained in:
ccremers 2006-02-22 15:49:32 +00:00
parent 41e797413c
commit 494d02a524
3 changed files with 436 additions and 425 deletions

View File

@ -28,19 +28,23 @@ def parse(scout):
st = 0
for l in scout.splitlines():
data = l.split()
if len(data) > 6 and data[0] == 'claim':
tag = data[6]
if tag == 'failed:':
if len(data) > 4 and data[0] == 'claim':
# determine claim status
tag = data[4]
if tag == 'Fail':
ra = ra + 1
nc = nc + 1
elif tag == 'correct:':
elif tag == 'Ok':
nc = nc + 1
if l.rfind("complete_proof") != -1:
if l.rfind("proof of correctness") != -1:
rp = rp + 1
else:
rb = rb + 1
elif data[0] == 'states':
st = int(data[1])
# now count the states
for d in data:
if d.startswith("states="):
st = st + int(d[7:])
return (ra,rb,rp,nc,st)
@ -61,7 +65,7 @@ def test_goal_selector(goalselector, options):
import protocollist
scythertest.set_extra_parameters("--goal-select=" + str(goalselector))
scythertest.set_extra_parameters("--count-states --heuristic=" + str(goalselector))
result = str(goalselector)
plist = protocollist.from_literature()
np = len(plist)
@ -145,8 +149,8 @@ def main():
statesmax = maxor(2)
boundstatesmax = maxor(2)
for g in range(1,31):
if (g & 8) == 0:
for g in range(1,63):
if (g & 8) == 0 and (g & 4) == 0 :
(ra,rb,rp,nc,np,st) = test_goal_selector(g, options)
# Scores: bounds are negative

View File

@ -3,11 +3,10 @@
# protocol list
#
#
import os;
def list_ppfix(list, prefix, postfix):
newlist = []
for i in list:
newlist.append(prefix + i + postfix)
return newlist
return [ prefix + i + postfix for i in list]
def from_good_literature():
list = [ \
@ -38,7 +37,7 @@ def from_good_literature():
"yahalom-lowe.spdl",
"yahalom-paulson.spdl" ]
return list_ppfix(list, "../spdl/SPORE/","")
return list_ppfix(list, "/home/cas/svn/ecss/protocols/spdl/SPORE/","")
def from_bad_literature():
list = [ \
@ -56,10 +55,18 @@ def from_bad_literature():
"yahalom-ban.spdl",
"yahalom.spdl" ]
return list_ppfix(list, "../spdl/SPORE/","")
return list_ppfix(list, "/home/cas/svn/ecss/protocols/spdl/SPORE/","")
def from_literature():
return from_good_literature() + from_bad_literature()
def spdlfiletype (fn):
return fn.endswith(".spdl")
spdldir = "/home/cas/svn/ecss/protocols/spdl/SPORE/"
sl = os.listdir (spdldir)
sld = [ spdldir + i for i in filter (spdlfiletype, sl)]
##print sld
return sld
def from_others():
list = [ \

View File

@ -31,13 +31,13 @@ def parse(scout):
lines = scout.splitlines()
for line in lines:
data = line.split()
if len(data) > 6 and data[0] == 'claim':
claim = " ".join(data[1:4])
tag = data[6]
if len(data) > 4 and data[0] == 'claim':
claim = ",".join(data[1:2])
tag = data[5]
value = -1
if tag == 'failed:':
if tag == 'Fail':
value = 0
if tag == 'correct:':
if tag == 'Ok':
value = 1
if value == -1:
raise IOError, 'Scyther output for ' + commandline + ', line ' + line + ' cannot be parsed.'
@ -51,7 +51,7 @@ def parse(scout):
# Yield default protocol list (from any other one)
def default_protocols(plist):
plist.sort()
return ['../spdl/spdl-defaults.inc'] + plist
return ['/home/cas/svn/ecss/protocols/spdl/spdl-defaults.inc'] + plist
# Get the extra parameters
def get_extra_parameters():
@ -105,12 +105,12 @@ def default_arguments(plist,match,bounds):
print "Don't know bounds method", bounds
sys.exit()
args = "--arachne"
args = ""
if timer > 0:
args = args + " --timer=%i" % timer
args = args + " --max-runs=%i --max-length=%i" % (maxruns, maxlength)
matching = "--match=" + str(match)
args = "--summary " + matching + " " + args
args = "--plain " + matching + " " + args
extra = get_extra_parameters()
if extra != "":