let simplifyDNFwrtCtx dnf kf1 status =
Aorai_option.debug "Before simplification: %a" pretty_dnf dnf;
let rec simplCondition c =
match c with
| TCall (kf2, None) ->
if Kernel_function.equal kf1 kf2 && status = Promelaast.Call then
TTrue
else TFalse
| TCall (kf2, Some _) ->
if Kernel_function.equal kf1 kf2 && status = Promelaast.Call then
c
else TFalse
| TReturn kf2 ->
if Kernel_function.equal kf1 kf2 && status = Promelaast.Return then
TTrue
else TFalse
| TNot c -> tnot (simplCondition c)
| TAnd(c1,c2) -> tand (simplCondition c1) (simplCondition c2)
| TOr (c1,c2) -> tor (simplCondition c1) (simplCondition c2)
| TTrue | TFalse | TRel _ -> c
in
let rec simplCNFwrtCtx cnf =
tands (List.map simplCondition cnf)
in
let res = tors (List.map simplCNFwrtCtx dnf) in
Aorai_option.debug
"After simplification: %a" Promelaoutput.print_condition res; res