let is_connected a b =
let rec term_is_connected = function
| Var(x) -> occurs (x, b)
| App(_, sl) -> List.exists term_is_connected sl
in
let terms_is_connected (s, t) =
term_is_connected s || term_is_connected t
in
match a with
| True -> false
| False -> false
| Equal(s, t) -> terms_is_connected (s, t)
| Diseq(s, t) -> terms_is_connected (s, t)
| In(s, _) -> term_is_connected s