-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.py
More file actions
36 lines (27 loc) · 990 Bytes
/
common.py
File metadata and controls
36 lines (27 loc) · 990 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from collections import namedtuple, OrderedDict
SOLVERS = OrderedDict({
"Z3" : "z3 -T:63",
"CVC4" : "cvc4 --tlimit=63000",
"BOOLECTOR" : "./tools/boolector-3.2.1/build/bin/boolector -t 63",
"YICES": "./tools/yices-2.6.2/bin/yices-smt2 --timeout=63"
})
EPSILON = 0.88 #probability with which to randomly search
EPSILON_DECAY = 0.92
TRAINING_SAMPLE = 2000
RESULTS_DIR = "results"
PROBLEM_DIR = "datasets/bv/**/*.smt2"
def output2result(problem, output):
# it's important to check for unsat first, since sat
# is a substring of unsat
if 'UNSAT' in output or 'unsat' in output:
return UNSAT_RESULT
if 'SAT' in output or 'sat' in output:
return SAT_RESULT
if 'UNKNOWN' in output or 'unknown' in output:
return UNKNOWN_RESULT
# print(problem, ': Couldn\'t parse output', file=sys.stderr)
return ERROR_RESULT
SAT_RESULT = 'sat'
UNSAT_RESULT = 'unsat'
UNKNOWN_RESULT = 'unknown'
ERROR_RESULT = 'error'