Skip to content

Commit 660bf07

Browse files
committed
remove unused argument extend t_code_transform to ehoare
1 parent c7dc1ec commit 660bf07

3 files changed

Lines changed: 23 additions & 18 deletions

File tree

src/ecLowPhlGoal.ml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ let t_zip f (cenv : code_txenv) (cpos : codepos) (prpo : form * form) (state, s)
789789
((me, Zpr.zip zpr, gs) : memenv * _ * form list)
790790
with InvalidCPos -> tc_error (fst cenv) "invalid code position"
791791

792-
let t_code_transform (side : oside) ?(bdhoare = false) cpos tr tx tc =
792+
let t_code_transform (side : oside) cpos tr tx tc =
793793
let pf = FApi.tc1_penv tc in
794794

795795
match side with
@@ -799,27 +799,32 @@ let t_code_transform (side : oside) ?(bdhoare = false) cpos tr tx tc =
799799
match concl.f_node with
800800
| FhoareS hs ->
801801
let pr, po = hs_pr hs, hs_po hs in
802+
(* FIXME: This is very suspicious why only main is provided ? *)
802803
let po = po.hsi_inv.main in
803804
let (me, stmt, cs) =
804805
tx (pf, hyps) cpos (pr.inv, po) (hs.hs_m, hs.hs_s) in
805806
let concl =
806-
f_hoareS (snd me) (hs_pr hs) stmt (hs_po hs)
807+
f_hoareS (snd me) pr stmt (hs_po hs)
807808
in
808809
FApi.xmutate1 tc (tr None) (cs @ [concl])
809810

810-
| FbdHoareS bhs when bdhoare ->
811+
| FbdHoareS bhs ->
811812
let pr, po = bhs_pr bhs, bhs_po bhs in
812813
let (me, stmt, cs) =
813814
tx (pf, hyps) cpos (pr.inv, po.inv) (bhs.bhs_m, bhs.bhs_s) in
814-
let concl = f_bdHoareS (snd me) (bhs_pr bhs) stmt (bhs_po bhs)
815-
bhs.bhs_cmp (bhs_bd bhs) in
815+
let concl = f_bdHoareS (snd me) pr stmt po bhs.bhs_cmp (bhs_bd bhs) in
816+
FApi.xmutate1 tc (tr None) (cs @ [concl])
817+
818+
| FeHoareS ehs ->
819+
let pr, po = ehs_pr ehs, ehs_po ehs in
820+
let (me, stmt, cs) =
821+
tx (pf, hyps) cpos (pr.inv, po.inv) (ehs.ehs_m, ehs.ehs_s) in
822+
let concl = f_eHoareS (snd me) pr stmt po in
816823
FApi.xmutate1 tc (tr None) (cs @ [concl])
817824

818825
| _ ->
819826
let kinds =
820-
(if bdhoare then [`PHoare `Stmt] else [])
821-
@ [`Hoare `Stmt] in
822-
827+
[`PHoare `Stmt; `Hoare `Stmt; `EHoare `Stmt ] in
823828
tc_error_noXhl ~kinds:kinds pf
824829
end
825830

src/phl/ecPhlCodeTx.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ let t_kill_r side cpos olen tc =
7878
in
7979

8080
let tr = fun side -> `Kill (side, cpos, olen) in
81-
t_code_transform side ~bdhoare:true cpos tr (t_zip kill_stmt) tc
81+
t_code_transform side cpos tr (t_zip kill_stmt) tc
8282

8383
(* -------------------------------------------------------------------- *)
8484
let alias_stmt env id (pf, _) me i =
@@ -109,7 +109,7 @@ let alias_stmt env id (pf, _) me i =
109109
let t_alias_r side cpos id g =
110110
let env = FApi.tc1_env g in
111111
let tr = fun side -> `Alias (side, cpos) in
112-
t_code_transform side ~bdhoare:true cpos tr (t_fold (alias_stmt env id)) g
112+
t_code_transform side cpos tr (t_fold (alias_stmt env id)) g
113113

114114
(* -------------------------------------------------------------------- *)
115115
let set_stmt (fresh, id) e =
@@ -136,7 +136,7 @@ let set_stmt (fresh, id) e =
136136

137137
let t_set_r side cpos (fresh, id) e tc =
138138
let tr = fun side -> `Set (side, cpos) in
139-
t_code_transform side ~bdhoare:true cpos tr (t_zip (set_stmt (fresh, id) e)) tc
139+
t_code_transform side cpos tr (t_zip (set_stmt (fresh, id) e)) tc
140140

141141
(* -------------------------------------------------------------------- *)
142142
let set_match_stmt (id : symbol) ((ue, mev, ptn) : _ * _ * form) =
@@ -181,7 +181,7 @@ let set_match_stmt (id : symbol) ((ue, mev, ptn) : _ * _ * form) =
181181

182182
let t_set_match_r (side : oside) (cpos : Position.codepos) (id : symbol) pattern tc =
183183
let tr = fun side -> `SetMatch (side, cpos) in
184-
t_code_transform side ~bdhoare:true cpos tr
184+
t_code_transform side cpos tr
185185
(t_zip (set_match_stmt id pattern)) tc
186186

187187
(* -------------------------------------------------------------------- *)
@@ -424,7 +424,7 @@ let t_cfold
424424
=
425425
let tr = fun side -> `Fold (side, cpos, olen) in
426426
let cb = fun cenv _ me zpr -> cfold_stmt ~eager cenv me olen zpr in
427-
t_code_transform side ~bdhoare:true cpos tr (t_zip cb) tc
427+
t_code_transform side cpos tr (t_zip cb) tc
428428

429429
(* -------------------------------------------------------------------- *)
430430
let t_kill = FApi.t_low3 "code-tx-kill" t_kill_r
@@ -619,7 +619,7 @@ let transform_if_stmt env (pf, _) me i =
619619
let t_transform_if_r side cpos g =
620620
let env = FApi.tc1_env g in
621621
let tr = fun side -> `TransformIf (side, cpos) in
622-
t_code_transform side ~bdhoare:true cpos tr (t_fold (transform_if_stmt env)) g
622+
t_code_transform side cpos tr (t_fold (transform_if_stmt env)) g
623623

624624
let t_transform_if = FApi.t_low2 "code-tx-transform_if" t_transform_if_r
625625

src/phl/ecPhlLoopTx.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ let fission_stmt (il, (d1, d2)) (pf, hyps) me zpr =
115115
let t_fission_r side cpos infos g =
116116
let tr = fun side -> `LoopFission (side, cpos, infos) in
117117
let cb = fun cenv _ me zpr -> fission_stmt infos cenv me zpr in
118-
t_code_transform side ~bdhoare:true cpos tr (t_zip cb) g
118+
t_code_transform side cpos tr (t_zip cb) g
119119

120120
let t_fission = FApi.t_low3 "loop-fission" t_fission_r
121121

@@ -170,7 +170,7 @@ let fusion_stmt (il, (d1, d2)) (pf, hyps) me zpr =
170170
let t_fusion_r side cpos infos g =
171171
let tr = fun side -> `LoopFusion (side, cpos, infos) in
172172
let cb = fun cenv _ me zpr -> fusion_stmt infos cenv me zpr in
173-
t_code_transform side ~bdhoare:true cpos tr (t_zip cb) g
173+
t_code_transform side cpos tr (t_zip cb) g
174174

175175
let t_fusion = FApi.t_low3 "loop-fusion" t_fusion_r
176176

@@ -182,7 +182,7 @@ let unroll_stmt (pf, _) me i =
182182

183183
let t_unroll_r side cpos g =
184184
let tr = fun side -> `LoopUnraoll (side, cpos) in
185-
t_code_transform side ~bdhoare:true cpos tr (t_fold unroll_stmt) g
185+
t_code_transform side cpos tr (t_fold unroll_stmt) g
186186

187187
let t_unroll = FApi.t_low2 "loop-unroll" t_unroll_r
188188

@@ -199,7 +199,7 @@ let splitwhile_stmt b (pf, _) me i =
199199

200200
let t_splitwhile_r b side cpos g =
201201
let tr = fun side -> `SplitWhile (b, side, cpos) in
202-
t_code_transform side ~bdhoare:true cpos tr (t_fold (splitwhile_stmt b)) g
202+
t_code_transform side cpos tr (t_fold (splitwhile_stmt b)) g
203203

204204
let t_splitwhile = FApi.t_low3 "split-while" t_splitwhile_r
205205

0 commit comments

Comments
 (0)