follow_path : string -> term -> term
Find the subterm of a given term indicated by a path.
A call follow_path p t follows path p inside t and returns the subterm
encountered. The path is a string with the successive characters interpreted as
- "b": take the body of an abstraction
- "l": take the left (rator) path in an application
- "r": take the right (rand) path in an application
- FAILURE CONDITIONS
Fails if the path is not meaningful for the term, e.g. if a "b" is
encountered for a subterm that is not an abstraction.
# follow_path "rrlr" `1 + 2 + 3 + 4 + 5`;;
val it : term = `3`
- SEE ALSO