diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2015-11-18 11:26:56 +0100 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2015-11-18 11:26:56 +0100 |
commit | 25da0d3ccc1bd03eaef0fd9ccf82bc4f720917b7 (patch) | |
tree | 6535fb596089de299992fe5aaab094dd7440b32e /prolog | |
parent | 254b3541b84a062ef0bec5b6a8d05e23232f1b1a (diff) |
Fix test code in prolog.engine
Diffstat (limited to 'prolog')
-rw-r--r-- | prolog/engine.py | 10 |
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) |