YES
0 QTRS
↳1 QTRSRRRProof (⇔, 65 ms)
↳2 QTRS
↳3 QTRSRRRProof (⇔, 0 ms)
↳4 QTRS
↳5 QTRSRRRProof (⇔, 0 ms)
↳6 QTRS
↳7 RisEmptyProof (⇔, 0 ms)
↳8 YES
g(A) → A
g(B) → A
g(B) → B
g(C) → A
g(C) → B
g(C) → C
foldB(t, 0) → t
foldB(t, s(n)) → f(foldB(t, n), B)
foldC(t, 0) → t
foldC(t, s(n)) → f(foldC(t, n), C)
f(t, x) → f'(t, g(x))
f'(triple(a, b, c), C) → triple(a, b, s(c))
f'(triple(a, b, c), B) → f(triple(a, b, c), A)
f'(triple(a, b, c), A) → f''(foldB(triple(s(a), 0, c), b))
f''(triple(a, b, c)) → foldC(triple(a, b, 0), c)
With this ordering the following rules can be removed by the rule removal processor [LPAR04] because they are oriented strictly:
POL(0) = 0
POL(A) = 2
POL(B) = 2
POL(C) = 2
POL(f(x1, x2)) = x1 + 2·x2
POL(f'(x1, x2)) = x1 + 2·x2
POL(f''(x1)) = x1
POL(foldB(x1, x2)) = 2 + x1 + 2·x2
POL(foldC(x1, x2)) = x1 + 2·x2
POL(g(x1)) = x1
POL(s(x1)) = 2 + x1
POL(triple(x1, x2, x3)) = x1 + 2·x2 + 2·x3
foldB(t, 0) → t
g(A) → A
g(B) → A
g(B) → B
g(C) → A
g(C) → B
g(C) → C
foldB(t, s(n)) → f(foldB(t, n), B)
foldC(t, 0) → t
foldC(t, s(n)) → f(foldC(t, n), C)
f(t, x) → f'(t, g(x))
f'(triple(a, b, c), C) → triple(a, b, s(c))
f'(triple(a, b, c), B) → f(triple(a, b, c), A)
f'(triple(a, b, c), A) → f''(foldB(triple(s(a), 0, c), b))
f''(triple(a, b, c)) → foldC(triple(a, b, 0), c)
With this ordering the following rules can be removed by the rule removal processor [LPAR04] because they are oriented strictly:
POL(0) = 0
POL(A) = 1
POL(B) = 1
POL(C) = 1
POL(f(x1, x2)) = 1 + x1 + x2
POL(f'(x1, x2)) = 1 + x1 + x2
POL(f''(x1)) = x1
POL(foldB(x1, x2)) = x1 + 2·x2
POL(foldC(x1, x2)) = x1 + 2·x2
POL(g(x1)) = x1
POL(s(x1)) = 1 + x1
POL(triple(x1, x2, x3)) = x1 + 2·x2 + 2·x3
f'(triple(a, b, c), A) → f''(foldB(triple(s(a), 0, c), b))
g(A) → A
g(B) → A
g(B) → B
g(C) → A
g(C) → B
g(C) → C
foldB(t, s(n)) → f(foldB(t, n), B)
foldC(t, 0) → t
foldC(t, s(n)) → f(foldC(t, n), C)
f(t, x) → f'(t, g(x))
f'(triple(a, b, c), C) → triple(a, b, s(c))
f'(triple(a, b, c), B) → f(triple(a, b, c), A)
f''(triple(a, b, c)) → foldC(triple(a, b, 0), c)
g1 > C > foldC2 > A > foldB2 > f2 > f'2 > 0 > triple3 > f''1 > s1 > B
A=1
B=2
C=2
0=2
g_1=0
s_1=2
f''_1=3
f_2=0
foldC_2=0
f'_2=0
triple_3=0
foldB_2=0
g(A) → A
g(B) → A
g(B) → B
g(C) → A
g(C) → B
g(C) → C
foldB(t, s(n)) → f(foldB(t, n), B)
foldC(t, 0) → t
foldC(t, s(n)) → f(foldC(t, n), C)
f(t, x) → f'(t, g(x))
f'(triple(a, b, c), C) → triple(a, b, s(c))
f'(triple(a, b, c), B) → f(triple(a, b, c), A)
f''(triple(a, b, c)) → foldC(triple(a, b, 0), c)