We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi there,
Thanks for this amazing module.
I think there is a problem with the way terms are printed. I run some Prolog code from Python, querying Prolog with:
H = pyswip.Variable() induce = pyswip.Functor('induce', 1) q = Query(induce(H)) q.nextSolution() print(H.value)
I get a result like this for H:
[Functor(319757,2, [Functor(9048461,3,_10560234,_10560236,_10560238), Functor(9044237,2,_10560234,_10560238), Functor(9040141,2,_10560238,_10560236), Functor(9036045,2,_10560238,_10560274), Functor(9036045,2,_10560236,_10560286), Functor(1724685,2,_10560274,_10560286)], [Functor(188685,2,_10560234,unit), Functor(188685,2,_10560236,unit), Functor(188685,2,_10560238,unit), Functor(188685,2,_10560286,time), Functor(188685,2,_10560274,time)])]
where I should get:
[[unconformity(A,C,B),above(A,B),touch(B,C),has_period(B,D),has_period(C,E),D\=E]/[A:unit,C:unit,B:unit,E:time,D:time]]
Strangely, it I print H.value[0].name, I have the correct name for the functor.
H.value[0].name
This is with Python 3.7, SwiPL 8.0.3, PySwip 0.2.10 under Windows 10.
Regards,
The text was updated successfully, but these errors were encountered:
I'm using the following function for converting the output to a String that I could feed back into Prolog:
def pyswip_output_to_str(inp) -> Union[str, int, List]: if type(inp) is bytes: inp: bytes return f'"{inp.decode("utf-8")}"' elif type(inp) is int: inp: int return inp elif type(inp) is pyswip.easy.Variable: inp: pyswip.easy.Variable if inp.chars is None: return f"_{inp.handle}" else: return inp.chars elif type(inp) is pyswip.easy.Atom: inp: pyswip.easy.Atom return f"'{inp.value}'" elif type(inp) is list: inp: List return [pyswip_output_to_str(child) for child in inp]
Sorry, something went wrong.
No branches or pull requests
Hi there,
Thanks for this amazing module.
I think there is a problem with the way terms are printed.
I run some Prolog code from Python, querying Prolog with:
I get a result like this for H:
where I should get:
Strangely, it I print
H.value[0].name
, I have the correct name for the functor.This is with Python 3.7, SwiPL 8.0.3, PySwip 0.2.10 under Windows 10.
Regards,
The text was updated successfully, but these errors were encountered: