Beispiel #1
0
def test_implication_sentence_case_1():
    p = Atom("P")
    q = Atom("Q")
    or_sentence = Implies(p, q)
    model = {"P": True, "Q": True}
    assert or_sentence.evaluate(model)
Beispiel #2
0
def test_atom():
    p = Atom("P")
    model = {"P": True}
    assert p.evaluate(model)
Beispiel #3
0
def test_or_sentence_case_4():
    p = Atom("P")
    q = Atom("Q")
    or_sentence = Or(p, q)
    model = {"P": False, "Q": False}
    assert not or_sentence.evaluate(model)
Beispiel #4
0
def test_and_sentence_case_4():
    p = Atom("P")
    q = Atom("Q")
    and_sentence = And(p, q)
    model = {"P": False, "Q": False}
    assert not and_sentence.evaluate(model)
Beispiel #5
0
def test_or_sentence_case_1():
    p = Atom("P")
    q = Atom("Q")
    or_sentence = Or(p, q)
    model = {"P": True, "Q": True}
    assert or_sentence.evaluate(model)
Beispiel #6
0
def test_and_sentence_case_1():
    p = Atom("P")
    q = Atom("Q")
    and_sentence = And(p, q)
    model = {"P": True, "Q": True}
    assert and_sentence.evaluate(model)
Beispiel #7
0
def test_atom_negation_false():
    p = Not(Atom("P"))
    model = {"P": False}
    assert p.evaluate(model)
Beispiel #8
0
def test_atom_negation():
    p = Not(Atom("P"))
    model = {"P": True}
    assert not p.evaluate(model)
Beispiel #9
0
def test_biconditional_sentence_case_4():
    p = Atom("P")
    q = Atom("Q")
    or_sentence = BiConditional(p, q)
    model = {"P": False, "Q": False}
    assert or_sentence.evaluate(model)
Beispiel #10
0
def test_atom_negative():
    q = Atom("Q")
    model = {"Q": False}
    assert not q.evaluate(model)