Skip to content

Commit

Permalink
Merge pull request #3517 from mtzguido/z3errfix
Browse files Browse the repository at this point in the history
A better error when z3 cannot be started
  • Loading branch information
mtzguido authored Oct 3, 2024
2 parents 55e1119 + ecbbb22 commit 57b25e6
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 5 deletions.
41 changes: 38 additions & 3 deletions ocaml/fstar-lib/generated/FStar_SMTEncoding_Z3.ml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 16 additions & 2 deletions src/smtencoding/FStar.SMTEncoding.Z3.fst
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,21 @@ let check_z3version (p:proc) : unit =
()
let new_z3proc (id:string) (cmd_and_args : string & list string) : BU.proc =
let proc = BU.start_process id (fst cmd_and_args) (snd cmd_and_args) (fun s -> s = "Done!") in
let proc =
try
BU.start_process id (fst cmd_and_args) (snd cmd_and_args) (fun s -> s = "Done!")
with
| e ->
let open FStar.Pprint in
let open FStar.Errors.Msg in
Errors.raise_error0 Errors.Error_Z3InvocationError [
text "Could not start SMT solver process.";
prefix 2 1 (text "Command:" )
(fst cmd_and_args |> arbitrary_string |> squotes);
prefix 2 1 (text "Exception:")
(BU.print_exn e |> arbitrary_string);
]
in
check_z3version proc;
proc
Expand Down Expand Up @@ -804,4 +818,4 @@ let ask
just_ask ()
in
// pop "query";
result
result

0 comments on commit 57b25e6

Please sign in to comment.