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
It seems I can use pyswip to load a .pl, but not unload one: [update]
from pyswip import Prolog prolog = Prolog() filename = "f" # # f.pl contains just foo(1,1). next(prolog.query(filename.join(["load_files('", "',[])"]))) print(list(prolog.query("foo(X,1)"))) # ==> [{X:1}] query = "unload_file('{}')".format(filename) print(query) next(prolog.query(query)) print(list(prolog.query("foo(X,1)"))) # ==> [{X:1}] -- should have failed with missing 'f'
The behavior I get from Prolog is:
?- load_files(f,[]). true. ?- foo(X,1). X = 1. ?- unload_file(f). . true. ?- foo(X,1). ERROR: Undefined procedure: foo/2 (DWIM could not correct goal)
Is the different behavior here a bug? (I'd like to load and unload files to keep unit tests independent in Python).
The text was updated successfully, but these errors were encountered:
Fixed a bug in the unload step ^^ above ^^. prolog.query(unload_file('f')) still fails to unload the name foo.
prolog.query(unload_file('f'))
Sorry, something went wrong.
No branches or pull requests
It seems I can use pyswip to load a .pl, but not unload one: [update]
The behavior I get from Prolog is:
Is the different behavior here a bug? (I'd like to load and unload files to keep unit tests independent in Python).
The text was updated successfully, but these errors were encountered: