t.test2(Conjunction([ a, Not(a), ])) t.test2(Conjunction([ Not(a), Not(a), ])) t.test2(Disjunction([a, b])) t.test2(Implication(a, b)) t.test2(Equivalence(a, b)) t.test2( Disjunction([Negation(Implication(a, b)), Negation(Implication(b, a))])) t.test2(Conjunction([Implication(a, b), Implication(Negation(a), c)])) t.test2( Equivalence(Conjunction([a, Negation(b)]), Disjunction([a, Implication(b, a)]))) # veeela premennych (no mozno nie az tak vela) nvars = 17 t.test2(Conjunction([Var(str(i)) for i in range(nvars)]))
t.test(Disjunction([Variable('a'), Variable('b')]), '(a|b)', [ (interps2[0], False), (interps2[1], True), (interps2[2], True), (interps2[3], True), ]) t.test(Implication(Variable('a'), Variable('b')), '(a=>b)', [ (interps2[0], True), (interps2[1], True), (interps2[2], False), (interps2[3], True), ]) t.test(Equivalence(Variable('a'), Variable('b')), '(a<=>b)', [ (interps2[0], True), (interps2[1], False), (interps2[2], False), (interps2[3], True), ]) t.test( Disjunction([ Negation(Implication(Variable('a'), Variable('b'))), Negation(Implication(Variable('b'), Variable('a'))) ]), '(-(a=>b)|-(b=>a))', [ (interps2[0], False), (interps2[1], True), (interps2[2], True), (interps2[3], False),
(valuations2[2], False), (valuations2[3], True), ]), (Disjunction([Variable('a'), Variable('b')]), '(a|b)', 1, ['a', 'b'], [ (valuations2[0], False), (valuations2[1], True), (valuations2[2], True), (valuations2[3], True), ]), (Implication(Variable('a'), Variable('b')), '(a->b)', 1, ['a', 'b'], [ (valuations2[0], True), (valuations2[1], True), (valuations2[2], False), (valuations2[3], True), ]), (Equivalence(Variable('a'), Variable('b')), '(a<->b)', 1, ['a', 'b'], [ (valuations2[0], True), (valuations2[1], False), (valuations2[2], False), (valuations2[3], True), ]), (Disjunction([ Negation(Implication(Variable('a'), Variable('b'))), Negation(Implication(Variable('b'), Variable('a'))) ]), '(-(a->b)|-(b->a))', 5, ['a', 'b'], [ (valuations2[0], False), (valuations2[1], True), (valuations2[2], True), (valuations2[3], False), ]), (Conjunction([
t.testSignedForm(Not(a), None, [F(a)]) t.testSignedForm(And([a, b]), ALPHA, [T(a), T(b)]) t.testSignedForm(Or([a, b]), BETA, [T(a), T(b)]) t.testSignedForm(And([a, b, c, d]), ALPHA, [T(a), T(b), T(c), T(d)]) t.testSignedForm(Or([a, b, c, d]), BETA, [T(a), T(b), T(c), T(d)]) t.testSignedForm(Or([a, Not(b), And(c, d)]), BETA, [T(a), T(Not(b)), T(And([c, d]))]) t.testSignedForm(Impl(a, b), BETA, [F(a), T(b)]) t.testSignedForm(Equivalence(a, b), ALPHA, [T(Impl(a, b)), T(Impl(b, a))]) correctRules = t.tested == t.passed t.testTableau(True, [F(Implication(a, a))]) t.testTableau(True, [F(Implication(Var('a'), Var('a')))]) t.testTableau(True, [F(Or(a, Not(a)))]) t.testTableau(True, [T(a), F(a)]) t.testTableau(True, [T(a), F(a), T(a)]) t.testTableau(True, [T(a), F(a), T(b)])
(interps2[2], True), (interps2[3], True), ]) t.test( Implication( Variable('a'), Variable('b') ), '(a=>b)', [ (interps2[0], True), (interps2[1], True), (interps2[2], False), (interps2[3], True), ]) t.test( Equivalence( Variable('a'), Variable('b') ), '(a<=>b)', [ (interps2[0], True), (interps2[1], False), (interps2[2], False), (interps2[3], True), ]) t.test( Disjunction([ Negation(Implication(Variable('a'),Variable('b'))), Negation(Implication(Variable('b'),Variable('a'))) ]), '(-(a=>b)|-(b=>a))', [