File tree Expand file tree Collapse file tree 4 files changed +28
-9
lines changed Expand file tree Collapse file tree 4 files changed +28
-9
lines changed Original file line number Diff line number Diff line change @@ -19,15 +19,18 @@ structure CVC = struct
19
19
end
20
20
21
21
fun is_configured () =
22
- Option.isSome (OS.Process.getEnv " HOL4_CVC_EXECUTABLE" )
22
+ let val v = OS.Process.getEnv " HOL4_CVC_EXECUTABLE" in
23
+ (Option.isSome v) andalso (Option.valOf v <> " " )
24
+ end ;
25
+
26
+ val error_msg = " CVC not configured: set the HOL4_CVC_EXECUTABLE environment variable to point to the cvc5 executable file." ;
23
27
24
28
fun mk_CVC_fun name pre cmd_stem post goal =
25
29
case OS.Process.getEnv " HOL4_CVC_EXECUTABLE" of
26
30
SOME file =>
27
31
SolverSpec.make_solver pre (file ^ cmd_stem) post goal
28
32
| NONE =>
29
- raise Feedback.mk_HOL_ERR " CVC" name
30
- " CVC not configured: set the HOL4_CVC_EXECUTABLE environment variable to point to the cvc5 executable file."
33
+ raise Feedback.mk_HOL_ERR " CVC" name error_msg
31
34
32
35
(* cvc5, SMT-LIB file format, no proofs *)
33
36
val CVC_SMT_Oracle =
Original file line number Diff line number Diff line change @@ -777,19 +777,25 @@ structure Yices = struct
777
777
end
778
778
779
779
fun is_configured () =
780
- Option.isSome (OS.Process.getEnv " HOL4_YICES_EXECUTABLE" )
780
+ let val v = OS.Process.getEnv " HOL4_YICES_EXECUTABLE" in
781
+ (Option.isSome v) andalso (Option.valOf v <> " " )
782
+ end ;
783
+
784
+ val error_msg = " Yices not configured: set the HOL4_YICES_EXECUTABLE environment variable to point to the Yices executable file." ;
781
785
782
786
(* Yices 1.0.29, native file format *)
783
787
fun Yices_Oracle goal =
784
788
case OS.Process.getEnv " HOL4_YICES_EXECUTABLE" of
785
789
SOME file =>
790
+ if file = " " then
791
+ raise Feedback.mk_HOL_ERR " Yices" " Yices_Oracle" error_msg
792
+ else
786
793
SolverSpec.make_solver
787
794
(Lib.pair () o goal_to_Yices)
788
795
(file ^ " -tc " )
789
796
(Lib.K result_fn)
790
797
goal
791
798
| NONE =>
792
- raise Feedback.mk_HOL_ERR " Yices" " Yices_Oracle"
793
- " Yices not configured: set the HOL4_YICES_EXECUTABLE environment variable to point to the Yices executable file."
799
+ raise Feedback.mk_HOL_ERR " Yices" " Yices_Oracle" error_msg
794
800
795
801
end
Original file line number Diff line number Diff line change @@ -21,15 +21,21 @@ structure Z3 = struct
21
21
end
22
22
23
23
fun is_configured () =
24
- Option.isSome (OS.Process.getEnv " HOL4_Z3_EXECUTABLE" )
24
+ let val v = OS.Process.getEnv " HOL4_Z3_EXECUTABLE" in
25
+ (Option.isSome v) andalso (Option.valOf v <> " " )
26
+ end ;
27
+
28
+ val error_msg = " Z3 not configured: set the HOL4_Z3_EXECUTABLE environment variable to point to the Z3 executable file." ;
25
29
26
30
fun mk_Z3_fun name pre cmd_stem post goal =
27
31
case OS.Process.getEnv " HOL4_Z3_EXECUTABLE" of
28
32
SOME file =>
33
+ if file = " " then
34
+ raise Feedback.mk_HOL_ERR " Z3" name error_msg
35
+ else
29
36
SolverSpec.make_solver pre (file ^ cmd_stem) post goal
30
37
| NONE =>
31
- raise Feedback.mk_HOL_ERR " Z3" name
32
- " Z3 not configured: set the HOL4_Z3_EXECUTABLE environment variable to point to the Z3 executable file."
38
+ raise Feedback.mk_HOL_ERR " Z3" name error_msg
33
39
34
40
(* Z3 (Linux/Unix), SMT-LIB file format, no proofs *)
35
41
val Z3_SMT_Oracle =
@@ -58,6 +64,7 @@ structure Z3 = struct
58
64
case OS.Process.getEnv " HOL4_Z3_EXECUTABLE" of
59
65
NONE => " 0"
60
66
| SOME p =>
67
+ if p = " " then " 0" else
61
68
let
62
69
val outfile = OS.FileSys.tmpName()
63
70
fun work () = let
Original file line number Diff line number Diff line change 1
1
(* Copyright (c) 2009-2012 Tjark Weber. All rights reserved. *)
2
2
3
3
(* Unit tests for HolSmtLib *)
4
+ open HolKernel Parse boolLib bossLib;
5
+
6
+ val _ = loose_equality ();
4
7
5
8
val _ = print " Testing HolSmtLib\n "
6
9
You can’t perform that action at this time.
0 commit comments