コード例 #1
0
ファイル: tool_duetcra.py プロジェクト: jbreck/reachc
        sys.exit(0)
    output = ""
    with open(params["logpath"],"rb") as logfile :
        mode = 0
        for line in logfile :
            if mode == 0 : 
                if line.startswith("Procedure:"):
                    output += line
                    mode = 2 
                    continue
            if mode == 2 :
                #if line.startswith("==========="):
                #    mode = 0
                #    continue
                output += line
    return output

# really should have a tool root
tool = choraconfig.get_default_tool_dict() 
tool["ID"] = "duetcra"
tool["displayname"] = "CRA"
tool["shortname"] = "cra"
tool["root"] = choraconfig.specify_tool_root_requirement("duetcra","duet.native")
tool["cmd"] = [os.path.join(tool["root"],"duet.native"),"-cra","{filename}","-test","{tmpfile}"]
tool["bounds_callout"] = duet_bounds_callout
tool["assert_results"] = duet_assert_results
tool["no_assert_line_numbers"] = True
tool["error_callout"] = choraconfig.generic_error_callout


コード例 #2
0
    text = text.replace("\n", " ")
    if re.search("result:\\s+true", text, re.I):
        results.append(("PASS", 0))
    elif re.search("result:\\s+false", text, re.I):
        results.append(("FAIL", 0))
    elif re.search("result:\\s+unknown", text, re.I):
        results.append(("FAIL", 0))
    else:
        results.append(("UNRECOGNIZED", 0))
    return results


# really should have a tool root
tool = choraconfig.get_default_tool_dict()
tool["displayname"] = "CPA-Seq"
tool["root"] = choraconfig.specify_tool_root_requirement("cpaseq", "cpa.sh")
#config_filename = "svcomp19.properties"
config_filename = "svcomp19-jbreck300.properties"
relative = "../config/"
troot = tool["root"]
for i in range(2):
    cpaseq_config = os.path.realpath(
        os.path.join(troot, relative, config_filename))
    cpash = os.path.realpath(os.path.join(troot, "cpa.sh"))
    if os.path.exists(cpaseq_config) and os.path.exists(cpash): break
    troot = troot.replace("\\ ", " ")
else:
    print "testing.py / tool_cpaseq.py: Error trying to run CPA-Seq:"
    if not os.path.exists(cpaseq_config):
        print "   Could not find the config file: " + config_filename
        print "   I'm looking in the directory " + relative
コード例 #3
0
ファイル: tool_ua.py プロジェクト: jbreck/reachc
    else :
        results.append( ("UNRECOGNIZED", 0) )
    return results

def ua_precheck(params) :
    prpfiles = [F for F in os.listdir(params["directory"]) if F.endswith(".prp")]
    if len(prpfiles) != 1 :
        print "testing.py / tool_ua.py : Error: could not find a unique .prp file in " + params["directory"]
        print "Maybe you want one of the ones from here: https://github.com/sosy-lab/sv-benchmarks/tree/master/c/properties"
        print "  (Jason: I'm guessing that the right one is 'unreach-call.prp')"
        sys.exit(0)
    # set "prpfile" entry in param dict for use in command construction
    params["prpfile"] = os.path.join(params["directory"],prpfiles[0])

# really should have a tool root
tool = choraconfig.get_default_tool_dict() 
tool["displayname"] = "U. Automizer"
tool["root"] = choraconfig.specify_tool_root_requirement("ua","Ultimate.py")
uapy = os.path.join(tool["root"],"Ultimate.py")
if not os.path.exists(uapy) :
    print "   Could not find the executable file: " + uapy
    print " File not found: " + uapy
#We used to use:
# eval "timeout $TIMEOUT $UA --full-output $directory/ALL.prp 64bit precise $infile.i &> $ua_outfile"
#Note that "{prpfile}" is set by the pre-check function
tool["cmd"] = [uapy,"--full-output","--spec","{prpfile}","--architecture","64bit","--file","{preprocessed_filename}"]
tool["precheck"] = ua_precheck
tool["assert_results"] = ua_assert_results
tool["error_callout"] = choraconfig.generic_error_callout

コード例 #4
0
ファイル: tool_icra.py プロジェクト: jbreck/reachc
        sys.exit(0)
    output = ""
    with open(params["logpath"],"rb") as logfile :
        mode = 0
        for line in logfile :
            if mode == 0 : 
                if line.startswith("Bounds on Variables"):
                    output += line
                    mode = 1
                    continue
            if mode == 1 : # skip a line
                mode = 2 
                continue
            if mode == 2 :
                if line.startswith("==========="):
                    mode = 0
                    continue
                output += line
    return output

# really should have a tool root
tool = choraconfig.get_default_tool_dict() 
tool["ID"] = "icra"
tool["displayname"] = "ICRA"
tool["root"] = choraconfig.specify_tool_root_requirement("icra","icra")
tool["cmd"] = [os.path.join(tool["root"],"icra"),"{filename}"]
tool["bounds_callout"] = icra_bounds_callout
tool["assert_results"] = icra_assert_results
tool["error_callout"] = choraconfig.generic_error_callout

コード例 #5
0
    if "logpath" not in params:
        print "ERROR: sea_assert_results was called without a path"
        sys.exit(0)
    results = list()
    with open(params["logpath"], "rb") as logfile:
        text = logfile.read()
    text = text.replace("\n", " ")
    if re.search("result\\s+true", text, re.I):
        results.append(("PASS", 0))
    elif re.search("result\\s+false", text, re.I):
        results.append(("FAIL", 0))
    elif re.search("result\\s+unknown", text, re.I):
        results.append(("FAIL", 0))
    else:
        results.append(("UNRECOGNIZED", 0))
    return results


tool = choraconfig.get_default_tool_dict()
tool["displayname"] = "SeaHorn"
tool["root"] = choraconfig.specify_tool_root_requirement("sea", "sea_svcomp")
sea_exe = os.path.join(tool["root"], "sea_svcomp")
if not os.path.exists(sea_exe):
    print "   Could not find the executable file: " + sea_exe
    print " File not found: " + sea_exe
#We used to use:
#eval "timeout $TIMEOUT $SEA $infile.i &> $sea_outfile"
tool["cmd"] = [sea_exe, "{preprocessed_filename}"]
tool["assert_results"] = sea_assert_results
tool["error_callout"] = choraconfig.generic_error_callout
コード例 #6
0
import choraconfig, re, sys, os.path

def reachc_assert_results(params) :
    if "logpath" not in params : 
        print "ERROR: reachc_assert_results was called without a path"
        sys.exit(0)
    #e.g., "Assertion on line 13 FAILED"
    results = list()
    kind_dict = {"SAT":"SAT","UNSAT":"UNSAT","UNKNOWN":"UNKNOWN"}
    regex = "RESULT: (\\S+)"
    with open(params["logpath"],"rb") as logfile :
        for line in logfile :
            matches = re.match(regex, line)
            if matches :
                for kind in kind_dict :
                    if kind in matches.group(1) :
                        results.append( (kind_dict[kind], -1) )
                        break
                else :
                    results.append( ("UNRECOGNIZED", -1 ) )
    return results

tool = choraconfig.get_default_tool_dict() 
tool["root"] = choraconfig.specify_tool_root_requirement("reachc","reachc.native")
tool["displayname"] = "ReACHC"
tool["cmd"] = [tool["root"] + "/reachc.native","{filename}"]
tool["assert_results"] = reachc_assert_results
tool["error_callout"] = choraconfig.generic_error_callout