|Did you know ...||Search Documentation:|
|library(occurs): Finding and counting sub-terms|
library(terms)provides similar predicates and is probably more wide-spread than this library.
This is a SWI-Prolog implementation of the corresponding Quintus library, based on the generalised arg/3 predicate of SWI-Prolog.
==) to any subterm of Term
==) of Term.
An example use-case is refactoring a large clause body by introducing intermediate predicates. This predicate can be used to find the arguments that must be passed to the new predicate.