Skip to content

Commit 0df8511

Browse files
committed
Remove non-strict proof mode.
Non-strict proof-mode allows SMT failures to be catchable with `try` and affiliated. This tends to lead to hardly maintainable proofs and is not used anymore. The commits remove the internal handling of non-strict proof scripts, removing the `proof strict` / `proof -strict` syntax. The only leftover is the `try!` tactical that allows to catch SMT failures. It is useful for debugging purpose but should not remain in final scripts.
1 parent 554909c commit 0df8511

File tree

13 files changed

+74
-112
lines changed

13 files changed

+74
-112
lines changed

src/ecCommands.ml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -494,8 +494,8 @@ and process_sct_close (scope : EcScope.scope) name =
494494
and process_tactics (scope : EcScope.scope) t =
495495
let mode = (Pragma.get ()).pm_check in
496496
match t with
497-
| `Actual t -> snd (EcScope.Tactics.process scope mode t)
498-
| `Proof pm -> EcScope.Tactics.proof scope mode pm.pm_strict
497+
| `Actual t -> snd (EcScope.Tactics.process scope mode t)
498+
| `Proof -> EcScope.Tactics.proof scope
499499

500500
(* -------------------------------------------------------------------- *)
501501
and process_save (scope : EcScope.scope) ed =
@@ -524,17 +524,10 @@ and process_proverinfo scope pi =
524524

525525
(* -------------------------------------------------------------------- *)
526526
and process_pragma (scope : EcScope.scope) opt =
527-
let pragma_check mode =
528-
match EcScope.goal scope with
529-
| Some { EcScope.puc_mode = Some false } ->
530-
EcScope.hierror "pragma [Proofs:*] in non-strict proof script";
531-
| _ -> pragma_check mode
532-
in
533-
534527
match unloc opt with
535-
| x when x = Pragmas.Proofs.weak -> pragma_check `WeakCheck
536-
| x when x = Pragmas.Proofs.check -> pragma_check `Check
537-
| x when x = Pragmas.Proofs.report -> pragma_check `Report
528+
| x when x = Pragmas.Proofs.weak -> pragma_check `WeakCheck
529+
| x when x = Pragmas.Proofs.check -> pragma_check `Check
530+
| x when x = Pragmas.Proofs.report -> pragma_check `Report
538531

539532
| "noop" -> ()
540533
| "compact" -> Gc.compact ()

src/ecCommands.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ val pp_maybe_current_goal : Format.formatter -> unit
4949
(* -------------------------------------------------------------------- *)
5050
val pragma_verbose : bool -> unit
5151
val pragma_g_prall : bool -> unit
52-
val pragma_check : EcScope.Ax.mode -> unit
52+
val pragma_check : EcScope.Ax.proofmode -> unit
5353

5454
exception InvalidPragma of string
5555

src/ecHiGoal.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module LG = EcCoreLib.CI_Logic
2929
(* -------------------------------------------------------------------- *)
3030
type ttenv = {
3131
tt_provers : EcParsetree.pprover_infos -> EcProvers.prover_infos;
32-
tt_smtmode : [`Admit | `Strict | `Standard | `Report];
32+
tt_smtmode : [`Admit | `Strict | `Sloppy | `Report];
3333
tt_implicits : bool;
3434
tt_oldip : bool;
3535
tt_redlogic : bool;
@@ -141,7 +141,7 @@ let process_smt ?loc (ttenv : ttenv) pi (tc : tcenv1) =
141141
| `Admit ->
142142
t_admit tc
143143

144-
| (`Standard | `Strict) as mode ->
144+
| (`Sloppy | `Strict) as mode ->
145145
t_seq (t_simplify ~delta:`No) (t_smt ~mode pi) tc
146146

147147
| `Report ->

src/ecHiGoal.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ open EcProofTerm
1010
(* -------------------------------------------------------------------- *)
1111
type ttenv = {
1212
tt_provers : EcParsetree.pprover_infos -> EcProvers.prover_infos;
13-
tt_smtmode : [`Admit | `Strict | `Standard | `Report];
13+
tt_smtmode : [`Admit | `Strict | `Sloppy | `Report];
1414
tt_implicits : bool;
1515
tt_oldip : bool;
1616
tt_redlogic : bool;

src/ecHiTacticals.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ and process1_seq (ttenv : ttenv) (ts : ptactic list) (tc : tcenv1) =
117117
and process1_nstrict (ttenv : ttenv) (t : ptactic_core) (tc : tcenv1) =
118118
if ttenv.tt_smtmode <> `Strict then
119119
tc_error !!tc "try! can only be used in strict proof mode";
120-
let ttenv = { ttenv with tt_smtmode = `Standard } in
120+
let ttenv = { ttenv with tt_smtmode = `Sloppy } in
121121
process1_try ttenv t tc
122122

123123
(* -------------------------------------------------------------------- *)

src/ecLexer.mll

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
"first" , FIRST ; (* KW: tactical *)
6868
"last" , LAST ; (* KW: tactical *)
6969
"do" , DO ; (* KW: tactical *)
70-
"strict" , STRICT ; (* KW: tactical *)
7170
"expect" , EXPECT ; (* KW: tactical *)
7271

7372
(* Lambda tactics *)

src/ecLowGoal.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2411,13 +2411,13 @@ let t_congr (f1, f2) (args, ty) tc =
24112411
doit (List.rev args) ty tc
24122412

24132413
(* -------------------------------------------------------------------- *)
2414-
type smtmode = [`Standard | `Strict | `Report of EcLocation.t option]
2414+
type smtmode = [`Sloppy | `Strict | `Report of EcLocation.t option]
24152415

24162416
(* -------------------------------------------------------------------- *)
24172417
let t_smt ~(mode:smtmode) pi tc =
24182418
let error () =
24192419
match mode with
2420-
| `Standard ->
2420+
| `Sloppy ->
24212421
tc_error !!tc ~catchable:true "cannot prove goal"
24222422
| `Strict ->
24232423
tc_error !!tc ~catchable:false "cannot prove goal (strict)"

src/ecLowGoal.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ val t_crush_fwd : ?delta:bool -> int -> FApi.backward
317317
val t_congr : form pair -> form pair list * ty -> FApi.backward
318318

319319
(* -------------------------------------------------------------------- *)
320-
type smtmode = [`Standard | `Strict | `Report of EcLocation.t option]
320+
type smtmode = [`Sloppy | `Strict | `Report of EcLocation.t option]
321321

322322
val t_smt: mode:smtmode -> prover_infos -> FApi.backward
323323

src/ecParser.mly

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,6 @@
572572
%token SPLIT
573573
%token SPLITWHILE
574574
%token STAR
575-
%token STRICT
576575
%token SUBST
577576
%token SUFF
578577
%token SWAP
@@ -664,7 +663,6 @@ _lident:
664663
| LEFT { "left" }
665664
| RIGHT { "right" }
666665
| SOLVE { "solve" }
667-
| STRICT { "strict" }
668666
| WLOG { "wlog" }
669667
| EXLIM { "exlim" }
670668
| ECALL { "ecall" }
@@ -3533,27 +3531,8 @@ toptactic:
35333531
| t=tactics { t }
35343532

35353533
tactics_or_prf:
3536-
| t=toptactic { `Actual t }
3537-
| p=proof { `Proof p }
3538-
3539-
proof:
3540-
| PROOF modes=proofmode1* {
3541-
let seen = Hashtbl.create 0 in
3542-
List.fold_left
3543-
(fun pmodes (mode, flag) ->
3544-
if Hashtbl.mem seen mode then
3545-
parse_error mode.pl_loc (Some "duplicated flag");
3546-
Hashtbl.add seen mode ();
3547-
match unloc mode with
3548-
| `Strict -> { pmodes with pm_strict = flag; })
3549-
{ pm_strict = true; } modes
3550-
}
3551-
3552-
proofmode1:
3553-
| b=boption(MINUS) pm=loc(proofmodename) { (pm, not b) }
3554-
3555-
proofmodename:
3556-
| STRICT { `Strict }
3534+
| t=toptactic { `Actual t }
3535+
| PROOF { `Proof }
35573536

35583537
(* -------------------------------------------------------------------- *)
35593538
tcd_toptactic:

src/ecParsetree.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ type global_action =
12601260
| GsctOpen of osymbol_r
12611261
| GsctClose of osymbol_r
12621262
| Grealize of prealize located
1263-
| Gtactics of [`Proof of proofmode | `Actual of ptactic list]
1263+
| Gtactics of [`Proof | `Actual of ptactic list]
12641264
| Gtcdump of (tcdump * ptactic list)
12651265
| Gprover_info of pprover_infos
12661266
| Gsave of save located

0 commit comments

Comments
 (0)