let check_preconditions ~slevel header state requires =
match requires with
| [] -> state
| _ ->
let vc = Logic_const.pands
(List.map Logic_const.pred_of_id_pred requires)
in
let res = eval_predicate ~result:None state vc in
(match res with
| True ->
List.iter (fun p -> Status.join_predicate p (status_true))
requires
| False ->
List.iter (fun p -> Status.join_predicate p (status_false))
requires
| Unknown ->
List.iter (fun p -> Status.join_predicate p (status_maybe))
requires);
Value_parameters.result ~current:true ~once:true
"Precondition of %s got status %s."
header (string_of_status res) ;
reduce_by_disjunction ~result:None state slevel vc