* Step 1: Sum WORST_CASE(?,O(n^2))
+ Considered Problem:
- Strict TRS:
-(x,0()) -> x
-(x,s(y)) -> if(greater(x,s(y)),s(-(x,p(s(y)))),0())
-(0(),y) -> 0()
p(0()) -> 0()
p(s(x)) -> x
- Signature:
{-/2,p/1} / {0/0,greater/2,if/3,s/1}
- Obligation:
innermost runtime complexity wrt. defined symbols {-,p} and constructors {0,greater,if,s}
+ Applied Processor:
Sum {left = someStrategy, right = someStrategy}
+ Details:
()
* Step 2: DependencyPairs WORST_CASE(?,O(n^2))
+ Considered Problem:
- Strict TRS:
-(x,0()) -> x
-(x,s(y)) -> if(greater(x,s(y)),s(-(x,p(s(y)))),0())
-(0(),y) -> 0()
p(0()) -> 0()
p(s(x)) -> x
- Signature:
{-/2,p/1} / {0/0,greater/2,if/3,s/1}
- Obligation:
innermost runtime complexity wrt. defined symbols {-,p} and constructors {0,greater,if,s}
+ Applied Processor:
DependencyPairs {dpKind_ = WIDP}
+ Details:
We add the following weak innermost dependency pairs:
Strict DPs
-#(x,0()) -> c_1()
-#(x,s(y)) -> c_2(-#(x,p(s(y))))
-#(0(),y) -> c_3()
p#(0()) -> c_4()
p#(s(x)) -> c_5()
Weak DPs
and mark the set of starting terms.
* Step 3: UsableRules WORST_CASE(?,O(n^2))
+ Considered Problem:
- Strict DPs:
-#(x,0()) -> c_1()
-#(x,s(y)) -> c_2(-#(x,p(s(y))))
-#(0(),y) -> c_3()
p#(0()) -> c_4()
p#(s(x)) -> c_5()
- Strict TRS:
-(x,0()) -> x
-(x,s(y)) -> if(greater(x,s(y)),s(-(x,p(s(y)))),0())
-(0(),y) -> 0()
p(0()) -> 0()
p(s(x)) -> x
- Signature:
{-/2,p/1,-#/2,p#/1} / {0/0,greater/2,if/3,s/1,c_1/0,c_2/1,c_3/0,c_4/0,c_5/0}
- Obligation:
innermost runtime complexity wrt. defined symbols {-#,p#} and constructors {0,greater,if,s}
+ Applied Processor:
UsableRules
+ Details:
We replace rewrite rules by usable rules:
p(s(x)) -> x
-#(x,0()) -> c_1()
-#(x,s(y)) -> c_2(-#(x,p(s(y))))
-#(0(),y) -> c_3()
p#(0()) -> c_4()
p#(s(x)) -> c_5()
* Step 4: WeightGap WORST_CASE(?,O(n^2))
+ Considered Problem:
- Strict DPs:
-#(x,0()) -> c_1()
-#(x,s(y)) -> c_2(-#(x,p(s(y))))
-#(0(),y) -> c_3()
p#(0()) -> c_4()
p#(s(x)) -> c_5()
- Strict TRS:
p(s(x)) -> x
- Signature:
{-/2,p/1,-#/2,p#/1} / {0/0,greater/2,if/3,s/1,c_1/0,c_2/1,c_3/0,c_4/0,c_5/0}
- Obligation:
innermost runtime complexity wrt. defined symbols {-#,p#} and constructors {0,greater,if,s}
+ Applied Processor:
WeightGap {wgDimension = 1, wgDegree = 1, wgKind = Algebraic, wgUArgs = UArgs, wgOn = WgOnTrs}
+ Details:
The weightgap principle applies using the following constant growth matrix-interpretation:
We apply a matrix interpretation of kind constructor based matrix interpretation:
The following argument positions are considered usable:
uargs(-#) = {2},
uargs(c_2) = {1}
Following symbols are considered usable:
all
TcT has computed the following interpretation:
p(-) = [0]
p(0) = [0]
p(greater) = [1] x1 + [1] x2 + [0]
p(if) = [1] x1 + [1] x2 + [1] x3 + [0]
p(p) = [1] x1 + [0]
p(s) = [1] x1 + [11]
p(-#) = [1] x2 + [0]
p(p#) = [0]
p(c_1) = [0]
p(c_2) = [1] x1 + [0]
p(c_3) = [0]
p(c_4) = [0]
p(c_5) = [0]
Following rules are strictly oriented:
p(s(x)) = [1] x + [11]
> [1] x + [0]
= x
Following rules are (at-least) weakly oriented:
-#(x,0()) = [0]
>= [0]
= c_1()
-#(x,s(y)) = [1] y + [11]
>= [1] y + [11]
= c_2(-#(x,p(s(y))))
-#(0(),y) = [1] y + [0]
>= [0]
= c_3()
p#(0()) = [0]
>= [0]
= c_4()
p#(s(x)) = [0]
>= [0]
= c_5()
Further, it can be verified that all rules not oriented are covered by the weightgap condition.
* Step 5: PredecessorEstimation WORST_CASE(?,O(n^2))
+ Considered Problem:
- Strict DPs:
-#(x,0()) -> c_1()
-#(x,s(y)) -> c_2(-#(x,p(s(y))))
-#(0(),y) -> c_3()
p#(0()) -> c_4()
p#(s(x)) -> c_5()
- Weak TRS:
p(s(x)) -> x
- Signature:
{-/2,p/1,-#/2,p#/1} / {0/0,greater/2,if/3,s/1,c_1/0,c_2/1,c_3/0,c_4/0,c_5/0}
- Obligation:
innermost runtime complexity wrt. defined symbols {-#,p#} and constructors {0,greater,if,s}
+ Applied Processor:
PredecessorEstimation {onSelection = all simple predecessor estimation selector}
+ Details:
We estimate the number of application of
{1,3,4,5}
by application of
Pre({1,3,4,5}) = {2}.
Here rules are labelled as follows:
1: -#(x,0()) -> c_1()
2: -#(x,s(y)) -> c_2(-#(x,p(s(y))))
3: -#(0(),y) -> c_3()
4: p#(0()) -> c_4()
5: p#(s(x)) -> c_5()
* Step 6: RemoveWeakSuffixes WORST_CASE(?,O(n^2))
+ Considered Problem:
- Strict DPs:
-#(x,s(y)) -> c_2(-#(x,p(s(y))))
- Weak DPs:
-#(x,0()) -> c_1()
-#(0(),y) -> c_3()
p#(0()) -> c_4()
p#(s(x)) -> c_5()
- Weak TRS:
p(s(x)) -> x
- Signature:
{-/2,p/1,-#/2,p#/1} / {0/0,greater/2,if/3,s/1,c_1/0,c_2/1,c_3/0,c_4/0,c_5/0}
- Obligation:
innermost runtime complexity wrt. defined symbols {-#,p#} and constructors {0,greater,if,s}
+ Applied Processor:
RemoveWeakSuffixes
+ Details:
Consider the dependency graph
1:S:-#(x,s(y)) -> c_2(-#(x,p(s(y))))
-->_1 -#(0(),y) -> c_3():3
-->_1 -#(x,0()) -> c_1():2
-->_1 -#(x,s(y)) -> c_2(-#(x,p(s(y)))):1
2:W:-#(x,0()) -> c_1()
3:W:-#(0(),y) -> c_3()
4:W:p#(0()) -> c_4()
5:W:p#(s(x)) -> c_5()
The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed.
5: p#(s(x)) -> c_5()
4: p#(0()) -> c_4()
2: -#(x,0()) -> c_1()
3: -#(0(),y) -> c_3()
* Step 7: PredecessorEstimationCP WORST_CASE(?,O(n^2))
+ Considered Problem:
- Strict DPs:
-#(x,s(y)) -> c_2(-#(x,p(s(y))))
- Weak TRS:
p(s(x)) -> x
- Signature:
{-/2,p/1,-#/2,p#/1} / {0/0,greater/2,if/3,s/1,c_1/0,c_2/1,c_3/0,c_4/0,c_5/0}
- Obligation:
innermost runtime complexity wrt. defined symbols {-#,p#} and constructors {0,greater,if,s}
+ Applied Processor:
PredecessorEstimationCP {onSelectionCP = any intersect of rules of CDG leaf and strict-rules, withComplexityPair = NaturalMI {miDimension = 3, miDegree = 2, miKind = Algebraic, uargs = UArgs, urules = URules, selector = Nothing}}
+ Details:
We first use the processor NaturalMI {miDimension = 3, miDegree = 2, miKind = Algebraic, uargs = UArgs, urules = URules, selector = Nothing} to orient following rules strictly:
1: -#(x,s(y)) -> c_2(-#(x,p(s(y))))
The strictly oriented rules are moved into the weak component.
** Step 7.a:1: NaturalMI WORST_CASE(?,O(n^2))
+ Considered Problem:
- Strict DPs:
-#(x,s(y)) -> c_2(-#(x,p(s(y))))
- Weak TRS:
p(s(x)) -> x
- Signature:
{-/2,p/1,-#/2,p#/1} / {0/0,greater/2,if/3,s/1,c_1/0,c_2/1,c_3/0,c_4/0,c_5/0}
- Obligation:
innermost runtime complexity wrt. defined symbols {-#,p#} and constructors {0,greater,if,s}
+ Applied Processor:
NaturalMI {miDimension = 3, miDegree = 2, miKind = Algebraic, uargs = UArgs, urules = URules, selector = Just first alternative for predecessorEstimation on any intersect of rules of CDG leaf and strict-rules}
+ Details:
We apply a matrix interpretation of kind constructor based matrix interpretation (containing no more than 2 non-zero interpretation-entries in the diagonal of the component-wise maxima):
The following argument positions are considered usable:
uargs(c_2) = {1}
Following symbols are considered usable:
{p,-#,p#}
TcT has computed the following interpretation:
p(-) = [4 0 4] [0 0 0] [0]
[0 2 1] x1 + [0 0 0] x2 + [0]
[0 0 2] [1 4 4] [0]
p(0) = [0]
[1]
[0]
p(greater) = [0 0 1] [0 1 1] [0]
[0 0 2] x1 + [0 0 2] x2 + [1]
[0 0 0] [0 0 0] [1]
p(if) = [1 1 0] [0 0 0] [0 1 1] [1]
[0 0 4] x1 + [0 0 4] x2 + [0 0 2] x3 + [0]
[0 0 0] [0 0 0] [0 0 0] [0]
p(p) = [4 1 4] [0]
[2 4 0] x1 + [1]
[0 1 0] [0]
p(s) = [1 2 0] [0]
[0 0 1] x1 + [2]
[0 0 1] [3]
p(-#) = [0 1 0] [0 0 4] [1]
[4 4 0] x1 + [1 0 0] x2 + [0]
[0 0 1] [1 0 0] [0]
p(p#) = [0]
[1]
[0]
p(c_1) = [0]
[0]
[2]
p(c_2) = [1 0 0] [1]
[0 0 0] x1 + [0]
[0 0 0] [0]
p(c_3) = [1]
[0]
[2]
p(c_4) = [0]
[1]
[1]
p(c_5) = [1]
[0]
[1]
Following rules are strictly oriented:
-#(x,s(y)) = [0 1 0] [0 0 4] [13]
[4 4 0] x + [1 2 0] y + [0]
[0 0 1] [1 2 0] [0]
> [0 1 0] [0 0 4] [10]
[0 0 0] x + [0 0 0] y + [0]
[0 0 0] [0 0 0] [0]
= c_2(-#(x,p(s(y))))
Following rules are (at-least) weakly oriented:
p(s(x)) = [4 8 5] [14]
[2 4 4] x + [9]
[0 0 1] [2]
>= [1 0 0] [0]
[0 1 0] x + [0]
[0 0 1] [0]
= x
** Step 7.a:2: Assumption WORST_CASE(?,O(1))
+ Considered Problem:
- Weak DPs:
-#(x,s(y)) -> c_2(-#(x,p(s(y))))
- Weak TRS:
p(s(x)) -> x
- Signature:
{-/2,p/1,-#/2,p#/1} / {0/0,greater/2,if/3,s/1,c_1/0,c_2/1,c_3/0,c_4/0,c_5/0}
- Obligation:
innermost runtime complexity wrt. defined symbols {-#,p#} and constructors {0,greater,if,s}
+ Applied Processor:
Assumption {assumed = Certificate {spaceUB = Unknown, spaceLB = Unknown, timeUB = Poly (Just 0), timeLB = Unknown}}
+ Details:
()
** Step 7.b:1: RemoveWeakSuffixes WORST_CASE(?,O(1))
+ Considered Problem:
- Weak DPs:
-#(x,s(y)) -> c_2(-#(x,p(s(y))))
- Weak TRS:
p(s(x)) -> x
- Signature:
{-/2,p/1,-#/2,p#/1} / {0/0,greater/2,if/3,s/1,c_1/0,c_2/1,c_3/0,c_4/0,c_5/0}
- Obligation:
innermost runtime complexity wrt. defined symbols {-#,p#} and constructors {0,greater,if,s}
+ Applied Processor:
RemoveWeakSuffixes
+ Details:
Consider the dependency graph
1:W:-#(x,s(y)) -> c_2(-#(x,p(s(y))))
-->_1 -#(x,s(y)) -> c_2(-#(x,p(s(y)))):1
The following weak DPs constitute a sub-graph of the DG that is closed under successors. The DPs are removed.
1: -#(x,s(y)) -> c_2(-#(x,p(s(y))))
** Step 7.b:2: EmptyProcessor WORST_CASE(?,O(1))
+ Considered Problem:
- Weak TRS:
p(s(x)) -> x
- Signature:
{-/2,p/1,-#/2,p#/1} / {0/0,greater/2,if/3,s/1,c_1/0,c_2/1,c_3/0,c_4/0,c_5/0}
- Obligation:
innermost runtime complexity wrt. defined symbols {-#,p#} and constructors {0,greater,if,s}
+ Applied Processor:
EmptyProcessor
+ Details:
The problem is already closed. The intended complexity is O(1).
WORST_CASE(?,O(n^2))