method private queue_assertion ?(pos = Before) assertion_list =
match assertion_list with
| [] -> ()
| _ ->
let stmt = Extlib.the (self#current_stmt) in
let kf = Extlib.the (self#current_kf) in
let already_posted_assertions =
try
HStmt.find assertion_table stmt
with Not_found -> []
in let pruned_assertion_list =
List.rev (
List.fold_left
(fun acc (assertion, status_opt) ->
if not (List.exists
(fun p ->
Logic_utils.is_same_predicate
p assertion.content)
already_posted_assertions)
then (assertion, status_opt) :: acc
else acc
) [] assertion_list
)
in let loc_add_assertion assertion assertion_status_opt =
let rte_named_assertion =
{ content = assertion.content ;
loc = assertion.loc ; name = [ rte_prefix ] }
in let annot =
Logic_const.new_code_annotation
(AAssert ([], rte_named_assertion))
in
Annotations.add
stmt
[ rte_dep_state ]
(match pos with
| Before -> Db_types.Before (Db_types.User annot)
| After ->
Db_types.After (Db_types.User annot) );
let astatus = match assertion_status_opt with
| None -> Unknown
| Some checked_status -> checked_status
in
let ip = Property.ip_of_code_annot kf stmt annot in
List.iter (fun x -> S.set x [] astatus) ip
in
let () = HStmt.replace assertion_table stmt
(List.rev_append
(List.rev_map (fun (a,_) -> a.content) pruned_assertion_list)
already_posted_assertions)
in
Queue.add
(fun () ->
List.iter
(fun (assertion, assertion_status_opt) ->
loc_add_assertion assertion assertion_status_opt
) pruned_assertion_list
) self#get_filling_actions