@@ -176,6 +176,26 @@ let tc1_as_equivF tc = pf_as_equivF !!tc (FApi.tc1_goal tc)
176
176
let tc1_as_equivS tc = pf_as_equivS !! tc (FApi. tc1_goal tc)
177
177
let tc1_as_eagerF tc = pf_as_eagerF !! tc (FApi. tc1_goal tc)
178
178
179
+ (* -------------------------------------------------------------------- *)
180
+ let is_program_logic (f : form ) (ks : hlkind list ) =
181
+ let do1 (k : hlkind ) =
182
+ match f.f_node, k with
183
+ | FhoareF _ , `Hoare (`Any | `Pred ) -> true
184
+ | FeHoareF _ , `EHoare (`Any | `Pred ) -> true
185
+ | FcHoareF _ , `CHoare (`Any | `Pred ) -> true
186
+ | FbdHoareF _ , `PHoare (`Any | `Pred ) -> true
187
+ | FequivF _ , `Equiv (`Any | `Pred ) -> true
188
+ | FhoareS _ , `Hoare (`Any | `Stmt ) -> true
189
+ | FeHoareS _ , `EHoare (`Any | `Stmt ) -> true
190
+ | FcHoareS _ , `CHoare (`Any | `Stmt ) -> true
191
+ | FbdHoareS _ , `PHoare (`Any | `Stmt ) -> true
192
+ | FequivS _ , `Equiv (`Any | `Stmt ) -> true
193
+ | FeagerF _ , `Eager -> true
194
+ | _ , _ -> false
195
+ in
196
+
197
+ List. exists do1 ks
198
+
179
199
(* -------------------------------------------------------------------- *)
180
200
let tc1_get_stmt side tc =
181
201
let concl = FApi. tc1_goal tc in
@@ -193,6 +213,17 @@ let tc1_get_stmt side tc =
193
213
| _ ->
194
214
tc_error_noXhl ~kinds: (hlkinds_Xhl_r `Stmt ) !! tc
195
215
216
+ (* -------------------------------------------------------------------- *)
217
+ let hl_set_stmt (side : side option ) (f : form ) (s : stmt ) =
218
+ match side, f.f_node with
219
+ | None , FhoareS hs -> f_hoareS_r { hs with hs_s = s }
220
+ | None , FeHoareS hs -> f_eHoareS_r { hs with ehs_s = s }
221
+ | None , FcHoareS hs -> f_cHoareS_r { hs with chs_s = s }
222
+ | None , FbdHoareS hs -> f_bdHoareS_r { hs with bhs_s = s }
223
+ | Some `Left , FequivS es -> f_equivS_r { es with es_sl = s }
224
+ | Some `Right , FequivS es -> f_equivS_r { es with es_sr = s }
225
+ | _ , _ -> assert false
226
+
196
227
(* -------------------------------------------------------------------- *)
197
228
let get_pre f =
198
229
match f.f_node with
0 commit comments