You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
%% findall(Template, Goal, Solutions).
%
% Unify Solutions with a list of all values that variables in Template can take in Goal.
% findall/3 is equivalent to bagof/3 with all free variables scoped to the Goal (^ operator)
% except that bagof/3 fails when no solutions are found and findall/3 unifies with an empty list.
It seems to me this isn't exactly right. Rather, Solutions gets unified with a list of all values which the term Template acquires when its variables are instantiated in the course of repeated instantiations of Goal.
Compare the language from Sterling & Shapiro Ch. 16, p.302:
A basic all-solutions predicate is findall(Term,Goal,Bag).
The predicate is true if and only if Bag unifies with the list of values
to which a variable X not occurring in Term or Goal would be bound
by successive resatisfaction of call(Goal) , X=Term? after systematic
replacement of all variables in X by new variables.
The text was updated successfully, but these errors were encountered:
8.10.1 findall/3
8.10.1.1 Description
findall(Template, Goal, Instances) is true iff
Instances unifies with the list of values to which a
variable X not occurring in Template or Goal would be
instantiated by successive re-executions of
call(Goal), X=Template
after systematic replacement of all variables in X by new
variables.
Currently, this documentation reads:
It seems to me this isn't exactly right. Rather,
Solutions
gets unified with a list of all values which the termTemplate
acquires when its variables are instantiated in the course of repeated instantiations ofGoal
.Compare the language from Sterling & Shapiro Ch. 16, p.302:
The text was updated successfully, but these errors were encountered: