Skip to content

Commit 75718ab

Browse files
bgregoirstrub
authored andcommitted
fix tactic ehoare-if
1 parent be15a49 commit 75718ab

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

src/phl/ecPhlCond.ml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,16 @@ module Sid = EcIdent.Sid
1212

1313
(* -------------------------------------------------------------------- *)
1414
module LowInternal = struct
15-
let t_gen_cond side e tc =
15+
16+
let t_finalize h h1 h2 =
17+
FApi.t_seqs [t_elim_hyp h;
18+
t_intros_i [h1;h2];
19+
t_apply_hyp h2]
20+
21+
let t_finalize_ehoare h _h1 _h2 tc =
22+
t_apply_hyp h tc
23+
24+
let t_gen_cond ?(t_finalize=t_finalize) side e tc =
1625
let hyps = FApi.tc1_hyps tc in
1726
let fresh = ["&m"; "&m"; "_"; "_"; "_"] in
1827
let fresh = LDecl.fresh_ids hyps fresh in
@@ -26,10 +35,7 @@ module LowInternal = struct
2635
(EcPhlRCond.t_rcond side b (Zpr.cpos 1))
2736
(FApi.t_seqs
2837
[t_introm; EcPhlSkip.t_skip; t_intros_i [m2;h];
29-
FApi.t_seqs [t_elim_hyp h;
30-
t_intros_i [h1;h2];
31-
t_apply_hyp h2];
32-
t_simplify])
38+
t_finalize h h1 h2; t_simplify])
3339
tc
3440
in
3541
FApi.t_seqsub
@@ -47,7 +53,8 @@ let t_hoare_cond tc =
4753
let t_ehoare_cond tc =
4854
let hs = tc1_as_ehoareS tc in
4955
let (e,_,_) = fst (tc1_first_if tc hs.ehs_s) in
50-
LowInternal.t_gen_cond None (form_of_expr (EcMemory.memory hs.ehs_m) e) tc
56+
LowInternal.t_gen_cond ~t_finalize:LowInternal.t_finalize_ehoare
57+
None (form_of_expr (EcMemory.memory hs.ehs_m) e) tc
5158

5259
(* -------------------------------------------------------------------- *)
5360
let t_bdhoare_cond tc =

0 commit comments

Comments
 (0)