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

Overzealous error in phrase/3 #1665

Closed
UWN opened this issue Dec 15, 2022 · 3 comments
Closed

Overzealous error in phrase/3 #1665

UWN opened this issue Dec 15, 2022 · 3 comments

Comments

@UWN
Copy link

UWN commented Dec 15, 2022

?- As = [], phrase(As,Bs).
   As = [], Bs = [].
?- As = [a], phrase(As,Bs).
   As = "a", Bs = "a".
?- As = [], phrase([a|As],Bs).
   error(instantiation_error,must_be/2), unexpected.
?- As = [], call(phrase([a|As],Bs)).
   error(instantiation_error,must_be/2), unexpected.
?- As = [], phrase([a|As],Bs)=G_0,G_0.
   As = [], Bs = "a", G_0 = phrase("a","a").
?- (As = 1, phrase([a|As],Bs))=G_0,G_0.
   error(instantiation_error,must_be/2), unexpected.
@UWN
Copy link
Author

UWN commented Dec 15, 2022

?- false,phrase(call(1),Xs).
   error(type_error(atom,1),(=..)/2), unexpected.

@UWN
Copy link
Author

UWN commented Apr 29, 2024

Thanks for the reminder, @flexoron Added as #33

@UWN
Copy link
Author

UWN commented May 2, 2024

?- L=[],(true;phrase([1|L],_)).
   L = []
;     error(instantiation_error,must_be/2), unexpected.
?- call((L=[],(true;phrase([1|L],_)))).
   L = []
;     error(instantiation_error,must_be/2), unexpected.

So this error cannot be from some term-to-body conversion prior to executing any of the goals.

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

1 participant