Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions validate-model.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,21 @@

funs = {}


def define_funs(cmds, funs):
for cmd in cmds:
match cmd:
case ("define-fun", name, *args):
funs[name] = cmd


if True:
file = sys.stdin
status = file.readline().strip()
assert status == "sat"
for line in file:
if line.strip() == "sat":
break
else:
raise ValueError("No line with 'sat' found")
content = file.read()
model = smtlib.parse_exprs(content)

Expand All @@ -34,8 +39,8 @@ def define_funs(cmds, funs):
define_funs(cmds, funs)

with open(chc_file, "r") as file:
content = file.read()
cmds = smtlib.parse_exprs(content)
content = file.read()
cmds = smtlib.parse_exprs(content)

defs = []
clauses = []
Expand All @@ -54,11 +59,11 @@ def define_funs(cmds, funs):
case ("assert", phi):
clauses.append(phi)

case ("check-sat", ):
case ("check-sat",):
pass
case ("get-model", ):
case ("get-model",):
pass
case ("exit", ):
case ("exit",):
pass

case _:
Expand All @@ -74,4 +79,4 @@ def define_funs(cmds, funs):
print(line)

print("(set-info :status unsat)")
print("(check-sat)")
print("(check-sat)")