/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), 89 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), 0 ms] (12) CpxRNTS (13) CompleteCoflocoProof [FINISHED, 154 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: ordered(Cons(x', Cons(x, xs))) -> ordered[Ite](<(x', x), Cons(x', Cons(x, xs))) ordered(Cons(x, Nil)) -> True ordered(Nil) -> True notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(xs) -> ordered(xs) The (relative) TRS S consists of the following rules: <(S(x), S(y)) -> <(x, y) <(0, S(y)) -> True <(x, 0) -> False ordered[Ite](True, Cons(x', Cons(x, xs))) -> ordered(xs) ordered[Ite](False, xs) -> False 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: ordered(Cons(x', Cons(x, xs))) -> ordered[Ite](<(x', x), Cons(x', Cons(x, xs))) ordered(Cons(x, Nil)) -> True ordered(Nil) -> True notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(xs) -> ordered(xs) The (relative) TRS S consists of the following rules: <(S(x), S(y)) -> <(x, y) <(0, S(y)) -> True <(x, 0) -> False ordered[Ite](True, Cons(x', Cons(x, xs))) -> ordered(xs) ordered[Ite](False, xs) -> False 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: ordered(Cons(x', Cons(x, xs))) -> ordered[Ite](<(x', x), Cons(x', Cons(x, xs))) [1] ordered(Cons(x, Nil)) -> True [1] ordered(Nil) -> True [1] notEmpty(Cons(x, xs)) -> True [1] notEmpty(Nil) -> False [1] goal(xs) -> ordered(xs) [1] <(S(x), S(y)) -> <(x, y) [0] <(0, S(y)) -> True [0] <(x, 0) -> False [0] ordered[Ite](True, Cons(x', Cons(x, xs))) -> ordered(xs) [0] ordered[Ite](False, xs) -> False [0] Rewrite Strategy: INNERMOST ---------------------------------------- (5) CpxWeightedTrsRenamingProof (BOTH BOUNDS(ID, ID)) Renamed defined symbols to avoid conflicts with arithmetic symbols: < => lt ---------------------------------------- (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: ordered(Cons(x', Cons(x, xs))) -> ordered[Ite](lt(x', x), Cons(x', Cons(x, xs))) [1] ordered(Cons(x, Nil)) -> True [1] ordered(Nil) -> True [1] notEmpty(Cons(x, xs)) -> True [1] notEmpty(Nil) -> False [1] goal(xs) -> ordered(xs) [1] lt(S(x), S(y)) -> lt(x, y) [0] lt(0, S(y)) -> True [0] lt(x, 0) -> False [0] ordered[Ite](True, Cons(x', Cons(x, xs))) -> ordered(xs) [0] ordered[Ite](False, xs) -> False [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: ordered(Cons(x', Cons(x, xs))) -> ordered[Ite](lt(x', x), Cons(x', Cons(x, xs))) [1] ordered(Cons(x, Nil)) -> True [1] ordered(Nil) -> True [1] notEmpty(Cons(x, xs)) -> True [1] notEmpty(Nil) -> False [1] goal(xs) -> ordered(xs) [1] lt(S(x), S(y)) -> lt(x, y) [0] lt(0, S(y)) -> True [0] lt(x, 0) -> False [0] ordered[Ite](True, Cons(x', Cons(x, xs))) -> ordered(xs) [0] ordered[Ite](False, xs) -> False [0] The TRS has the following type information: ordered :: Cons:Nil -> True:False Cons :: S:0 -> Cons:Nil -> Cons:Nil ordered[Ite] :: True:False -> Cons:Nil -> True:False lt :: S:0 -> S:0 -> True:False Nil :: Cons:Nil True :: True:False notEmpty :: Cons:Nil -> True:False False :: True:False goal :: Cons:Nil -> True:False S :: S:0 -> S:0 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: lt(v0, v1) -> null_lt [0] ordered[Ite](v0, v1) -> null_ordered[Ite] [0] And the following fresh constants: null_lt, null_ordered[Ite] ---------------------------------------- (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: ordered(Cons(x', Cons(x, xs))) -> ordered[Ite](lt(x', x), Cons(x', Cons(x, xs))) [1] ordered(Cons(x, Nil)) -> True [1] ordered(Nil) -> True [1] notEmpty(Cons(x, xs)) -> True [1] notEmpty(Nil) -> False [1] goal(xs) -> ordered(xs) [1] lt(S(x), S(y)) -> lt(x, y) [0] lt(0, S(y)) -> True [0] lt(x, 0) -> False [0] ordered[Ite](True, Cons(x', Cons(x, xs))) -> ordered(xs) [0] ordered[Ite](False, xs) -> False [0] lt(v0, v1) -> null_lt [0] ordered[Ite](v0, v1) -> null_ordered[Ite] [0] The TRS has the following type information: ordered :: Cons:Nil -> True:False:null_lt:null_ordered[Ite] Cons :: S:0 -> Cons:Nil -> Cons:Nil ordered[Ite] :: True:False:null_lt:null_ordered[Ite] -> Cons:Nil -> True:False:null_lt:null_ordered[Ite] lt :: S:0 -> S:0 -> True:False:null_lt:null_ordered[Ite] Nil :: Cons:Nil True :: True:False:null_lt:null_ordered[Ite] notEmpty :: Cons:Nil -> True:False:null_lt:null_ordered[Ite] False :: True:False:null_lt:null_ordered[Ite] goal :: Cons:Nil -> True:False:null_lt:null_ordered[Ite] S :: S:0 -> S:0 0 :: S:0 null_lt :: True:False:null_lt:null_ordered[Ite] null_ordered[Ite] :: True:False:null_lt:null_ordered[Ite] 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 True => 2 False => 1 0 => 0 null_lt => 0 null_ordered[Ite] => 0 ---------------------------------------- (12) Obligation: Complexity RNTS consisting of the following rules: goal(z) -{ 1 }-> ordered(xs) :|: xs >= 0, z = xs lt(z, z') -{ 0 }-> lt(x, y) :|: z' = 1 + y, x >= 0, y >= 0, z = 1 + x lt(z, z') -{ 0 }-> 2 :|: z' = 1 + y, y >= 0, z = 0 lt(z, z') -{ 0 }-> 1 :|: x >= 0, z = x, z' = 0 lt(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 notEmpty(z) -{ 1 }-> 2 :|: z = 1 + x + xs, xs >= 0, x >= 0 notEmpty(z) -{ 1 }-> 1 :|: z = 0 ordered(z) -{ 1 }-> ordered[Ite](lt(x', x), 1 + x' + (1 + x + xs)) :|: xs >= 0, x' >= 0, x >= 0, z = 1 + x' + (1 + x + xs) ordered(z) -{ 1 }-> 2 :|: x >= 0, z = 1 + x + 0 ordered(z) -{ 1 }-> 2 :|: z = 0 ordered[Ite](z, z') -{ 0 }-> ordered(xs) :|: z = 2, z' = 1 + x' + (1 + x + xs), xs >= 0, x' >= 0, x >= 0 ordered[Ite](z, z') -{ 0 }-> 1 :|: xs >= 0, z = 1, z' = xs ordered[Ite](z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 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, V9),0,[ordered(V, Out)],[V >= 0]). eq(start(V, V9),0,[notEmpty(V, Out)],[V >= 0]). eq(start(V, V9),0,[goal(V, Out)],[V >= 0]). eq(start(V, V9),0,[lt(V, V9, Out)],[V >= 0,V9 >= 0]). eq(start(V, V9),0,[fun(V, V9, Out)],[V >= 0,V9 >= 0]). eq(ordered(V, Out),1,[lt(V2, V3, Ret0),fun(Ret0, 1 + V2 + (1 + V3 + V1), Ret)],[Out = Ret,V1 >= 0,V2 >= 0,V3 >= 0,V = 2 + V1 + V2 + V3]). eq(ordered(V, Out),1,[],[Out = 2,V4 >= 0,V = 1 + V4]). eq(ordered(V, Out),1,[],[Out = 2,V = 0]). eq(notEmpty(V, Out),1,[],[Out = 2,V = 1 + V5 + V6,V6 >= 0,V5 >= 0]). eq(notEmpty(V, Out),1,[],[Out = 1,V = 0]). eq(goal(V, Out),1,[ordered(V7, Ret1)],[Out = Ret1,V7 >= 0,V = V7]). eq(lt(V, V9, Out),0,[lt(V8, V10, Ret2)],[Out = Ret2,V9 = 1 + V10,V8 >= 0,V10 >= 0,V = 1 + V8]). eq(lt(V, V9, Out),0,[],[Out = 2,V9 = 1 + V11,V11 >= 0,V = 0]). eq(lt(V, V9, Out),0,[],[Out = 1,V12 >= 0,V = V12,V9 = 0]). eq(fun(V, V9, Out),0,[ordered(V14, Ret3)],[Out = Ret3,V = 2,V9 = 2 + V13 + V14 + V15,V14 >= 0,V15 >= 0,V13 >= 0]). eq(fun(V, V9, Out),0,[],[Out = 1,V16 >= 0,V = 1,V9 = V16]). eq(lt(V, V9, Out),0,[],[Out = 0,V18 >= 0,V17 >= 0,V = V18,V9 = V17]). eq(fun(V, V9, Out),0,[],[Out = 0,V20 >= 0,V19 >= 0,V = V20,V9 = V19]). input_output_vars(ordered(V,Out),[V],[Out]). input_output_vars(notEmpty(V,Out),[V],[Out]). input_output_vars(goal(V,Out),[V],[Out]). input_output_vars(lt(V,V9,Out),[V,V9],[Out]). input_output_vars(fun(V,V9,Out),[V,V9],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [lt/3] 1. recursive : [fun/3,ordered/2] 2. non_recursive : [goal/2] 3. non_recursive : [notEmpty/2] 4. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into lt/3 1. SCC is partially evaluated into ordered/2 2. SCC is completely evaluated into other SCCs 3. SCC is partially evaluated into notEmpty/2 4. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations lt/3 * CE 17 is refined into CE [18] * CE 16 is refined into CE [19] * CE 15 is refined into CE [20] * CE 14 is refined into CE [21] ### Cost equations --> "Loop" of lt/3 * CEs [21] --> Loop 13 * CEs [18] --> Loop 14 * CEs [19] --> Loop 15 * CEs [20] --> Loop 16 ### Ranking functions of CR lt(V,V9,Out) * RF of phase [13]: [V,V9] #### Partial ranking functions of CR lt(V,V9,Out) * Partial RF of phase [13]: - RF of loop [13:1]: V V9 ### Specialization of cost equations ordered/2 * CE 10 is refined into CE [22] * CE 8 is refined into CE [23,24] * CE 7 is refined into CE [25,26,27,28,29] * CE 11 is refined into CE [30] * CE 9 is refined into CE [31,32] ### Cost equations --> "Loop" of ordered/2 * CEs [31,32] --> Loop 17 * CEs [22] --> Loop 18 * CEs [23,24] --> Loop 19 * CEs [25,26,27,28,29] --> Loop 20 * CEs [30] --> Loop 21 ### Ranking functions of CR ordered(V,Out) * RF of phase [17]: [V/2-1] #### Partial ranking functions of CR ordered(V,Out) * Partial RF of phase [17]: - RF of loop [17:1]: V/2-1 ### Specialization of cost equations notEmpty/2 * CE 12 is refined into CE [33] * CE 13 is refined into CE [34] ### Cost equations --> "Loop" of notEmpty/2 * CEs [33] --> Loop 22 * CEs [34] --> Loop 23 ### Ranking functions of CR notEmpty(V,Out) #### Partial ranking functions of CR notEmpty(V,Out) ### Specialization of cost equations start/2 * CE 1 is refined into CE [35] * CE 2 is refined into CE [36,37,38,39] * CE 3 is refined into CE [40,41,42,43] * CE 4 is refined into CE [44,45] * CE 5 is refined into CE [46,47,48,49] * CE 6 is refined into CE [50,51,52,53,54] ### Cost equations --> "Loop" of start/2 * CEs [41,42,43,45,47,48,49] --> Loop 24 * CEs [51] --> Loop 25 * CEs [35,36,37,38,39,52,53,54] --> Loop 26 * CEs [40,44,46,50] --> Loop 27 ### Ranking functions of CR start(V,V9) #### Partial ranking functions of CR start(V,V9) Computing Bounds ===================================== #### Cost of chains of lt(V,V9,Out): * Chain [[13],16]: 0 with precondition: [Out=2,V>=1,V9>=V+1] * Chain [[13],15]: 0 with precondition: [Out=1,V9>=1,V>=V9] * Chain [[13],14]: 0 with precondition: [Out=0,V>=1,V9>=1] * Chain [16]: 0 with precondition: [V=0,Out=2,V9>=1] * Chain [15]: 0 with precondition: [V9=0,Out=1,V>=0] * Chain [14]: 0 with precondition: [Out=0,V>=0,V9>=0] #### Cost of chains of ordered(V,Out): * Chain [[17],21]: 1*it(17)+1 Such that:it(17) =< V/2 with precondition: [Out=2,V>=3] * Chain [[17],20]: 1*it(17)+1 Such that:it(17) =< V/2 with precondition: [Out=0,V>=4] * Chain [[17],19]: 1*it(17)+1 Such that:it(17) =< V/2 with precondition: [Out=1,V>=4] * Chain [[17],18]: 1*it(17)+1 Such that:it(17) =< V/2 with precondition: [Out=2,V>=3] * Chain [21]: 1 with precondition: [V=0,Out=2] * Chain [20]: 1 with precondition: [Out=0,V>=2] * Chain [19]: 1 with precondition: [Out=1,V>=2] * Chain [18]: 1 with precondition: [Out=2,V>=1] #### Cost of chains of notEmpty(V,Out): * Chain [23]: 1 with precondition: [V=0,Out=1] * Chain [22]: 1 with precondition: [Out=2,V>=1] #### Cost of chains of start(V,V9): * Chain [27]: 2 with precondition: [V=0] * Chain [26]: 4*s(5)+1 Such that:aux(2) =< V9/2 s(5) =< aux(2) with precondition: [V>=0,V9>=0] * Chain [25]: 0 with precondition: [V9=0,V>=0] * Chain [24]: 8*s(9)+2 Such that:aux(3) =< V/2 s(9) =< aux(3) with precondition: [V>=1] Closed-form bounds of start(V,V9): ------------------------------------- * Chain [27] with precondition: [V=0] - Upper bound: 2 - Complexity: constant * Chain [26] with precondition: [V>=0,V9>=0] - Upper bound: 2*V9+1 - Complexity: n * Chain [25] with precondition: [V9=0,V>=0] - Upper bound: 0 - Complexity: constant * Chain [24] with precondition: [V>=1] - Upper bound: 4*V+2 - Complexity: n ### Maximum cost of start(V,V9): max([4*V+2,nat(V9/2)*4+1]) Asymptotic class: n * Total analysis performed in 180 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: ordered(Cons(x', Cons(x, xs))) -> ordered[Ite](<(x', x), Cons(x', Cons(x, xs))) ordered(Cons(x, Nil)) -> True ordered(Nil) -> True notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(xs) -> ordered(xs) The (relative) TRS S consists of the following rules: <(S(x), S(y)) -> <(x, y) <(0, S(y)) -> True <(x, 0) -> False ordered[Ite](True, Cons(x', Cons(x, xs))) -> ordered(xs) ordered[Ite](False, xs) -> False 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 ordered(Cons(0, Cons(S(y1_0), xs))) ->^+ ordered(xs) gives rise to a decreasing loop by considering the right hand sides subterm at position []. The pumping substitution is [xs / Cons(0, Cons(S(y1_0), 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: ordered(Cons(x', Cons(x, xs))) -> ordered[Ite](<(x', x), Cons(x', Cons(x, xs))) ordered(Cons(x, Nil)) -> True ordered(Nil) -> True notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(xs) -> ordered(xs) The (relative) TRS S consists of the following rules: <(S(x), S(y)) -> <(x, y) <(0, S(y)) -> True <(x, 0) -> False ordered[Ite](True, Cons(x', Cons(x, xs))) -> ordered(xs) ordered[Ite](False, xs) -> False 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: ordered(Cons(x', Cons(x, xs))) -> ordered[Ite](<(x', x), Cons(x', Cons(x, xs))) ordered(Cons(x, Nil)) -> True ordered(Nil) -> True notEmpty(Cons(x, xs)) -> True notEmpty(Nil) -> False goal(xs) -> ordered(xs) The (relative) TRS S consists of the following rules: <(S(x), S(y)) -> <(x, y) <(0, S(y)) -> True <(x, 0) -> False ordered[Ite](True, Cons(x', Cons(x, xs))) -> ordered(xs) ordered[Ite](False, xs) -> False Rewrite Strategy: INNERMOST