WORST_CASE(Omega(n^1), O(n^1)) proof of /export/starexec/sandbox/benchmark/theBenchmark.xml # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty The Derivational Complexity (innermost) of the given DCpxTrs could be proven to be BOUNDS(n^1, n^1). (0) DCpxTrs (1) DerivationalComplexityToRuntimeComplexityProof [BOTH BOUNDS(ID, ID), 0 ms] (2) CpxRelTRS (3) SInnermostTerminationProof [BOTH CONCRETE BOUNDS(ID, ID), 169 ms] (4) CpxRelTRS (5) NonCtorToCtorProof [UPPER BOUND(ID), 0 ms] (6) CpxRelTRS (7) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CpxWeightedTrs (9) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (10) CpxTypedWeightedTrs (11) CompletionProof [UPPER BOUND(ID), 0 ms] (12) CpxTypedWeightedCompleteTrs (13) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (14) CpxRNTS (15) CompleteCoflocoProof [FINISHED, 579 ms] (16) BOUNDS(1, n^1) (17) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (18) CpxRelTRS (19) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (20) typed CpxTrs (21) OrderProof [LOWER BOUND(ID), 0 ms] (22) typed CpxTrs (23) RewriteLemmaProof [LOWER BOUND(ID), 246 ms] (24) proven lower bound (25) LowerBoundPropagationProof [FINISHED, 0 ms] (26) BOUNDS(n^1, INF) ---------------------------------------- (0) Obligation: The Derivational Complexity (innermost) of the given DCpxTrs could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: .(1, x) -> x .(x, 1) -> x .(i(x), x) -> 1 .(x, i(x)) -> 1 i(1) -> 1 i(i(x)) -> x .(i(y), .(y, z)) -> z .(y, .(i(y), z)) -> z S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (1) DerivationalComplexityToRuntimeComplexityProof (BOTH BOUNDS(ID, ID)) The following rules have been added to S to convert the given derivational complexity problem to a runtime complexity problem: encArg(1) -> 1 encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) encArg(cons_i(x_1)) -> i(encArg(x_1)) encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) encode_1 -> 1 encode_i(x_1) -> i(encArg(x_1)) ---------------------------------------- (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: .(1, x) -> x .(x, 1) -> x .(i(x), x) -> 1 .(x, i(x)) -> 1 i(1) -> 1 i(i(x)) -> x .(i(y), .(y, z)) -> z .(y, .(i(y), z)) -> z The (relative) TRS S consists of the following rules: encArg(1) -> 1 encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) encArg(cons_i(x_1)) -> i(encArg(x_1)) encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) encode_1 -> 1 encode_i(x_1) -> i(encArg(x_1)) Rewrite Strategy: INNERMOST ---------------------------------------- (3) SInnermostTerminationProof (BOTH CONCRETE BOUNDS(ID, ID)) proved innermost termination of relative rules ---------------------------------------- (4) 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: .(1, x) -> x .(x, 1) -> x .(i(x), x) -> 1 .(x, i(x)) -> 1 i(1) -> 1 i(i(x)) -> x .(i(y), .(y, z)) -> z .(y, .(i(y), z)) -> z The (relative) TRS S consists of the following rules: encArg(1) -> 1 encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) encArg(cons_i(x_1)) -> i(encArg(x_1)) encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) encode_1 -> 1 encode_i(x_1) -> i(encArg(x_1)) Rewrite Strategy: INNERMOST ---------------------------------------- (5) NonCtorToCtorProof (UPPER BOUND(ID)) transformed non-ctor to ctor-system ---------------------------------------- (6) 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: .(1, x) -> x .(x, 1) -> x i(1) -> 1 .(c_i(x), x) -> 1 .(x, c_i(x)) -> 1 i(c_i(x)) -> x .(y, c_.(c_i(y), z)) -> z .(c_i(y), c_.(y, z)) -> z The (relative) TRS S consists of the following rules: encArg(1) -> 1 encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) encArg(cons_i(x_1)) -> i(encArg(x_1)) encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) encode_1 -> 1 encode_i(x_1) -> i(encArg(x_1)) i(x0) -> c_i(x0) .(x0, x1) -> c_.(x0, x1) Rewrite Strategy: INNERMOST ---------------------------------------- (7) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (8) 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: .(1, x) -> x [1] .(x, 1) -> x [1] i(1) -> 1 [1] .(c_i(x), x) -> 1 [1] .(x, c_i(x)) -> 1 [1] i(c_i(x)) -> x [1] .(y, c_.(c_i(y), z)) -> z [1] .(c_i(y), c_.(y, z)) -> z [1] encArg(1) -> 1 [0] encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) [0] encArg(cons_i(x_1)) -> i(encArg(x_1)) [0] encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) [0] encode_1 -> 1 [0] encode_i(x_1) -> i(encArg(x_1)) [0] i(x0) -> c_i(x0) [0] .(x0, x1) -> c_.(x0, x1) [0] Rewrite Strategy: INNERMOST ---------------------------------------- (9) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (10) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: .(1, x) -> x [1] .(x, 1) -> x [1] i(1) -> 1 [1] .(c_i(x), x) -> 1 [1] .(x, c_i(x)) -> 1 [1] i(c_i(x)) -> x [1] .(y, c_.(c_i(y), z)) -> z [1] .(c_i(y), c_.(y, z)) -> z [1] encArg(1) -> 1 [0] encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) [0] encArg(cons_i(x_1)) -> i(encArg(x_1)) [0] encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) [0] encode_1 -> 1 [0] encode_i(x_1) -> i(encArg(x_1)) [0] i(x0) -> c_i(x0) [0] .(x0, x1) -> c_.(x0, x1) [0] The TRS has the following type information: . :: 1:c_i:c_.:cons_.:cons_i -> 1:c_i:c_.:cons_.:cons_i -> 1:c_i:c_.:cons_.:cons_i 1 :: 1:c_i:c_.:cons_.:cons_i i :: 1:c_i:c_.:cons_.:cons_i -> 1:c_i:c_.:cons_.:cons_i c_i :: 1:c_i:c_.:cons_.:cons_i -> 1:c_i:c_.:cons_.:cons_i c_. :: 1:c_i:c_.:cons_.:cons_i -> 1:c_i:c_.:cons_.:cons_i -> 1:c_i:c_.:cons_.:cons_i encArg :: 1:c_i:c_.:cons_.:cons_i -> 1:c_i:c_.:cons_.:cons_i cons_. :: 1:c_i:c_.:cons_.:cons_i -> 1:c_i:c_.:cons_.:cons_i -> 1:c_i:c_.:cons_.:cons_i cons_i :: 1:c_i:c_.:cons_.:cons_i -> 1:c_i:c_.:cons_.:cons_i encode_. :: 1:c_i:c_.:cons_.:cons_i -> 1:c_i:c_.:cons_.:cons_i -> 1:c_i:c_.:cons_.:cons_i encode_1 :: 1:c_i:c_.:cons_.:cons_i encode_i :: 1:c_i:c_.:cons_.:cons_i -> 1:c_i:c_.:cons_.:cons_i Rewrite Strategy: INNERMOST ---------------------------------------- (11) 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: encArg(v0) -> null_encArg [0] encode_.(v0, v1) -> null_encode_. [0] encode_1 -> null_encode_1 [0] encode_i(v0) -> null_encode_i [0] i(v0) -> null_i [0] .(v0, v1) -> null_. [0] And the following fresh constants: null_encArg, null_encode_., null_encode_1, null_encode_i, null_i, null_. ---------------------------------------- (12) 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: .(1, x) -> x [1] .(x, 1) -> x [1] i(1) -> 1 [1] .(c_i(x), x) -> 1 [1] .(x, c_i(x)) -> 1 [1] i(c_i(x)) -> x [1] .(y, c_.(c_i(y), z)) -> z [1] .(c_i(y), c_.(y, z)) -> z [1] encArg(1) -> 1 [0] encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) [0] encArg(cons_i(x_1)) -> i(encArg(x_1)) [0] encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) [0] encode_1 -> 1 [0] encode_i(x_1) -> i(encArg(x_1)) [0] i(x0) -> c_i(x0) [0] .(x0, x1) -> c_.(x0, x1) [0] encArg(v0) -> null_encArg [0] encode_.(v0, v1) -> null_encode_. [0] encode_1 -> null_encode_1 [0] encode_i(v0) -> null_encode_i [0] i(v0) -> null_i [0] .(v0, v1) -> null_. [0] The TRS has the following type information: . :: 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. -> 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. -> 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. 1 :: 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. i :: 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. -> 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. c_i :: 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. -> 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. c_. :: 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. -> 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. -> 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. encArg :: 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. -> 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. cons_. :: 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. -> 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. -> 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. cons_i :: 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. -> 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. encode_. :: 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. -> 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. -> 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. encode_1 :: 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. encode_i :: 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. -> 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. null_encArg :: 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. null_encode_. :: 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. null_encode_1 :: 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. null_encode_i :: 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. null_i :: 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. null_. :: 1:c_i:c_.:cons_.:cons_i:null_encArg:null_encode_.:null_encode_1:null_encode_i:null_i:null_. Rewrite Strategy: INNERMOST ---------------------------------------- (13) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: 1 => 0 null_encArg => 0 null_encode_. => 0 null_encode_1 => 0 null_encode_i => 0 null_i => 0 null_. => 0 ---------------------------------------- (14) Obligation: Complexity RNTS consisting of the following rules: .(z', z'') -{ 1 }-> x :|: x >= 0, z'' = x, z' = 0 .(z', z'') -{ 1 }-> x :|: z'' = 0, z' = x, x >= 0 .(z', z'') -{ 1 }-> z :|: z >= 0, z'' = 1 + (1 + y) + z, y >= 0, z' = y .(z', z'') -{ 1 }-> z :|: z' = 1 + y, z >= 0, y >= 0, z'' = 1 + y + z .(z', z'') -{ 1 }-> 0 :|: z' = 1 + x, x >= 0, z'' = x .(z', z'') -{ 1 }-> 0 :|: z' = x, x >= 0, z'' = 1 + x .(z', z'') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z'' = v1, z' = v0 .(z', z'') -{ 0 }-> 1 + x0 + x1 :|: z'' = x1, x0 >= 0, x1 >= 0, z' = x0 encArg(z') -{ 0 }-> i(encArg(x_1)) :|: x_1 >= 0, z' = 1 + x_1 encArg(z') -{ 0 }-> 0 :|: z' = 0 encArg(z') -{ 0 }-> 0 :|: v0 >= 0, z' = v0 encArg(z') -{ 0 }-> .(encArg(x_1), encArg(x_2)) :|: x_1 >= 0, x_2 >= 0, z' = 1 + x_1 + x_2 encode_.(z', z'') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z'' = v1, z' = v0 encode_.(z', z'') -{ 0 }-> .(encArg(x_1), encArg(x_2)) :|: x_1 >= 0, z' = x_1, x_2 >= 0, z'' = x_2 encode_1 -{ 0 }-> 0 :|: encode_i(z') -{ 0 }-> i(encArg(x_1)) :|: x_1 >= 0, z' = x_1 encode_i(z') -{ 0 }-> 0 :|: v0 >= 0, z' = v0 i(z') -{ 1 }-> x :|: z' = 1 + x, x >= 0 i(z') -{ 1 }-> 0 :|: z' = 0 i(z') -{ 0 }-> 0 :|: v0 >= 0, z' = v0 i(z') -{ 0 }-> 1 + x0 :|: x0 >= 0, z' = x0 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (15) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V, V2),0,[fun(V, V2, Out)],[V >= 0,V2 >= 0]). eq(start(V, V2),0,[i(V, Out)],[V >= 0]). eq(start(V, V2),0,[encArg(V, Out)],[V >= 0]). eq(start(V, V2),0,[fun1(V, V2, Out)],[V >= 0,V2 >= 0]). eq(start(V, V2),0,[fun2(Out)],[]). eq(start(V, V2),0,[fun3(V, Out)],[V >= 0]). eq(fun(V, V2, Out),1,[],[Out = V1,V1 >= 0,V2 = V1,V = 0]). eq(fun(V, V2, Out),1,[],[Out = V3,V2 = 0,V = V3,V3 >= 0]). eq(i(V, Out),1,[],[Out = 0,V = 0]). eq(fun(V, V2, Out),1,[],[Out = 0,V = 1 + V4,V4 >= 0,V2 = V4]). eq(fun(V, V2, Out),1,[],[Out = 0,V = V5,V5 >= 0,V2 = 1 + V5]). eq(i(V, Out),1,[],[Out = V6,V = 1 + V6,V6 >= 0]). eq(fun(V, V2, Out),1,[],[Out = V8,V8 >= 0,V2 = 2 + V7 + V8,V7 >= 0,V = V7]). eq(fun(V, V2, Out),1,[],[Out = V9,V = 1 + V10,V9 >= 0,V10 >= 0,V2 = 1 + V10 + V9]). eq(encArg(V, Out),0,[],[Out = 0,V = 0]). eq(encArg(V, Out),0,[encArg(V12, Ret0),encArg(V11, Ret1),fun(Ret0, Ret1, Ret)],[Out = Ret,V12 >= 0,V11 >= 0,V = 1 + V11 + V12]). eq(encArg(V, Out),0,[encArg(V13, Ret01),i(Ret01, Ret2)],[Out = Ret2,V13 >= 0,V = 1 + V13]). eq(fun1(V, V2, Out),0,[encArg(V14, Ret02),encArg(V15, Ret11),fun(Ret02, Ret11, Ret3)],[Out = Ret3,V14 >= 0,V = V14,V15 >= 0,V2 = V15]). eq(fun2(Out),0,[],[Out = 0]). eq(fun3(V, Out),0,[encArg(V16, Ret03),i(Ret03, Ret4)],[Out = Ret4,V16 >= 0,V = V16]). eq(i(V, Out),0,[],[Out = 1 + V17,V17 >= 0,V = V17]). eq(fun(V, V2, Out),0,[],[Out = 1 + V18 + V19,V2 = V19,V18 >= 0,V19 >= 0,V = V18]). eq(encArg(V, Out),0,[],[Out = 0,V20 >= 0,V = V20]). eq(fun1(V, V2, Out),0,[],[Out = 0,V22 >= 0,V21 >= 0,V2 = V21,V = V22]). eq(fun3(V, Out),0,[],[Out = 0,V23 >= 0,V = V23]). eq(i(V, Out),0,[],[Out = 0,V24 >= 0,V = V24]). eq(fun(V, V2, Out),0,[],[Out = 0,V25 >= 0,V26 >= 0,V2 = V26,V = V25]). input_output_vars(fun(V,V2,Out),[V,V2],[Out]). input_output_vars(i(V,Out),[V],[Out]). input_output_vars(encArg(V,Out),[V],[Out]). input_output_vars(fun1(V,V2,Out),[V,V2],[Out]). input_output_vars(fun2(Out),[],[Out]). input_output_vars(fun3(V,Out),[V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. non_recursive : [fun/3] 1. non_recursive : [i/2] 2. recursive [non_tail,multiple] : [encArg/2] 3. non_recursive : [fun1/3] 4. non_recursive : [fun2/1] 5. non_recursive : [fun3/2] 6. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into fun/3 1. SCC is partially evaluated into i/2 2. SCC is partially evaluated into encArg/2 3. SCC is partially evaluated into fun1/3 4. SCC is completely evaluated into other SCCs 5. SCC is partially evaluated into fun3/2 6. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations fun/3 * CE 13 is refined into CE [26] * CE 12 is refined into CE [27] * CE 11 is refined into CE [28] * CE 10 is refined into CE [29] * CE 9 is refined into CE [30] * CE 14 is refined into CE [31] * CE 8 is refined into CE [32] * CE 7 is refined into CE [33] ### Cost equations --> "Loop" of fun/3 * CEs [26] --> Loop 17 * CEs [27] --> Loop 18 * CEs [28] --> Loop 19 * CEs [29] --> Loop 20 * CEs [30,31] --> Loop 21 * CEs [32] --> Loop 22 * CEs [33] --> Loop 23 ### Ranking functions of CR fun(V,V2,Out) #### Partial ranking functions of CR fun(V,V2,Out) ### Specialization of cost equations i/2 * CE 17 is refined into CE [34] * CE 16 is refined into CE [35] * CE 15 is refined into CE [36] * CE 18 is refined into CE [37] ### Cost equations --> "Loop" of i/2 * CEs [34] --> Loop 24 * CEs [35] --> Loop 25 * CEs [36,37] --> Loop 26 ### Ranking functions of CR i(V,Out) #### Partial ranking functions of CR i(V,Out) ### Specialization of cost equations encArg/2 * CE 19 is refined into CE [38] * CE 21 is refined into CE [39,40,41] * CE 20 is refined into CE [42,43,44,45,46,47] ### Cost equations --> "Loop" of encArg/2 * CEs [45] --> Loop 27 * CEs [46] --> Loop 28 * CEs [47] --> Loop 29 * CEs [43] --> Loop 30 * CEs [42] --> Loop 31 * CEs [44] --> Loop 32 * CEs [41] --> Loop 33 * CEs [40] --> Loop 34 * CEs [39] --> Loop 35 * CEs [38] --> Loop 36 ### Ranking functions of CR encArg(V,Out) * RF of phase [27,28,29,30,31,32,33,34,35]: [V] #### Partial ranking functions of CR encArg(V,Out) * Partial RF of phase [27,28,29,30,31,32,33,34,35]: - RF of loop [27:1,27:2,28:1,28:2,29:1,29:2,30:1,30:2,31:1,31:2,32:1,32:2,33:1,34:1,35:1]: V ### Specialization of cost equations fun1/3 * CE 22 is refined into CE [48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66] * CE 23 is refined into CE [67] ### Cost equations --> "Loop" of fun1/3 * CEs [66] --> Loop 37 * CEs [60] --> Loop 38 * CEs [58,62] --> Loop 39 * CEs [56] --> Loop 40 * CEs [52,55,61,64,65] --> Loop 41 * CEs [51] --> Loop 42 * CEs [48,49,50,53,54,57,59,63,67] --> Loop 43 ### Ranking functions of CR fun1(V,V2,Out) #### Partial ranking functions of CR fun1(V,V2,Out) ### Specialization of cost equations fun3/2 * CE 24 is refined into CE [68,69,70,71,72] * CE 25 is refined into CE [73] ### Cost equations --> "Loop" of fun3/2 * CEs [72] --> Loop 44 * CEs [71] --> Loop 45 * CEs [69] --> Loop 46 * CEs [68,70,73] --> Loop 47 ### Ranking functions of CR fun3(V,Out) #### Partial ranking functions of CR fun3(V,Out) ### Specialization of cost equations start/2 * CE 1 is refined into CE [74,75,76,77,78,79] * CE 2 is refined into CE [80,81,82] * CE 3 is refined into CE [83,84] * CE 4 is refined into CE [85,86,87,88,89,90,91] * CE 5 is refined into CE [92] * CE 6 is refined into CE [93,94,95,96] ### Cost equations --> "Loop" of start/2 * CEs [74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96] --> Loop 48 ### Ranking functions of CR start(V,V2) #### Partial ranking functions of CR start(V,V2) Computing Bounds ===================================== #### Cost of chains of fun(V,V2,Out): * Chain [23]: 1 with precondition: [V=0,V2=Out,V2>=0] * Chain [22]: 1 with precondition: [V2=0,V=Out,V>=0] * Chain [21]: 1 with precondition: [Out=0,V>=0,V2>=0] * Chain [20]: 1 with precondition: [Out=0,V+1=V2,V>=0] * Chain [19]: 1 with precondition: [V2=Out+V+2,V>=0,V2>=V+2] * Chain [18]: 1 with precondition: [V2=Out+V,V>=1,V2>=V] * Chain [17]: 0 with precondition: [V+V2+1=Out,V>=0,V2>=0] #### Cost of chains of i(V,Out): * Chain [26]: 1 with precondition: [Out=0,V>=0] * Chain [25]: 1 with precondition: [V=Out+1,V>=1] * Chain [24]: 0 with precondition: [V+1=Out,V>=0] #### Cost of chains of encArg(V,Out): * Chain [36]: 0 with precondition: [Out=0,V>=0] * Chain [multiple([27,28,29,30,31,32,33,34,35],[[36]])]: 2*it(27)+3*it(30)+2*it(33)+0 Such that:it([36]) =< V+1 aux(3) =< V aux(4) =< V/2 it(30) =< aux(3) it(33) =< aux(3) it(27) =< aux(4) it(27) =< it([36])*(1/2)+aux(4) it(30) =< it([36])*(1/2)+aux(4) with precondition: [V>=1,Out>=0,V>=Out] #### Cost of chains of fun1(V,V2,Out): * Chain [43]: 9*s(4)+6*s(5)+6*s(6)+9*s(16)+6*s(17)+6*s(18)+1 Such that:aux(5) =< V aux(6) =< V+1 aux(7) =< V/2 aux(8) =< V2 aux(9) =< V2+1 aux(10) =< V2/2 s(16) =< aux(5) s(17) =< aux(5) s(18) =< aux(7) s(18) =< aux(6)*(1/2)+aux(7) s(16) =< aux(6)*(1/2)+aux(7) s(4) =< aux(8) s(5) =< aux(8) s(6) =< aux(10) s(6) =< aux(9)*(1/2)+aux(10) s(4) =< aux(9)*(1/2)+aux(10) with precondition: [Out=0,V>=0,V2>=0] * Chain [42]: 0 with precondition: [Out=1,V>=0,V2>=0] * Chain [41]: 15*s(40)+10*s(41)+10*s(42)+9*s(52)+6*s(53)+6*s(54)+1 Such that:aux(11) =< V aux(12) =< V+1 aux(13) =< V/2 aux(14) =< V2 aux(15) =< V2+1 aux(16) =< V2/2 s(40) =< aux(14) s(41) =< aux(14) s(42) =< aux(16) s(42) =< aux(15)*(1/2)+aux(16) s(40) =< aux(15)*(1/2)+aux(16) s(52) =< aux(11) s(53) =< aux(11) s(54) =< aux(13) s(54) =< aux(12)*(1/2)+aux(13) s(52) =< aux(12)*(1/2)+aux(13) with precondition: [V>=0,V2>=1,Out>=0,V2>=Out] * Chain [40]: 3*s(88)+2*s(89)+2*s(90)+0 Such that:s(86) =< V2 s(85) =< V2+1 s(87) =< V2/2 s(88) =< s(86) s(89) =< s(86) s(90) =< s(87) s(90) =< s(85)*(1/2)+s(87) s(88) =< s(85)*(1/2)+s(87) with precondition: [V>=0,V2>=1,Out>=1,V2+1>=Out] * Chain [39]: 6*s(94)+4*s(95)+4*s(96)+3*s(106)+2*s(107)+2*s(108)+1 Such that:s(104) =< V2 s(103) =< V2+1 s(105) =< V2/2 aux(17) =< V aux(18) =< V+1 aux(19) =< V/2 s(94) =< aux(17) s(95) =< aux(17) s(96) =< aux(19) s(96) =< aux(18)*(1/2)+aux(19) s(94) =< aux(18)*(1/2)+aux(19) s(106) =< s(104) s(107) =< s(104) s(108) =< s(105) s(108) =< s(103)*(1/2)+s(105) s(106) =< s(103)*(1/2)+s(105) with precondition: [V>=1,V2>=0,Out>=0,V>=Out] * Chain [38]: 3*s(112)+2*s(113)+2*s(114)+0 Such that:s(110) =< V s(109) =< V+1 s(111) =< V/2 s(112) =< s(110) s(113) =< s(110) s(114) =< s(111) s(114) =< s(109)*(1/2)+s(111) s(112) =< s(109)*(1/2)+s(111) with precondition: [V>=1,V2>=0,Out>=1,V+1>=Out] * Chain [37]: 3*s(118)+2*s(119)+2*s(120)+3*s(124)+2*s(125)+2*s(126)+0 Such that:s(116) =< V s(115) =< V+1 s(117) =< V/2 s(122) =< V2 s(121) =< V2+1 s(123) =< V2/2 s(124) =< s(122) s(125) =< s(122) s(126) =< s(123) s(126) =< s(121)*(1/2)+s(123) s(124) =< s(121)*(1/2)+s(123) s(118) =< s(116) s(119) =< s(116) s(120) =< s(117) s(120) =< s(115)*(1/2)+s(117) s(118) =< s(115)*(1/2)+s(117) with precondition: [V>=1,V2>=1,Out>=1,V+V2+1>=Out] #### Cost of chains of fun3(V,Out): * Chain [47]: 3*s(130)+2*s(131)+2*s(132)+1 Such that:s(128) =< V s(127) =< V+1 s(129) =< V/2 s(130) =< s(128) s(131) =< s(128) s(132) =< s(129) s(132) =< s(127)*(1/2)+s(129) s(130) =< s(127)*(1/2)+s(129) with precondition: [Out=0,V>=0] * Chain [46]: 0 with precondition: [Out=1,V>=0] * Chain [45]: 3*s(136)+2*s(137)+2*s(138)+0 Such that:s(134) =< V s(133) =< V+1 s(135) =< V/2 s(136) =< s(134) s(137) =< s(134) s(138) =< s(135) s(138) =< s(133)*(1/2)+s(135) s(136) =< s(133)*(1/2)+s(135) with precondition: [V>=1,Out>=1,V+1>=Out] * Chain [44]: 3*s(142)+2*s(143)+2*s(144)+1 Such that:s(140) =< V s(139) =< V+1 s(141) =< V/2 s(142) =< s(140) s(143) =< s(140) s(144) =< s(141) s(144) =< s(139)*(1/2)+s(141) s(142) =< s(139)*(1/2)+s(141) with precondition: [Out>=0,V>=Out+1] #### Cost of chains of start(V,V2): * Chain [48]: 42*s(148)+28*s(149)+28*s(150)+33*s(160)+22*s(161)+22*s(162)+1 Such that:aux(20) =< V aux(21) =< V+1 aux(22) =< V/2 aux(23) =< V2 aux(24) =< V2+1 aux(25) =< V2/2 s(148) =< aux(20) s(149) =< aux(20) s(150) =< aux(22) s(150) =< aux(21)*(1/2)+aux(22) s(148) =< aux(21)*(1/2)+aux(22) s(160) =< aux(23) s(161) =< aux(23) s(162) =< aux(25) s(162) =< aux(24)*(1/2)+aux(25) s(160) =< aux(24)*(1/2)+aux(25) with precondition: [] Closed-form bounds of start(V,V2): ------------------------------------- * Chain [48] with precondition: [] - Upper bound: nat(V)*70+1+nat(V2)*55+nat(V/2)*28+nat(V2/2)*22 - Complexity: n ### Maximum cost of start(V,V2): nat(V)*70+1+nat(V2)*55+nat(V/2)*28+nat(V2/2)*22 Asymptotic class: n * Total analysis performed in 503 ms. ---------------------------------------- (16) BOUNDS(1, n^1) ---------------------------------------- (17) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (18) 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: .(1', x) -> x .(x, 1') -> x .(i(x), x) -> 1' .(x, i(x)) -> 1' i(1') -> 1' i(i(x)) -> x .(i(y), .(y, z)) -> z .(y, .(i(y), z)) -> z The (relative) TRS S consists of the following rules: encArg(1') -> 1' encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) encArg(cons_i(x_1)) -> i(encArg(x_1)) encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) encode_1 -> 1' encode_i(x_1) -> i(encArg(x_1)) Rewrite Strategy: INNERMOST ---------------------------------------- (19) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (20) Obligation: Innermost TRS: Rules: .(1', x) -> x .(x, 1') -> x .(i(x), x) -> 1' .(x, i(x)) -> 1' i(1') -> 1' i(i(x)) -> x .(i(y), .(y, z)) -> z .(y, .(i(y), z)) -> z encArg(1') -> 1' encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) encArg(cons_i(x_1)) -> i(encArg(x_1)) encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) encode_1 -> 1' encode_i(x_1) -> i(encArg(x_1)) Types: . :: 1':cons_.:cons_i -> 1':cons_.:cons_i -> 1':cons_.:cons_i 1' :: 1':cons_.:cons_i i :: 1':cons_.:cons_i -> 1':cons_.:cons_i encArg :: 1':cons_.:cons_i -> 1':cons_.:cons_i cons_. :: 1':cons_.:cons_i -> 1':cons_.:cons_i -> 1':cons_.:cons_i cons_i :: 1':cons_.:cons_i -> 1':cons_.:cons_i encode_. :: 1':cons_.:cons_i -> 1':cons_.:cons_i -> 1':cons_.:cons_i encode_1 :: 1':cons_.:cons_i encode_i :: 1':cons_.:cons_i -> 1':cons_.:cons_i hole_1':cons_.:cons_i1_0 :: 1':cons_.:cons_i gen_1':cons_.:cons_i2_0 :: Nat -> 1':cons_.:cons_i ---------------------------------------- (21) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: encArg ---------------------------------------- (22) Obligation: Innermost TRS: Rules: .(1', x) -> x .(x, 1') -> x .(i(x), x) -> 1' .(x, i(x)) -> 1' i(1') -> 1' i(i(x)) -> x .(i(y), .(y, z)) -> z .(y, .(i(y), z)) -> z encArg(1') -> 1' encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) encArg(cons_i(x_1)) -> i(encArg(x_1)) encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) encode_1 -> 1' encode_i(x_1) -> i(encArg(x_1)) Types: . :: 1':cons_.:cons_i -> 1':cons_.:cons_i -> 1':cons_.:cons_i 1' :: 1':cons_.:cons_i i :: 1':cons_.:cons_i -> 1':cons_.:cons_i encArg :: 1':cons_.:cons_i -> 1':cons_.:cons_i cons_. :: 1':cons_.:cons_i -> 1':cons_.:cons_i -> 1':cons_.:cons_i cons_i :: 1':cons_.:cons_i -> 1':cons_.:cons_i encode_. :: 1':cons_.:cons_i -> 1':cons_.:cons_i -> 1':cons_.:cons_i encode_1 :: 1':cons_.:cons_i encode_i :: 1':cons_.:cons_i -> 1':cons_.:cons_i hole_1':cons_.:cons_i1_0 :: 1':cons_.:cons_i gen_1':cons_.:cons_i2_0 :: Nat -> 1':cons_.:cons_i Generator Equations: gen_1':cons_.:cons_i2_0(0) <=> 1' gen_1':cons_.:cons_i2_0(+(x, 1)) <=> cons_.(1', gen_1':cons_.:cons_i2_0(x)) The following defined symbols remain to be analysed: encArg ---------------------------------------- (23) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: encArg(gen_1':cons_.:cons_i2_0(n4_0)) -> gen_1':cons_.:cons_i2_0(0), rt in Omega(n4_0) Induction Base: encArg(gen_1':cons_.:cons_i2_0(0)) ->_R^Omega(0) 1' Induction Step: encArg(gen_1':cons_.:cons_i2_0(+(n4_0, 1))) ->_R^Omega(0) .(encArg(1'), encArg(gen_1':cons_.:cons_i2_0(n4_0))) ->_R^Omega(0) .(1', encArg(gen_1':cons_.:cons_i2_0(n4_0))) ->_IH .(1', gen_1':cons_.:cons_i2_0(0)) ->_R^Omega(1) gen_1':cons_.:cons_i2_0(0) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (24) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: .(1', x) -> x .(x, 1') -> x .(i(x), x) -> 1' .(x, i(x)) -> 1' i(1') -> 1' i(i(x)) -> x .(i(y), .(y, z)) -> z .(y, .(i(y), z)) -> z encArg(1') -> 1' encArg(cons_.(x_1, x_2)) -> .(encArg(x_1), encArg(x_2)) encArg(cons_i(x_1)) -> i(encArg(x_1)) encode_.(x_1, x_2) -> .(encArg(x_1), encArg(x_2)) encode_1 -> 1' encode_i(x_1) -> i(encArg(x_1)) Types: . :: 1':cons_.:cons_i -> 1':cons_.:cons_i -> 1':cons_.:cons_i 1' :: 1':cons_.:cons_i i :: 1':cons_.:cons_i -> 1':cons_.:cons_i encArg :: 1':cons_.:cons_i -> 1':cons_.:cons_i cons_. :: 1':cons_.:cons_i -> 1':cons_.:cons_i -> 1':cons_.:cons_i cons_i :: 1':cons_.:cons_i -> 1':cons_.:cons_i encode_. :: 1':cons_.:cons_i -> 1':cons_.:cons_i -> 1':cons_.:cons_i encode_1 :: 1':cons_.:cons_i encode_i :: 1':cons_.:cons_i -> 1':cons_.:cons_i hole_1':cons_.:cons_i1_0 :: 1':cons_.:cons_i gen_1':cons_.:cons_i2_0 :: Nat -> 1':cons_.:cons_i Generator Equations: gen_1':cons_.:cons_i2_0(0) <=> 1' gen_1':cons_.:cons_i2_0(+(x, 1)) <=> cons_.(1', gen_1':cons_.:cons_i2_0(x)) The following defined symbols remain to be analysed: encArg ---------------------------------------- (25) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (26) BOUNDS(n^1, INF)