Comments (2)
I tried debugging this, and it seems the call to PL_get_chars
in Variable.__init__
returns 0 and thus Variable.chars
is never set. I assume this should be set to the print name of the variable and allow me to identify unique variables.
I don't have a minimal test case for this (though maybe I could try to write one), but this also happens with a more complex query:
In swipl:
refine(grandparent(Tgt0,Tgt1) :- true, [Tgt0,Tgt1], 0, 0, Results).
Results = [((grandparent(Tgt0, Tgt1):-parent(Tgt0, Tgt0)), 0, 1, [Tgt0, Tgt1]), ...]
And the same query via pyswip:
list(prolog.query(query))
Out[3]:
[{'Tgt0': Variable(70),
'Tgt1': Variable(73),
'Results': [Functor(196877,2,:-(grandparent(Variable(83), Variable(84)), parent(Variable(85), Variable(86))),,(0, ,(1, [Variable(92), Variable(93)]))),
...]}]
As can be seen, here every time the same variable appears it has a unique identifier, which means the result is unusable for my application.
from pyswip.
I found an (the?) issue. The values in core.py for CVT_VARIABLE, BUF_RING etc no longer matches SWI-Prolog.h.
I don't know the exact version where these changes were introduced but it seems new version logic is needed for this.
from pyswip.
Related Issues (20)
- Errors on queries
- Powered by PySwip HOT 2
- Swipl DCG does not appear to function HOT 1
- Problem running the quick test code on Windows 11 HOT 2
- Compatibility with Mac M1 chip HOT 6
- How to clean prolog ? HOT 2
- Error with SWI-Prolog v8.5.3 and pyswipl 0.2.10
- Error by using char '¬' as operator in prolog and translate it with pyswip
- pyswip cannot work with flask HOT 1
- Operating with dictionaries in pyswip
- Please provide support for M1 Macs HOT 2
- Core dump HOT 9
- pyswip incompatible with swi-prolog 9.0.0? HOT 6
- Could not find the SWI-Prolog library in this platform. HOT 3
- efficient way of adding and removing facts
- How do I use prolog's debug/trace mode in python HOT 1
- Reviewers
- Redefined static procedure after clearing Prolog() object HOT 1
- Problem in representing incomplete structures
- Powered by Pyswip HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyswip.