let rec term_contains_term (term: term) (contained: term) : bool =
term_equal contained term
||
match term with
| Var _
| Const _ ->
false
| Func func ->
Tools.array_exists
(fun term' -> term_contains_term term' contained)
func.subterms