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

View File

@ -3,11 +3,10 @@
# protocol list # protocol list
# #
# #
import os;
def list_ppfix(list, prefix, postfix): def list_ppfix(list, prefix, postfix):
newlist = [] return [ prefix + i + postfix for i in list]
for i in list:
newlist.append(prefix + i + postfix)
return newlist
def from_good_literature(): def from_good_literature():
list = [ \ list = [ \
@ -38,7 +37,7 @@ def from_good_literature():
"yahalom-lowe.spdl", "yahalom-lowe.spdl",
"yahalom-paulson.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(): def from_bad_literature():
list = [ \ list = [ \
@ -56,10 +55,18 @@ def from_bad_literature():
"yahalom-ban.spdl", "yahalom-ban.spdl",
"yahalom.spdl" ] "yahalom.spdl" ]
return list_ppfix(list, "../spdl/SPORE/","") return list_ppfix(list, "/home/cas/svn/ecss/protocols/spdl/SPORE/","")
def from_literature(): 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(): def from_others():
list = [ \ list = [ \

View File

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