aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChantal Keller <Chantal.Keller@inria.fr>2015-04-30 16:13:38 +0200
committerChantal Keller <Chantal.Keller@inria.fr>2015-04-30 16:13:38 +0200
commit45b32648b9039d2b124d3cb07ce4251dcd867167 (patch)
tree8692682251ca962725bc1f08957db5f8bf58cd17
parent9383fc9958b966465491c4e90afd8452704c6392 (diff)
downloadsmtcoq-45b32648b9039d2b124d3cb07ce4251dcd867167.tar.gz
smtcoq-45b32648b9039d2b124d3cb07ce4251dcd867167.zip
Generic program to run the extracted checkers (basic error messages)
-rw-r--r--src/extraction/smtcoq.ml32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/extraction/smtcoq.ml b/src/extraction/smtcoq.ml
index b88a280..f3bd6b1 100644
--- a/src/extraction/smtcoq.ml
+++ b/src/extraction/smtcoq.ml
@@ -24,21 +24,25 @@ let verifier_of_solver = function
let run s pb trace =
Printf.printf "Calling the %s verifier on %s and %s...\n" (string_of_solver s) pb trace;
let v = verifier_of_solver s in
- let t1 = Unix.time () in
- let res = v pb trace in
- let t2 = Unix.time () in
- if res then
- Printf.printf "The trace was correctly verified in %fs\n" (t2 -. t1)
- else
- Printf.printf "The verifier failed to check the trace :-(\n"
+ try
+ let t1 = Unix.time () in
+ let res = v pb trace in
+ let t2 = Unix.time () in
+ if res then
+ Printf.printf "The trace was correctly verified in %fs\n" (t2 -. t1)
+ else
+ failwith "Error"
+ with | _ -> Printf.printf "The verifier failed to check the trace :-(\n"
let _ =
- try
- let s = if Sys.argv.(1) = "-verit" then Verit else Zchaff in
- let pb = Sys.argv.((Array.length Sys.argv)-2) in
- let trace = Sys.argv.((Array.length Sys.argv)-1) in
- run s pb trace
- with
- | _ -> Printf.printf "%s" usage; exit 0
+ let (s,pb,trace) =
+ try
+ let s = if Sys.argv.(1) = "-verit" then Verit else Zchaff in
+ let pb = Sys.argv.((Array.length Sys.argv)-2) in
+ let trace = Sys.argv.((Array.length Sys.argv)-1) in
+ (s,pb,trace)
+ with
+ | _ -> Printf.printf "%s" usage; exit 0 in
+ run s pb trace