(0) Obligation:

The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(1, n^1).


The TRS R consists of the following rules:

active(fact(X)) → mark(if(zero(X), s(0), prod(X, fact(p(X)))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(prod(0, X)) → mark(0)
active(prod(s(X), Y)) → mark(add(Y, prod(X, Y)))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(zero(0)) → mark(true)
active(zero(s(X))) → mark(false)
active(p(s(X))) → mark(X)
active(fact(X)) → fact(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(zero(X)) → zero(active(X))
active(s(X)) → s(active(X))
active(prod(X1, X2)) → prod(active(X1), X2)
active(prod(X1, X2)) → prod(X1, active(X2))
active(p(X)) → p(active(X))
active(add(X1, X2)) → add(active(X1), X2)
active(add(X1, X2)) → add(X1, active(X2))
fact(mark(X)) → mark(fact(X))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
zero(mark(X)) → mark(zero(X))
s(mark(X)) → mark(s(X))
prod(mark(X1), X2) → mark(prod(X1, X2))
prod(X1, mark(X2)) → mark(prod(X1, X2))
p(mark(X)) → mark(p(X))
add(mark(X1), X2) → mark(add(X1, X2))
add(X1, mark(X2)) → mark(add(X1, X2))
proper(fact(X)) → fact(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(zero(X)) → zero(proper(X))
proper(s(X)) → s(proper(X))
proper(0) → ok(0)
proper(prod(X1, X2)) → prod(proper(X1), proper(X2))
proper(p(X)) → p(proper(X))
proper(add(X1, X2)) → add(proper(X1), proper(X2))
proper(true) → ok(true)
proper(false) → ok(false)
fact(ok(X)) → ok(fact(X))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
zero(ok(X)) → ok(zero(X))
s(ok(X)) → ok(s(X))
prod(ok(X1), ok(X2)) → ok(prod(X1, X2))
p(ok(X)) → ok(p(X))
add(ok(X1), ok(X2)) → ok(add(X1, X2))
top(mark(X)) → top(proper(X))
top(ok(X)) → top(active(X))

Rewrite Strategy: FULL

(1) NestedDefinedSymbolProof (BOTH BOUNDS(ID, ID) transformation)

The following defined symbols can occur below the 0th argument of top: proper, active
The following defined symbols can occur below the 0th argument of proper: proper, active
The following defined symbols can occur below the 0th argument of active: proper, active

Hence, the left-hand sides of the following rules are not basic-reachable and can be removed:
active(fact(X)) → mark(if(zero(X), s(0), prod(X, fact(p(X)))))
active(add(0, X)) → mark(X)
active(add(s(X), Y)) → mark(s(add(X, Y)))
active(prod(0, X)) → mark(0)
active(prod(s(X), Y)) → mark(add(Y, prod(X, Y)))
active(if(true, X, Y)) → mark(X)
active(if(false, X, Y)) → mark(Y)
active(zero(0)) → mark(true)
active(zero(s(X))) → mark(false)
active(p(s(X))) → mark(X)
active(fact(X)) → fact(active(X))
active(if(X1, X2, X3)) → if(active(X1), X2, X3)
active(zero(X)) → zero(active(X))
active(s(X)) → s(active(X))
active(prod(X1, X2)) → prod(active(X1), X2)
active(prod(X1, X2)) → prod(X1, active(X2))
active(p(X)) → p(active(X))
active(add(X1, X2)) → add(active(X1), X2)
active(add(X1, X2)) → add(X1, active(X2))
proper(fact(X)) → fact(proper(X))
proper(if(X1, X2, X3)) → if(proper(X1), proper(X2), proper(X3))
proper(zero(X)) → zero(proper(X))
proper(s(X)) → s(proper(X))
proper(prod(X1, X2)) → prod(proper(X1), proper(X2))
proper(p(X)) → p(proper(X))
proper(add(X1, X2)) → add(proper(X1), proper(X2))

(2) Obligation:

The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(1, n^1).


The TRS R consists of the following rules:

p(mark(X)) → mark(p(X))
proper(true) → ok(true)
add(ok(X1), ok(X2)) → ok(add(X1, X2))
top(ok(X)) → top(active(X))
p(ok(X)) → ok(p(X))
zero(ok(X)) → ok(zero(X))
zero(mark(X)) → mark(zero(X))
prod(X1, mark(X2)) → mark(prod(X1, X2))
prod(mark(X1), X2) → mark(prod(X1, X2))
prod(ok(X1), ok(X2)) → ok(prod(X1, X2))
add(X1, mark(X2)) → mark(add(X1, X2))
s(ok(X)) → ok(s(X))
fact(ok(X)) → ok(fact(X))
s(mark(X)) → mark(s(X))
proper(false) → ok(false)
proper(0) → ok(0)
fact(mark(X)) → mark(fact(X))
add(mark(X1), X2) → mark(add(X1, X2))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
top(mark(X)) → top(proper(X))

Rewrite Strategy: FULL

(3) RcToIrcProof (BOTH BOUNDS(ID, ID) transformation)

Converted rc-obligation to irc-obligation.

As the TRS is a non-duplicating overlay system, we have rc = irc.

(4) Obligation:

The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^1).


The TRS R consists of the following rules:

p(mark(X)) → mark(p(X))
proper(true) → ok(true)
add(ok(X1), ok(X2)) → ok(add(X1, X2))
top(ok(X)) → top(active(X))
p(ok(X)) → ok(p(X))
zero(ok(X)) → ok(zero(X))
zero(mark(X)) → mark(zero(X))
prod(X1, mark(X2)) → mark(prod(X1, X2))
prod(mark(X1), X2) → mark(prod(X1, X2))
prod(ok(X1), ok(X2)) → ok(prod(X1, X2))
add(X1, mark(X2)) → mark(add(X1, X2))
s(ok(X)) → ok(s(X))
fact(ok(X)) → ok(fact(X))
s(mark(X)) → mark(s(X))
proper(false) → ok(false)
proper(0) → ok(0)
fact(mark(X)) → mark(fact(X))
add(mark(X1), X2) → mark(add(X1, X2))
if(mark(X1), X2, X3) → mark(if(X1, X2, X3))
if(ok(X1), ok(X2), ok(X3)) → ok(if(X1, X2, X3))
top(mark(X)) → top(proper(X))

Rewrite Strategy: INNERMOST

(5) CpxTrsMatchBoundsTAProof (EQUIVALENT transformation)

A linear upper bound on the runtime complexity of the TRS R could be shown with a Match-Bound[TAB_LEFTLINEAR,TAB_NONLEFTLINEAR] (for contructor-based start-terms) of 2.

The compatible tree automaton used to show the Match-Boundedness (for constructor-based start-terms) is represented by:
final states : [1, 2, 3, 4, 5, 6, 7, 8, 9]
transitions:
mark0(0) → 0
true0() → 0
ok0(0) → 0
active0(0) → 0
false0() → 0
00() → 0
p0(0) → 1
proper0(0) → 2
add0(0, 0) → 3
top0(0) → 4
zero0(0) → 5
prod0(0, 0) → 6
s0(0) → 7
fact0(0) → 8
if0(0, 0, 0) → 9
p1(0) → 10
mark1(10) → 1
true1() → 11
ok1(11) → 2
add1(0, 0) → 12
ok1(12) → 3
active1(0) → 13
top1(13) → 4
p1(0) → 14
ok1(14) → 1
zero1(0) → 15
ok1(15) → 5
zero1(0) → 16
mark1(16) → 5
prod1(0, 0) → 17
mark1(17) → 6
prod1(0, 0) → 18
ok1(18) → 6
add1(0, 0) → 19
mark1(19) → 3
s1(0) → 20
ok1(20) → 7
fact1(0) → 21
ok1(21) → 8
s1(0) → 22
mark1(22) → 7
false1() → 23
ok1(23) → 2
01() → 24
ok1(24) → 2
fact1(0) → 25
mark1(25) → 8
if1(0, 0, 0) → 26
mark1(26) → 9
if1(0, 0, 0) → 27
ok1(27) → 9
proper1(0) → 28
top1(28) → 4
mark1(10) → 10
mark1(10) → 14
ok1(11) → 28
ok1(12) → 12
ok1(12) → 19
ok1(14) → 10
ok1(14) → 14
ok1(15) → 15
ok1(15) → 16
mark1(16) → 15
mark1(16) → 16
mark1(17) → 17
mark1(17) → 18
ok1(18) → 17
ok1(18) → 18
mark1(19) → 12
mark1(19) → 19
ok1(20) → 20
ok1(20) → 22
ok1(21) → 21
ok1(21) → 25
mark1(22) → 20
mark1(22) → 22
ok1(23) → 28
ok1(24) → 28
mark1(25) → 21
mark1(25) → 25
mark1(26) → 26
mark1(26) → 27
ok1(27) → 26
ok1(27) → 27
active2(11) → 29
top2(29) → 4
active2(23) → 29
active2(24) → 29

(6) BOUNDS(1, n^1)