307.99/291.53 WORST_CASE(Omega(n^1), ?) 307.99/291.54 proof of /export/starexec/sandbox/benchmark/theBenchmark.xml 307.99/291.54 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 307.99/291.54 307.99/291.54 307.99/291.54 The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). 307.99/291.54 307.99/291.54 (0) CpxTRS 307.99/291.54 (1) RelTrsToDecreasingLoopProblemProof [LOWER BOUND(ID), 0 ms] 307.99/291.54 (2) TRS for Loop Detection 307.99/291.54 (3) DecreasingLoopProof [LOWER BOUND(ID), 0 ms] 307.99/291.54 (4) BEST 307.99/291.54 (5) proven lower bound 307.99/291.54 (6) LowerBoundPropagationProof [FINISHED, 0 ms] 307.99/291.54 (7) BOUNDS(n^1, INF) 307.99/291.54 (8) TRS for Loop Detection 307.99/291.54 307.99/291.54 307.99/291.54 ---------------------------------------- 307.99/291.54 307.99/291.54 (0) 307.99/291.54 Obligation: 307.99/291.54 The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). 307.99/291.54 307.99/291.54 307.99/291.54 The TRS R consists of the following rules: 307.99/291.54 307.99/291.54 average(x, y) -> if(ge(x, y), x, y) 307.99/291.54 if(true, x, y) -> averIter(y, x, y) 307.99/291.54 if(false, x, y) -> averIter(x, y, x) 307.99/291.54 averIter(x, y, z) -> ifIter(ge(x, y), x, y, z) 307.99/291.54 ifIter(true, x, y, z) -> z 307.99/291.54 ifIter(false, x, y, z) -> averIter(plus(x, s(s(s(0)))), plus(y, s(0)), plus(z, s(0))) 307.99/291.54 append(nil, y) -> y 307.99/291.54 append(cons(n, x), y) -> cons(n, app(x, y)) 307.99/291.54 low(n, nil) -> nil 307.99/291.54 low(n, cons(m, x)) -> if_low(ge(m, n), n, cons(m, x)) 307.99/291.54 if_low(false, n, cons(m, x)) -> cons(m, low(n, x)) 307.99/291.54 if_low(true, n, cons(m, x)) -> low(n, x) 307.99/291.54 high(n, nil) -> nil 307.99/291.54 high(n, cons(m, x)) -> if_high(ge(m, n), n, cons(m, x)) 307.99/291.54 if_high(false, n, cons(m, x)) -> high(n, x) 307.99/291.54 if_high(true, n, cons(m, x)) -> cons(average(m, m), high(n, x)) 307.99/291.54 quicksort(x) -> ifquick(isempty(x), x) 307.99/291.54 ifquick(true, x) -> nil 307.99/291.54 ifquick(false, x) -> append(quicksort(low(head(x), tail(x))), cons(tail(x), quicksort(high(head(x), tail(x))))) 307.99/291.54 plus(0, y) -> y 307.99/291.54 plus(s(x), y) -> s(plus(x, y)) 307.99/291.54 isempty(nil) -> true 307.99/291.54 isempty(cons(n, x)) -> false 307.99/291.54 head(nil) -> error 307.99/291.54 head(cons(n, x)) -> n 307.99/291.54 tail(nil) -> nil 307.99/291.54 tail(cons(n, x)) -> x 307.99/291.54 ge(x, 0) -> true 307.99/291.54 ge(0, s(y)) -> false 307.99/291.54 ge(s(x), s(y)) -> ge(x, y) 307.99/291.54 a -> b 307.99/291.54 a -> c 307.99/291.54 307.99/291.54 S is empty. 307.99/291.54 Rewrite Strategy: FULL 307.99/291.54 ---------------------------------------- 307.99/291.54 307.99/291.54 (1) RelTrsToDecreasingLoopProblemProof (LOWER BOUND(ID)) 307.99/291.54 Transformed a relative TRS into a decreasing-loop problem. 307.99/291.54 ---------------------------------------- 307.99/291.54 307.99/291.54 (2) 307.99/291.54 Obligation: 307.99/291.54 Analyzing the following TRS for decreasing loops: 307.99/291.54 307.99/291.54 The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). 307.99/291.54 307.99/291.54 307.99/291.54 The TRS R consists of the following rules: 307.99/291.54 307.99/291.54 average(x, y) -> if(ge(x, y), x, y) 307.99/291.54 if(true, x, y) -> averIter(y, x, y) 307.99/291.54 if(false, x, y) -> averIter(x, y, x) 307.99/291.54 averIter(x, y, z) -> ifIter(ge(x, y), x, y, z) 307.99/291.54 ifIter(true, x, y, z) -> z 307.99/291.54 ifIter(false, x, y, z) -> averIter(plus(x, s(s(s(0)))), plus(y, s(0)), plus(z, s(0))) 307.99/291.54 append(nil, y) -> y 307.99/291.54 append(cons(n, x), y) -> cons(n, app(x, y)) 307.99/291.54 low(n, nil) -> nil 307.99/291.54 low(n, cons(m, x)) -> if_low(ge(m, n), n, cons(m, x)) 307.99/291.54 if_low(false, n, cons(m, x)) -> cons(m, low(n, x)) 307.99/291.54 if_low(true, n, cons(m, x)) -> low(n, x) 307.99/291.54 high(n, nil) -> nil 307.99/291.54 high(n, cons(m, x)) -> if_high(ge(m, n), n, cons(m, x)) 307.99/291.54 if_high(false, n, cons(m, x)) -> high(n, x) 307.99/291.54 if_high(true, n, cons(m, x)) -> cons(average(m, m), high(n, x)) 307.99/291.54 quicksort(x) -> ifquick(isempty(x), x) 307.99/291.54 ifquick(true, x) -> nil 307.99/291.54 ifquick(false, x) -> append(quicksort(low(head(x), tail(x))), cons(tail(x), quicksort(high(head(x), tail(x))))) 307.99/291.54 plus(0, y) -> y 307.99/291.54 plus(s(x), y) -> s(plus(x, y)) 307.99/291.54 isempty(nil) -> true 307.99/291.54 isempty(cons(n, x)) -> false 307.99/291.54 head(nil) -> error 307.99/291.54 head(cons(n, x)) -> n 307.99/291.54 tail(nil) -> nil 307.99/291.54 tail(cons(n, x)) -> x 307.99/291.54 ge(x, 0) -> true 307.99/291.54 ge(0, s(y)) -> false 307.99/291.54 ge(s(x), s(y)) -> ge(x, y) 307.99/291.54 a -> b 307.99/291.54 a -> c 307.99/291.54 307.99/291.54 S is empty. 307.99/291.54 Rewrite Strategy: FULL 307.99/291.54 ---------------------------------------- 307.99/291.54 307.99/291.54 (3) DecreasingLoopProof (LOWER BOUND(ID)) 307.99/291.54 The following loop(s) give(s) rise to the lower bound Omega(n^1): 307.99/291.54 307.99/291.54 The rewrite sequence 307.99/291.54 307.99/291.54 plus(s(x), y) ->^+ s(plus(x, y)) 307.99/291.54 307.99/291.54 gives rise to a decreasing loop by considering the right hand sides subterm at position [0]. 307.99/291.54 307.99/291.54 The pumping substitution is [x / s(x)]. 307.99/291.54 307.99/291.54 The result substitution is [ ]. 307.99/291.54 307.99/291.54 307.99/291.54 307.99/291.54 307.99/291.54 ---------------------------------------- 307.99/291.54 307.99/291.54 (4) 307.99/291.54 Complex Obligation (BEST) 307.99/291.54 307.99/291.54 ---------------------------------------- 307.99/291.54 307.99/291.54 (5) 307.99/291.54 Obligation: 307.99/291.54 Proved the lower bound n^1 for the following obligation: 307.99/291.54 307.99/291.54 The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). 307.99/291.54 307.99/291.54 307.99/291.54 The TRS R consists of the following rules: 307.99/291.54 307.99/291.54 average(x, y) -> if(ge(x, y), x, y) 307.99/291.54 if(true, x, y) -> averIter(y, x, y) 307.99/291.54 if(false, x, y) -> averIter(x, y, x) 307.99/291.54 averIter(x, y, z) -> ifIter(ge(x, y), x, y, z) 307.99/291.54 ifIter(true, x, y, z) -> z 307.99/291.54 ifIter(false, x, y, z) -> averIter(plus(x, s(s(s(0)))), plus(y, s(0)), plus(z, s(0))) 307.99/291.54 append(nil, y) -> y 307.99/291.54 append(cons(n, x), y) -> cons(n, app(x, y)) 307.99/291.54 low(n, nil) -> nil 307.99/291.54 low(n, cons(m, x)) -> if_low(ge(m, n), n, cons(m, x)) 307.99/291.54 if_low(false, n, cons(m, x)) -> cons(m, low(n, x)) 307.99/291.54 if_low(true, n, cons(m, x)) -> low(n, x) 307.99/291.54 high(n, nil) -> nil 307.99/291.54 high(n, cons(m, x)) -> if_high(ge(m, n), n, cons(m, x)) 307.99/291.54 if_high(false, n, cons(m, x)) -> high(n, x) 307.99/291.54 if_high(true, n, cons(m, x)) -> cons(average(m, m), high(n, x)) 307.99/291.54 quicksort(x) -> ifquick(isempty(x), x) 307.99/291.54 ifquick(true, x) -> nil 307.99/291.54 ifquick(false, x) -> append(quicksort(low(head(x), tail(x))), cons(tail(x), quicksort(high(head(x), tail(x))))) 307.99/291.54 plus(0, y) -> y 307.99/291.54 plus(s(x), y) -> s(plus(x, y)) 307.99/291.54 isempty(nil) -> true 307.99/291.54 isempty(cons(n, x)) -> false 307.99/291.54 head(nil) -> error 307.99/291.54 head(cons(n, x)) -> n 307.99/291.54 tail(nil) -> nil 307.99/291.54 tail(cons(n, x)) -> x 307.99/291.54 ge(x, 0) -> true 307.99/291.54 ge(0, s(y)) -> false 307.99/291.54 ge(s(x), s(y)) -> ge(x, y) 307.99/291.54 a -> b 307.99/291.54 a -> c 307.99/291.54 307.99/291.54 S is empty. 307.99/291.54 Rewrite Strategy: FULL 307.99/291.54 ---------------------------------------- 307.99/291.54 307.99/291.54 (6) LowerBoundPropagationProof (FINISHED) 307.99/291.54 Propagated lower bound. 307.99/291.54 ---------------------------------------- 307.99/291.54 307.99/291.54 (7) 307.99/291.54 BOUNDS(n^1, INF) 307.99/291.54 307.99/291.54 ---------------------------------------- 307.99/291.54 307.99/291.54 (8) 307.99/291.54 Obligation: 307.99/291.54 Analyzing the following TRS for decreasing loops: 307.99/291.54 307.99/291.54 The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). 307.99/291.54 307.99/291.54 307.99/291.54 The TRS R consists of the following rules: 307.99/291.54 307.99/291.54 average(x, y) -> if(ge(x, y), x, y) 307.99/291.54 if(true, x, y) -> averIter(y, x, y) 307.99/291.54 if(false, x, y) -> averIter(x, y, x) 307.99/291.54 averIter(x, y, z) -> ifIter(ge(x, y), x, y, z) 307.99/291.54 ifIter(true, x, y, z) -> z 307.99/291.54 ifIter(false, x, y, z) -> averIter(plus(x, s(s(s(0)))), plus(y, s(0)), plus(z, s(0))) 307.99/291.54 append(nil, y) -> y 307.99/291.54 append(cons(n, x), y) -> cons(n, app(x, y)) 307.99/291.54 low(n, nil) -> nil 307.99/291.54 low(n, cons(m, x)) -> if_low(ge(m, n), n, cons(m, x)) 307.99/291.54 if_low(false, n, cons(m, x)) -> cons(m, low(n, x)) 307.99/291.54 if_low(true, n, cons(m, x)) -> low(n, x) 307.99/291.54 high(n, nil) -> nil 307.99/291.54 high(n, cons(m, x)) -> if_high(ge(m, n), n, cons(m, x)) 307.99/291.54 if_high(false, n, cons(m, x)) -> high(n, x) 307.99/291.54 if_high(true, n, cons(m, x)) -> cons(average(m, m), high(n, x)) 307.99/291.54 quicksort(x) -> ifquick(isempty(x), x) 307.99/291.54 ifquick(true, x) -> nil 307.99/291.54 ifquick(false, x) -> append(quicksort(low(head(x), tail(x))), cons(tail(x), quicksort(high(head(x), tail(x))))) 307.99/291.54 plus(0, y) -> y 307.99/291.54 plus(s(x), y) -> s(plus(x, y)) 307.99/291.54 isempty(nil) -> true 307.99/291.54 isempty(cons(n, x)) -> false 307.99/291.54 head(nil) -> error 307.99/291.54 head(cons(n, x)) -> n 307.99/291.54 tail(nil) -> nil 307.99/291.54 tail(cons(n, x)) -> x 307.99/291.54 ge(x, 0) -> true 307.99/291.54 ge(0, s(y)) -> false 307.99/291.54 ge(s(x), s(y)) -> ge(x, y) 307.99/291.54 a -> b 307.99/291.54 a -> c 307.99/291.54 307.99/291.54 S is empty. 307.99/291.54 Rewrite Strategy: FULL 308.06/291.57 EOF