let isCrossable tr func st =
let rec isCross p =
match p with
| POr (c1, c2) -> bool3or (isCross c1) (isCross c2)
| PAnd (c1, c2) -> bool3and (isCross c1) (isCross c2)
| PNot (c1) -> bool3not (isCross c1)
| PCall (s) -> if func=s && st=Call then True else False
| PReturn (s) -> if func=s && st=Return then True else False
| PCallOrReturn (s) -> if func=s then True else False
| PTrue -> True
| PFalse -> False
| PIndexedExp (_) -> Undefined
| PFuncReturn (_, f) ->
if Datatype.String.equal func f && st = Return then Undefined else False
| PFuncParam (_, f, _) ->
if Datatype.String.equal func f && st = Call then Undefined else False
in
let res = isCross tr.cross <> False in
Aorai_option.debug ~level:2 "Function %s %s-state, transition %s -> %s is%s possible" func
( if st=Call then "pre" else "post")
tr.start.Promelaast.name
tr.stop.Promelaast.name
(if res then "" else " NOT");
res