I am using a macbook pro Apple-M1 running macOS Ventura 13.5.2.
I have installed
* pyswip-0.2.10
* swi-prolog version 9.0.4 using Mac Homebrew
* Python 3.11.4 [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
I am trying to run the following pyswip instructional example but am the getting errors listed below. I also get the same error which I use pyswip to consult a prolog knowledge base that I know works in the version of swi-prolog that I have.
Any help is supremely appreciated
Thanks!
>>> from pyswip import Prolog
>>> prolog = Prolog()
>>> prolog.assertz("father(michael,john)")
ERROR: atom_chars/2: Arguments are not sufficiently instantiated
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/ted/misc/hacking_around/by-jove-rpg/by_jove/.venv/lib/python3.11/site-packages/pyswip/prolog.py", line 140, in assertz
next(cls.query(assertion.join(["assertz((", "))."]), catcherrors=catcherrors))
File "/Users/ted/misc/hacking_around/by-jove-rpg/by_jove/.venv/lib/python3.11/site-packages/pyswip/prolog.py", line 126, in __call__
raise PrologError("".join(["Caused by: '", query, "'. ",
pyswip.prolog.PrologError: Caused by: 'assertz((father(michael,john))).'. Returned: 'error(instantiation_error, context(:(system, /(atom_chars, 2)), _3208))'.