@@ -12,7 +12,16 @@ module Sid = EcIdent.Sid
12
12
13
13
(* -------------------------------------------------------------------- *)
14
14
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 =
16
25
let hyps = FApi. tc1_hyps tc in
17
26
let fresh = [" &m" ; " &m" ; " _" ; " _" ; " _" ] in
18
27
let fresh = LDecl. fresh_ids hyps fresh in
@@ -26,10 +35,7 @@ module LowInternal = struct
26
35
(EcPhlRCond. t_rcond side b (Zpr. cpos 1 ))
27
36
(FApi. t_seqs
28
37
[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])
33
39
tc
34
40
in
35
41
FApi. t_seqsub
@@ -47,7 +53,8 @@ let t_hoare_cond tc =
47
53
let t_ehoare_cond tc =
48
54
let hs = tc1_as_ehoareS tc in
49
55
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
51
58
52
59
(* -------------------------------------------------------------------- *)
53
60
let t_bdhoare_cond tc =
0 commit comments