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

dif/2 with different open variables #481

Open
UWN opened this issue Jan 27, 2024 · 3 comments
Open

dif/2 with different open variables #481

UWN opened this issue Jan 27, 2024 · 3 comments

Comments

@UWN
Copy link

UWN commented Jan 27, 2024

:- use_module(library(lambda)).

til([G_0, (A,B,D)]) :-
   G_0 = (D,A,B),
   D = dif(_,_),
   skel(B),
   f(G_0).

f((dif(A,B),A=B/[],B=C/A/C)).

skel(_=_/_/_).

?- {N,Vs} +\ ( til(L),nth1(N,L,G), call_residue_vars(G,Vs) ).
   N = 1, Vs = [_A], unexpected
;  N = 2, Vs = []
;  false.
@UWN
Copy link
Author

UWN commented Jan 27, 2024

?- {N,Constrs} +\ ( til(L),nth1(N,L,G), call_residue_vars(G,Vs), copy_term(Vs,_,Constrs) ).
   N = 1, Constrs = [dif:dif(_A/(_A/(_A/_/_A/[])/_A/[])/_A/[],_A/(_A/(_A/_/_A/[])/_A/[])/_A)], unexpected
;  N = 2, Constrs = []
;  false.

So copy_term/3 sees this unexpected dangeling constraint, but the top level loops denies its existence...

@infradig
Copy link
Contributor

infradig commented Jan 27, 2024 via email

@UWN
Copy link
Author

UWN commented Feb 9, 2024

Now:

?- {N,Constrs} +\ ( til(L),nth1(N,L,G), call_residue_vars(G,Vs), copy_term(Vs,_,Constrs) ).
   N = 1, Constrs = [[]], unexpected
;  N = 2, Constrs = []

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