/export/starexec/sandbox2/solver/bin/starexec_run_complexity /export/starexec/sandbox2/benchmark/theBenchmark.xml /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), O(n^1)) proof of /export/starexec/sandbox2/benchmark/theBenchmark.xml # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). (0) CpxRelTRS (1) SInnermostTerminationProof [BOTH CONCRETE BOUNDS(ID, ID), 168 ms] (2) CpxRelTRS (3) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxWeightedTrs (5) CpxWeightedTrsRenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CpxWeightedTrs (7) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CpxTypedWeightedTrs (9) CompletionProof [UPPER BOUND(ID), 0 ms] (10) CpxTypedWeightedCompleteTrs (11) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 6 ms] (12) CpxRNTS (13) CompleteCoflocoProof [FINISHED, 222 ms] (14) BOUNDS(1, n^1) (15) RelTrsToDecreasingLoopProblemProof [LOWER BOUND(ID), 0 ms] (16) TRS for Loop Detection (17) DecreasingLoopProof [LOWER BOUND(ID), 0 ms] (18) BEST (19) proven lower bound (20) LowerBoundPropagationProof [FINISHED, 0 ms] (21) BOUNDS(n^1, INF) (22) TRS for Loop Detection ---------------------------------------- (0) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: map(Cons(x, xs)) -> Cons(f(x), map(xs)) map(Nil) -> Nil goal(xs) -> map(xs) f(x) -> *(x, x) +Full(S(x), y) -> +Full(x, S(y)) +Full(0, y) -> y The (relative) TRS S consists of the following rules: *(x, S(S(y))) -> +(x, *(x, S(y))) *(x, S(0)) -> x *(x, 0) -> 0 *(0, y) -> 0 Rewrite Strategy: INNERMOST ---------------------------------------- (1) SInnermostTerminationProof (BOTH CONCRETE BOUNDS(ID, ID)) proved innermost termination of relative rules ---------------------------------------- (2) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: map(Cons(x, xs)) -> Cons(f(x), map(xs)) map(Nil) -> Nil goal(xs) -> map(xs) f(x) -> *(x, x) +Full(S(x), y) -> +Full(x, S(y)) +Full(0, y) -> y The (relative) TRS S consists of the following rules: *(x, S(S(y))) -> +(x, *(x, S(y))) *(x, S(0)) -> x *(x, 0) -> 0 *(0, y) -> 0 Rewrite Strategy: INNERMOST ---------------------------------------- (3) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (4) Obligation: The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^1). The TRS R consists of the following rules: map(Cons(x, xs)) -> Cons(f(x), map(xs)) [1] map(Nil) -> Nil [1] goal(xs) -> map(xs) [1] f(x) -> *(x, x) [1] +Full(S(x), y) -> +Full(x, S(y)) [1] +Full(0, y) -> y [1] *(x, S(S(y))) -> +(x, *(x, S(y))) [0] *(x, S(0)) -> x [0] *(x, 0) -> 0 [0] *(0, y) -> 0 [0] Rewrite Strategy: INNERMOST ---------------------------------------- (5) CpxWeightedTrsRenamingProof (BOTH BOUNDS(ID, ID)) Renamed defined symbols to avoid conflicts with arithmetic symbols: * => times ---------------------------------------- (6) Obligation: The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^1). The TRS R consists of the following rules: map(Cons(x, xs)) -> Cons(f(x), map(xs)) [1] map(Nil) -> Nil [1] goal(xs) -> map(xs) [1] f(x) -> times(x, x) [1] +Full(S(x), y) -> +Full(x, S(y)) [1] +Full(0, y) -> y [1] times(x, S(S(y))) -> +(x, times(x, S(y))) [0] times(x, S(0)) -> x [0] times(x, 0) -> 0 [0] times(0, y) -> 0 [0] Rewrite Strategy: INNERMOST ---------------------------------------- (7) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (8) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: map(Cons(x, xs)) -> Cons(f(x), map(xs)) [1] map(Nil) -> Nil [1] goal(xs) -> map(xs) [1] f(x) -> times(x, x) [1] +Full(S(x), y) -> +Full(x, S(y)) [1] +Full(0, y) -> y [1] times(x, S(S(y))) -> +(x, times(x, S(y))) [0] times(x, S(0)) -> x [0] times(x, 0) -> 0 [0] times(0, y) -> 0 [0] The TRS has the following type information: map :: Cons:Nil -> Cons:Nil Cons :: S:0:+ -> Cons:Nil -> Cons:Nil f :: S:0:+ -> S:0:+ Nil :: Cons:Nil goal :: Cons:Nil -> Cons:Nil times :: S:0:+ -> S:0:+ -> S:0:+ +Full :: S:0:+ -> S:0:+ -> S:0:+ S :: S:0:+ -> S:0:+ 0 :: S:0:+ + :: S:0:+ -> S:0:+ -> S:0:+ Rewrite Strategy: INNERMOST ---------------------------------------- (9) CompletionProof (UPPER BOUND(ID)) The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: times(v0, v1) -> null_times [0] +Full(v0, v1) -> null_+Full [0] And the following fresh constants: null_times, null_+Full ---------------------------------------- (10) Obligation: Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: map(Cons(x, xs)) -> Cons(f(x), map(xs)) [1] map(Nil) -> Nil [1] goal(xs) -> map(xs) [1] f(x) -> times(x, x) [1] +Full(S(x), y) -> +Full(x, S(y)) [1] +Full(0, y) -> y [1] times(x, S(S(y))) -> +(x, times(x, S(y))) [0] times(x, S(0)) -> x [0] times(x, 0) -> 0 [0] times(0, y) -> 0 [0] times(v0, v1) -> null_times [0] +Full(v0, v1) -> null_+Full [0] The TRS has the following type information: map :: Cons:Nil -> Cons:Nil Cons :: S:0:+:null_times:null_+Full -> Cons:Nil -> Cons:Nil f :: S:0:+:null_times:null_+Full -> S:0:+:null_times:null_+Full Nil :: Cons:Nil goal :: Cons:Nil -> Cons:Nil times :: S:0:+:null_times:null_+Full -> S:0:+:null_times:null_+Full -> S:0:+:null_times:null_+Full +Full :: S:0:+:null_times:null_+Full -> S:0:+:null_times:null_+Full -> S:0:+:null_times:null_+Full S :: S:0:+:null_times:null_+Full -> S:0:+:null_times:null_+Full 0 :: S:0:+:null_times:null_+Full + :: S:0:+:null_times:null_+Full -> S:0:+:null_times:null_+Full -> S:0:+:null_times:null_+Full null_times :: S:0:+:null_times:null_+Full null_+Full :: S:0:+:null_times:null_+Full Rewrite Strategy: INNERMOST ---------------------------------------- (11) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: Nil => 0 0 => 0 null_times => 0 null_+Full => 0 ---------------------------------------- (12) Obligation: Complexity RNTS consisting of the following rules: +Full(z, z') -{ 1 }-> y :|: y >= 0, z = 0, z' = y +Full(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 +Full(z, z') -{ 1 }-> +Full(x, 1 + y) :|: x >= 0, y >= 0, z = 1 + x, z' = y f(z) -{ 1 }-> times(x, x) :|: x >= 0, z = x goal(z) -{ 1 }-> map(xs) :|: xs >= 0, z = xs map(z) -{ 1 }-> 0 :|: z = 0 map(z) -{ 1 }-> 1 + f(x) + map(xs) :|: z = 1 + x + xs, xs >= 0, x >= 0 times(z, z') -{ 0 }-> x :|: x >= 0, z' = 1 + 0, z = x times(z, z') -{ 0 }-> 0 :|: x >= 0, z = x, z' = 0 times(z, z') -{ 0 }-> 0 :|: y >= 0, z = 0, z' = y times(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 times(z, z') -{ 0 }-> 1 + x + times(x, 1 + y) :|: z' = 1 + (1 + y), x >= 0, y >= 0, z = x Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (13) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V, V5),0,[map(V, Out)],[V >= 0]). eq(start(V, V5),0,[goal(V, Out)],[V >= 0]). eq(start(V, V5),0,[f(V, Out)],[V >= 0]). eq(start(V, V5),0,[fun(V, V5, Out)],[V >= 0,V5 >= 0]). eq(start(V, V5),0,[times(V, V5, Out)],[V >= 0,V5 >= 0]). eq(map(V, Out),1,[f(V2, Ret01),map(V1, Ret1)],[Out = 1 + Ret01 + Ret1,V = 1 + V1 + V2,V1 >= 0,V2 >= 0]). eq(map(V, Out),1,[],[Out = 0,V = 0]). eq(goal(V, Out),1,[map(V3, Ret)],[Out = Ret,V3 >= 0,V = V3]). eq(f(V, Out),1,[times(V4, V4, Ret2)],[Out = Ret2,V4 >= 0,V = V4]). eq(fun(V, V5, Out),1,[fun(V6, 1 + V7, Ret3)],[Out = Ret3,V6 >= 0,V7 >= 0,V = 1 + V6,V5 = V7]). eq(fun(V, V5, Out),1,[],[Out = V8,V8 >= 0,V = 0,V5 = V8]). eq(times(V, V5, Out),0,[times(V9, 1 + V10, Ret11)],[Out = 1 + Ret11 + V9,V5 = 2 + V10,V9 >= 0,V10 >= 0,V = V9]). eq(times(V, V5, Out),0,[],[Out = V11,V11 >= 0,V5 = 1,V = V11]). eq(times(V, V5, Out),0,[],[Out = 0,V12 >= 0,V = V12,V5 = 0]). eq(times(V, V5, Out),0,[],[Out = 0,V13 >= 0,V = 0,V5 = V13]). eq(times(V, V5, Out),0,[],[Out = 0,V15 >= 0,V14 >= 0,V = V15,V5 = V14]). eq(fun(V, V5, Out),0,[],[Out = 0,V17 >= 0,V16 >= 0,V = V17,V5 = V16]). input_output_vars(map(V,Out),[V],[Out]). input_output_vars(goal(V,Out),[V],[Out]). input_output_vars(f(V,Out),[V],[Out]). input_output_vars(fun(V,V5,Out),[V,V5],[Out]). input_output_vars(times(V,V5,Out),[V,V5],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [times/3] 1. non_recursive : [f/2] 2. recursive : [fun/3] 3. recursive : [map/2] 4. non_recursive : [goal/2] 5. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into times/3 1. SCC is completely evaluated into other SCCs 2. SCC is partially evaluated into fun/3 3. SCC is partially evaluated into map/2 4. SCC is completely evaluated into other SCCs 5. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations times/3 * CE 9 is refined into CE [15] * CE 10 is refined into CE [16] * CE 11 is refined into CE [17] * CE 8 is refined into CE [18] ### Cost equations --> "Loop" of times/3 * CEs [18] --> Loop 10 * CEs [15] --> Loop 11 * CEs [16,17] --> Loop 12 ### Ranking functions of CR times(V,V5,Out) * RF of phase [10]: [V5-1] #### Partial ranking functions of CR times(V,V5,Out) * Partial RF of phase [10]: - RF of loop [10:1]: V5-1 ### Specialization of cost equations fun/3 * CE 14 is refined into CE [19] * CE 13 is refined into CE [20] * CE 12 is refined into CE [21] ### Cost equations --> "Loop" of fun/3 * CEs [21] --> Loop 13 * CEs [19] --> Loop 14 * CEs [20] --> Loop 15 ### Ranking functions of CR fun(V,V5,Out) * RF of phase [13]: [V] #### Partial ranking functions of CR fun(V,V5,Out) * Partial RF of phase [13]: - RF of loop [13:1]: V ### Specialization of cost equations map/2 * CE 7 is refined into CE [22] * CE 6 is refined into CE [23,24,25] ### Cost equations --> "Loop" of map/2 * CEs [25] --> Loop 16 * CEs [24] --> Loop 17 * CEs [23] --> Loop 18 * CEs [22] --> Loop 19 ### Ranking functions of CR map(V,Out) * RF of phase [16,17,18]: [V] #### Partial ranking functions of CR map(V,Out) * Partial RF of phase [16,17,18]: - RF of loop [16:1]: V-2 - RF of loop [17:1]: V - RF of loop [18:1]: V-1 ### Specialization of cost equations start/2 * CE 1 is refined into CE [26,27] * CE 2 is refined into CE [28,29] * CE 3 is refined into CE [30,31,32] * CE 4 is refined into CE [33,34,35] * CE 5 is refined into CE [36,37,38] ### Cost equations --> "Loop" of start/2 * CEs [36] --> Loop 20 * CEs [30] --> Loop 21 * CEs [26,27,28,29,31,32,33,34,35,37,38] --> Loop 22 ### Ranking functions of CR start(V,V5) #### Partial ranking functions of CR start(V,V5) Computing Bounds ===================================== #### Cost of chains of times(V,V5,Out): * Chain [[10],12]: 0 with precondition: [V>=0,V5>=2,Out>=V+1] * Chain [[10],11]: 0 with precondition: [V>=0,V5>=2,Out+1>=2*V+V5] * Chain [12]: 0 with precondition: [Out=0,V>=0,V5>=0] * Chain [11]: 0 with precondition: [V5=1,V=Out,V>=0] #### Cost of chains of fun(V,V5,Out): * Chain [[13],15]: 1*it(13)+1 Such that:it(13) =< -V5+Out with precondition: [V+V5=Out,V>=1,V5>=0] * Chain [[13],14]: 1*it(13)+0 Such that:it(13) =< V with precondition: [Out=0,V>=1,V5>=0] * Chain [15]: 1 with precondition: [V=0,V5=Out,V5>=0] * Chain [14]: 0 with precondition: [Out=0,V>=0,V5>=0] #### Cost of chains of map(V,Out): * Chain [[16,17,18],19]: 6*it(16)+1 Such that:aux(3) =< V it(16) =< aux(3) with precondition: [V>=1,Out>=1] * Chain [19]: 1 with precondition: [V=0,Out=0] #### Cost of chains of start(V,V5): * Chain [22]: 14*s(3)+2 Such that:aux(4) =< V s(3) =< aux(4) with precondition: [V>=0] * Chain [21]: 1 with precondition: [V=1] * Chain [20]: 0 with precondition: [V5=1,V>=0] Closed-form bounds of start(V,V5): ------------------------------------- * Chain [22] with precondition: [V>=0] - Upper bound: 14*V+2 - Complexity: n * Chain [21] with precondition: [V=1] - Upper bound: 1 - Complexity: constant * Chain [20] with precondition: [V5=1,V>=0] - Upper bound: 0 - Complexity: constant ### Maximum cost of start(V,V5): 14*V+2 Asymptotic class: n * Total analysis performed in 164 ms. ---------------------------------------- (14) BOUNDS(1, n^1) ---------------------------------------- (15) RelTrsToDecreasingLoopProblemProof (LOWER BOUND(ID)) Transformed a relative TRS into a decreasing-loop problem. ---------------------------------------- (16) Obligation: Analyzing the following TRS for decreasing loops: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: map(Cons(x, xs)) -> Cons(f(x), map(xs)) map(Nil) -> Nil goal(xs) -> map(xs) f(x) -> *(x, x) +Full(S(x), y) -> +Full(x, S(y)) +Full(0, y) -> y The (relative) TRS S consists of the following rules: *(x, S(S(y))) -> +(x, *(x, S(y))) *(x, S(0)) -> x *(x, 0) -> 0 *(0, y) -> 0 Rewrite Strategy: INNERMOST ---------------------------------------- (17) DecreasingLoopProof (LOWER BOUND(ID)) The following loop(s) give(s) rise to the lower bound Omega(n^1): The rewrite sequence map(Cons(x, xs)) ->^+ Cons(f(x), map(xs)) gives rise to a decreasing loop by considering the right hand sides subterm at position [1]. The pumping substitution is [xs / Cons(x, xs)]. The result substitution is [ ]. ---------------------------------------- (18) Complex Obligation (BEST) ---------------------------------------- (19) Obligation: Proved the lower bound n^1 for the following obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: map(Cons(x, xs)) -> Cons(f(x), map(xs)) map(Nil) -> Nil goal(xs) -> map(xs) f(x) -> *(x, x) +Full(S(x), y) -> +Full(x, S(y)) +Full(0, y) -> y The (relative) TRS S consists of the following rules: *(x, S(S(y))) -> +(x, *(x, S(y))) *(x, S(0)) -> x *(x, 0) -> 0 *(0, y) -> 0 Rewrite Strategy: INNERMOST ---------------------------------------- (20) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (21) BOUNDS(n^1, INF) ---------------------------------------- (22) Obligation: Analyzing the following TRS for decreasing loops: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: map(Cons(x, xs)) -> Cons(f(x), map(xs)) map(Nil) -> Nil goal(xs) -> map(xs) f(x) -> *(x, x) +Full(S(x), y) -> +Full(x, S(y)) +Full(0, y) -> y The (relative) TRS S consists of the following rules: *(x, S(S(y))) -> +(x, *(x, S(y))) *(x, S(0)) -> x *(x, 0) -> 0 *(0, y) -> 0 Rewrite Strategy: INNERMOST