summaryrefslogtreecommitdiff
path: root/prolog
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2015-11-18 11:26:56 +0100
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2015-11-18 11:26:56 +0100
commit25da0d3ccc1bd03eaef0fd9ccf82bc4f720917b7 (patch)
tree6535fb596089de299992fe5aaab094dd7440b32e /prolog
parent254b3541b84a062ef0bec5b6a8d05e23232f1b1a (diff)
Fix test code in prolog.engine
Diffstat (limited to 'prolog')
-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)