From 4d3cf64a3c53f2ca1562e4feb446e893b01b433e Mon Sep 17 00:00:00 2001 From: Doug Date: Fri, 4 Jul 2025 09:29:37 -0700 Subject: [PATCH 1/2] Added simple example for findall/4 --- src/lib/builtins.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lib/builtins.pl b/src/lib/builtins.pl index bea783f77..591acfcc6 100644 --- a/src/lib/builtins.pl +++ b/src/lib/builtins.pl @@ -934,6 +934,15 @@ %% findall(Template, Goal, Solutions0, Solutions1) % % Similar to `findall/3` but returns the solutions as the difference list Solutions0-Solutions1. +% Example: +% +% ``` +% f(1,2). +% f(1,3). +% f(1,4). +%?- findall(X-Y, f(X, Y), Solutions0,Solutions1). +% Solutions0 = [1-2,1-3,1-4|Solutions1]. +% ``` findall(Template, Goal, Solutions0, Solutions1) :- error:can_be(list, Solutions0), error:can_be(list, Solutions1), From 5e6451c73a6eec2999ad0b9834bee4c19876007c Mon Sep 17 00:00:00 2001 From: Doug Date: Fri, 4 Jul 2025 12:28:14 -0700 Subject: [PATCH 2/2] added an example for findall/4 --- src/lib/builtins.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/builtins.pl b/src/lib/builtins.pl index 591acfcc6..06eed905c 100644 --- a/src/lib/builtins.pl +++ b/src/lib/builtins.pl @@ -940,7 +940,7 @@ % f(1,2). % f(1,3). % f(1,4). -%?- findall(X-Y, f(X, Y), Solutions0,Solutions1). +% ?- findall(X-Y, f(X, Y), Solutions0,Solutions1). % Solutions0 = [1-2,1-3,1-4|Solutions1]. % ``` findall(Template, Goal, Solutions0, Solutions1) :-