summaryrefslogtreecommitdiff
path: root/compiler/Driver.ml
diff options
context:
space:
mode:
authorJonathan Protzenko2023-01-27 16:59:38 -0800
committerSon HO2023-06-04 21:44:33 +0200
commit1d6742c059cf53e73c9bc66cec7ac1f857830e78 (patch)
treec1d1058b9fee9f12e9410b0a8930941728b2695c /compiler/Driver.ml
parent8f27b1e64ef3dab9a314df4794ae8c361a8ef3dd (diff)
WIP lots of stuff
Diffstat (limited to 'compiler/Driver.ml')
-rw-r--r--compiler/Driver.ml34
1 files changed, 19 insertions, 15 deletions
diff --git a/compiler/Driver.ml b/compiler/Driver.ml
index 4350c9ae..f460f73d 100644
--- a/compiler/Driver.ml
+++ b/compiler/Driver.ml
@@ -95,28 +95,19 @@ let () =
" Forbid backward functions from updating the state" );
( "-template-clauses",
Arg.Set extract_template_decreases_clauses,
- " Generate templates for the required decreases clauses, in a\n\
- \ dedicated file. Reauires -decreases-clauses"
+ " Generate templates for the required decreases clauses, in a \
+ dedicated file. Implies -decreases-clauses"
);
( "-no-split-files",
Arg.Clear split_files,
- " Don't split the definitions between different files for types,\n\
- \ functions, etc." );
+ " Don't split the definitions between different files for types, \
+ functions, etc." );
( "-no-check-inv",
Arg.Clear check_invariants,
- " Deactivate the invariant sanity checks performed at every step of\n\
- \ evaluation. Dramatically saves speed." );
+ " Deactivate the invariant sanity checks performed at every step of \
+ evaluation. Dramatically saves speed." );
]
in
- (* Sanity check: -template-clauses ==> not -no-decrease-clauses *)
- assert (!extract_decreases_clauses || not !extract_template_decreases_clauses);
- (* Sanity check: -backward-no-state-update ==> not -no-state *)
- assert ((not !backward_no_state_update) || !use_state);
- (* Sanity check: the use of decrease clauses is not compatible with the use of fuel *)
- assert (
- (not !use_fuel)
- || (not !extract_decreases_clauses)
- && not !extract_template_decreases_clauses);
let spec = Arg.align spec in
let filenames = ref [] in
@@ -127,6 +118,19 @@ let () =
exit 1
in
+ if !extract_template_decreases_clauses then
+ extract_decreases_clauses := true;
+
+ (* Sanity check (now that the arguments are parsed!): -template-clauses ==> decrease-clauses *)
+ assert (!extract_decreases_clauses || not !extract_template_decreases_clauses);
+ (* Sanity check: -backward-no-state-update ==> -state *)
+ assert ((not !backward_no_state_update) || !use_state);
+ (* Sanity check: the use of decrease clauses is not compatible with the use of fuel *)
+ assert (
+ (not !use_fuel)
+ || (not !extract_decreases_clauses)
+ && not !extract_template_decreases_clauses);
+
(* Check that the user specified a backend *)
let _ =
match !opt_backend with