Unexpected result with findall/3
See original GitHub issueFor the following program in http://tau-prolog.org/sandbox/
test :-
findall([A,_],p(A,_),L),
write(L),
nl.
p(a,b).
p(c,d).
p(e,f).
the query
test.
gives
[[a,__2],[c,__2],[e,__2]]
whereas the expectation is somtehing like
[[a,_2],[c,_3],[e,_4]]
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Python findall returns unexpected results - Stack Overflow
re.findall returns a tuple which contains all results () captures. Your have 9 () in your regular pattern, so you got a tuple...
Read more >prolog_notes/README.md at master - GitHub
findall (Template, Goal, Instances) is true iff Instances unifies with the list of values to which a variable X not occurring in Template...
Read more >FindAll with Regex returns unexpected range with bulleted text ...
When the text contains a "-" as bullet, the "-" is returned as part of the result when the beginning of the text...
Read more >5 Common Hibernate Mistakes That Cause Dozens of ...
5 Common Hibernate Mistakes That Cause Dozens of Unexpected Queries ; 1 1. Not Initializing Lazily Fetched Associations. 1.1 Initialize all Required Associations....
Read more >re — Regular expression operations — Python 3.11.1 ...
prog = re.compile(pattern) result = prog.match(string). is equivalent to ... re.findall(r'\bf[a-z]*', 'which foot or hand fell fastest') ['foot', 'fell', ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That clarifies it, thanks. Test added (https://github.com/LogtalkDotOrg/logtalk3/commit/72f5836dc190ccae4a4280c5085ac8981132aa3f).
@pmoura Try with a variable not in the goal. You should get something like: