/export/starexec/sandbox/solver/bin/starexec_run_rcdcRelativeAlsoLower /export/starexec/sandbox/benchmark/theBenchmark.xml /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), O(n^2)) proof of /export/starexec/sandbox/benchmark/theBenchmark.xml # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty The Derivational Complexity (full) of the given DCpxTrs could be proven to be BOUNDS(n^1, n^2). (0) DCpxTrs (1) DerivationalComplexityToRuntimeComplexityProof [BOTH BOUNDS(ID, ID), 0 ms] (2) CpxRelTRS (3) SInnermostTerminationProof [BOTH CONCRETE BOUNDS(ID, ID), 38 ms] (4) CpxRelTRS (5) NonCtorToCtorProof [UPPER BOUND(ID), 0 ms] (6) CpxRelTRS (7) RcToIrcProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CpxRelTRS (9) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (10) CpxWeightedTrs (11) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CpxTypedWeightedTrs (13) CompletionProof [UPPER BOUND(ID), 0 ms] (14) CpxTypedWeightedCompleteTrs (15) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 11 ms] (16) CpxRNTS (17) CompleteCoflocoProof [FINISHED, 543 ms] (18) BOUNDS(1, n^2) (19) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (20) CpxRelTRS (21) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (22) typed CpxTrs (23) OrderProof [LOWER BOUND(ID), 0 ms] (24) typed CpxTrs (25) RewriteLemmaProof [LOWER BOUND(ID), 185 ms] (26) proven lower bound (27) LowerBoundPropagationProof [FINISHED, 0 ms] (28) BOUNDS(n^1, INF) ---------------------------------------- (0) Obligation: The Derivational Complexity (full) of the given DCpxTrs could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: half(0) -> 0 half(s(0)) -> 0 half(s(s(x))) -> s(half(x)) s(log(0)) -> s(0) log(s(x)) -> s(log(half(s(x)))) S is empty. Rewrite Strategy: FULL ---------------------------------------- (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(0) -> 0 encArg(cons_half(x_1)) -> half(encArg(x_1)) encArg(cons_s(x_1)) -> s(encArg(x_1)) encArg(cons_log(x_1)) -> log(encArg(x_1)) encode_half(x_1) -> half(encArg(x_1)) encode_0 -> 0 encode_s(x_1) -> s(encArg(x_1)) encode_log(x_1) -> log(encArg(x_1)) ---------------------------------------- (2) Obligation: The Runtime Complexity (full) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: half(0) -> 0 half(s(0)) -> 0 half(s(s(x))) -> s(half(x)) s(log(0)) -> s(0) log(s(x)) -> s(log(half(s(x)))) The (relative) TRS S consists of the following rules: encArg(0) -> 0 encArg(cons_half(x_1)) -> half(encArg(x_1)) encArg(cons_s(x_1)) -> s(encArg(x_1)) encArg(cons_log(x_1)) -> log(encArg(x_1)) encode_half(x_1) -> half(encArg(x_1)) encode_0 -> 0 encode_s(x_1) -> s(encArg(x_1)) encode_log(x_1) -> log(encArg(x_1)) Rewrite Strategy: FULL ---------------------------------------- (3) SInnermostTerminationProof (BOTH CONCRETE BOUNDS(ID, ID)) proved innermost termination of relative rules ---------------------------------------- (4) Obligation: The Runtime Complexity (full) of the given CpxRelTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: half(0) -> 0 half(s(0)) -> 0 half(s(s(x))) -> s(half(x)) s(log(0)) -> s(0) log(s(x)) -> s(log(half(s(x)))) The (relative) TRS S consists of the following rules: encArg(0) -> 0 encArg(cons_half(x_1)) -> half(encArg(x_1)) encArg(cons_s(x_1)) -> s(encArg(x_1)) encArg(cons_log(x_1)) -> log(encArg(x_1)) encode_half(x_1) -> half(encArg(x_1)) encode_0 -> 0 encode_s(x_1) -> s(encArg(x_1)) encode_log(x_1) -> log(encArg(x_1)) Rewrite Strategy: FULL ---------------------------------------- (5) NonCtorToCtorProof (UPPER BOUND(ID)) transformed non-ctor to ctor-system ---------------------------------------- (6) Obligation: The Runtime Complexity (full) of the given CpxRelTRS could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: half(0) -> 0 half(c_s(0)) -> 0 half(c_s(c_s(x))) -> s(half(x)) log(c_s(x)) -> s(log(half(s(x)))) s(c_log(0)) -> s(0) The (relative) TRS S consists of the following rules: encArg(0) -> 0 encArg(cons_half(x_1)) -> half(encArg(x_1)) encArg(cons_s(x_1)) -> s(encArg(x_1)) encArg(cons_log(x_1)) -> log(encArg(x_1)) encode_half(x_1) -> half(encArg(x_1)) encode_0 -> 0 encode_s(x_1) -> s(encArg(x_1)) encode_log(x_1) -> log(encArg(x_1)) s(x0) -> c_s(x0) log(x0) -> c_log(x0) Rewrite Strategy: FULL ---------------------------------------- (7) RcToIrcProof (BOTH BOUNDS(ID, ID)) Converted rc-obligation to irc-obligation. As the TRS is a non-duplicating overlay system, we have rc = irc. ---------------------------------------- (8) Obligation: The Runtime Complexity (innermost) of the given CpxRelTRS could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: half(0) -> 0 half(c_s(0)) -> 0 half(c_s(c_s(x))) -> s(half(x)) log(c_s(x)) -> s(log(half(s(x)))) s(c_log(0)) -> s(0) The (relative) TRS S consists of the following rules: encArg(0) -> 0 encArg(cons_half(x_1)) -> half(encArg(x_1)) encArg(cons_s(x_1)) -> s(encArg(x_1)) encArg(cons_log(x_1)) -> log(encArg(x_1)) encode_half(x_1) -> half(encArg(x_1)) encode_0 -> 0 encode_s(x_1) -> s(encArg(x_1)) encode_log(x_1) -> log(encArg(x_1)) s(x0) -> c_s(x0) log(x0) -> c_log(x0) Rewrite Strategy: INNERMOST ---------------------------------------- (9) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (10) Obligation: The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2). The TRS R consists of the following rules: half(0) -> 0 [1] half(c_s(0)) -> 0 [1] half(c_s(c_s(x))) -> s(half(x)) [1] log(c_s(x)) -> s(log(half(s(x)))) [1] s(c_log(0)) -> s(0) [1] encArg(0) -> 0 [0] encArg(cons_half(x_1)) -> half(encArg(x_1)) [0] encArg(cons_s(x_1)) -> s(encArg(x_1)) [0] encArg(cons_log(x_1)) -> log(encArg(x_1)) [0] encode_half(x_1) -> half(encArg(x_1)) [0] encode_0 -> 0 [0] encode_s(x_1) -> s(encArg(x_1)) [0] encode_log(x_1) -> log(encArg(x_1)) [0] s(x0) -> c_s(x0) [0] log(x0) -> c_log(x0) [0] Rewrite Strategy: INNERMOST ---------------------------------------- (11) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (12) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: half(0) -> 0 [1] half(c_s(0)) -> 0 [1] half(c_s(c_s(x))) -> s(half(x)) [1] log(c_s(x)) -> s(log(half(s(x)))) [1] s(c_log(0)) -> s(0) [1] encArg(0) -> 0 [0] encArg(cons_half(x_1)) -> half(encArg(x_1)) [0] encArg(cons_s(x_1)) -> s(encArg(x_1)) [0] encArg(cons_log(x_1)) -> log(encArg(x_1)) [0] encode_half(x_1) -> half(encArg(x_1)) [0] encode_0 -> 0 [0] encode_s(x_1) -> s(encArg(x_1)) [0] encode_log(x_1) -> log(encArg(x_1)) [0] s(x0) -> c_s(x0) [0] log(x0) -> c_log(x0) [0] The TRS has the following type information: half :: 0:c_s:c_log:cons_half:cons_s:cons_log -> 0:c_s:c_log:cons_half:cons_s:cons_log 0 :: 0:c_s:c_log:cons_half:cons_s:cons_log c_s :: 0:c_s:c_log:cons_half:cons_s:cons_log -> 0:c_s:c_log:cons_half:cons_s:cons_log s :: 0:c_s:c_log:cons_half:cons_s:cons_log -> 0:c_s:c_log:cons_half:cons_s:cons_log log :: 0:c_s:c_log:cons_half:cons_s:cons_log -> 0:c_s:c_log:cons_half:cons_s:cons_log c_log :: 0:c_s:c_log:cons_half:cons_s:cons_log -> 0:c_s:c_log:cons_half:cons_s:cons_log encArg :: 0:c_s:c_log:cons_half:cons_s:cons_log -> 0:c_s:c_log:cons_half:cons_s:cons_log cons_half :: 0:c_s:c_log:cons_half:cons_s:cons_log -> 0:c_s:c_log:cons_half:cons_s:cons_log cons_s :: 0:c_s:c_log:cons_half:cons_s:cons_log -> 0:c_s:c_log:cons_half:cons_s:cons_log cons_log :: 0:c_s:c_log:cons_half:cons_s:cons_log -> 0:c_s:c_log:cons_half:cons_s:cons_log encode_half :: 0:c_s:c_log:cons_half:cons_s:cons_log -> 0:c_s:c_log:cons_half:cons_s:cons_log encode_0 :: 0:c_s:c_log:cons_half:cons_s:cons_log encode_s :: 0:c_s:c_log:cons_half:cons_s:cons_log -> 0:c_s:c_log:cons_half:cons_s:cons_log encode_log :: 0:c_s:c_log:cons_half:cons_s:cons_log -> 0:c_s:c_log:cons_half:cons_s:cons_log Rewrite Strategy: INNERMOST ---------------------------------------- (13) 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_half(v0) -> null_encode_half [0] encode_0 -> null_encode_0 [0] encode_s(v0) -> null_encode_s [0] encode_log(v0) -> null_encode_log [0] s(v0) -> null_s [0] log(v0) -> null_log [0] half(v0) -> null_half [0] And the following fresh constants: null_encArg, null_encode_half, null_encode_0, null_encode_s, null_encode_log, null_s, null_log, null_half ---------------------------------------- (14) 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: half(0) -> 0 [1] half(c_s(0)) -> 0 [1] half(c_s(c_s(x))) -> s(half(x)) [1] log(c_s(x)) -> s(log(half(s(x)))) [1] s(c_log(0)) -> s(0) [1] encArg(0) -> 0 [0] encArg(cons_half(x_1)) -> half(encArg(x_1)) [0] encArg(cons_s(x_1)) -> s(encArg(x_1)) [0] encArg(cons_log(x_1)) -> log(encArg(x_1)) [0] encode_half(x_1) -> half(encArg(x_1)) [0] encode_0 -> 0 [0] encode_s(x_1) -> s(encArg(x_1)) [0] encode_log(x_1) -> log(encArg(x_1)) [0] s(x0) -> c_s(x0) [0] log(x0) -> c_log(x0) [0] encArg(v0) -> null_encArg [0] encode_half(v0) -> null_encode_half [0] encode_0 -> null_encode_0 [0] encode_s(v0) -> null_encode_s [0] encode_log(v0) -> null_encode_log [0] s(v0) -> null_s [0] log(v0) -> null_log [0] half(v0) -> null_half [0] The TRS has the following type information: half :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half -> 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half 0 :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half c_s :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half -> 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half s :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half -> 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half log :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half -> 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half c_log :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half -> 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half encArg :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half -> 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half cons_half :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half -> 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half cons_s :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half -> 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half cons_log :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half -> 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half encode_half :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half -> 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half encode_0 :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half encode_s :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half -> 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half encode_log :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half -> 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half null_encArg :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half null_encode_half :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half null_encode_0 :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half null_encode_s :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half null_encode_log :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half null_s :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half null_log :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half null_half :: 0:c_s:c_log:cons_half:cons_s:cons_log:null_encArg:null_encode_half:null_encode_0:null_encode_s:null_encode_log:null_s:null_log:null_half Rewrite Strategy: INNERMOST ---------------------------------------- (15) 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_encArg => 0 null_encode_half => 0 null_encode_0 => 0 null_encode_s => 0 null_encode_log => 0 null_s => 0 null_log => 0 null_half => 0 ---------------------------------------- (16) Obligation: Complexity RNTS consisting of the following rules: encArg(z) -{ 0 }-> s(encArg(x_1)) :|: z = 1 + x_1, x_1 >= 0 encArg(z) -{ 0 }-> log(encArg(x_1)) :|: z = 1 + x_1, x_1 >= 0 encArg(z) -{ 0 }-> half(encArg(x_1)) :|: z = 1 + x_1, x_1 >= 0 encArg(z) -{ 0 }-> 0 :|: z = 0 encArg(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 encode_0 -{ 0 }-> 0 :|: encode_half(z) -{ 0 }-> half(encArg(x_1)) :|: x_1 >= 0, z = x_1 encode_half(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 encode_log(z) -{ 0 }-> log(encArg(x_1)) :|: x_1 >= 0, z = x_1 encode_log(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 encode_s(z) -{ 0 }-> s(encArg(x_1)) :|: x_1 >= 0, z = x_1 encode_s(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 half(z) -{ 1 }-> s(half(x)) :|: x >= 0, z = 1 + (1 + x) half(z) -{ 1 }-> 0 :|: z = 0 half(z) -{ 1 }-> 0 :|: z = 1 + 0 half(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 log(z) -{ 1 }-> s(log(half(s(x)))) :|: x >= 0, z = 1 + x log(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 log(z) -{ 0 }-> 1 + x0 :|: z = x0, x0 >= 0 s(z) -{ 1 }-> s(0) :|: z = 1 + 0 s(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 s(z) -{ 0 }-> 1 + x0 :|: z = x0, x0 >= 0 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (17) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V),0,[half(V, Out)],[V >= 0]). eq(start(V),0,[log(V, Out)],[V >= 0]). eq(start(V),0,[s(V, Out)],[V >= 0]). eq(start(V),0,[encArg(V, Out)],[V >= 0]). eq(start(V),0,[fun(V, Out)],[V >= 0]). eq(start(V),0,[fun1(Out)],[]). eq(start(V),0,[fun2(V, Out)],[V >= 0]). eq(start(V),0,[fun3(V, Out)],[V >= 0]). eq(half(V, Out),1,[],[Out = 0,V = 0]). eq(half(V, Out),1,[],[Out = 0,V = 1]). eq(half(V, Out),1,[half(V1, Ret0),s(Ret0, Ret)],[Out = Ret,V1 >= 0,V = 2 + V1]). eq(log(V, Out),1,[s(V2, Ret000),half(Ret000, Ret00),log(Ret00, Ret01),s(Ret01, Ret1)],[Out = Ret1,V2 >= 0,V = 1 + V2]). eq(s(V, Out),1,[s(0, Ret2)],[Out = Ret2,V = 1]). eq(encArg(V, Out),0,[],[Out = 0,V = 0]). eq(encArg(V, Out),0,[encArg(V3, Ret02),half(Ret02, Ret3)],[Out = Ret3,V = 1 + V3,V3 >= 0]). eq(encArg(V, Out),0,[encArg(V4, Ret03),s(Ret03, Ret4)],[Out = Ret4,V = 1 + V4,V4 >= 0]). eq(encArg(V, Out),0,[encArg(V5, Ret04),log(Ret04, Ret5)],[Out = Ret5,V = 1 + V5,V5 >= 0]). eq(fun(V, Out),0,[encArg(V6, Ret05),half(Ret05, Ret6)],[Out = Ret6,V6 >= 0,V = V6]). eq(fun1(Out),0,[],[Out = 0]). eq(fun2(V, Out),0,[encArg(V7, Ret06),s(Ret06, Ret7)],[Out = Ret7,V7 >= 0,V = V7]). eq(fun3(V, Out),0,[encArg(V8, Ret07),log(Ret07, Ret8)],[Out = Ret8,V8 >= 0,V = V8]). eq(s(V, Out),0,[],[Out = 1 + V9,V = V9,V9 >= 0]). eq(log(V, Out),0,[],[Out = 1 + V10,V = V10,V10 >= 0]). eq(encArg(V, Out),0,[],[Out = 0,V11 >= 0,V = V11]). eq(fun(V, Out),0,[],[Out = 0,V12 >= 0,V = V12]). eq(fun2(V, Out),0,[],[Out = 0,V13 >= 0,V = V13]). eq(fun3(V, Out),0,[],[Out = 0,V14 >= 0,V = V14]). eq(s(V, Out),0,[],[Out = 0,V15 >= 0,V = V15]). eq(log(V, Out),0,[],[Out = 0,V16 >= 0,V = V16]). eq(half(V, Out),0,[],[Out = 0,V17 >= 0,V = V17]). input_output_vars(half(V,Out),[V],[Out]). input_output_vars(log(V,Out),[V],[Out]). input_output_vars(s(V,Out),[V],[Out]). input_output_vars(encArg(V,Out),[V],[Out]). input_output_vars(fun(V,Out),[V],[Out]). input_output_vars(fun1(Out),[],[Out]). input_output_vars(fun2(V,Out),[V],[Out]). input_output_vars(fun3(V,Out),[V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [s/2] 1. recursive [non_tail] : [half/2] 2. recursive [non_tail] : [log/2] 3. recursive [non_tail] : [encArg/2] 4. non_recursive : [fun/2] 5. non_recursive : [fun1/1] 6. non_recursive : [fun2/2] 7. non_recursive : [fun3/2] 8. non_recursive : [start/1] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into s/2 1. SCC is partially evaluated into half/2 2. SCC is partially evaluated into log/2 3. SCC is partially evaluated into encArg/2 4. SCC is partially evaluated into fun/2 5. SCC is completely evaluated into other SCCs 6. SCC is partially evaluated into fun2/2 7. SCC is partially evaluated into fun3/2 8. SCC is partially evaluated into start/1 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations s/2 * CE 17 is refined into CE [29] * CE 18 is refined into CE [30] * CE 16 is refined into CE [31] ### Cost equations --> "Loop" of s/2 * CEs [31] --> Loop 16 * CEs [29] --> Loop 17 * CEs [30] --> Loop 18 ### Ranking functions of CR s(V,Out) #### Partial ranking functions of CR s(V,Out) ### Specialization of cost equations half/2 * CE 10 is refined into CE [32] * CE 9 is refined into CE [33] * CE 12 is refined into CE [34] * CE 11 is refined into CE [35,36,37] ### Cost equations --> "Loop" of half/2 * CEs [37] --> Loop 19 * CEs [36] --> Loop 20 * CEs [35] --> Loop 21 * CEs [32] --> Loop 22 * CEs [33,34] --> Loop 23 ### Ranking functions of CR half(V,Out) * RF of phase [19,20,21]: [V-1] #### Partial ranking functions of CR half(V,Out) * Partial RF of phase [19,20,21]: - RF of loop [19:1,20:1,21:1]: V-1 ### Specialization of cost equations log/2 * CE 14 is refined into CE [38] * CE 15 is refined into CE [39] * CE 13 is refined into CE [40,41,42,43,44,45,46,47,48,49,50,51] ### Cost equations --> "Loop" of log/2 * CEs [51] --> Loop 24 * CEs [50] --> Loop 25 * CEs [49] --> Loop 26 * CEs [42,45,48] --> Loop 27 * CEs [41,44,47] --> Loop 28 * CEs [40,43,46] --> Loop 29 * CEs [38] --> Loop 30 * CEs [39] --> Loop 31 ### Ranking functions of CR log(V,Out) * RF of phase [24,25,26]: [2*V-3] #### Partial ranking functions of CR log(V,Out) * Partial RF of phase [24,25,26]: - RF of loop [24:1,25:1,26:1]: 2*V-3 ### Specialization of cost equations encArg/2 * CE 19 is refined into CE [52] * CE 20 is refined into CE [53,54] * CE 21 is refined into CE [55,56,57] * CE 22 is refined into CE [58,59,60,61,62] ### Cost equations --> "Loop" of encArg/2 * CEs [54,62] --> Loop 32 * CEs [57,61] --> Loop 33 * CEs [60] --> Loop 34 * CEs [56,59] --> Loop 35 * CEs [53,55,58] --> Loop 36 * CEs [52] --> Loop 37 ### Ranking functions of CR encArg(V,Out) * RF of phase [32,33,34,35,36]: [V] #### Partial ranking functions of CR encArg(V,Out) * Partial RF of phase [32,33,34,35,36]: - RF of loop [32:1,33:1,34:1,35:1,36:1]: V ### Specialization of cost equations fun/2 * CE 23 is refined into CE [63,64,65] * CE 24 is refined into CE [66] ### Cost equations --> "Loop" of fun/2 * CEs [65] --> Loop 38 * CEs [63,64,66] --> Loop 39 ### Ranking functions of CR fun(V,Out) #### Partial ranking functions of CR fun(V,Out) ### Specialization of cost equations fun2/2 * CE 25 is refined into CE [67,68,69,70,71] * CE 26 is refined into CE [72] ### Cost equations --> "Loop" of fun2/2 * CEs [71] --> Loop 40 * CEs [68,70] --> Loop 41 * CEs [67,69,72] --> Loop 42 ### Ranking functions of CR fun2(V,Out) #### Partial ranking functions of CR fun2(V,Out) ### Specialization of cost equations fun3/2 * CE 27 is refined into CE [73,74,75,76,77,78,79] * CE 28 is refined into CE [80] ### Cost equations --> "Loop" of fun3/2 * CEs [79] --> Loop 43 * CEs [77,78] --> Loop 44 * CEs [74,76] --> Loop 45 * CEs [73,75,80] --> Loop 46 ### Ranking functions of CR fun3(V,Out) #### Partial ranking functions of CR fun3(V,Out) ### Specialization of cost equations start/1 * CE 1 is refined into CE [81,82] * CE 2 is refined into CE [83,84,85,86,87] * CE 3 is refined into CE [88,89,90] * CE 4 is refined into CE [91,92] * CE 5 is refined into CE [93,94] * CE 6 is refined into CE [95] * CE 7 is refined into CE [96,97,98] * CE 8 is refined into CE [99,100,101,102] ### Cost equations --> "Loop" of start/1 * CEs [81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102] --> Loop 47 ### Ranking functions of CR start(V) #### Partial ranking functions of CR start(V) Computing Bounds ===================================== #### Cost of chains of s(V,Out): * Chain [18]: 0 with precondition: [Out=0,V>=0] * Chain [17]: 0 with precondition: [V+1=Out,V>=0] * Chain [16,18]: 1 with precondition: [V=1,Out=0] * Chain [16,17]: 1 with precondition: [V=1,Out=1] #### Cost of chains of half(V,Out): * Chain [[19,20,21],23]: 5*it(19)+1 Such that:aux(3) =< V it(19) =< aux(3) with precondition: [V>=2,Out>=0,V>=2*Out] * Chain [[19,20,21],22]: 5*it(19)+1 Such that:aux(4) =< V it(19) =< aux(4) with precondition: [V>=3,Out>=0,V>=2*Out+1] * Chain [23]: 1 with precondition: [Out=0,V>=0] * Chain [22]: 1 with precondition: [V=1,Out=0] #### Cost of chains of log(V,Out): * Chain [[24,25,26],31]: 38*it(24)+0 Such that:aux(8) =< 2*V it(24) =< aux(8) with precondition: [V>=2,Out>=0,V>=2*Out] * Chain [[24,25,26],30]: 38*it(24)+0 Such that:aux(9) =< 2*V it(24) =< aux(9) with precondition: [V>=2,Out>=0,V+4>=2*Out] * Chain [[24,25,26],29,31]: 38*it(24)+4 Such that:aux(10) =< 2*V it(24) =< aux(10) with precondition: [V>=2,Out>=0,V>=2*Out] * Chain [[24,25,26],29,30]: 38*it(24)+4 Such that:aux(11) =< 2*V it(24) =< aux(11) with precondition: [V>=2,Out>=0,V>=2*Out] * Chain [[24,25,26],28,30]: 38*it(24)+4 Such that:aux(12) =< 2*V it(24) =< aux(12) with precondition: [V>=2,Out>=0,V+2>=2*Out] * Chain [[24,25,26],27,31]: 38*it(24)+3 Such that:aux(13) =< 2*V it(24) =< aux(13) with precondition: [V>=2,Out>=0,V+2>=2*Out] * Chain [[24,25,26],27,30]: 38*it(24)+3 Such that:aux(14) =< 2*V it(24) =< aux(14) with precondition: [V>=2,Out>=0,V+4>=2*Out] * Chain [31]: 0 with precondition: [Out=0,V>=0] * Chain [30]: 0 with precondition: [V+1=Out,V>=0] * Chain [29,31]: 4 with precondition: [Out=0,V>=1] * Chain [29,30]: 4 with precondition: [Out=0,V>=1] * Chain [28,30]: 4 with precondition: [Out=1,V>=1] * Chain [27,31]: 3 with precondition: [Out=1,V>=1] * Chain [27,30]: 3 with precondition: [Out=2,V>=1] #### Cost of chains of encArg(V,Out): * Chain [[32,33,34,35,36],37]: 15*it(32)+10*s(45)+266*s(46)+0 Such that:aux(20) =< V it(32) =< aux(20) aux(17) =< it(32)*aux(20) s(47) =< aux(17)*2 s(45) =< aux(17) s(46) =< s(47) with precondition: [V>=1,Out>=0,V>=Out] * Chain [37]: 0 with precondition: [Out=0,V>=0] #### Cost of chains of fun(V,Out): * Chain [39]: 15*s(50)+10*s(53)+266*s(54)+1 Such that:s(49) =< V s(50) =< s(49) s(51) =< s(50)*s(49) s(52) =< s(51)*2 s(53) =< s(51) s(54) =< s(52) with precondition: [Out=0,V>=0] * Chain [38]: 25*s(56)+10*s(59)+266*s(60)+1 Such that:aux(21) =< V s(56) =< aux(21) s(57) =< s(56)*aux(21) s(58) =< s(57)*2 s(59) =< s(57) s(60) =< s(58) with precondition: [V>=2,Out>=0,V>=2*Out] #### Cost of chains of fun2(V,Out): * Chain [42]: 15*s(64)+10*s(67)+266*s(68)+1 Such that:s(63) =< V s(64) =< s(63) s(65) =< s(64)*s(63) s(66) =< s(65)*2 s(67) =< s(65) s(68) =< s(66) with precondition: [Out=0,V>=0] * Chain [41]: 15*s(70)+10*s(73)+266*s(74)+1 Such that:s(69) =< V s(70) =< s(69) s(71) =< s(70)*s(69) s(72) =< s(71)*2 s(73) =< s(71) s(74) =< s(72) with precondition: [Out=1,V>=0] * Chain [40]: 15*s(76)+10*s(79)+266*s(80)+0 Such that:s(75) =< V s(76) =< s(75) s(77) =< s(76)*s(75) s(78) =< s(77)*2 s(79) =< s(77) s(80) =< s(78) with precondition: [V>=1,Out>=1,V+1>=Out] #### Cost of chains of fun3(V,Out): * Chain [46]: 15*s(82)+10*s(85)+266*s(86)+4 Such that:s(81) =< V s(82) =< s(81) s(83) =< s(82)*s(81) s(84) =< s(83)*2 s(85) =< s(83) s(86) =< s(84) with precondition: [Out=0,V>=0] * Chain [45]: 15*s(88)+10*s(91)+266*s(92)+4 Such that:s(87) =< V s(88) =< s(87) s(89) =< s(88)*s(87) s(90) =< s(89)*2 s(91) =< s(89) s(92) =< s(90) with precondition: [Out=1,V>=0] * Chain [44]: 30*s(94)+20*s(97)+532*s(98)+3 Such that:aux(22) =< V s(94) =< aux(22) s(95) =< s(94)*aux(22) s(96) =< s(95)*2 s(97) =< s(95) s(98) =< s(96) with precondition: [V>=1,Out>=1,V+1>=Out] * Chain [43]: 15*s(106)+10*s(109)+266*s(110)+266*s(112)+4 Such that:s(105) =< V s(111) =< 2*V s(112) =< s(111) s(106) =< s(105) s(107) =< s(106)*s(105) s(108) =< s(107)*2 s(109) =< s(107) s(110) =< s(108) with precondition: [V>=2,Out>=0,V+4>=2*Out] #### Cost of chains of start(V): * Chain [47]: 185*s(114)+532*s(116)+110*s(121)+2926*s(122)+4 Such that:aux(23) =< V aux(24) =< 2*V s(114) =< aux(23) s(119) =< s(114)*aux(23) s(120) =< s(119)*2 s(121) =< s(119) s(122) =< s(120) s(116) =< aux(24) with precondition: [] Closed-form bounds of start(V): ------------------------------------- * Chain [47] with precondition: [] - Upper bound: nat(V)*185+4+nat(V)*5962*nat(V)+nat(2*V)*532 - Complexity: n^2 ### Maximum cost of start(V): nat(V)*185+4+nat(V)*5962*nat(V)+nat(2*V)*532 Asymptotic class: n^2 * Total analysis performed in 454 ms. ---------------------------------------- (18) BOUNDS(1, n^2) ---------------------------------------- (19) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (20) Obligation: The Runtime Complexity (full) of the given CpxRelTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: half(0') -> 0' half(s(0')) -> 0' half(s(s(x))) -> s(half(x)) s(log(0')) -> s(0') log(s(x)) -> s(log(half(s(x)))) The (relative) TRS S consists of the following rules: encArg(0') -> 0' encArg(cons_half(x_1)) -> half(encArg(x_1)) encArg(cons_s(x_1)) -> s(encArg(x_1)) encArg(cons_log(x_1)) -> log(encArg(x_1)) encode_half(x_1) -> half(encArg(x_1)) encode_0 -> 0' encode_s(x_1) -> s(encArg(x_1)) encode_log(x_1) -> log(encArg(x_1)) Rewrite Strategy: FULL ---------------------------------------- (21) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (22) Obligation: TRS: Rules: half(0') -> 0' half(s(0')) -> 0' half(s(s(x))) -> s(half(x)) s(log(0')) -> s(0') log(s(x)) -> s(log(half(s(x)))) encArg(0') -> 0' encArg(cons_half(x_1)) -> half(encArg(x_1)) encArg(cons_s(x_1)) -> s(encArg(x_1)) encArg(cons_log(x_1)) -> log(encArg(x_1)) encode_half(x_1) -> half(encArg(x_1)) encode_0 -> 0' encode_s(x_1) -> s(encArg(x_1)) encode_log(x_1) -> log(encArg(x_1)) Types: half :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log 0' :: 0':cons_half:cons_s:cons_log s :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log log :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log encArg :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log cons_half :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log cons_s :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log cons_log :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log encode_half :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log encode_0 :: 0':cons_half:cons_s:cons_log encode_s :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log encode_log :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log hole_0':cons_half:cons_s:cons_log1_2 :: 0':cons_half:cons_s:cons_log gen_0':cons_half:cons_s:cons_log2_2 :: Nat -> 0':cons_half:cons_s:cons_log ---------------------------------------- (23) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: half, s, log, encArg They will be analysed ascendingly in the following order: s < half half < log half < encArg s < log s < encArg log < encArg ---------------------------------------- (24) Obligation: TRS: Rules: half(0') -> 0' half(s(0')) -> 0' half(s(s(x))) -> s(half(x)) s(log(0')) -> s(0') log(s(x)) -> s(log(half(s(x)))) encArg(0') -> 0' encArg(cons_half(x_1)) -> half(encArg(x_1)) encArg(cons_s(x_1)) -> s(encArg(x_1)) encArg(cons_log(x_1)) -> log(encArg(x_1)) encode_half(x_1) -> half(encArg(x_1)) encode_0 -> 0' encode_s(x_1) -> s(encArg(x_1)) encode_log(x_1) -> log(encArg(x_1)) Types: half :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log 0' :: 0':cons_half:cons_s:cons_log s :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log log :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log encArg :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log cons_half :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log cons_s :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log cons_log :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log encode_half :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log encode_0 :: 0':cons_half:cons_s:cons_log encode_s :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log encode_log :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log hole_0':cons_half:cons_s:cons_log1_2 :: 0':cons_half:cons_s:cons_log gen_0':cons_half:cons_s:cons_log2_2 :: Nat -> 0':cons_half:cons_s:cons_log Generator Equations: gen_0':cons_half:cons_s:cons_log2_2(0) <=> 0' gen_0':cons_half:cons_s:cons_log2_2(+(x, 1)) <=> cons_half(gen_0':cons_half:cons_s:cons_log2_2(x)) The following defined symbols remain to be analysed: s, half, log, encArg They will be analysed ascendingly in the following order: s < half half < log half < encArg s < log s < encArg log < encArg ---------------------------------------- (25) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: encArg(gen_0':cons_half:cons_s:cons_log2_2(n21_2)) -> gen_0':cons_half:cons_s:cons_log2_2(0), rt in Omega(n21_2) Induction Base: encArg(gen_0':cons_half:cons_s:cons_log2_2(0)) ->_R^Omega(0) 0' Induction Step: encArg(gen_0':cons_half:cons_s:cons_log2_2(+(n21_2, 1))) ->_R^Omega(0) half(encArg(gen_0':cons_half:cons_s:cons_log2_2(n21_2))) ->_IH half(gen_0':cons_half:cons_s:cons_log2_2(0)) ->_R^Omega(1) 0' We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (26) Obligation: Proved the lower bound n^1 for the following obligation: TRS: Rules: half(0') -> 0' half(s(0')) -> 0' half(s(s(x))) -> s(half(x)) s(log(0')) -> s(0') log(s(x)) -> s(log(half(s(x)))) encArg(0') -> 0' encArg(cons_half(x_1)) -> half(encArg(x_1)) encArg(cons_s(x_1)) -> s(encArg(x_1)) encArg(cons_log(x_1)) -> log(encArg(x_1)) encode_half(x_1) -> half(encArg(x_1)) encode_0 -> 0' encode_s(x_1) -> s(encArg(x_1)) encode_log(x_1) -> log(encArg(x_1)) Types: half :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log 0' :: 0':cons_half:cons_s:cons_log s :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log log :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log encArg :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log cons_half :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log cons_s :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log cons_log :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log encode_half :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log encode_0 :: 0':cons_half:cons_s:cons_log encode_s :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log encode_log :: 0':cons_half:cons_s:cons_log -> 0':cons_half:cons_s:cons_log hole_0':cons_half:cons_s:cons_log1_2 :: 0':cons_half:cons_s:cons_log gen_0':cons_half:cons_s:cons_log2_2 :: Nat -> 0':cons_half:cons_s:cons_log Generator Equations: gen_0':cons_half:cons_s:cons_log2_2(0) <=> 0' gen_0':cons_half:cons_s:cons_log2_2(+(x, 1)) <=> cons_half(gen_0':cons_half:cons_s:cons_log2_2(x)) The following defined symbols remain to be analysed: encArg ---------------------------------------- (27) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (28) BOUNDS(n^1, INF)