* Step 1: Sum WORST_CASE(Omega(n^1),O(n^1))
+ Considered Problem:
- Strict TRS:
divp(x,y) -> =(rem(x,y),0())
prime(0()) -> false()
prime(s(0())) -> false()
prime(s(s(x))) -> prime1(s(s(x)),s(x))
prime1(x,0()) -> false()
prime1(x,s(0())) -> true()
prime1(x,s(s(y))) -> and(not(divp(s(s(y)),x)),prime1(x,s(y)))
- Signature:
{divp/2,prime/1,prime1/2} / {0/0,=/2,and/2,false/0,not/1,rem/2,s/1,true/0}
- Obligation:
innermost runtime complexity wrt. defined symbols {divp,prime,prime1} and constructors {0,=,and,false,not
,rem,s,true}
+ Applied Processor:
Sum {left = someStrategy, right = someStrategy}
+ Details:
()
** Step 1.a:1: DecreasingLoops WORST_CASE(Omega(n^1),?)
+ Considered Problem:
- Strict TRS:
divp(x,y) -> =(rem(x,y),0())
prime(0()) -> false()
prime(s(0())) -> false()
prime(s(s(x))) -> prime1(s(s(x)),s(x))
prime1(x,0()) -> false()
prime1(x,s(0())) -> true()
prime1(x,s(s(y))) -> and(not(divp(s(s(y)),x)),prime1(x,s(y)))
- Signature:
{divp/2,prime/1,prime1/2} / {0/0,=/2,and/2,false/0,not/1,rem/2,s/1,true/0}
- Obligation:
innermost runtime complexity wrt. defined symbols {divp,prime,prime1} and constructors {0,=,and,false,not
,rem,s,true}
+ Applied Processor:
DecreasingLoops {bound = AnyLoop, narrow = 10}
+ Details:
The system has following decreasing Loops:
prime1(x,s(y)){y -> s(y)} =
prime1(x,s(s(y))) ->^+ and(not(divp(s(s(y)),x)),prime1(x,s(y)))
= C[prime1(x,s(y)) = prime1(x,s(y)){}]
** Step 1.b:1: WeightGap WORST_CASE(?,O(n^1))
+ Considered Problem:
- Strict TRS:
divp(x,y) -> =(rem(x,y),0())
prime(0()) -> false()
prime(s(0())) -> false()
prime(s(s(x))) -> prime1(s(s(x)),s(x))
prime1(x,0()) -> false()
prime1(x,s(0())) -> true()
prime1(x,s(s(y))) -> and(not(divp(s(s(y)),x)),prime1(x,s(y)))
- Signature:
{divp/2,prime/1,prime1/2} / {0/0,=/2,and/2,false/0,not/1,rem/2,s/1,true/0}
- Obligation:
innermost runtime complexity wrt. defined symbols {divp,prime,prime1} and constructors {0,=,and,false,not
,rem,s,true}
+ Applied Processor:
WeightGap {wgDimension = 1, wgDegree = 1, wgKind = Algebraic, wgUArgs = UArgs, wgOn = WgOnAny}
+ Details:
The weightgap principle applies using the following nonconstant growth matrix-interpretation:
We apply a matrix interpretation of kind constructor based matrix interpretation:
The following argument positions are considered usable:
uargs(and) = {1,2},
uargs(not) = {1}
Following symbols are considered usable:
all
TcT has computed the following interpretation:
p(0) = [0]
p(=) = [0]
p(and) = [1] x1 + [1] x2 + [2]
p(divp) = [0]
p(false) = [0]
p(not) = [1] x1 + [1]
p(prime) = [1] x1 + [4]
p(prime1) = [1] x2 + [13]
p(rem) = [1] x2 + [0]
p(s) = [1] x1 + [4]
p(true) = [0]
Following rules are strictly oriented:
prime(0()) = [4]
> [0]
= false()
prime(s(0())) = [8]
> [0]
= false()
prime1(x,0()) = [13]
> [0]
= false()
prime1(x,s(0())) = [17]
> [0]
= true()
prime1(x,s(s(y))) = [1] y + [21]
> [1] y + [20]
= and(not(divp(s(s(y)),x)),prime1(x,s(y)))
Following rules are (at-least) weakly oriented:
divp(x,y) = [0]
>= [0]
= =(rem(x,y),0())
prime(s(s(x))) = [1] x + [12]
>= [1] x + [17]
= prime1(s(s(x)),s(x))
Further, it can be verified that all rules not oriented are covered by the weightgap condition.
** Step 1.b:2: WeightGap WORST_CASE(?,O(n^1))
+ Considered Problem:
- Strict TRS:
divp(x,y) -> =(rem(x,y),0())
prime(s(s(x))) -> prime1(s(s(x)),s(x))
- Weak TRS:
prime(0()) -> false()
prime(s(0())) -> false()
prime1(x,0()) -> false()
prime1(x,s(0())) -> true()
prime1(x,s(s(y))) -> and(not(divp(s(s(y)),x)),prime1(x,s(y)))
- Signature:
{divp/2,prime/1,prime1/2} / {0/0,=/2,and/2,false/0,not/1,rem/2,s/1,true/0}
- Obligation:
innermost runtime complexity wrt. defined symbols {divp,prime,prime1} and constructors {0,=,and,false,not
,rem,s,true}
+ Applied Processor:
WeightGap {wgDimension = 1, wgDegree = 1, wgKind = Algebraic, wgUArgs = UArgs, wgOn = WgOnAny}
+ Details:
The weightgap principle applies using the following nonconstant growth matrix-interpretation:
We apply a matrix interpretation of kind constructor based matrix interpretation:
The following argument positions are considered usable:
uargs(and) = {1,2},
uargs(not) = {1}
Following symbols are considered usable:
all
TcT has computed the following interpretation:
p(0) = [1]
p(=) = [1] x1 + [7]
p(and) = [1] x1 + [1] x2 + [0]
p(divp) = [0]
p(false) = [4]
p(not) = [1] x1 + [0]
p(prime) = [2] x1 + [9]
p(prime1) = [4] x2 + [0]
p(rem) = [8]
p(s) = [4]
p(true) = [0]
Following rules are strictly oriented:
prime(s(s(x))) = [17]
> [16]
= prime1(s(s(x)),s(x))
Following rules are (at-least) weakly oriented:
divp(x,y) = [0]
>= [15]
= =(rem(x,y),0())
prime(0()) = [11]
>= [4]
= false()
prime(s(0())) = [17]
>= [4]
= false()
prime1(x,0()) = [4]
>= [4]
= false()
prime1(x,s(0())) = [16]
>= [0]
= true()
prime1(x,s(s(y))) = [16]
>= [16]
= and(not(divp(s(s(y)),x)),prime1(x,s(y)))
Further, it can be verified that all rules not oriented are covered by the weightgap condition.
** Step 1.b:3: WeightGap WORST_CASE(?,O(n^1))
+ Considered Problem:
- Strict TRS:
divp(x,y) -> =(rem(x,y),0())
- Weak TRS:
prime(0()) -> false()
prime(s(0())) -> false()
prime(s(s(x))) -> prime1(s(s(x)),s(x))
prime1(x,0()) -> false()
prime1(x,s(0())) -> true()
prime1(x,s(s(y))) -> and(not(divp(s(s(y)),x)),prime1(x,s(y)))
- Signature:
{divp/2,prime/1,prime1/2} / {0/0,=/2,and/2,false/0,not/1,rem/2,s/1,true/0}
- Obligation:
innermost runtime complexity wrt. defined symbols {divp,prime,prime1} and constructors {0,=,and,false,not
,rem,s,true}
+ Applied Processor:
WeightGap {wgDimension = 1, wgDegree = 1, wgKind = Algebraic, wgUArgs = UArgs, wgOn = WgOnAny}
+ Details:
The weightgap principle applies using the following nonconstant growth matrix-interpretation:
We apply a matrix interpretation of kind constructor based matrix interpretation:
The following argument positions are considered usable:
uargs(and) = {1,2},
uargs(not) = {1}
Following symbols are considered usable:
all
TcT has computed the following interpretation:
p(0) = [1]
p(=) = [1] x2 + [1]
p(and) = [1] x1 + [1] x2 + [0]
p(divp) = [4]
p(false) = [1]
p(not) = [1] x1 + [0]
p(prime) = [13] x1 + [5]
p(prime1) = [4] x1 + [4] x2 + [12]
p(rem) = [1] x2 + [1]
p(s) = [1] x1 + [1]
p(true) = [0]
Following rules are strictly oriented:
divp(x,y) = [4]
> [2]
= =(rem(x,y),0())
Following rules are (at-least) weakly oriented:
prime(0()) = [18]
>= [1]
= false()
prime(s(0())) = [31]
>= [1]
= false()
prime(s(s(x))) = [13] x + [31]
>= [8] x + [24]
= prime1(s(s(x)),s(x))
prime1(x,0()) = [4] x + [16]
>= [1]
= false()
prime1(x,s(0())) = [4] x + [20]
>= [0]
= true()
prime1(x,s(s(y))) = [4] x + [4] y + [20]
>= [4] x + [4] y + [20]
= and(not(divp(s(s(y)),x)),prime1(x,s(y)))
Further, it can be verified that all rules not oriented are covered by the weightgap condition.
** Step 1.b:4: EmptyProcessor WORST_CASE(?,O(1))
+ Considered Problem:
- Weak TRS:
divp(x,y) -> =(rem(x,y),0())
prime(0()) -> false()
prime(s(0())) -> false()
prime(s(s(x))) -> prime1(s(s(x)),s(x))
prime1(x,0()) -> false()
prime1(x,s(0())) -> true()
prime1(x,s(s(y))) -> and(not(divp(s(s(y)),x)),prime1(x,s(y)))
- Signature:
{divp/2,prime/1,prime1/2} / {0/0,=/2,and/2,false/0,not/1,rem/2,s/1,true/0}
- Obligation:
innermost runtime complexity wrt. defined symbols {divp,prime,prime1} and constructors {0,=,and,false,not
,rem,s,true}
+ Applied Processor:
EmptyProcessor
+ Details:
The problem is already closed. The intended complexity is O(1).
WORST_CASE(Omega(n^1),O(n^1))