-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_lzz.py
37 lines (25 loc) · 1018 Bytes
/
run_lzz.py
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
import argparse
import logging
import barrier
from sabbath.lzz.serialization import importLzz, importInvar
from pysmt.shortcuts import get_env, Solver
from pysmt.logics import QF_NRA
from sabbath.lzz.lzz import lzz, LzzOpt
from sabbath.mathematica.mathematica import get_mathematica, MathematicaSession
parser = argparse.ArgumentParser()
parser.add_argument("problem",help="File containing the invariant check problem")
parser.add_argument("--solver",
choices=["z3","mathsat","mathematica"],
default="z3",
help="SMT solver to use")
args = parser.parse_args()
logging.basicConfig(level=logging.DEBUG)
print("Parsing problem...")
env = get_env()
with open(args.problem, "r") as json_stream:
lzz_problem = importLzz(json_stream, env)
(name, candidate, dyn_sys, invar) = lzz_problem
solver = Solver(logic=QF_NRA, name="z3")
opt = LzzOpt(True,True)
is_invar = lzz(opt, solver, candidate, dyn_sys.get_derivator(), candidate, invar)
print(is_invar)