You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For some reason the char '¬' used as operator in a prolog file leads to an error in pyswip.
Python-file:
from pyswip import Prolog
prolog = Prolog()
prolog.consult("test.pl")
for res in prolog.query(f"m_Proposition_Binary_x_y(∨(¬(p), q), A, B)."):
print(res)
Traceback (most recent call last):
File "~/test.py", line 43, in <module>
for res in prolog.query(f"m_Proposition_Binary_x_y(∨(¬(p), q), A, B)."):
File "/home/martin/.local/lib/python3.9/site-packages/pyswip/prolog.py", line 112, in __call__
t = getTerm(swipl_list)
File "/home/martin/.local/lib/python3.9/site-packages/pyswip/easy.py", line 436, in getTerm
res = getList(t)
File "/home/martin/.local/lib/python3.9/site-packages/pyswip/easy.py", line 451, in getList
result.append(getTerm(head))
File "/home/martin/.local/lib/python3.9/site-packages/pyswip/easy.py", line 438, in getTerm
res = getFunctor(t)
File "/home/martin/.local/lib/python3.9/site-packages/pyswip/easy.py", line 460, in getFunctor
return Functor.fromTerm(t)
File "/home/martin/.local/lib/python3.9/site-packages/pyswip/easy.py", line 291, in fromTerm
args.append(getTerm(a0 + i))
File "/home/martin/.local/lib/python3.9/site-packages/pyswip/easy.py", line 438, in getTerm
res = getFunctor(t)
File "/home/martin/.local/lib/python3.9/site-packages/pyswip/easy.py", line 460, in getFunctor
return Functor.fromTerm(t)
File "/home/martin/.local/lib/python3.9/site-packages/pyswip/easy.py", line 293, in fromTerm
return cls(f.value, args=args, a0=a0)
File "/home/martin/.local/lib/python3.9/site-packages/pyswip/easy.py", line 267, in __init__
self.name = Atom(PL_functor_name(self.handle))
File "/home/martin/.local/lib/python3.9/site-packages/pyswip/easy.py", line 68, in __init__
self.chars = PL_atom_wchars(self.handle, byref(slen))
ValueError: character U+ffffffac is not in range [U+0000; U+10ffff]
For some reason '¬' (has unicode U+00AC) is translated into U+ffffffac. Can you reproduce this error/bug?
If I replace '¬' (in prolog and python-file) by some other char, say '~' or '∧' everything works fine and gives: {'A': '∧(p)', 'B': 'q'}
or {'A': '~(p)', 'B': 'q'}
Version used
0.2.11
The text was updated successfully, but these errors were encountered:
For some reason the char '¬' used as operator in a prolog file leads to an error in pyswip.
Python-file:
Prolog-file ("test.pl")
Error-Message:
For some reason '¬' (has unicode U+00AC) is translated into U+ffffffac. Can you reproduce this error/bug?
If I replace '¬' (in prolog and python-file) by some other char, say '~' or '∧' everything works fine and gives:
{'A': '∧(p)', 'B': 'q'}
or
{'A': '~(p)', 'B': 'q'}
Version used
0.2.11
The text was updated successfully, but these errors were encountered: