Skip to content

Commit 45e01be

Browse files
committed
nuke old and rebind in conseq
1 parent 72b48e4 commit 45e01be

3 files changed

Lines changed: 17 additions & 17 deletions

File tree

src/ecEnv.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,6 +1724,7 @@ module Fun = struct
17241724
let post = prF_memenv m path env in
17251725
Memory.push_active_ss post env
17261726
1727+
(* FIXME: This does not use the memory identifier except to return it *)
17271728
let hoareF_memenv mem path env =
17281729
let (ip, _) = oget (ipath_of_xpath path) in
17291730
let fun_ = snd (oget (by_ipath ip env)) in

src/phl/ecPhlConseq.ml

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ module PT = EcProofTerm
1818
module TTC = EcProofTyping
1919

2020
(* -------------------------------------------------------------------- *)
21-
let conseq_cond_old pre post spre spost =
22-
f_imp pre spre, f_imp spost post
23-
2421
let conseq_cond_ss pre post spre spost =
2522
map_ss_inv2 f_imp pre spre, map_ss_inv2 f_imp spost post
2623

@@ -103,14 +100,6 @@ let t_ehoareS_conseq pre post tc =
103100
FApi.xmutate1 tc `HlConseq [concl1; concl2; concl3]
104101

105102
(* -------------------------------------------------------------------- *)
106-
let bdHoare_conseq_conds_old cmp pr po new_pr new_po =
107-
let cond1, cond2 = conseq_cond_old pr po new_pr new_po in
108-
let cond2 = match cmp with
109-
| FHle -> f_imp po new_po
110-
| FHeq -> f_iff po new_po
111-
| FHge -> cond2
112-
in
113-
cond1, cond2
114103

115104
let bdHoare_conseq_conds cmp pr po new_pr new_po =
116105
let cond1, cond2 = conseq_cond_ss pr po new_pr new_po in
@@ -127,6 +116,8 @@ let t_bdHoareF_conseq pre post tc =
127116
let env = FApi.tc1_env tc in
128117
let bhf = tc1_as_bdhoareF tc in
129118
let mpr,mpo = EcEnv.Fun.hoareF_memenv bhf.bhf_m bhf.bhf_f env in
119+
let pre = ss_inv_rebind pre bhf.bhf_m in
120+
let post = ss_inv_rebind post bhf.bhf_m in
130121
let cond1, cond2 =
131122
bdHoare_conseq_conds bhf.bhf_cmp (bhf_pr bhf) (bhf_po bhf) pre post in
132123
let concl1 = f_forall_mems_ss_inv mpr cond1 in
@@ -137,6 +128,8 @@ let t_bdHoareF_conseq pre post tc =
137128
(* -------------------------------------------------------------------- *)
138129
let t_bdHoareS_conseq pre post tc =
139130
let bhs = tc1_as_bdhoareS tc in
131+
let pre = ss_inv_rebind pre (fst bhs.bhs_m) in
132+
let post = ss_inv_rebind post (fst bhs.bhs_m) in
140133
let cond1, cond2 =
141134
bdHoare_conseq_conds bhs.bhs_cmp (bhs_pr bhs) (bhs_po bhs) pre post in
142135
let concl1 = f_forall_mems_ss_inv bhs.bhs_m cond1 in
@@ -170,6 +163,8 @@ let t_equivF_conseq pre post tc =
170163
let ef = tc1_as_equivF tc in
171164
let (mprl,mprr), (mpol,mpor) =
172165
EcEnv.Fun.equivF_memenv ef.ef_ml ef.ef_mr ef.ef_fl ef.ef_fr env in
166+
let pre = ts_inv_rebind pre ef.ef_ml ef.ef_mr in
167+
let post = ts_inv_rebind post ef.ef_ml ef.ef_mr in
173168
let cond1, cond2 = conseq_cond_ts (ef_pr ef) (ef_po ef) pre post in
174169
let concl1 = f_forall_mems_ts_inv mprl mprr cond1 in
175170
let concl2 = f_forall_mems_ts_inv mpol mpor cond2 in
@@ -182,6 +177,8 @@ let t_eagerF_conseq pre post tc =
182177
let eg = tc1_as_eagerF tc in
183178
let (mprl,mprr), (mpol,mpor) =
184179
EcEnv.Fun.equivF_memenv eg.eg_ml eg.eg_mr eg.eg_fl eg.eg_fr env in
180+
let pre = ts_inv_rebind pre eg.eg_ml eg.eg_mr in
181+
let post = ts_inv_rebind post eg.eg_ml eg.eg_mr in
185182
let cond1, cond2 = conseq_cond_ts (eg_pr eg) (eg_po eg) pre post in
186183
let concl1 = f_forall_mems_ts_inv mprl mprr cond1 in
187184
let concl2 = f_forall_mems_ts_inv mpol mpor cond2 in

src/phl/ecPhlTrans.ml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,16 +209,18 @@ let process_trans_stmt tf s ?pat c tc =
209209
let process_trans_fun f p1 q1 p2 q2 tc =
210210
let env, hyps, _ = FApi.tc1_eflat tc in
211211
let ef = tc1_as_equivF tc in
212+
let ml, mr = ef.ef_ml, ef.ef_mr in
212213
let f = EcTyping.trans_gamepath env f in
213-
let (_, prmt), (_, pomt) = Fun.hoareF_memenv mhr f env in
214+
let m_mid = EcIdent.create "&hr" in
215+
let (_, prmt), (_, pomt) = Fun.hoareF_memenv m_mid f env in
214216
let (prml, prmr), (poml, pomr) = Fun.equivF_memenv ef.ef_ml ef.ef_mr ef.ef_fl ef.ef_fr env in
215217
let process ml mr fo =
216-
let inv = TTC.pf_process_form !!tc (LDecl.push_all [ml; mr] hyps) tbool fo in
218+
let inv = TTC.pf_process_form !!tc (LDecl.push_active_ts ml mr hyps) tbool fo in
217219
{ml=fst ml;mr=fst mr;inv} in
218-
let p1 = process prml (mright, prmt) p1 in
219-
let q1 = process poml (mright, pomt) q1 in
220-
let p2 = process (mleft,prmt) prmr p2 in
221-
let q2 = process (mleft,pomt) pomr q2 in
220+
let p1 = process prml (mr, prmt) p1 in
221+
let q1 = process poml (mr, pomt) q1 in
222+
let p2 = process (ml, prmt) prmr p2 in
223+
let q2 = process (ml, pomt) pomr q2 in
222224
t_equivF_trans f (p1, q1) (p2, q2) tc
223225

224226
(* -------------------------------------------------------------------- *)

0 commit comments

Comments
 (0)