Пример #1
0
def test_socrates_question():
    oliveask.eval('Socrates is Human.')
    oliveask.eval('if someone is Human then he is Intelligent.')
    assert grammar.program.parse('Socrates is Intelligent?')[0].eval() == True
Пример #2
0
def test_save_expression():
    knowledgebase.clear()
    oliveask.eval('A.')
    oliveask.eval('A or B.')
    assert [str(x) for x in knowledgebase.get_all()] == ["A", "(A | B)"]
Пример #3
0
def test_question_eval():
    knowledgebase.clear()
    oliveask.eval('A.')
    assert grammar.program.parse('A?')[0].eval() == True
    assert grammar.program.parse('B?')[0].eval() == False