Skip to content

Commit bc9bf16

Browse files
committed
ensure consistent memories
1 parent 610a0af commit bc9bf16

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/phl/ecPhlConseq.ml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ let t_eagerF_conseq pre post tc =
191191
(* -------------------------------------------------------------------- *)
192192
let t_equivS_conseq pre post tc =
193193
let es = tc1_as_equivS tc in
194+
let pre = ts_inv_rebind pre (fst es.es_ml) (fst es.es_mr) in
195+
let post = ts_inv_rebind post (fst es.es_ml) (fst es.es_mr) in
194196
let cond1, cond2 = conseq_cond_ts (es_pr es) (es_po es) pre post in
195197
let concl1 = f_forall_mems_ts_inv es.es_ml es.es_mr cond1 in
196198
let concl2 = f_forall_mems_ts_inv es.es_ml es.es_mr cond2 in

src/phl/ecPhlEqobs.ml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,22 +435,23 @@ let process_eqs env tc f =
435435
(EcPrinting.pp_form ppe) f.inv)
436436

437437
(* -------------------------------------------------------------------- *)
438-
let process_hint tc hyps (feqs, inv) =
438+
let process_hint ml mr tc hyps (feqs, inv) =
439439
let env = LDecl.toenv hyps in
440440
let doinv pf = TTC.tc1_process_prhl_form tc tbool pf in
441441
let doeq pf = process_eqs env tc (doinv pf) in
442442
let dof g = omap (EcTyping.trans_gamepath env) g in
443443
let geqs =
444444
List.map (fun ((f1,f2),geq) -> dof f1, dof f2, doeq geq)
445445
feqs in
446-
let ginv = odfl {ml=mleft;mr=mright;inv=f_true} (omap doinv inv) in
446+
let ginv = odfl {ml;mr;inv=f_true} (omap doinv inv) in
447447
geqs, ginv
448448

449449
(* -------------------------------------------------------------------- *)
450450
let process_eqobs_inS info tc =
451451
let env, hyps, _ = FApi.tc1_eflat tc in
452452
let es = tc1_as_equivS tc in
453-
let spec, inv = process_hint tc hyps info.EcParsetree.sim_hint in
453+
let ml, mr = fst es.es_ml, fst es.es_mr in
454+
let spec, inv = process_hint ml mr tc hyps info.EcParsetree.sim_hint in
454455
let eqo =
455456
match info.EcParsetree.sim_eqs with
456457
| Some pf ->
@@ -492,7 +493,8 @@ let process_eqobs_inF info tc =
492493
tc_error !!tc "no positions excepted";
493494
let env, hyps, _ = FApi.tc1_eflat tc in
494495
let ef = tc1_as_equivF tc in
495-
let spec, inv = process_hint tc hyps info.EcParsetree.sim_hint in
496+
let ml, mr = ef.ef_ml, ef.ef_mr in
497+
let spec, inv = process_hint ml mr tc hyps info.EcParsetree.sim_hint in
496498
let fl = ef.ef_fl and fr = ef.ef_fr in
497499
let eqo =
498500
match info.EcParsetree.sim_eqs with

src/phl/ecPhlLoopTx.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ let process_unroll_for side cpos tc =
320320
let (h', pos', z') = oget hds.(i-1) in
321321
FApi.t_seqs [
322322
EcPhlWp.t_wp (Some (Single (Zpr.cpos (pos-2))));
323-
EcPhlApp.t_hoare_app (Zpr.cpos (pos' - 1)) (map_ss_inv2 f_eq x {m;inv=f_int z'}) @+
323+
EcPhlApp.t_hoare_app (Zpr.cpos (pos' - 1)) (map_ss_inv2 f_eq x {m=goal_m;inv=f_int z'}) @+
324324
[t_apply_hd h'; t_conseq_nm] ] tc
325325
in
326326

0 commit comments

Comments
 (0)