WORST_CASE(Omega(n^1),O(n^1)) proof of input_GPlgMHbwDg.trs # AProVE Commit ID: aff8ecad908e01718a4c36e68d2e55d5e0f16e15 fuhs 20220216 unpublished The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). (0) CpxTRS (1) CpxTrsToCdtProof [UPPER BOUND(ID), 0 ms] (2) CdtProblem (3) CdtLeafRemovalProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CdtProblem (5) CdtRhsSimplificationProcessorProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CdtProblem (7) CdtUsableRulesProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CdtProblem (9) CdtToCpxRelTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (10) CpxRelTRS (11) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CpxWeightedTrs (13) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (14) CpxTypedWeightedTrs (15) CompletionProof [UPPER BOUND(ID), 0 ms] (16) CpxTypedWeightedCompleteTrs (17) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (18) CpxRNTS (19) CompleteCoflocoProof [FINISHED, 197 ms] (20) BOUNDS(1, n^1) (21) CpxTrsToCdtProof [BOTH BOUNDS(ID, ID), 0 ms] (22) CdtProblem (23) CdtToCpxRelTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (24) CpxRelTRS (25) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (26) CpxRelTRS (27) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (28) typed CpxTrs (29) OrderProof [LOWER BOUND(ID), 11 ms] (30) typed CpxTrs (31) RewriteLemmaProof [LOWER BOUND(ID), 302 ms] (32) BEST (33) proven lower bound (34) LowerBoundPropagationProof [FINISHED, 0 ms] (35) BOUNDS(n^1, INF) (36) typed CpxTrs (37) RewriteLemmaProof [LOWER BOUND(ID), 135 ms] (38) typed CpxTrs (39) RewriteLemmaProof [LOWER BOUND(ID), 20 ms] (40) typed CpxTrs (41) RewriteLemmaProof [LOWER BOUND(ID), 64 ms] (42) typed CpxTrs ---------------------------------------- (0) Obligation: The Runtime Complexity (parallel-innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: minus(0, Y) -> 0 minus(s(X), s(Y)) -> minus(X, Y) geq(X, 0) -> true geq(0, s(Y)) -> false geq(s(X), s(Y)) -> geq(X, Y) div(0, s(Y)) -> 0 div(s(X), s(Y)) -> if(geq(X, Y), s(div(minus(X, Y), s(Y))), 0) if(true, X, Y) -> X if(false, X, Y) -> Y S is empty. Rewrite Strategy: PARALLEL_INNERMOST ---------------------------------------- (1) CpxTrsToCdtProof (UPPER BOUND(ID)) Converted Cpx (relative) TRS with rewrite strategy PARALLEL_INNERMOST to CDT ---------------------------------------- (2) Obligation: Complexity Dependency Tuples Problem Rules: minus(0, z0) -> 0 minus(s(z0), s(z1)) -> minus(z0, z1) geq(z0, 0) -> true geq(0, s(z0)) -> false geq(s(z0), s(z1)) -> geq(z0, z1) div(0, s(z0)) -> 0 div(s(z0), s(z1)) -> if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0) if(true, z0, z1) -> z0 if(false, z0, z1) -> z1 Tuples: MINUS(0, z0) -> c MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(z0, 0) -> c2 GEQ(0, s(z0)) -> c3 GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(0, s(z0)) -> c5 DIV(s(z0), s(z1)) -> c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF(true, z0, z1) -> c8 IF(false, z0, z1) -> c9 S tuples: MINUS(0, z0) -> c MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(z0, 0) -> c2 GEQ(0, s(z0)) -> c3 GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(0, s(z0)) -> c5 DIV(s(z0), s(z1)) -> c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF(true, z0, z1) -> c8 IF(false, z0, z1) -> c9 K tuples:none Defined Rule Symbols: minus_2, geq_2, div_2, if_3 Defined Pair Symbols: MINUS_2, GEQ_2, DIV_2, IF_3 Compound Symbols: c, c1_1, c2, c3, c4_1, c5, c6_2, c7_3, c8, c9 ---------------------------------------- (3) CdtLeafRemovalProof (BOTH BOUNDS(ID, ID)) Removed 6 trailing nodes: DIV(0, s(z0)) -> c5 GEQ(0, s(z0)) -> c3 GEQ(z0, 0) -> c2 MINUS(0, z0) -> c IF(false, z0, z1) -> c9 IF(true, z0, z1) -> c8 ---------------------------------------- (4) Obligation: Complexity Dependency Tuples Problem Rules: minus(0, z0) -> 0 minus(s(z0), s(z1)) -> minus(z0, z1) geq(z0, 0) -> true geq(0, s(z0)) -> false geq(s(z0), s(z1)) -> geq(z0, z1) div(0, s(z0)) -> 0 div(s(z0), s(z1)) -> if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0) if(true, z0, z1) -> z0 if(false, z0, z1) -> z1 Tuples: MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) S tuples: MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) K tuples:none Defined Rule Symbols: minus_2, geq_2, div_2, if_3 Defined Pair Symbols: MINUS_2, GEQ_2, DIV_2 Compound Symbols: c1_1, c4_1, c6_2, c7_3 ---------------------------------------- (5) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID)) Removed 2 trailing tuple parts ---------------------------------------- (6) Obligation: Complexity Dependency Tuples Problem Rules: minus(0, z0) -> 0 minus(s(z0), s(z1)) -> minus(z0, z1) geq(z0, 0) -> true geq(0, s(z0)) -> false geq(s(z0), s(z1)) -> geq(z0, z1) div(0, s(z0)) -> 0 div(s(z0), s(z1)) -> if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0) if(true, z0, z1) -> z0 if(false, z0, z1) -> z1 Tuples: MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c6(GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) S tuples: MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c6(GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) K tuples:none Defined Rule Symbols: minus_2, geq_2, div_2, if_3 Defined Pair Symbols: MINUS_2, GEQ_2, DIV_2 Compound Symbols: c1_1, c4_1, c6_1, c7_2 ---------------------------------------- (7) CdtUsableRulesProof (BOTH BOUNDS(ID, ID)) The following rules are not usable and were removed: geq(z0, 0) -> true geq(0, s(z0)) -> false geq(s(z0), s(z1)) -> geq(z0, z1) div(0, s(z0)) -> 0 div(s(z0), s(z1)) -> if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0) if(true, z0, z1) -> z0 if(false, z0, z1) -> z1 ---------------------------------------- (8) Obligation: Complexity Dependency Tuples Problem Rules: minus(0, z0) -> 0 minus(s(z0), s(z1)) -> minus(z0, z1) Tuples: MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c6(GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) S tuples: MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c6(GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) K tuples:none Defined Rule Symbols: minus_2 Defined Pair Symbols: MINUS_2, GEQ_2, DIV_2 Compound Symbols: c1_1, c4_1, c6_1, c7_2 ---------------------------------------- (9) CdtToCpxRelTrsProof (BOTH BOUNDS(ID, ID)) Converted S to standard rules, and D \ S as well as R to relative rules. ---------------------------------------- (10) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(1, n^1). The TRS R consists of the following rules: MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c6(GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) The (relative) TRS S consists of the following rules: minus(0, z0) -> 0 minus(s(z0), s(z1)) -> minus(z0, z1) Rewrite Strategy: INNERMOST ---------------------------------------- (11) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (12) 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: MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) [1] GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) [1] DIV(s(z0), s(z1)) -> c6(GEQ(z0, z1)) [1] DIV(s(z0), s(z1)) -> c7(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) [1] minus(0, z0) -> 0 [0] minus(s(z0), s(z1)) -> minus(z0, z1) [0] Rewrite Strategy: INNERMOST ---------------------------------------- (13) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (14) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) [1] GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) [1] DIV(s(z0), s(z1)) -> c6(GEQ(z0, z1)) [1] DIV(s(z0), s(z1)) -> c7(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) [1] minus(0, z0) -> 0 [0] minus(s(z0), s(z1)) -> minus(z0, z1) [0] The TRS has the following type information: MINUS :: s:0 -> s:0 -> c1 s :: s:0 -> s:0 c1 :: c1 -> c1 GEQ :: s:0 -> s:0 -> c4 c4 :: c4 -> c4 DIV :: s:0 -> s:0 -> c6:c7 c6 :: c4 -> c6:c7 c7 :: c6:c7 -> c1 -> c6:c7 minus :: s:0 -> s:0 -> s:0 0 :: s:0 Rewrite Strategy: INNERMOST ---------------------------------------- (15) 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: minus(v0, v1) -> null_minus [0] MINUS(v0, v1) -> null_MINUS [0] GEQ(v0, v1) -> null_GEQ [0] DIV(v0, v1) -> null_DIV [0] And the following fresh constants: null_minus, null_MINUS, null_GEQ, null_DIV ---------------------------------------- (16) 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: MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) [1] GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) [1] DIV(s(z0), s(z1)) -> c6(GEQ(z0, z1)) [1] DIV(s(z0), s(z1)) -> c7(DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) [1] minus(0, z0) -> 0 [0] minus(s(z0), s(z1)) -> minus(z0, z1) [0] minus(v0, v1) -> null_minus [0] MINUS(v0, v1) -> null_MINUS [0] GEQ(v0, v1) -> null_GEQ [0] DIV(v0, v1) -> null_DIV [0] The TRS has the following type information: MINUS :: s:0:null_minus -> s:0:null_minus -> c1:null_MINUS s :: s:0:null_minus -> s:0:null_minus c1 :: c1:null_MINUS -> c1:null_MINUS GEQ :: s:0:null_minus -> s:0:null_minus -> c4:null_GEQ c4 :: c4:null_GEQ -> c4:null_GEQ DIV :: s:0:null_minus -> s:0:null_minus -> c6:c7:null_DIV c6 :: c4:null_GEQ -> c6:c7:null_DIV c7 :: c6:c7:null_DIV -> c1:null_MINUS -> c6:c7:null_DIV minus :: s:0:null_minus -> s:0:null_minus -> s:0:null_minus 0 :: s:0:null_minus null_minus :: s:0:null_minus null_MINUS :: c1:null_MINUS null_GEQ :: c4:null_GEQ null_DIV :: c6:c7:null_DIV Rewrite Strategy: INNERMOST ---------------------------------------- (17) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: 0 => 0 null_minus => 0 null_MINUS => 0 null_GEQ => 0 null_DIV => 0 ---------------------------------------- (18) Obligation: Complexity RNTS consisting of the following rules: DIV(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 DIV(z, z') -{ 1 }-> 1 + GEQ(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 DIV(z, z') -{ 1 }-> 1 + DIV(minus(z0, z1), 1 + z1) + MINUS(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 GEQ(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 GEQ(z, z') -{ 1 }-> 1 + GEQ(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 MINUS(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 MINUS(z, z') -{ 1 }-> 1 + MINUS(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 minus(z, z') -{ 0 }-> minus(z0, z1) :|: z1 >= 0, z = 1 + z0, z0 >= 0, z' = 1 + z1 minus(z, z') -{ 0 }-> 0 :|: z0 >= 0, z = 0, z' = z0 minus(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (19) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V1, V),0,[fun(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[fun1(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[fun2(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[minus(V1, V, Out)],[V1 >= 0,V >= 0]). eq(fun(V1, V, Out),1,[fun(V3, V2, Ret1)],[Out = 1 + Ret1,V2 >= 0,V1 = 1 + V3,V3 >= 0,V = 1 + V2]). eq(fun1(V1, V, Out),1,[fun1(V5, V4, Ret11)],[Out = 1 + Ret11,V4 >= 0,V1 = 1 + V5,V5 >= 0,V = 1 + V4]). eq(fun2(V1, V, Out),1,[fun1(V7, V6, Ret12)],[Out = 1 + Ret12,V6 >= 0,V1 = 1 + V7,V7 >= 0,V = 1 + V6]). eq(fun2(V1, V, Out),1,[minus(V8, V9, Ret010),fun2(Ret010, 1 + V9, Ret01),fun(V8, V9, Ret13)],[Out = 1 + Ret01 + Ret13,V9 >= 0,V1 = 1 + V8,V8 >= 0,V = 1 + V9]). eq(minus(V1, V, Out),0,[],[Out = 0,V10 >= 0,V1 = 0,V = V10]). eq(minus(V1, V, Out),0,[minus(V12, V11, Ret)],[Out = Ret,V11 >= 0,V1 = 1 + V12,V12 >= 0,V = 1 + V11]). eq(minus(V1, V, Out),0,[],[Out = 0,V14 >= 0,V13 >= 0,V1 = V14,V = V13]). eq(fun(V1, V, Out),0,[],[Out = 0,V16 >= 0,V15 >= 0,V1 = V16,V = V15]). eq(fun1(V1, V, Out),0,[],[Out = 0,V18 >= 0,V17 >= 0,V1 = V18,V = V17]). eq(fun2(V1, V, Out),0,[],[Out = 0,V19 >= 0,V20 >= 0,V1 = V19,V = V20]). input_output_vars(fun(V1,V,Out),[V1,V],[Out]). input_output_vars(fun1(V1,V,Out),[V1,V],[Out]). input_output_vars(fun2(V1,V,Out),[V1,V],[Out]). input_output_vars(minus(V1,V,Out),[V1,V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [fun/3] 1. recursive : [fun1/3] 2. recursive : [minus/3] 3. recursive [non_tail] : [fun2/3] 4. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun/3 1. SCC is partially evaluated into fun1/3 2. SCC is partially evaluated into minus/3 3. SCC is partially evaluated into fun2/3 4. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun/3 * CE 6 is refined into CE [14] * CE 5 is refined into CE [15] ### Cost equations --> "Loop" of fun/3 * CEs [15] --> Loop 11 * CEs [14] --> Loop 12 ### Ranking functions of CR fun(V1,V,Out) * RF of phase [11]: [V,V1] #### Partial ranking functions of CR fun(V1,V,Out) * Partial RF of phase [11]: - RF of loop [11:1]: V V1 ### Specialization of cost equations fun1/3 * CE 8 is refined into CE [16] * CE 7 is refined into CE [17] ### Cost equations --> "Loop" of fun1/3 * CEs [17] --> Loop 13 * CEs [16] --> Loop 14 ### Ranking functions of CR fun1(V1,V,Out) * RF of phase [13]: [V,V1] #### Partial ranking functions of CR fun1(V1,V,Out) * Partial RF of phase [13]: - RF of loop [13:1]: V V1 ### Specialization of cost equations minus/3 * CE 12 is refined into CE [18] * CE 13 is refined into CE [19] ### Cost equations --> "Loop" of minus/3 * CEs [19] --> Loop 15 * CEs [18] --> Loop 16 ### Ranking functions of CR minus(V1,V,Out) * RF of phase [15]: [V,V1] #### Partial ranking functions of CR minus(V1,V,Out) * Partial RF of phase [15]: - RF of loop [15:1]: V V1 ### Specialization of cost equations fun2/3 * CE 9 is refined into CE [20,21] * CE 11 is refined into CE [22] * CE 10 is refined into CE [23,24] ### Cost equations --> "Loop" of fun2/3 * CEs [24] --> Loop 17 * CEs [23] --> Loop 18 * CEs [21] --> Loop 19 * CEs [20] --> Loop 20 * CEs [22] --> Loop 21 ### Ranking functions of CR fun2(V1,V,Out) #### Partial ranking functions of CR fun2(V1,V,Out) ### Specialization of cost equations start/2 * CE 1 is refined into CE [25,26] * CE 2 is refined into CE [27,28] * CE 3 is refined into CE [29,30,31] * CE 4 is refined into CE [32] ### Cost equations --> "Loop" of start/2 * CEs [25,26,27,28,29,30,31,32] --> Loop 22 ### Ranking functions of CR start(V1,V) #### Partial ranking functions of CR start(V1,V) Computing Bounds ===================================== #### Cost of chains of fun(V1,V,Out): * Chain [[11],12]: 1*it(11)+0 Such that:it(11) =< Out with precondition: [Out>=1,V1>=Out,V>=Out] * Chain [12]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of fun1(V1,V,Out): * Chain [[13],14]: 1*it(13)+0 Such that:it(13) =< Out with precondition: [Out>=1,V1>=Out,V>=Out] * Chain [14]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of minus(V1,V,Out): * Chain [[15],16]: 0 with precondition: [Out=0,V1>=1,V>=1] * Chain [16]: 0 with precondition: [Out=0,V1>=0,V>=0] #### Cost of chains of fun2(V1,V,Out): * Chain [21]: 0 with precondition: [Out=0,V1>=0,V>=0] * Chain [20]: 1 with precondition: [Out=1,V1>=1,V>=1] * Chain [19]: 1*s(1)+1 Such that:s(1) =< V with precondition: [Out>=2,V1>=Out,V>=Out] * Chain [18,21]: 1 with precondition: [Out=1,V1>=1,V>=1] * Chain [17,21]: 1*s(2)+1 Such that:s(2) =< V1 with precondition: [Out>=2,V1>=Out,V>=Out] #### Cost of chains of start(V1,V): * Chain [22]: 3*s(5)+1*s(7)+1 Such that:s(7) =< V1 aux(1) =< V s(5) =< aux(1) with precondition: [V1>=0,V>=0] Closed-form bounds of start(V1,V): ------------------------------------- * Chain [22] with precondition: [V1>=0,V>=0] - Upper bound: V1+3*V+1 - Complexity: n ### Maximum cost of start(V1,V): V1+3*V+1 Asymptotic class: n * Total analysis performed in 164 ms. ---------------------------------------- (20) BOUNDS(1, n^1) ---------------------------------------- (21) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID)) Converted Cpx (relative) TRS with rewrite strategy PARALLEL_INNERMOST to CDT ---------------------------------------- (22) Obligation: Complexity Dependency Tuples Problem Rules: minus(0, z0) -> 0 minus(s(z0), s(z1)) -> minus(z0, z1) geq(z0, 0) -> true geq(0, s(z0)) -> false geq(s(z0), s(z1)) -> geq(z0, z1) div(0, s(z0)) -> 0 div(s(z0), s(z1)) -> if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0) if(true, z0, z1) -> z0 if(false, z0, z1) -> z1 Tuples: MINUS(0, z0) -> c MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(z0, 0) -> c2 GEQ(0, s(z0)) -> c3 GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(0, s(z0)) -> c5 DIV(s(z0), s(z1)) -> c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF(true, z0, z1) -> c8 IF(false, z0, z1) -> c9 S tuples: MINUS(0, z0) -> c MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(z0, 0) -> c2 GEQ(0, s(z0)) -> c3 GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(0, s(z0)) -> c5 DIV(s(z0), s(z1)) -> c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF(true, z0, z1) -> c8 IF(false, z0, z1) -> c9 K tuples:none Defined Rule Symbols: minus_2, geq_2, div_2, if_3 Defined Pair Symbols: MINUS_2, GEQ_2, DIV_2, IF_3 Compound Symbols: c, c1_1, c2, c3, c4_1, c5, c6_2, c7_3, c8, c9 ---------------------------------------- (23) CdtToCpxRelTrsProof (BOTH BOUNDS(ID, ID)) Converted S to standard rules, and D \ S as well as R to relative rules. ---------------------------------------- (24) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: MINUS(0, z0) -> c MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(z0, 0) -> c2 GEQ(0, s(z0)) -> c3 GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(0, s(z0)) -> c5 DIV(s(z0), s(z1)) -> c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF(true, z0, z1) -> c8 IF(false, z0, z1) -> c9 The (relative) TRS S consists of the following rules: minus(0, z0) -> 0 minus(s(z0), s(z1)) -> minus(z0, z1) geq(z0, 0) -> true geq(0, s(z0)) -> false geq(s(z0), s(z1)) -> geq(z0, z1) div(0, s(z0)) -> 0 div(s(z0), s(z1)) -> if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0) if(true, z0, z1) -> z0 if(false, z0, z1) -> z1 Rewrite Strategy: INNERMOST ---------------------------------------- (25) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (26) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: MINUS(0', z0) -> c MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(z0, 0') -> c2 GEQ(0', s(z0)) -> c3 GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(0', s(z0)) -> c5 DIV(s(z0), s(z1)) -> c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0'), GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0'), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF(true, z0, z1) -> c8 IF(false, z0, z1) -> c9 The (relative) TRS S consists of the following rules: minus(0', z0) -> 0' minus(s(z0), s(z1)) -> minus(z0, z1) geq(z0, 0') -> true geq(0', s(z0)) -> false geq(s(z0), s(z1)) -> geq(z0, z1) div(0', s(z0)) -> 0' div(s(z0), s(z1)) -> if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0') if(true, z0, z1) -> z0 if(false, z0, z1) -> z1 Rewrite Strategy: INNERMOST ---------------------------------------- (27) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Inferred types. ---------------------------------------- (28) Obligation: Innermost TRS: Rules: MINUS(0', z0) -> c MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(z0, 0') -> c2 GEQ(0', s(z0)) -> c3 GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(0', s(z0)) -> c5 DIV(s(z0), s(z1)) -> c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0'), GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0'), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF(true, z0, z1) -> c8 IF(false, z0, z1) -> c9 minus(0', z0) -> 0' minus(s(z0), s(z1)) -> minus(z0, z1) geq(z0, 0') -> true geq(0', s(z0)) -> false geq(s(z0), s(z1)) -> geq(z0, z1) div(0', s(z0)) -> 0' div(s(z0), s(z1)) -> if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0') if(true, z0, z1) -> z0 if(false, z0, z1) -> z1 Types: MINUS :: 0':s -> 0':s -> c:c1 0' :: 0':s c :: c:c1 s :: 0':s -> 0':s c1 :: c:c1 -> c:c1 GEQ :: 0':s -> 0':s -> c2:c3:c4 c2 :: c2:c3:c4 c3 :: c2:c3:c4 c4 :: c2:c3:c4 -> c2:c3:c4 DIV :: 0':s -> 0':s -> c5:c6:c7 c5 :: c5:c6:c7 c6 :: c8:c9 -> c2:c3:c4 -> c5:c6:c7 IF :: true:false -> 0':s -> 0':s -> c8:c9 geq :: 0':s -> 0':s -> true:false div :: 0':s -> 0':s -> 0':s minus :: 0':s -> 0':s -> 0':s c7 :: c8:c9 -> c5:c6:c7 -> c:c1 -> c5:c6:c7 true :: true:false c8 :: c8:c9 false :: true:false c9 :: c8:c9 if :: true:false -> 0':s -> 0':s -> 0':s hole_c:c11_10 :: c:c1 hole_0':s2_10 :: 0':s hole_c2:c3:c43_10 :: c2:c3:c4 hole_c5:c6:c74_10 :: c5:c6:c7 hole_c8:c95_10 :: c8:c9 hole_true:false6_10 :: true:false gen_c:c17_10 :: Nat -> c:c1 gen_0':s8_10 :: Nat -> 0':s gen_c2:c3:c49_10 :: Nat -> c2:c3:c4 gen_c5:c6:c710_10 :: Nat -> c5:c6:c7 ---------------------------------------- (29) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: MINUS, GEQ, DIV, geq, div, minus They will be analysed ascendingly in the following order: MINUS < DIV GEQ < DIV geq < DIV div < DIV minus < DIV geq < div minus < div ---------------------------------------- (30) Obligation: Innermost TRS: Rules: MINUS(0', z0) -> c MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(z0, 0') -> c2 GEQ(0', s(z0)) -> c3 GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(0', s(z0)) -> c5 DIV(s(z0), s(z1)) -> c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0'), GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0'), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF(true, z0, z1) -> c8 IF(false, z0, z1) -> c9 minus(0', z0) -> 0' minus(s(z0), s(z1)) -> minus(z0, z1) geq(z0, 0') -> true geq(0', s(z0)) -> false geq(s(z0), s(z1)) -> geq(z0, z1) div(0', s(z0)) -> 0' div(s(z0), s(z1)) -> if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0') if(true, z0, z1) -> z0 if(false, z0, z1) -> z1 Types: MINUS :: 0':s -> 0':s -> c:c1 0' :: 0':s c :: c:c1 s :: 0':s -> 0':s c1 :: c:c1 -> c:c1 GEQ :: 0':s -> 0':s -> c2:c3:c4 c2 :: c2:c3:c4 c3 :: c2:c3:c4 c4 :: c2:c3:c4 -> c2:c3:c4 DIV :: 0':s -> 0':s -> c5:c6:c7 c5 :: c5:c6:c7 c6 :: c8:c9 -> c2:c3:c4 -> c5:c6:c7 IF :: true:false -> 0':s -> 0':s -> c8:c9 geq :: 0':s -> 0':s -> true:false div :: 0':s -> 0':s -> 0':s minus :: 0':s -> 0':s -> 0':s c7 :: c8:c9 -> c5:c6:c7 -> c:c1 -> c5:c6:c7 true :: true:false c8 :: c8:c9 false :: true:false c9 :: c8:c9 if :: true:false -> 0':s -> 0':s -> 0':s hole_c:c11_10 :: c:c1 hole_0':s2_10 :: 0':s hole_c2:c3:c43_10 :: c2:c3:c4 hole_c5:c6:c74_10 :: c5:c6:c7 hole_c8:c95_10 :: c8:c9 hole_true:false6_10 :: true:false gen_c:c17_10 :: Nat -> c:c1 gen_0':s8_10 :: Nat -> 0':s gen_c2:c3:c49_10 :: Nat -> c2:c3:c4 gen_c5:c6:c710_10 :: Nat -> c5:c6:c7 Generator Equations: gen_c:c17_10(0) <=> c gen_c:c17_10(+(x, 1)) <=> c1(gen_c:c17_10(x)) gen_0':s8_10(0) <=> 0' gen_0':s8_10(+(x, 1)) <=> s(gen_0':s8_10(x)) gen_c2:c3:c49_10(0) <=> c2 gen_c2:c3:c49_10(+(x, 1)) <=> c4(gen_c2:c3:c49_10(x)) gen_c5:c6:c710_10(0) <=> c5 gen_c5:c6:c710_10(+(x, 1)) <=> c7(c8, gen_c5:c6:c710_10(x), c) The following defined symbols remain to be analysed: MINUS, GEQ, DIV, geq, div, minus They will be analysed ascendingly in the following order: MINUS < DIV GEQ < DIV geq < DIV div < DIV minus < DIV geq < div minus < div ---------------------------------------- (31) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: MINUS(gen_0':s8_10(n12_10), gen_0':s8_10(n12_10)) -> gen_c:c17_10(n12_10), rt in Omega(1 + n12_10) Induction Base: MINUS(gen_0':s8_10(0), gen_0':s8_10(0)) ->_R^Omega(1) c Induction Step: MINUS(gen_0':s8_10(+(n12_10, 1)), gen_0':s8_10(+(n12_10, 1))) ->_R^Omega(1) c1(MINUS(gen_0':s8_10(n12_10), gen_0':s8_10(n12_10))) ->_IH c1(gen_c:c17_10(c13_10)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (32) Complex Obligation (BEST) ---------------------------------------- (33) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: MINUS(0', z0) -> c MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(z0, 0') -> c2 GEQ(0', s(z0)) -> c3 GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(0', s(z0)) -> c5 DIV(s(z0), s(z1)) -> c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0'), GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0'), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF(true, z0, z1) -> c8 IF(false, z0, z1) -> c9 minus(0', z0) -> 0' minus(s(z0), s(z1)) -> minus(z0, z1) geq(z0, 0') -> true geq(0', s(z0)) -> false geq(s(z0), s(z1)) -> geq(z0, z1) div(0', s(z0)) -> 0' div(s(z0), s(z1)) -> if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0') if(true, z0, z1) -> z0 if(false, z0, z1) -> z1 Types: MINUS :: 0':s -> 0':s -> c:c1 0' :: 0':s c :: c:c1 s :: 0':s -> 0':s c1 :: c:c1 -> c:c1 GEQ :: 0':s -> 0':s -> c2:c3:c4 c2 :: c2:c3:c4 c3 :: c2:c3:c4 c4 :: c2:c3:c4 -> c2:c3:c4 DIV :: 0':s -> 0':s -> c5:c6:c7 c5 :: c5:c6:c7 c6 :: c8:c9 -> c2:c3:c4 -> c5:c6:c7 IF :: true:false -> 0':s -> 0':s -> c8:c9 geq :: 0':s -> 0':s -> true:false div :: 0':s -> 0':s -> 0':s minus :: 0':s -> 0':s -> 0':s c7 :: c8:c9 -> c5:c6:c7 -> c:c1 -> c5:c6:c7 true :: true:false c8 :: c8:c9 false :: true:false c9 :: c8:c9 if :: true:false -> 0':s -> 0':s -> 0':s hole_c:c11_10 :: c:c1 hole_0':s2_10 :: 0':s hole_c2:c3:c43_10 :: c2:c3:c4 hole_c5:c6:c74_10 :: c5:c6:c7 hole_c8:c95_10 :: c8:c9 hole_true:false6_10 :: true:false gen_c:c17_10 :: Nat -> c:c1 gen_0':s8_10 :: Nat -> 0':s gen_c2:c3:c49_10 :: Nat -> c2:c3:c4 gen_c5:c6:c710_10 :: Nat -> c5:c6:c7 Generator Equations: gen_c:c17_10(0) <=> c gen_c:c17_10(+(x, 1)) <=> c1(gen_c:c17_10(x)) gen_0':s8_10(0) <=> 0' gen_0':s8_10(+(x, 1)) <=> s(gen_0':s8_10(x)) gen_c2:c3:c49_10(0) <=> c2 gen_c2:c3:c49_10(+(x, 1)) <=> c4(gen_c2:c3:c49_10(x)) gen_c5:c6:c710_10(0) <=> c5 gen_c5:c6:c710_10(+(x, 1)) <=> c7(c8, gen_c5:c6:c710_10(x), c) The following defined symbols remain to be analysed: MINUS, GEQ, DIV, geq, div, minus They will be analysed ascendingly in the following order: MINUS < DIV GEQ < DIV geq < DIV div < DIV minus < DIV geq < div minus < div ---------------------------------------- (34) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (35) BOUNDS(n^1, INF) ---------------------------------------- (36) Obligation: Innermost TRS: Rules: MINUS(0', z0) -> c MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(z0, 0') -> c2 GEQ(0', s(z0)) -> c3 GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(0', s(z0)) -> c5 DIV(s(z0), s(z1)) -> c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0'), GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0'), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF(true, z0, z1) -> c8 IF(false, z0, z1) -> c9 minus(0', z0) -> 0' minus(s(z0), s(z1)) -> minus(z0, z1) geq(z0, 0') -> true geq(0', s(z0)) -> false geq(s(z0), s(z1)) -> geq(z0, z1) div(0', s(z0)) -> 0' div(s(z0), s(z1)) -> if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0') if(true, z0, z1) -> z0 if(false, z0, z1) -> z1 Types: MINUS :: 0':s -> 0':s -> c:c1 0' :: 0':s c :: c:c1 s :: 0':s -> 0':s c1 :: c:c1 -> c:c1 GEQ :: 0':s -> 0':s -> c2:c3:c4 c2 :: c2:c3:c4 c3 :: c2:c3:c4 c4 :: c2:c3:c4 -> c2:c3:c4 DIV :: 0':s -> 0':s -> c5:c6:c7 c5 :: c5:c6:c7 c6 :: c8:c9 -> c2:c3:c4 -> c5:c6:c7 IF :: true:false -> 0':s -> 0':s -> c8:c9 geq :: 0':s -> 0':s -> true:false div :: 0':s -> 0':s -> 0':s minus :: 0':s -> 0':s -> 0':s c7 :: c8:c9 -> c5:c6:c7 -> c:c1 -> c5:c6:c7 true :: true:false c8 :: c8:c9 false :: true:false c9 :: c8:c9 if :: true:false -> 0':s -> 0':s -> 0':s hole_c:c11_10 :: c:c1 hole_0':s2_10 :: 0':s hole_c2:c3:c43_10 :: c2:c3:c4 hole_c5:c6:c74_10 :: c5:c6:c7 hole_c8:c95_10 :: c8:c9 hole_true:false6_10 :: true:false gen_c:c17_10 :: Nat -> c:c1 gen_0':s8_10 :: Nat -> 0':s gen_c2:c3:c49_10 :: Nat -> c2:c3:c4 gen_c5:c6:c710_10 :: Nat -> c5:c6:c7 Lemmas: MINUS(gen_0':s8_10(n12_10), gen_0':s8_10(n12_10)) -> gen_c:c17_10(n12_10), rt in Omega(1 + n12_10) Generator Equations: gen_c:c17_10(0) <=> c gen_c:c17_10(+(x, 1)) <=> c1(gen_c:c17_10(x)) gen_0':s8_10(0) <=> 0' gen_0':s8_10(+(x, 1)) <=> s(gen_0':s8_10(x)) gen_c2:c3:c49_10(0) <=> c2 gen_c2:c3:c49_10(+(x, 1)) <=> c4(gen_c2:c3:c49_10(x)) gen_c5:c6:c710_10(0) <=> c5 gen_c5:c6:c710_10(+(x, 1)) <=> c7(c8, gen_c5:c6:c710_10(x), c) The following defined symbols remain to be analysed: GEQ, DIV, geq, div, minus They will be analysed ascendingly in the following order: GEQ < DIV geq < DIV div < DIV minus < DIV geq < div minus < div ---------------------------------------- (37) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: GEQ(gen_0':s8_10(n402_10), gen_0':s8_10(n402_10)) -> gen_c2:c3:c49_10(n402_10), rt in Omega(1 + n402_10) Induction Base: GEQ(gen_0':s8_10(0), gen_0':s8_10(0)) ->_R^Omega(1) c2 Induction Step: GEQ(gen_0':s8_10(+(n402_10, 1)), gen_0':s8_10(+(n402_10, 1))) ->_R^Omega(1) c4(GEQ(gen_0':s8_10(n402_10), gen_0':s8_10(n402_10))) ->_IH c4(gen_c2:c3:c49_10(c403_10)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (38) Obligation: Innermost TRS: Rules: MINUS(0', z0) -> c MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(z0, 0') -> c2 GEQ(0', s(z0)) -> c3 GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(0', s(z0)) -> c5 DIV(s(z0), s(z1)) -> c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0'), GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0'), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF(true, z0, z1) -> c8 IF(false, z0, z1) -> c9 minus(0', z0) -> 0' minus(s(z0), s(z1)) -> minus(z0, z1) geq(z0, 0') -> true geq(0', s(z0)) -> false geq(s(z0), s(z1)) -> geq(z0, z1) div(0', s(z0)) -> 0' div(s(z0), s(z1)) -> if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0') if(true, z0, z1) -> z0 if(false, z0, z1) -> z1 Types: MINUS :: 0':s -> 0':s -> c:c1 0' :: 0':s c :: c:c1 s :: 0':s -> 0':s c1 :: c:c1 -> c:c1 GEQ :: 0':s -> 0':s -> c2:c3:c4 c2 :: c2:c3:c4 c3 :: c2:c3:c4 c4 :: c2:c3:c4 -> c2:c3:c4 DIV :: 0':s -> 0':s -> c5:c6:c7 c5 :: c5:c6:c7 c6 :: c8:c9 -> c2:c3:c4 -> c5:c6:c7 IF :: true:false -> 0':s -> 0':s -> c8:c9 geq :: 0':s -> 0':s -> true:false div :: 0':s -> 0':s -> 0':s minus :: 0':s -> 0':s -> 0':s c7 :: c8:c9 -> c5:c6:c7 -> c:c1 -> c5:c6:c7 true :: true:false c8 :: c8:c9 false :: true:false c9 :: c8:c9 if :: true:false -> 0':s -> 0':s -> 0':s hole_c:c11_10 :: c:c1 hole_0':s2_10 :: 0':s hole_c2:c3:c43_10 :: c2:c3:c4 hole_c5:c6:c74_10 :: c5:c6:c7 hole_c8:c95_10 :: c8:c9 hole_true:false6_10 :: true:false gen_c:c17_10 :: Nat -> c:c1 gen_0':s8_10 :: Nat -> 0':s gen_c2:c3:c49_10 :: Nat -> c2:c3:c4 gen_c5:c6:c710_10 :: Nat -> c5:c6:c7 Lemmas: MINUS(gen_0':s8_10(n12_10), gen_0':s8_10(n12_10)) -> gen_c:c17_10(n12_10), rt in Omega(1 + n12_10) GEQ(gen_0':s8_10(n402_10), gen_0':s8_10(n402_10)) -> gen_c2:c3:c49_10(n402_10), rt in Omega(1 + n402_10) Generator Equations: gen_c:c17_10(0) <=> c gen_c:c17_10(+(x, 1)) <=> c1(gen_c:c17_10(x)) gen_0':s8_10(0) <=> 0' gen_0':s8_10(+(x, 1)) <=> s(gen_0':s8_10(x)) gen_c2:c3:c49_10(0) <=> c2 gen_c2:c3:c49_10(+(x, 1)) <=> c4(gen_c2:c3:c49_10(x)) gen_c5:c6:c710_10(0) <=> c5 gen_c5:c6:c710_10(+(x, 1)) <=> c7(c8, gen_c5:c6:c710_10(x), c) The following defined symbols remain to be analysed: geq, DIV, div, minus They will be analysed ascendingly in the following order: geq < DIV div < DIV minus < DIV geq < div minus < div ---------------------------------------- (39) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: geq(gen_0':s8_10(n1051_10), gen_0':s8_10(n1051_10)) -> true, rt in Omega(0) Induction Base: geq(gen_0':s8_10(0), gen_0':s8_10(0)) ->_R^Omega(0) true Induction Step: geq(gen_0':s8_10(+(n1051_10, 1)), gen_0':s8_10(+(n1051_10, 1))) ->_R^Omega(0) geq(gen_0':s8_10(n1051_10), gen_0':s8_10(n1051_10)) ->_IH true We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (40) Obligation: Innermost TRS: Rules: MINUS(0', z0) -> c MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(z0, 0') -> c2 GEQ(0', s(z0)) -> c3 GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(0', s(z0)) -> c5 DIV(s(z0), s(z1)) -> c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0'), GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0'), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF(true, z0, z1) -> c8 IF(false, z0, z1) -> c9 minus(0', z0) -> 0' minus(s(z0), s(z1)) -> minus(z0, z1) geq(z0, 0') -> true geq(0', s(z0)) -> false geq(s(z0), s(z1)) -> geq(z0, z1) div(0', s(z0)) -> 0' div(s(z0), s(z1)) -> if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0') if(true, z0, z1) -> z0 if(false, z0, z1) -> z1 Types: MINUS :: 0':s -> 0':s -> c:c1 0' :: 0':s c :: c:c1 s :: 0':s -> 0':s c1 :: c:c1 -> c:c1 GEQ :: 0':s -> 0':s -> c2:c3:c4 c2 :: c2:c3:c4 c3 :: c2:c3:c4 c4 :: c2:c3:c4 -> c2:c3:c4 DIV :: 0':s -> 0':s -> c5:c6:c7 c5 :: c5:c6:c7 c6 :: c8:c9 -> c2:c3:c4 -> c5:c6:c7 IF :: true:false -> 0':s -> 0':s -> c8:c9 geq :: 0':s -> 0':s -> true:false div :: 0':s -> 0':s -> 0':s minus :: 0':s -> 0':s -> 0':s c7 :: c8:c9 -> c5:c6:c7 -> c:c1 -> c5:c6:c7 true :: true:false c8 :: c8:c9 false :: true:false c9 :: c8:c9 if :: true:false -> 0':s -> 0':s -> 0':s hole_c:c11_10 :: c:c1 hole_0':s2_10 :: 0':s hole_c2:c3:c43_10 :: c2:c3:c4 hole_c5:c6:c74_10 :: c5:c6:c7 hole_c8:c95_10 :: c8:c9 hole_true:false6_10 :: true:false gen_c:c17_10 :: Nat -> c:c1 gen_0':s8_10 :: Nat -> 0':s gen_c2:c3:c49_10 :: Nat -> c2:c3:c4 gen_c5:c6:c710_10 :: Nat -> c5:c6:c7 Lemmas: MINUS(gen_0':s8_10(n12_10), gen_0':s8_10(n12_10)) -> gen_c:c17_10(n12_10), rt in Omega(1 + n12_10) GEQ(gen_0':s8_10(n402_10), gen_0':s8_10(n402_10)) -> gen_c2:c3:c49_10(n402_10), rt in Omega(1 + n402_10) geq(gen_0':s8_10(n1051_10), gen_0':s8_10(n1051_10)) -> true, rt in Omega(0) Generator Equations: gen_c:c17_10(0) <=> c gen_c:c17_10(+(x, 1)) <=> c1(gen_c:c17_10(x)) gen_0':s8_10(0) <=> 0' gen_0':s8_10(+(x, 1)) <=> s(gen_0':s8_10(x)) gen_c2:c3:c49_10(0) <=> c2 gen_c2:c3:c49_10(+(x, 1)) <=> c4(gen_c2:c3:c49_10(x)) gen_c5:c6:c710_10(0) <=> c5 gen_c5:c6:c710_10(+(x, 1)) <=> c7(c8, gen_c5:c6:c710_10(x), c) The following defined symbols remain to be analysed: minus, DIV, div They will be analysed ascendingly in the following order: div < DIV minus < DIV minus < div ---------------------------------------- (41) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: minus(gen_0':s8_10(n1411_10), gen_0':s8_10(n1411_10)) -> gen_0':s8_10(0), rt in Omega(0) Induction Base: minus(gen_0':s8_10(0), gen_0':s8_10(0)) ->_R^Omega(0) 0' Induction Step: minus(gen_0':s8_10(+(n1411_10, 1)), gen_0':s8_10(+(n1411_10, 1))) ->_R^Omega(0) minus(gen_0':s8_10(n1411_10), gen_0':s8_10(n1411_10)) ->_IH gen_0':s8_10(0) We have rt in Omega(1) and sz in O(n). Thus, we have irc_R in Omega(n^0). ---------------------------------------- (42) Obligation: Innermost TRS: Rules: MINUS(0', z0) -> c MINUS(s(z0), s(z1)) -> c1(MINUS(z0, z1)) GEQ(z0, 0') -> c2 GEQ(0', s(z0)) -> c3 GEQ(s(z0), s(z1)) -> c4(GEQ(z0, z1)) DIV(0', s(z0)) -> c5 DIV(s(z0), s(z1)) -> c6(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0'), GEQ(z0, z1)) DIV(s(z0), s(z1)) -> c7(IF(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0'), DIV(minus(z0, z1), s(z1)), MINUS(z0, z1)) IF(true, z0, z1) -> c8 IF(false, z0, z1) -> c9 minus(0', z0) -> 0' minus(s(z0), s(z1)) -> minus(z0, z1) geq(z0, 0') -> true geq(0', s(z0)) -> false geq(s(z0), s(z1)) -> geq(z0, z1) div(0', s(z0)) -> 0' div(s(z0), s(z1)) -> if(geq(z0, z1), s(div(minus(z0, z1), s(z1))), 0') if(true, z0, z1) -> z0 if(false, z0, z1) -> z1 Types: MINUS :: 0':s -> 0':s -> c:c1 0' :: 0':s c :: c:c1 s :: 0':s -> 0':s c1 :: c:c1 -> c:c1 GEQ :: 0':s -> 0':s -> c2:c3:c4 c2 :: c2:c3:c4 c3 :: c2:c3:c4 c4 :: c2:c3:c4 -> c2:c3:c4 DIV :: 0':s -> 0':s -> c5:c6:c7 c5 :: c5:c6:c7 c6 :: c8:c9 -> c2:c3:c4 -> c5:c6:c7 IF :: true:false -> 0':s -> 0':s -> c8:c9 geq :: 0':s -> 0':s -> true:false div :: 0':s -> 0':s -> 0':s minus :: 0':s -> 0':s -> 0':s c7 :: c8:c9 -> c5:c6:c7 -> c:c1 -> c5:c6:c7 true :: true:false c8 :: c8:c9 false :: true:false c9 :: c8:c9 if :: true:false -> 0':s -> 0':s -> 0':s hole_c:c11_10 :: c:c1 hole_0':s2_10 :: 0':s hole_c2:c3:c43_10 :: c2:c3:c4 hole_c5:c6:c74_10 :: c5:c6:c7 hole_c8:c95_10 :: c8:c9 hole_true:false6_10 :: true:false gen_c:c17_10 :: Nat -> c:c1 gen_0':s8_10 :: Nat -> 0':s gen_c2:c3:c49_10 :: Nat -> c2:c3:c4 gen_c5:c6:c710_10 :: Nat -> c5:c6:c7 Lemmas: MINUS(gen_0':s8_10(n12_10), gen_0':s8_10(n12_10)) -> gen_c:c17_10(n12_10), rt in Omega(1 + n12_10) GEQ(gen_0':s8_10(n402_10), gen_0':s8_10(n402_10)) -> gen_c2:c3:c49_10(n402_10), rt in Omega(1 + n402_10) geq(gen_0':s8_10(n1051_10), gen_0':s8_10(n1051_10)) -> true, rt in Omega(0) minus(gen_0':s8_10(n1411_10), gen_0':s8_10(n1411_10)) -> gen_0':s8_10(0), rt in Omega(0) Generator Equations: gen_c:c17_10(0) <=> c gen_c:c17_10(+(x, 1)) <=> c1(gen_c:c17_10(x)) gen_0':s8_10(0) <=> 0' gen_0':s8_10(+(x, 1)) <=> s(gen_0':s8_10(x)) gen_c2:c3:c49_10(0) <=> c2 gen_c2:c3:c49_10(+(x, 1)) <=> c4(gen_c2:c3:c49_10(x)) gen_c5:c6:c710_10(0) <=> c5 gen_c5:c6:c710_10(+(x, 1)) <=> c7(c8, gen_c5:c6:c710_10(x), c) The following defined symbols remain to be analysed: div, DIV They will be analysed ascendingly in the following order: div < DIV