yuce / pyswip

PySwip is a Python-Prolog interface that enables querying SWI-Prolog in your Python programs.
https://pyswip.org
MIT License
482 stars 98 forks source link

Operating with dictionaries in pyswip #141

Open Losbarthos opened 2 years ago

Losbarthos commented 2 years ago

Based on this introduction about dictionaries, I just tried the following statement:

from prolog import *

pl = Prolog()
#pl.consult("logic.pl")
print(list(pl.query("X = point{x:1,y:2}.C.")))

expected output: [{'X': 1, 'C': x}, {'X': 2, 'C': y}]

actual output: [{'X': ".(Atom('26501')(point, 1, x, 2, y), _3198)", 'C': Variable(101)}, {'X': ".(Atom('26501')(point, 1, x, 2, y), _3198)", 'C': Variable(80)}]