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

Unification result for Prolog lists with variables recorded incorrectly #68

Open
kayceesrk opened this issue Oct 8, 2019 · 0 comments

Comments

@kayceesrk
Copy link

kayceesrk commented Oct 8, 2019

Consider the query,

?- L = [1,2 | X]

SWI-Prolog interpreter correctly returns L = [1,2 |X] indicating that L is a list with prefix [1,2]. However, the similar program written using pyswip:

from pyswip import Prolog
prolog = Prolog()
for soln in prolog.query("L = [1,2 | X]"):
    print(soln["L"])

prints [1,2] saying that L is the list [1,2]. It should be [1,2 | X] or similar.

But it does not appear to be a unification issue since the following query unifies correctly, but is still displayed incorrectly:

from pyswip import Prolog
prolog = Prolog()
for soln in prolog.query("L = [1,2 | X], X = [3 | Y]"):
    print(soln["L"])

prints [1,2,3]. It should be [1,2,3 | Y] or similar.

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