def setUp(self): text = ''' b(X) :- Y = (write(X), X), call(Y). a(1). a(2).'''.lstrip() self.engine = core.Engine() self.engine._consult(text)
def setUp(self): theory = """ twice(!) :- write('C '). twice(true) :- write('Moss '). goal((twice(_), !)). goal(write('Three ')). """.lstrip() self.engine = core.Engine() self.engine._consult(theory)
def setUp(self): theory = ''' foo(X) :- Y is X * 2, throw(test(Y)). bar(X) :- X = Y, throw(Y). coo(X) :- throw(X). car(X) :- X = 1, throw(X). g :- catch(p, B, write(h2)), coo(c). p. p :- throw(B). '''.lstrip() self.engine = core.Engine() self.engine._consult(theory)
def test_true(self): engine = core.Engine() self.assertTrue(engine.solve('true.'))
def setUp(self): self.engine = core.Engine()
def test_fail(self): engine = core.Engine() self.assertFalse(engine.solve('fail.'))