summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--prolog/engine.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/prolog/engine.py b/prolog/engine.py
index 5258878..94ce14a 100644
--- a/prolog/engine.py
+++ b/prolog/engine.py
@@ -224,7 +224,9 @@ def process_answer(reply):
# Basic sanity check.
if __name__ == '__main__':
- answers, messages = run('b(Y). a(X) :- {X > 3}, (X = 5 ; {X > 4}).', 'a(X)', timeout=1)
- print(messages)
- for bindings, constraints in answers:
- print('bindings: {}, constraints: {}'.format(bindings, constraints))
+ engine, messages = create('b(Y). a(X) :- {X > 3}, (X = 5 ; {X > 4}).')
+ print(engine, messages)
+ if engine is not None:
+ reply = ask(engine, 'a(X)', timeout=1.0)
+ print(reply)
+ destroy(engine)