Exemplo n.º 1
0
def build_T7(F, G):
    # (F->G)->((!F->G)->G)

    nF = notFormula(F)
    nG = notFormula(G)

    F1 = Node(F, G)
    F1.msg = "t7 hypoth"
    F2 = Node(nF, G)
    F2.msg = "t7 hypoth"

    f3 = build_T5(F, G)
    F3 = f3[-1]
    F4 = axiom.A3(F, G)

    f5 = syl_1(F3, F4)
    F5 = f5[-1]

    F6 = MP(F1, F5)

    f7 = build_T4(nG, F)
    F7 = f7[-1]

    # (!F->G)->(!F->!!G)
    F8 = nF
    F9 = Node(nF, G)
    F10 = MP(F8, F9)
    f11 = build_T2(G)
    F11 = f11[-1]

    F12 = MP(F10, F11)

    f13 = build_deduction([F1, F2, F9], F8, F12, [F8, F9, F10] + f11 + [F12])
    F13 = f13[-1]
    f14 = build_deduction([], F9, F13, f13)
    F14 = f14[-1]

    #...
    f15 = syl_1(F14, F7)
    F15 = f15[-1]
    f16 = syl_1(F15, F6)
    F16 = f16[-1]

    proof = [F1, F2] + f14 + [F4] + f5

    f17 = build_deduction([], F1, F16, proof)

    proof = f17

    return proof
Exemplo n.º 2
0
def build_T4(F, G):
    # (!G->!F)->(F->G)

    nF = notFormula(F)
    nG = notFormula(G)

    F1 = Node(nG, nF)
    F2 = F

    F3 = axiom.A3(F, G)
    F4 = MP(F1, F3)
    F5 = axiom.A1(F, nG)

    f6 = syl_1(F5, F4)

    proof = [F3, F4, F5]
    proof.extend(f6)

    proof = build_deduction([F1, F], F1, f6[-1], proof)

    return proof
Exemplo n.º 3
0
def build_T2(F):
    nF = notFormula(F)  # !F
    nnF = notFormula(nF)  # !!F
    nnnF = notFormula(nnF)  # !!!F

    F1 = axiom.A3(F, nnF)  # (!!!F->!F)->((!!F->F)->!!F)

    f2 = build_T1(nF)  # build th. 1
    F2 = f2[-1]  # !!!A->!A

    F3 = MP(F2, F1)  # ...->!!A
    F4 = axiom.A1(F, nnnF)  # A->...

    f5 = syl_1(F4, F3)  # f5[-1] = A->!!A

    res = [F1]
    res.extend(f2)
    res.extend([F3, F4])
    res.extend(f5)

    return res
Exemplo n.º 4
0
def build_T5(F, G):
    """
        (F->G)->(!G->!F)
    """

    nF = notFormula(F)
    nG = notFormula(G)

    nnF = notFormula(nF)
    nnG = notFormula(nG)

    F1 = Node(F, G)

    f2 = build_T2(G)
    F2 = f2[-1]

    F3 = axiom.A3(nG, nF)

    f4 = syl_1(F1, F2)  # f->!!g
    F4 = f4[-1]

    f5 = build_T1(F)
    F5 = f5[-1]

    f6 = syl_1(F5, F4)  # !!f->!!g
    F6 = f6[-1]

    F7 = MP(F6, F3)  # (!!f->!g)->!f

    F8 = axiom.A1(nG, nnF)

    f9 = syl_1(F8, F7)
    F9 = f9[-1]

    proof = f2 + [F3] + f4 + f5 + f6 + [F7, F8] + f9

    proof = build_deduction([F1, nG], F1, F9, proof)

    return proof
Exemplo n.º 5
0
def build_T3(F, G):
    # !f -> (f->G)
    nG = notFormula(G)

    F1 = notFormula(F)
    F2 = F

    F3 = axiom.A1(F2, nG)
    F4 = MP(F2, F3)

    F5 = axiom.A1(F1, nG)
    F6 = MP(F1, F5)
    F7 = axiom.A3(F, G)
    F8 = MP(F6, F7)
    F9 = MP(F4, F8)

    proof = [F1, F2, F3, F4, F5, F6, F7, F8, F9]

    ded1 = build_deduction([F1], F, G, proof)
    proof = ded1
    ded2 = build_deduction([], F1, ded1[-1], proof)
    proof = ded2

    return proof
Exemplo n.º 6
0
def build_T1(F):
    nF = notFormula(F)

    F1 = axiom.A3(nF, F)

    f2 = build_TL(nF)
    F2 = f2[-1]

    f3 = syl_2(F1, F2)
    F3 = f3[-1]

    nnF = notFormula(nF)
    F4 = axiom.A1(nnF, nF)

    f5 = syl_1(F4, F3)
    F5 = f5[-1]

    res = [F1]
    res.extend(f2)
    res.extend(f3)
    res.extend([F4])
    res.extend(f5)

    return res