module Subterm: sig
.. end
Basic functions on terms
val fold : (Term.term -> 'a -> 'a) -> Term.term -> 'a -> 'a
Fold among subterms
val find : (Term.term -> bool) -> Term.term -> Term.term
Find a subterm satisfying some predicate. raise Not_found otherwise
val find_opt : (Term.term -> 'a option) -> Term.term -> 'a option
Find Some subterm satisfying some predicate or None
val exists : (Term.term -> bool) -> Term.term -> bool
Test whether there exits a subterm satisfying some predicate
type
position = int list
Positions in a term
val subterm_pos : Term.term -> position -> Term.term
Subterm at position p
val replace : Term.term -> position -> Term.term -> Term.term
replace t p u
replaces the subterm of t at position p by u
val foldi : (Term.term -> position -> 'a -> 'a) -> Term.term -> 'a -> 'a
Functions taking into account the position
val findi : (Term.term -> position -> bool) ->
Term.term -> Term.term * position
val find_opti : (Term.term -> position -> 'a option) ->
Term.term -> ('a * position) option
val existsi : (Term.term -> position -> bool) -> Term.term -> bool