Skip to content

Commit b0c4c72

Browse files
struballeystoughton
andcommitted
Remove the iterate SMT option
The `iterate` option, when enabled, made `EcSmt.select` retry the SMT call several times, growing the relevance-selected lemma set on each attempt. Compile and llm modes hard-coded it to true at startup, which silently overrode user-specified bounds: a `smt()` call (max=0) would still ship dozens or hundreds of axioms after one or two retries, and proofs that should fail were closed by lemmas the user never asked for. Interactive mode left iteration off, so the same script behaved differently between batch and REPL. Drop the option entirely: the parsetree field, the parser keyword, the CLI flag, the scope/checkmode/prover_infos plumbing, and the iteration branch in `EcSmt.select`. SMT now always runs a single attempt with the lemma set the user requested. Co-Authored-By: Alley Stoughton <alley.stoughton@icloud.com>
1 parent cc2baa4 commit b0c4c72

14 files changed

Lines changed: 16 additions & 80 deletions

File tree

examples/MEE-CBC/CBC.eca

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -502,23 +502,24 @@ section Reduce.
502502
/\ Compute.qs{2} = (DoubleQuery.qs `|` (fset1 (s + nth witness p i))){1}).
503503
wp; rnd (fun x => x + pi{2}); auto=> /> &1 &2 ge0_iP _ _ lt_i_szp.
504504
case: (mem DoubleQuery.qs{1} _)=> //=.
505-
split=> [|_]; 1:smt (addbA addbK add0b). (* TODO: instantiate ring structure *)
505+
split=> [sR _|_]; 1:smt(addbA addbK addbC add0b). (* TODO: instantiate ring structure *)
506506
split=> [|_ r _]; 1:smt (dBlock_uffu).
507507
split=> [|_]; 1:smt (dBlock_uffu).
508-
split=> [|_]; 1:smt (addbA addbK add0b). (* TODO: instantiate ring structure *)
509-
by split=> [|/#]; 1:smt (addbA addbK add0b). (* TODO: instantiate ring structure *)
510-
split=> [|_]; 1:smt (addbA addbK add0b). (* TODO: instantiate ring structure *)
508+
split=> [|_]; 1:smt (addbA addbK addbC add0b). (* TODO: instantiate ring structure *)
509+
by split=> [|/#];
510+
split; [congr; congr; smt(addbA addbK addbC add0b) | smt()]. (* TODO: instantiate ring structure *)
511+
split=> [sR _ |_]; 1:smt (addbA addbK addbC add0b). (* TODO: instantiate ring structure *)
511512
split=> [|_ r _]; 1:smt (dBlock_uffu).
512513
split=> [|_]; 1:smt (dBlock_uffu).
513-
split=> [|_]; 1:smt (addbA addbK add0b). (* TODO: instantiate ring structure *)
514+
split=> [|_]; 1:smt (addbA addbK addbC add0b). (* TODO: instantiate ring structure *)
514515
split.
515516
by move=> h; rewrite -addbA Block.subrr Block.addr0 /= /#.
516517
by move=> h; rewrite -addbA Block.subrr Block.addr0 /= /#.
517518
wp; rnd (fun x => x + pi{2}).
518-
auto=> /> &2 szp_neq_0; split=> [|_]; 1:smt (addbA addbK add0b). (* TODO: instantiate ring structure *)
519+
auto=> /> &2 szp_neq_0; split=> [|_]; 1:smt (addbA addbK addbC add0b). (* TODO: instantiate ring structure *)
519520
split=> [|_ s _]; 1:smt (dBlock_uffu).
520521
split=> [|_]; 1:smt (dBlock_uffu).
521-
split=> [|_]; 1:smt (addbA addbK add0b). (* TODO: instantiate ring structure *)
522+
split=> [|_]; 1:smt (addbA addbK addbC add0b). (* TODO: instantiate ring structure *)
522523
smt (size_ge0).
523524
qed.
524525

src/ec.ml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,6 @@ let main () =
269269
["-profile"]
270270
else [] in
271271

272-
let iterate =
273-
if input.runo_provers.prvo_iterate then
274-
["-iterate"]
275-
else [] in
276-
277272
let why3srv =
278273
input.runo_provers.prvo_why3server
279274
|> omap (fun server -> ["-server"; server])
@@ -311,7 +306,7 @@ let main () =
311306
List.flatten [
312307
maxjobs; timeout; cpufactor; ppwidth;
313308
provers; quorum ; pragmas ; checkall;
314-
profile; iterate; why3srv ; why3 ;
309+
profile; why3srv ; why3 ;
315310
reloc ; noevict; boot ; idirs ;
316311
]
317312
in
@@ -527,7 +522,7 @@ let main () =
527522
Some [State.{ position = 0; goals = None; messages = [] }]
528523
else None in
529524

530-
{ prvopts = {cmpopts.cmpo_provers with prvo_iterate = true}
525+
{ prvopts = cmpopts.cmpo_provers
531526
; input = Some name
532527
; terminal = terminal
533528
; interactive = false
@@ -556,7 +551,7 @@ let main () =
556551
lazy (T.from_channel ~name ~progress:`Silent ~lastgoals (open_in name))
557552
in
558553

559-
{ prvopts = {llmopts.llmo_provers with prvo_iterate = true}
554+
{ prvopts = llmopts.llmo_provers
560555
; input = Some name
561556
; terminal = terminal
562557
; interactive = false
@@ -594,7 +589,6 @@ let main () =
594589
prvo_ppwidth = None;
595590
prvo_checkall = false;
596591
prvo_profile = false;
597-
prvo_iterate = false;
598592
prvo_why3server = None; }
599593
in
600594

@@ -742,7 +736,6 @@ let main () =
742736
EcCommands.cm_provers = state.prvopts.prvo_provers;
743737
EcCommands.cm_quorum = state.prvopts.prvo_quorum;
744738
EcCommands.cm_profile = state.prvopts.prvo_profile;
745-
EcCommands.cm_iterate = state.prvopts.prvo_iterate;
746739
} in
747740

748741
let checkproof = not state.docgen in

src/ecCommands.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,6 @@ type checkmode = {
846846
cm_provers : string list option;
847847
cm_quorum : int option;
848848
cm_profile : bool;
849-
cm_iterate : bool;
850849
}
851850

852851
let initial ~checkmode ~boot ~checkproof =
@@ -858,7 +857,6 @@ let initial ~checkmode ~boot ~checkproof =
858857
EcScope.Prover.po_nprovers = Some checkmode.cm_nprovers;
859858
EcScope.Prover.po_provers = (checkmode.cm_provers, []);
860859
EcScope.Prover.po_quorum = checkmode.cm_quorum;
861-
EcScope.Prover.pl_iterate = Some (checkmode.cm_iterate);
862860
} in
863861

864862
let perv = (None, (mk_loc _dummy EcCoreLib.i_Pervasive, None), Some `Export) in

src/ecCommands.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ type checkmode = {
2222
cm_provers : string list option;
2323
cm_quorum : int option;
2424
cm_profile : bool;
25-
cm_iterate : bool;
2625
}
2726

2827
val initial : checkmode:checkmode -> boot:bool -> checkproof:bool -> EcScope.scope

src/ecOptions.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ and prv_options = {
6565
prvo_ppwidth : int option;
6666
prvo_checkall : bool;
6767
prvo_profile : bool;
68-
prvo_iterate : bool;
6968
prvo_why3server : string option;
7069
}
7170

@@ -410,7 +409,6 @@ let specs = {
410409
`Spec ("pragmas" , `String, "Comma-separated list of pragmas");
411410
`Spec ("pp-width" , `Int , "pretty-printing width");
412411
`Spec ("profile" , `Flag , "Collect some profiling informations");
413-
`Spec ("iterate" , `Flag , "Force to iterate smt call");
414412
`Spec ("server" , `String, "Connect to an external Why3 server");
415413
]);
416414

@@ -535,7 +533,6 @@ let prv_options_of_values ini values =
535533
end;
536534
prvo_checkall = get_flag "check-all" values;
537535
prvo_profile = get_flag "profile" values;
538-
prvo_iterate = get_flag "iterate" values;
539536
prvo_why3server = get_string "why3server" values;
540537
}
541538

src/ecOptions.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ and prv_options = {
6161
prvo_ppwidth : int option;
6262
prvo_checkall : bool;
6363
prvo_profile : bool;
64-
prvo_iterate : bool;
6564
prvo_why3server : string option;
6665
}
6766

src/ecParser.mly

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@
152152

153153
type smt = [
154154
| `ALL
155-
| `ITERATE
156155
| `QUORUM of int
157156
| `MAXLEMMAS of int option
158157
| `MAXPROVERS of int
@@ -198,7 +197,6 @@
198197
"verbose" ;
199198
"lazy" ;
200199
"full" ;
201-
"iterate" ;
202200
"dumpin" ;
203201
"selected" ;
204202
"debug" ]
@@ -258,7 +256,6 @@
258256
| "lazy" -> `VERSION (get_as_none s o; `Lazy)
259257
| "full" -> `VERSION (get_as_none s o; `Full)
260258
| "all" -> get_as_none s o; (`ALL)
261-
| "iterate" -> get_as_none s o; (`ITERATE)
262259
| "selected" -> get_as_none s o; (`SELECTED)
263260
| "debug" -> get_as_none s o; (`DEBUG)
264261
| _ -> assert false
@@ -274,7 +271,6 @@
274271
let unwanted = ref None in
275272
let verbose = ref None in
276273
let version = ref None in
277-
let iterate = ref None in
278274
let dumpin = ref None in
279275
let selected = ref None in
280276
let debug = ref None in
@@ -318,7 +314,6 @@
318314
| `UNWANTEDLEMMAS d -> unwanted := Some d
319315
| `VERBOSE v -> verbose := Some v
320316
| `VERSION v -> version := Some v
321-
| `ITERATE -> iterate := Some true
322317
| `PROVER p -> List.iter add_prover p
323318
| `DUMPIN f -> dumpin := Some f
324319
| `SELECTED -> selected := Some true
@@ -340,7 +335,6 @@
340335
pprov_version = !version;
341336
plem_all = !all;
342337
plem_max = !mlemmas;
343-
plem_iterate = !iterate;
344338
plem_wanted = !wanted;
345339
plem_unwanted = !unwanted;
346340
plem_dumpin = !dumpin;

src/ecParsetree.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,6 @@ type pprover_infos = {
890890
pprov_version : [`Lazy | `Full] option;
891891
plem_all : bool option;
892892
plem_max : int option option;
893-
plem_iterate : bool option;
894893
plem_wanted : pdbhint option;
895894
plem_unwanted : pdbhint option;
896895
plem_dumpin : string located option;
@@ -908,7 +907,6 @@ let empty_pprover = {
908907
pprov_version = None;
909908
plem_all = None;
910909
plem_max = None;
911-
plem_iterate = None;
912910
plem_wanted = None;
913911
plem_unwanted = None;
914912
plem_dumpin = None;

src/ecProvers.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ type prover_infos = {
401401
pr_verbose : int;
402402
pr_all : bool;
403403
pr_max : int;
404-
pr_iterate : bool;
405404
pr_wanted : hints;
406405
pr_unwanted : hints;
407406
pr_dumpin : string EcLocation.located option;
@@ -418,7 +417,6 @@ let dft_prover_infos = {
418417
pr_quorum = 1;
419418
pr_verbose = 0;
420419
pr_all = false;
421-
pr_iterate = false;
422420
pr_max = 50;
423421
pr_wanted = Hints.empty;
424422
pr_unwanted = Hints.empty;

src/ecProvers.mli

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ type prover_infos = {
4949
pr_verbose : int;
5050
pr_all : bool;
5151
pr_max : int;
52-
pr_iterate : bool;
5352
pr_wanted : hints;
5453
pr_unwanted : hints;
5554
pr_dumpin : string EcLocation.located option;

0 commit comments

Comments
 (0)