let interp_annot state stmt ca =
match ca.annot_content with
| AAssert (behav,p) ->
let in_behavior =
match behav with
[] -> True
| [ behav ] ->
let initial_state_single =
State_set.join AnalysisParam.initial_state in
let _valid_behaviors =
valid_behaviors
(current_kf())
initial_state_single
in
if List.exists (fun b -> b.b_name = behav) _valid_behaviors
then Unknown
else False
| _ -> Unknown
in
if in_behavior = False
then state
else
let result = eval_predicate ~result:None state p in
let ip = Property.IPCodeAnnot (current_kf(),stmt,ca) in
let message, result =
(match result, in_behavior with
| Unknown, _ | False, Unknown ->
Status.join ip (status_maybe);
"unknown", state
| True, _ ->
Status.join ip (status_true);
"valid", state
| False, True ->
Status.join ip (status_false);
"invalid (stopping propagation).", State_set.empty
| _, False -> assert false)
in
let result =
if in_behavior = True
then
reduce_by_disjunction ~result:None
result
AnalysisParam.slevel
p
else result
in
Value_parameters.result ~once:true ~current:true
"Assertion got status %s." message;
result
| APragma _
| AInvariant _
| AVariant _ | AAssigns _
| AStmtSpec _ -> state