Skip to content

Commit 40e84c7

Browse files
committed
feat: new source-documented lazy/eager logic.
This logic is deliberately slightly less expressive than the one it replaces, which does not hinder usability in any cryptographic context, with the hope that it is simpler to maintain and verify.
1 parent 5223d14 commit 40e84c7

File tree

8 files changed

+485
-668
lines changed

8 files changed

+485
-668
lines changed

src/ecEnv.ml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2351,7 +2351,7 @@ module NormMp = struct
23512351
match item with
23522352
| MI_Module me -> mod_use env rm fdone us (EcPath.mqname mp me.me_name)
23532353
| MI_Variable v -> add_var env (xpath mp v.v_name) us
2354-
| MI_Function f -> fun_use_aux env rm fdone us (xpath mp f.f_name)
2354+
| MI_Function f -> gen_fun_use env fdone rm us (xpath mp f.f_name)
23552355
23562356
and body_use env rm fdone mp us comps body =
23572357
match body with
@@ -2363,9 +2363,6 @@ module NormMp = struct
23632363
| ME_Structure ms ->
23642364
List.fold_left (item_use env rm fdone mp) us ms.ms_body
23652365
2366-
and fun_use_aux env rm fdone us f =
2367-
gen_fun_use env fdone rm us f
2368-
23692366
let mod_use_top env mp =
23702367
let mp = norm_mpath env mp in
23712368
let me, _ = Mod.by_mpath mp env in

src/ecHiTacticals.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,8 @@ and process1_phl (_ : ttenv) (t : phltactic located) (tc : tcenv1) =
222222
| Peager_if -> EcPhlEager.process_if
223223
| Peager_while info -> EcPhlEager.process_while info
224224
| Peager_fun_def -> EcPhlEager.process_fun_def
225-
| Peager_fun_abs infos -> curry EcPhlEager.process_fun_abs infos
225+
| Peager_fun_abs infos -> EcPhlEager.process_fun_abs infos
226226
| Peager_call info -> EcPhlEager.process_call info
227-
| Peager infos -> curry EcPhlEager.process_eager infos
228227
| Pbd_equiv (nm, f1, f2) -> EcPhlConseq.process_bd_equiv nm (f1, f2)
229228
| Pauto -> EcPhlAuto.t_auto ~conv:`Conv
230229
| Plossless -> EcPhlHiAuto.t_lossless

src/ecParser.mly

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2844,35 +2844,25 @@ logtactic:
28442844
| WLOG b=boption(SUFF) COLON ids=loc(ipcore_name)* SLASH f=form
28452845
{ Pwlog (ids, b, f) }
28462846

2847-
eager_info:
2848-
| h=ident
2849-
{ LE_done h }
2850-
2851-
| LPAREN h=ident COLON s1=stmt TILD s2=stmt COLON pr=form LONGARROW po=form RPAREN
2852-
{ LE_todo (h, s1, s2, pr, po) }
2853-
28542847
eager_tac:
2855-
| SEQ n1=codepos1 n2=codepos1 i=eager_info COLON p=sform
2856-
{ Peager_seq (i, (n1, n2), p) }
2848+
| SEQ n1=codepos1 n2=codepos1 COLON s=stmt COLON p=form_or_double_form
2849+
{ Peager_seq ((n1, n2), s, p) }
28572850

28582851
| IF
28592852
{ Peager_if }
28602853

2861-
| WHILE i=eager_info
2854+
| WHILE i=sform
28622855
{ Peager_while i }
28632856

28642857
| PROC
28652858
{ Peager_fun_def }
28662859

2867-
| PROC i=eager_info f=sform
2868-
{ Peager_fun_abs (i, f) }
2860+
| PROC f=sform
2861+
{ Peager_fun_abs f }
28692862

28702863
| CALL info=gpterm(call_info)
28712864
{ Peager_call info }
28722865

2873-
| info=eager_info COLON p=sform
2874-
{ Peager (info, p) }
2875-
28762866
form_or_double_form:
28772867
| f=sform
28782868
{ Single f }

src/ecParsetree.ml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -596,11 +596,6 @@ type trans_formula =
596596
type trans_info =
597597
trans_kind * trans_formula
598598

599-
(* -------------------------------------------------------------------- *)
600-
type eager_info =
601-
| LE_done of psymbol
602-
| LE_todo of psymbol * pstmt * pstmt * pformula * pformula
603-
604599
(* -------------------------------------------------------------------- *)
605600
type bdh_split =
606601
| BDH_split_bop of pformula * pformula * pformula option
@@ -774,13 +769,12 @@ type phltactic =
774769
| Pprocrewrite of side option * pcodepos * prrewrite
775770

776771
(* Eager *)
777-
| Peager_seq of (eager_info * pcodepos1 pair * pformula)
772+
| Peager_seq of (pcodepos1 pair * pstmt * pformula doption)
778773
| Peager_if
779-
| Peager_while of (eager_info)
774+
| Peager_while of pformula
780775
| Peager_fun_def
781-
| Peager_fun_abs of (eager_info * pformula)
782-
| Peager_call of (call_info gppterm)
783-
| Peager of (eager_info * pformula)
776+
| Peager_fun_abs of pformula
777+
| Peager_call of call_info gppterm
784778

785779
(* Relation between logic *)
786780
| Pbd_equiv of (side * pformula * pformula)

0 commit comments

Comments
 (0)