Esempio n. 1
0
        (valuations2[1], True),
        (valuations2[2], True),
        (valuations2[3], False),
    ])

print("Testing Negation.originalFormula")
a = Variable('a')
na = Negation(a)
nna = Negation(na)
t.compare(nna.originalFormula(), na, "Negation.originalFormula")

print("Testing Implication rightSide / leftSide")
a = Variable('a')
b = Variable('b')
na = Negation(a)
nab = Implication(na, b)
t.compare(nab.leftSide(), na, "Implication.leftSide")
t.compare(nab.rightSide(), b, "Implication.rightSide")

print("Testing Equivalence rightSide / leftSide")
a = Variable('a')
b = Variable('b')
na = Negation(a)
nab = Equivalence(na, b)
t.compare(nab.leftSide(), na, "Equivalence.leftSide")
t.compare(nab.rightSide(), b, "Equivalence.rightSide")

t.status()

# vim: set sw=4 ts=4 sts=4 sw :
Esempio n. 2
0
b = Variable('b')
t.compare(a.name(), 'a', "Variable.name")
t.compare(b.name(), 'b', "Variable.name")

print("Testing Negation.originalFormula")
a = Variable('a')
na = Negation(a)
nna = Negation(na)
t.compare(nna.originalFormula() is na, True, "Negation.originalFormula")

print("Testing Implication rightSide / leftSide")
a = Variable('a')
b = Variable('b')
na = Negation(a)
nab = Implication(na, b)
t.compare(nab.leftSide() is na, True, "Implication.leftSide")
t.compare(nab.rightSide() is b, True, "Implication.rightSide")

print("Testing Equivalence rightSide / leftSide")
a = Variable('a')
b = Variable('b')
na = Negation(a)
nab = Equivalence(na, b)
t.compare(nab.leftSide() is na, True, "Equivalence.leftSide")
t.compare(nab.rightSide() is b, True, "Equivalence.rightSide")

print("Testing equals")
t.compare(Variable('a').equals(Variable('a')), True, 'equals')
t.compare(Variable('a').equals(Variable('b')), False, 'equals')

a = Equivalence(
Esempio n. 3
0
            (interps2[2], True),
            (interps2[3], False),
        ])


print("Testing Negation.originalFormula")
a = Variable('a')
na = Negation(a)
nna = Negation(na)
t.compare(nna.originalFormula(), na, "Negation.originalFormula")

print("Testing Implication rightSide / leftSide")
a = Variable('a')
b = Variable('b')
na = Negation(a)
nab = Implication(na, b)
t.compare(nab.leftSide(), na, "Implication.leftSide")
t.compare(nab.rightSide(), b, "Implication.rightSide")

print("Testing Equivalence rightSide / leftSide")
a = Variable('a')
b = Variable('b')
na = Negation(a)
nab = Equivalence(na, b)
t.compare(nab.leftSide(), na, "Equivalence.leftSide")
t.compare(nab.rightSide(), b, "Equivalence.rightSide")

t.status()

# vim: set sw=4 ts=4 sts=4 sw :