NextPrevUpTopContentsIndex

findall

Function
Syntax

findall pattern-to-instantiate goal-to-prove

Arguments

pattern-to-instantiate is a list or symbol. goal-to-prove is any backward chaining goal.

Description

The backward chaining inference engine is started to look for all sets of bindings which satisfy goal-to-prove . Using those each of bindings, pattern-to-instantiate is instantiated and returned as a list.

Values

A list is returned containing zero or more occurrences of pattern-to-instantiate , each instantiated with a different set of bindings which satisfies goal-to-prove .

Examples
(findall '(?x is in (1 2 3)) '(member ?x (1 2 3)))

returns

((1 is in (1 2 3))
 (2 is in (1 2 3))
 (3 is in (1 2 3)))
(findall '(?truck is a truck) '(truck ?truck))

returns

((#<TRUCK TRUCK1> IS A TRUCK)
 (#<TRUCK TRUCK2> IS A TRUCK))
See also

any


KnowledgeWorks and Prolog User Guide (Unix version) - 4 Apr 2005

NextPrevUpTopContentsIndex