Generic higher-order predicate that can be used to scan and/or
process a Term with some InData in order to get a Result term and
some OutData. This predicate uses two different lists of
predicates (which can be empty):
- Scanners: predicates with signature "(+Term, -Result, +InData,
-OutData)" that must not fail.
- Testers: unary predicates with signature "(+Term)" that may
The behavior of the process_term/6 predicate is defined by means
of the following algorithm:
Extracts all the compound terms from List that match template
"Prefix/Arity" and returns them in the Items list.
- 1: Call the Scanners with the initial Term and InData to get
a Result and some OutData.
- 2: If Result is not a compound term, return Result and
- 3: If Result is a compound term:
- 3.1: Call the Testers with the Result.
- 3.2: If any of the Testers fail, return Result and OutData.
- 3.3: If all the Testers succeed:
- 3.3.1: Call this predicate recursively with each of the
arguments of Result. OutData will be passed as
InData on the first call to get a new OutData, then
this OutData will be passed as InData on the second
call and so on.
- 3.3.2: Return a new term with the Result functor and
the arguments returned by the recursive calls, and
also the OutData returned by the last recursive
For example, given Prefix = 'sim' and Arity = 3, this predicate
will only return "
sim(_, _, _)" terms.
Extracts all the atoms of List that begin with Prefix sub-atom,
removes Prefix from all those atoms and returns them in Result.
- - iso
For example, given List = ['atom1', 'other', 'atom_ex'] and
Prefix = 'atom', this predicate will return Result = ['1', '_ex'].
Scans a list with the closure Properties of a fuzzy relation and
returns its Closure and TNorm numeric values, which can then be
used to invoke the ext_closure/5 foreign predicate.
- - iso
Valid fuzzy relation properties are 'symmetric', 'reflexive' and
transitive(TNorm)', where TNorm can be 'yes', 'no', 'min',
'product' or 'luka'.