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

Problem in representing incomplete structures #157

Open
remuspetrache opened this issue May 1, 2024 · 0 comments
Open

Problem in representing incomplete structures #157

remuspetrache opened this issue May 1, 2024 · 0 comments
Milestone

Comments

@remuspetrache
Copy link

remuspetrache commented May 1, 2024

I am currently using the latest version of Pyswip and I have a problem in getting the correct representation of incomplete structures.
For example, in Prolog an incomplete list would look like: L = [1,2,3 | _].

My code:

prolog = Prolog()
query_string = "L=[1,2,3,_|_]"
results = list(prolog.query(query_string))
    for result in results:
            print(result)

The result is:
{'L': [1, 2, 3, Variable(77)]}

If I use
LS = [1,2,3 | LE], LE = [4,5 | _]
I get
{'LS': [1, 2, 3, 4, 5], 'LE': [4, 5]}

I understand that it is quite complicated to translate such structures directly into a Python list, but I was wondering what alternatives are there. How could I get the incomplete structure representation (maybe as a string instead of a list)?

@yuce yuce added this to the v0.3.3 milestone Oct 27, 2024
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