From 25da0d3ccc1bd03eaef0fd9ccf82bc4f720917b7 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Wed, 18 Nov 2015 11:26:56 +0100 Subject: Fix test code in prolog.engine --- prolog/engine.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'prolog') 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) -- cgit v1.2.1