Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add z3new as solver type command line flag, which sets sat.smt=true. #741

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion backend/cn/bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ module Verify_flags = struct
let doc = "Specify the SMT solver interface" in
Arg.(
value
& opt (some (enum [ ("z3", Simple_smt.Z3); ("cvc5", Simple_smt.CVC5) ])) None
& opt (some (enum [ ("z3", Simple_smt.Z3); ("z3new", Simple_smt.Z3new); ("cvc5", Simple_smt.CVC5) ])) None
& info [ "solver-type" ] ~docv:"z3|cvc5" ~doc)


Expand Down
8 changes: 7 additions & 1 deletion backend/cn/lib/simple_smt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ let arr_store arr i v = app_ "store" [ arr; i; v ]
to decide how to generate terms for those cases. *)
type solver_extensions =
| Z3
| Z3new
| CVC5
| Other

Expand Down Expand Up @@ -545,7 +546,7 @@ let get_model s =
match s.config.exts with
| CVC5 -> ans
| Other -> ans
| Z3 ->
| (Z3 | Z3new) ->
(* Workaround for https://github.com/Z3Prover/z3/issues/7270:
remove `as-array` *)
let rec drop_as_array x =
Expand Down Expand Up @@ -903,3 +904,8 @@ let z3 : solver_config =
(* let params = [ ("sat.smt", "true") ] in *)
let params = [] in
{ exe = "z3"; opts = [ "-in"; "-smt2" ]; params; exts = Z3; log = quiet_log }


let z3new : solver_config =
let params = [ ("sat.smt", "true"); ("model.completion", "true"); ] in
{ exe = "z3"; opts = [ "-in"; "-smt2" ]; params; exts = Z3new; log = quiet_log }
2 changes: 2 additions & 0 deletions backend/cn/lib/solver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1260,6 +1260,7 @@ let make globals =
| Some t ->
(match t with
| SMT.Z3 -> SMT.z3
| SMT.Z3new -> SMT.z3new
| SMT.CVC5 -> SMT.cvc5
| SMT.Other -> failwith "Unsupported solver.")
| None ->
Expand All @@ -1279,6 +1280,7 @@ let make globals =
Logger.make
(match !cfg.exts with
| SMT.Z3 -> "z3"
| SMT.Z3new -> "z3new"
| SMT.CVC5 -> "cvc5"
| SMT.Other -> "other")
};
Expand Down
Loading