Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Top level: underscore variables incorrect #354

Open
UWN opened this issue Jul 5, 2023 · 6 comments
Open

Top level: underscore variables incorrect #354

UWN opened this issue Jul 5, 2023 · 6 comments

Comments

@UWN
Copy link

UWN commented Jul 5, 2023

?- term_variables(_+_,L).
   L = [_], unexpected.
   L = [_A,_B]. % expected but not found
@UWN
Copy link
Author

UWN commented Jul 5, 2023

Shorter:

?- _==_.
   true, unexpected.
   false. % expected

@UWN
Copy link
Author

UWN commented Jul 5, 2023

Yet,

?- _=1,_=2.
   true. % as expected

@pmoura
Copy link
Contributor

pmoura commented Jul 5, 2023

Shorter:

?- _==_.
   true, unexpected.
   false. % expected

Could this be a top-level issue? Logtalk includes this test and it passes with the latest Tau Prolog git version. Moreover:

?- A == B.
false

?- _ == _.
true

?- assertz((t :- _ == _)).
true

?- t.
false

@UWN
Copy link
Author

UWN commented Jul 5, 2023

?- copy_term(_+_,T).
   T = __1+__2. % expected, perfect!

@UWN
Copy link
Author

UWN commented Jul 5, 2023

   ?- sort([_,_],L).
   L = [_], unexpected.

@UWN
Copy link
Author

UWN commented Jul 5, 2023

?- X=_,Y=_,L=X-X.
   X = Y, _ = Y, L = Y-Y, unexpected.

(All examples, I enter at the first page directly. So the prompt there is actually ">" and the answers are given in reverse order on the right...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants