/export/starexec/sandbox2/solver/bin/starexec_run_complexity /export/starexec/sandbox2/benchmark/theBenchmark.xml /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- WORST_CASE(Omega(n^1), O(n^1)) proof of /export/starexec/sandbox2/benchmark/theBenchmark.xml # AProVE Commit ID: 794c25de1cacf0d048858bcd21c9a779e1221865 marcel 20200619 unpublished dirty The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). (0) CpxTRS (1) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (2) CpxWeightedTrs (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxTypedWeightedTrs (5) CompletionProof [UPPER BOUND(ID), 0 ms] (6) CpxTypedWeightedCompleteTrs (7) NarrowingProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CpxTypedWeightedCompleteTrs (9) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (10) CpxRNTS (11) SimplificationProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CpxRNTS (13) CpxRntsAnalysisOrderProof [BOTH BOUNDS(ID, ID), 0 ms] (14) CpxRNTS (15) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (16) CpxRNTS (17) IntTrsBoundProof [UPPER BOUND(ID), 152 ms] (18) CpxRNTS (19) IntTrsBoundProof [UPPER BOUND(ID), 55 ms] (20) CpxRNTS (21) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (22) CpxRNTS (23) IntTrsBoundProof [UPPER BOUND(ID), 581 ms] (24) CpxRNTS (25) IntTrsBoundProof [UPPER BOUND(ID), 216 ms] (26) CpxRNTS (27) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (28) CpxRNTS (29) IntTrsBoundProof [UPPER BOUND(ID), 127 ms] (30) CpxRNTS (31) IntTrsBoundProof [UPPER BOUND(ID), 42 ms] (32) CpxRNTS (33) ResultPropagationProof [UPPER BOUND(ID), 0 ms] (34) CpxRNTS (35) IntTrsBoundProof [UPPER BOUND(ID), 127 ms] (36) CpxRNTS (37) IntTrsBoundProof [UPPER BOUND(ID), 52 ms] (38) CpxRNTS (39) FinalProof [FINISHED, 0 ms] (40) BOUNDS(1, n^1) (41) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (42) CpxTRS (43) SlicingProof [LOWER BOUND(ID), 0 ms] (44) CpxTRS (45) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (46) typed CpxTrs (47) OrderProof [LOWER BOUND(ID), 0 ms] (48) typed CpxTrs (49) RewriteLemmaProof [LOWER BOUND(ID), 195 ms] (50) BEST (51) proven lower bound (52) LowerBoundPropagationProof [FINISHED, 0 ms] (53) BOUNDS(n^1, INF) (54) typed CpxTrs ---------------------------------------- (0) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: is_empty(nil) -> true is_empty(cons(x, l)) -> false hd(cons(x, l)) -> x tl(cons(x, l)) -> l append(l1, l2) -> ifappend(l1, l2, l1) ifappend(l1, l2, nil) -> l2 ifappend(l1, l2, cons(x, l)) -> cons(x, append(l, l2)) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (1) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (2) 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: is_empty(nil) -> true [1] is_empty(cons(x, l)) -> false [1] hd(cons(x, l)) -> x [1] tl(cons(x, l)) -> l [1] append(l1, l2) -> ifappend(l1, l2, l1) [1] ifappend(l1, l2, nil) -> l2 [1] ifappend(l1, l2, cons(x, l)) -> cons(x, append(l, l2)) [1] Rewrite Strategy: INNERMOST ---------------------------------------- (3) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (4) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: is_empty(nil) -> true [1] is_empty(cons(x, l)) -> false [1] hd(cons(x, l)) -> x [1] tl(cons(x, l)) -> l [1] append(l1, l2) -> ifappend(l1, l2, l1) [1] ifappend(l1, l2, nil) -> l2 [1] ifappend(l1, l2, cons(x, l)) -> cons(x, append(l, l2)) [1] The TRS has the following type information: is_empty :: nil:cons -> true:false nil :: nil:cons true :: true:false cons :: hd -> nil:cons -> nil:cons false :: true:false hd :: nil:cons -> hd tl :: nil:cons -> nil:cons append :: nil:cons -> nil:cons -> nil:cons ifappend :: nil:cons -> nil:cons -> nil:cons -> nil:cons Rewrite Strategy: INNERMOST ---------------------------------------- (5) CompletionProof (UPPER BOUND(ID)) The transformation into a RNTS is sound, since: (a) The obligation is a constructor system where every type has a constant constructor, (b) The following defined symbols do not have to be completely defined, as they can never occur inside other defined symbols: is_empty_1 hd_1 tl_1 append_2 ifappend_3 (c) The following functions are completely defined: none Due to the following rules being added: none And the following fresh constants: const ---------------------------------------- (6) Obligation: Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: is_empty(nil) -> true [1] is_empty(cons(x, l)) -> false [1] hd(cons(x, l)) -> x [1] tl(cons(x, l)) -> l [1] append(l1, l2) -> ifappend(l1, l2, l1) [1] ifappend(l1, l2, nil) -> l2 [1] ifappend(l1, l2, cons(x, l)) -> cons(x, append(l, l2)) [1] The TRS has the following type information: is_empty :: nil:cons -> true:false nil :: nil:cons true :: true:false cons :: hd -> nil:cons -> nil:cons false :: true:false hd :: nil:cons -> hd tl :: nil:cons -> nil:cons append :: nil:cons -> nil:cons -> nil:cons ifappend :: nil:cons -> nil:cons -> nil:cons -> nil:cons const :: hd Rewrite Strategy: INNERMOST ---------------------------------------- (7) NarrowingProof (BOTH BOUNDS(ID, ID)) Narrowed the inner basic terms of all right-hand sides by a single narrowing step. ---------------------------------------- (8) Obligation: Runtime Complexity Weighted TRS where critical functions are completely defined. The underlying TRS is: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: is_empty(nil) -> true [1] is_empty(cons(x, l)) -> false [1] hd(cons(x, l)) -> x [1] tl(cons(x, l)) -> l [1] append(l1, l2) -> ifappend(l1, l2, l1) [1] ifappend(l1, l2, nil) -> l2 [1] ifappend(l1, l2, cons(x, l)) -> cons(x, append(l, l2)) [1] The TRS has the following type information: is_empty :: nil:cons -> true:false nil :: nil:cons true :: true:false cons :: hd -> nil:cons -> nil:cons false :: true:false hd :: nil:cons -> hd tl :: nil:cons -> nil:cons append :: nil:cons -> nil:cons -> nil:cons ifappend :: nil:cons -> nil:cons -> nil:cons -> nil:cons const :: hd Rewrite Strategy: INNERMOST ---------------------------------------- (9) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: nil => 0 true => 1 false => 0 const => 0 ---------------------------------------- (10) Obligation: Complexity RNTS consisting of the following rules: append(z, z') -{ 1 }-> ifappend(l1, l2, l1) :|: z = l1, z' = l2, l1 >= 0, l2 >= 0 hd(z) -{ 1 }-> x :|: x >= 0, l >= 0, z = 1 + x + l ifappend(z, z', z'') -{ 1 }-> l2 :|: z'' = 0, z = l1, z' = l2, l1 >= 0, l2 >= 0 ifappend(z, z', z'') -{ 1 }-> 1 + x + append(l, l2) :|: z'' = 1 + x + l, z = l1, x >= 0, l >= 0, z' = l2, l1 >= 0, l2 >= 0 is_empty(z) -{ 1 }-> 1 :|: z = 0 is_empty(z) -{ 1 }-> 0 :|: x >= 0, l >= 0, z = 1 + x + l tl(z) -{ 1 }-> l :|: x >= 0, l >= 0, z = 1 + x + l ---------------------------------------- (11) SimplificationProof (BOTH BOUNDS(ID, ID)) Simplified the RNTS by moving equalities from the constraints into the right-hand sides. ---------------------------------------- (12) Obligation: Complexity RNTS consisting of the following rules: append(z, z') -{ 1 }-> ifappend(z, z', z) :|: z >= 0, z' >= 0 hd(z) -{ 1 }-> x :|: x >= 0, l >= 0, z = 1 + x + l ifappend(z, z', z'') -{ 1 }-> z' :|: z'' = 0, z >= 0, z' >= 0 ifappend(z, z', z'') -{ 1 }-> 1 + x + append(l, z') :|: z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0 is_empty(z) -{ 1 }-> 1 :|: z = 0 is_empty(z) -{ 1 }-> 0 :|: x >= 0, l >= 0, z = 1 + x + l tl(z) -{ 1 }-> l :|: x >= 0, l >= 0, z = 1 + x + l ---------------------------------------- (13) CpxRntsAnalysisOrderProof (BOTH BOUNDS(ID, ID)) Found the following analysis order by SCC decomposition: { is_empty } { ifappend, append } { tl } { hd } ---------------------------------------- (14) Obligation: Complexity RNTS consisting of the following rules: append(z, z') -{ 1 }-> ifappend(z, z', z) :|: z >= 0, z' >= 0 hd(z) -{ 1 }-> x :|: x >= 0, l >= 0, z = 1 + x + l ifappend(z, z', z'') -{ 1 }-> z' :|: z'' = 0, z >= 0, z' >= 0 ifappend(z, z', z'') -{ 1 }-> 1 + x + append(l, z') :|: z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0 is_empty(z) -{ 1 }-> 1 :|: z = 0 is_empty(z) -{ 1 }-> 0 :|: x >= 0, l >= 0, z = 1 + x + l tl(z) -{ 1 }-> l :|: x >= 0, l >= 0, z = 1 + x + l Function symbols to be analyzed: {is_empty}, {ifappend,append}, {tl}, {hd} ---------------------------------------- (15) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (16) Obligation: Complexity RNTS consisting of the following rules: append(z, z') -{ 1 }-> ifappend(z, z', z) :|: z >= 0, z' >= 0 hd(z) -{ 1 }-> x :|: x >= 0, l >= 0, z = 1 + x + l ifappend(z, z', z'') -{ 1 }-> z' :|: z'' = 0, z >= 0, z' >= 0 ifappend(z, z', z'') -{ 1 }-> 1 + x + append(l, z') :|: z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0 is_empty(z) -{ 1 }-> 1 :|: z = 0 is_empty(z) -{ 1 }-> 0 :|: x >= 0, l >= 0, z = 1 + x + l tl(z) -{ 1 }-> l :|: x >= 0, l >= 0, z = 1 + x + l Function symbols to be analyzed: {is_empty}, {ifappend,append}, {tl}, {hd} ---------------------------------------- (17) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using CoFloCo for: is_empty after applying outer abstraction to obtain an ITS, resulting in: O(1) with polynomial bound: 1 ---------------------------------------- (18) Obligation: Complexity RNTS consisting of the following rules: append(z, z') -{ 1 }-> ifappend(z, z', z) :|: z >= 0, z' >= 0 hd(z) -{ 1 }-> x :|: x >= 0, l >= 0, z = 1 + x + l ifappend(z, z', z'') -{ 1 }-> z' :|: z'' = 0, z >= 0, z' >= 0 ifappend(z, z', z'') -{ 1 }-> 1 + x + append(l, z') :|: z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0 is_empty(z) -{ 1 }-> 1 :|: z = 0 is_empty(z) -{ 1 }-> 0 :|: x >= 0, l >= 0, z = 1 + x + l tl(z) -{ 1 }-> l :|: x >= 0, l >= 0, z = 1 + x + l Function symbols to be analyzed: {is_empty}, {ifappend,append}, {tl}, {hd} Previous analysis results are: is_empty: runtime: ?, size: O(1) [1] ---------------------------------------- (19) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: is_empty after applying outer abstraction to obtain an ITS, resulting in: O(1) with polynomial bound: 1 ---------------------------------------- (20) Obligation: Complexity RNTS consisting of the following rules: append(z, z') -{ 1 }-> ifappend(z, z', z) :|: z >= 0, z' >= 0 hd(z) -{ 1 }-> x :|: x >= 0, l >= 0, z = 1 + x + l ifappend(z, z', z'') -{ 1 }-> z' :|: z'' = 0, z >= 0, z' >= 0 ifappend(z, z', z'') -{ 1 }-> 1 + x + append(l, z') :|: z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0 is_empty(z) -{ 1 }-> 1 :|: z = 0 is_empty(z) -{ 1 }-> 0 :|: x >= 0, l >= 0, z = 1 + x + l tl(z) -{ 1 }-> l :|: x >= 0, l >= 0, z = 1 + x + l Function symbols to be analyzed: {ifappend,append}, {tl}, {hd} Previous analysis results are: is_empty: runtime: O(1) [1], size: O(1) [1] ---------------------------------------- (21) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (22) Obligation: Complexity RNTS consisting of the following rules: append(z, z') -{ 1 }-> ifappend(z, z', z) :|: z >= 0, z' >= 0 hd(z) -{ 1 }-> x :|: x >= 0, l >= 0, z = 1 + x + l ifappend(z, z', z'') -{ 1 }-> z' :|: z'' = 0, z >= 0, z' >= 0 ifappend(z, z', z'') -{ 1 }-> 1 + x + append(l, z') :|: z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0 is_empty(z) -{ 1 }-> 1 :|: z = 0 is_empty(z) -{ 1 }-> 0 :|: x >= 0, l >= 0, z = 1 + x + l tl(z) -{ 1 }-> l :|: x >= 0, l >= 0, z = 1 + x + l Function symbols to be analyzed: {ifappend,append}, {tl}, {hd} Previous analysis results are: is_empty: runtime: O(1) [1], size: O(1) [1] ---------------------------------------- (23) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using CoFloCo for: ifappend after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: z' + z'' Computed SIZE bound using CoFloCo for: append after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: z + z' ---------------------------------------- (24) Obligation: Complexity RNTS consisting of the following rules: append(z, z') -{ 1 }-> ifappend(z, z', z) :|: z >= 0, z' >= 0 hd(z) -{ 1 }-> x :|: x >= 0, l >= 0, z = 1 + x + l ifappend(z, z', z'') -{ 1 }-> z' :|: z'' = 0, z >= 0, z' >= 0 ifappend(z, z', z'') -{ 1 }-> 1 + x + append(l, z') :|: z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0 is_empty(z) -{ 1 }-> 1 :|: z = 0 is_empty(z) -{ 1 }-> 0 :|: x >= 0, l >= 0, z = 1 + x + l tl(z) -{ 1 }-> l :|: x >= 0, l >= 0, z = 1 + x + l Function symbols to be analyzed: {ifappend,append}, {tl}, {hd} Previous analysis results are: is_empty: runtime: O(1) [1], size: O(1) [1] ifappend: runtime: ?, size: O(n^1) [z' + z''] append: runtime: ?, size: O(n^1) [z + z'] ---------------------------------------- (25) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: ifappend after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 3 + 2*z'' Computed RUNTIME bound using CoFloCo for: append after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: 4 + 2*z ---------------------------------------- (26) Obligation: Complexity RNTS consisting of the following rules: append(z, z') -{ 1 }-> ifappend(z, z', z) :|: z >= 0, z' >= 0 hd(z) -{ 1 }-> x :|: x >= 0, l >= 0, z = 1 + x + l ifappend(z, z', z'') -{ 1 }-> z' :|: z'' = 0, z >= 0, z' >= 0 ifappend(z, z', z'') -{ 1 }-> 1 + x + append(l, z') :|: z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0 is_empty(z) -{ 1 }-> 1 :|: z = 0 is_empty(z) -{ 1 }-> 0 :|: x >= 0, l >= 0, z = 1 + x + l tl(z) -{ 1 }-> l :|: x >= 0, l >= 0, z = 1 + x + l Function symbols to be analyzed: {tl}, {hd} Previous analysis results are: is_empty: runtime: O(1) [1], size: O(1) [1] ifappend: runtime: O(n^1) [3 + 2*z''], size: O(n^1) [z' + z''] append: runtime: O(n^1) [4 + 2*z], size: O(n^1) [z + z'] ---------------------------------------- (27) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (28) Obligation: Complexity RNTS consisting of the following rules: append(z, z') -{ 4 + 2*z }-> s :|: s >= 0, s <= z' + z, z >= 0, z' >= 0 hd(z) -{ 1 }-> x :|: x >= 0, l >= 0, z = 1 + x + l ifappend(z, z', z'') -{ 1 }-> z' :|: z'' = 0, z >= 0, z' >= 0 ifappend(z, z', z'') -{ 5 + 2*l }-> 1 + x + s' :|: s' >= 0, s' <= l + z', z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0 is_empty(z) -{ 1 }-> 1 :|: z = 0 is_empty(z) -{ 1 }-> 0 :|: x >= 0, l >= 0, z = 1 + x + l tl(z) -{ 1 }-> l :|: x >= 0, l >= 0, z = 1 + x + l Function symbols to be analyzed: {tl}, {hd} Previous analysis results are: is_empty: runtime: O(1) [1], size: O(1) [1] ifappend: runtime: O(n^1) [3 + 2*z''], size: O(n^1) [z' + z''] append: runtime: O(n^1) [4 + 2*z], size: O(n^1) [z + z'] ---------------------------------------- (29) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using KoAT for: tl after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: z ---------------------------------------- (30) Obligation: Complexity RNTS consisting of the following rules: append(z, z') -{ 4 + 2*z }-> s :|: s >= 0, s <= z' + z, z >= 0, z' >= 0 hd(z) -{ 1 }-> x :|: x >= 0, l >= 0, z = 1 + x + l ifappend(z, z', z'') -{ 1 }-> z' :|: z'' = 0, z >= 0, z' >= 0 ifappend(z, z', z'') -{ 5 + 2*l }-> 1 + x + s' :|: s' >= 0, s' <= l + z', z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0 is_empty(z) -{ 1 }-> 1 :|: z = 0 is_empty(z) -{ 1 }-> 0 :|: x >= 0, l >= 0, z = 1 + x + l tl(z) -{ 1 }-> l :|: x >= 0, l >= 0, z = 1 + x + l Function symbols to be analyzed: {tl}, {hd} Previous analysis results are: is_empty: runtime: O(1) [1], size: O(1) [1] ifappend: runtime: O(n^1) [3 + 2*z''], size: O(n^1) [z' + z''] append: runtime: O(n^1) [4 + 2*z], size: O(n^1) [z + z'] tl: runtime: ?, size: O(n^1) [z] ---------------------------------------- (31) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: tl after applying outer abstraction to obtain an ITS, resulting in: O(1) with polynomial bound: 1 ---------------------------------------- (32) Obligation: Complexity RNTS consisting of the following rules: append(z, z') -{ 4 + 2*z }-> s :|: s >= 0, s <= z' + z, z >= 0, z' >= 0 hd(z) -{ 1 }-> x :|: x >= 0, l >= 0, z = 1 + x + l ifappend(z, z', z'') -{ 1 }-> z' :|: z'' = 0, z >= 0, z' >= 0 ifappend(z, z', z'') -{ 5 + 2*l }-> 1 + x + s' :|: s' >= 0, s' <= l + z', z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0 is_empty(z) -{ 1 }-> 1 :|: z = 0 is_empty(z) -{ 1 }-> 0 :|: x >= 0, l >= 0, z = 1 + x + l tl(z) -{ 1 }-> l :|: x >= 0, l >= 0, z = 1 + x + l Function symbols to be analyzed: {hd} Previous analysis results are: is_empty: runtime: O(1) [1], size: O(1) [1] ifappend: runtime: O(n^1) [3 + 2*z''], size: O(n^1) [z' + z''] append: runtime: O(n^1) [4 + 2*z], size: O(n^1) [z + z'] tl: runtime: O(1) [1], size: O(n^1) [z] ---------------------------------------- (33) ResultPropagationProof (UPPER BOUND(ID)) Applied inner abstraction using the recently inferred runtime/size bounds where possible. ---------------------------------------- (34) Obligation: Complexity RNTS consisting of the following rules: append(z, z') -{ 4 + 2*z }-> s :|: s >= 0, s <= z' + z, z >= 0, z' >= 0 hd(z) -{ 1 }-> x :|: x >= 0, l >= 0, z = 1 + x + l ifappend(z, z', z'') -{ 1 }-> z' :|: z'' = 0, z >= 0, z' >= 0 ifappend(z, z', z'') -{ 5 + 2*l }-> 1 + x + s' :|: s' >= 0, s' <= l + z', z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0 is_empty(z) -{ 1 }-> 1 :|: z = 0 is_empty(z) -{ 1 }-> 0 :|: x >= 0, l >= 0, z = 1 + x + l tl(z) -{ 1 }-> l :|: x >= 0, l >= 0, z = 1 + x + l Function symbols to be analyzed: {hd} Previous analysis results are: is_empty: runtime: O(1) [1], size: O(1) [1] ifappend: runtime: O(n^1) [3 + 2*z''], size: O(n^1) [z' + z''] append: runtime: O(n^1) [4 + 2*z], size: O(n^1) [z + z'] tl: runtime: O(1) [1], size: O(n^1) [z] ---------------------------------------- (35) IntTrsBoundProof (UPPER BOUND(ID)) Computed SIZE bound using KoAT for: hd after applying outer abstraction to obtain an ITS, resulting in: O(n^1) with polynomial bound: z ---------------------------------------- (36) Obligation: Complexity RNTS consisting of the following rules: append(z, z') -{ 4 + 2*z }-> s :|: s >= 0, s <= z' + z, z >= 0, z' >= 0 hd(z) -{ 1 }-> x :|: x >= 0, l >= 0, z = 1 + x + l ifappend(z, z', z'') -{ 1 }-> z' :|: z'' = 0, z >= 0, z' >= 0 ifappend(z, z', z'') -{ 5 + 2*l }-> 1 + x + s' :|: s' >= 0, s' <= l + z', z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0 is_empty(z) -{ 1 }-> 1 :|: z = 0 is_empty(z) -{ 1 }-> 0 :|: x >= 0, l >= 0, z = 1 + x + l tl(z) -{ 1 }-> l :|: x >= 0, l >= 0, z = 1 + x + l Function symbols to be analyzed: {hd} Previous analysis results are: is_empty: runtime: O(1) [1], size: O(1) [1] ifappend: runtime: O(n^1) [3 + 2*z''], size: O(n^1) [z' + z''] append: runtime: O(n^1) [4 + 2*z], size: O(n^1) [z + z'] tl: runtime: O(1) [1], size: O(n^1) [z] hd: runtime: ?, size: O(n^1) [z] ---------------------------------------- (37) IntTrsBoundProof (UPPER BOUND(ID)) Computed RUNTIME bound using CoFloCo for: hd after applying outer abstraction to obtain an ITS, resulting in: O(1) with polynomial bound: 1 ---------------------------------------- (38) Obligation: Complexity RNTS consisting of the following rules: append(z, z') -{ 4 + 2*z }-> s :|: s >= 0, s <= z' + z, z >= 0, z' >= 0 hd(z) -{ 1 }-> x :|: x >= 0, l >= 0, z = 1 + x + l ifappend(z, z', z'') -{ 1 }-> z' :|: z'' = 0, z >= 0, z' >= 0 ifappend(z, z', z'') -{ 5 + 2*l }-> 1 + x + s' :|: s' >= 0, s' <= l + z', z'' = 1 + x + l, x >= 0, l >= 0, z >= 0, z' >= 0 is_empty(z) -{ 1 }-> 1 :|: z = 0 is_empty(z) -{ 1 }-> 0 :|: x >= 0, l >= 0, z = 1 + x + l tl(z) -{ 1 }-> l :|: x >= 0, l >= 0, z = 1 + x + l Function symbols to be analyzed: Previous analysis results are: is_empty: runtime: O(1) [1], size: O(1) [1] ifappend: runtime: O(n^1) [3 + 2*z''], size: O(n^1) [z' + z''] append: runtime: O(n^1) [4 + 2*z], size: O(n^1) [z + z'] tl: runtime: O(1) [1], size: O(n^1) [z] hd: runtime: O(1) [1], size: O(n^1) [z] ---------------------------------------- (39) FinalProof (FINISHED) Computed overall runtime complexity ---------------------------------------- (40) BOUNDS(1, n^1) ---------------------------------------- (41) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (42) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: is_empty(nil) -> true is_empty(cons(x, l)) -> false hd(cons(x, l)) -> x tl(cons(x, l)) -> l append(l1, l2) -> ifappend(l1, l2, l1) ifappend(l1, l2, nil) -> l2 ifappend(l1, l2, cons(x, l)) -> cons(x, append(l, l2)) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (43) SlicingProof (LOWER BOUND(ID)) Sliced the following arguments: ifappend/0 ---------------------------------------- (44) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: is_empty(nil) -> true is_empty(cons(x, l)) -> false hd(cons(x, l)) -> x tl(cons(x, l)) -> l append(l1, l2) -> ifappend(l2, l1) ifappend(l2, nil) -> l2 ifappend(l2, cons(x, l)) -> cons(x, append(l, l2)) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (45) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (46) Obligation: Innermost TRS: Rules: is_empty(nil) -> true is_empty(cons(x, l)) -> false hd(cons(x, l)) -> x tl(cons(x, l)) -> l append(l1, l2) -> ifappend(l2, l1) ifappend(l2, nil) -> l2 ifappend(l2, cons(x, l)) -> cons(x, append(l, l2)) Types: is_empty :: nil:cons -> true:false nil :: nil:cons true :: true:false cons :: hd -> nil:cons -> nil:cons false :: true:false hd :: nil:cons -> hd tl :: nil:cons -> nil:cons append :: nil:cons -> nil:cons -> nil:cons ifappend :: nil:cons -> nil:cons -> nil:cons hole_true:false1_0 :: true:false hole_nil:cons2_0 :: nil:cons hole_hd3_0 :: hd gen_nil:cons4_0 :: Nat -> nil:cons ---------------------------------------- (47) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: append, ifappend They will be analysed ascendingly in the following order: append = ifappend ---------------------------------------- (48) Obligation: Innermost TRS: Rules: is_empty(nil) -> true is_empty(cons(x, l)) -> false hd(cons(x, l)) -> x tl(cons(x, l)) -> l append(l1, l2) -> ifappend(l2, l1) ifappend(l2, nil) -> l2 ifappend(l2, cons(x, l)) -> cons(x, append(l, l2)) Types: is_empty :: nil:cons -> true:false nil :: nil:cons true :: true:false cons :: hd -> nil:cons -> nil:cons false :: true:false hd :: nil:cons -> hd tl :: nil:cons -> nil:cons append :: nil:cons -> nil:cons -> nil:cons ifappend :: nil:cons -> nil:cons -> nil:cons hole_true:false1_0 :: true:false hole_nil:cons2_0 :: nil:cons hole_hd3_0 :: hd gen_nil:cons4_0 :: Nat -> nil:cons Generator Equations: gen_nil:cons4_0(0) <=> nil gen_nil:cons4_0(+(x, 1)) <=> cons(hole_hd3_0, gen_nil:cons4_0(x)) The following defined symbols remain to be analysed: ifappend, append They will be analysed ascendingly in the following order: append = ifappend ---------------------------------------- (49) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: ifappend(gen_nil:cons4_0(a), gen_nil:cons4_0(n6_0)) -> gen_nil:cons4_0(+(n6_0, a)), rt in Omega(1 + n6_0) Induction Base: ifappend(gen_nil:cons4_0(a), gen_nil:cons4_0(0)) ->_R^Omega(1) gen_nil:cons4_0(a) Induction Step: ifappend(gen_nil:cons4_0(a), gen_nil:cons4_0(+(n6_0, 1))) ->_R^Omega(1) cons(hole_hd3_0, append(gen_nil:cons4_0(n6_0), gen_nil:cons4_0(a))) ->_R^Omega(1) cons(hole_hd3_0, ifappend(gen_nil:cons4_0(a), gen_nil:cons4_0(n6_0))) ->_IH cons(hole_hd3_0, gen_nil:cons4_0(+(a, c7_0))) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (50) Complex Obligation (BEST) ---------------------------------------- (51) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: is_empty(nil) -> true is_empty(cons(x, l)) -> false hd(cons(x, l)) -> x tl(cons(x, l)) -> l append(l1, l2) -> ifappend(l2, l1) ifappend(l2, nil) -> l2 ifappend(l2, cons(x, l)) -> cons(x, append(l, l2)) Types: is_empty :: nil:cons -> true:false nil :: nil:cons true :: true:false cons :: hd -> nil:cons -> nil:cons false :: true:false hd :: nil:cons -> hd tl :: nil:cons -> nil:cons append :: nil:cons -> nil:cons -> nil:cons ifappend :: nil:cons -> nil:cons -> nil:cons hole_true:false1_0 :: true:false hole_nil:cons2_0 :: nil:cons hole_hd3_0 :: hd gen_nil:cons4_0 :: Nat -> nil:cons Generator Equations: gen_nil:cons4_0(0) <=> nil gen_nil:cons4_0(+(x, 1)) <=> cons(hole_hd3_0, gen_nil:cons4_0(x)) The following defined symbols remain to be analysed: ifappend, append They will be analysed ascendingly in the following order: append = ifappend ---------------------------------------- (52) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (53) BOUNDS(n^1, INF) ---------------------------------------- (54) Obligation: Innermost TRS: Rules: is_empty(nil) -> true is_empty(cons(x, l)) -> false hd(cons(x, l)) -> x tl(cons(x, l)) -> l append(l1, l2) -> ifappend(l2, l1) ifappend(l2, nil) -> l2 ifappend(l2, cons(x, l)) -> cons(x, append(l, l2)) Types: is_empty :: nil:cons -> true:false nil :: nil:cons true :: true:false cons :: hd -> nil:cons -> nil:cons false :: true:false hd :: nil:cons -> hd tl :: nil:cons -> nil:cons append :: nil:cons -> nil:cons -> nil:cons ifappend :: nil:cons -> nil:cons -> nil:cons hole_true:false1_0 :: true:false hole_nil:cons2_0 :: nil:cons hole_hd3_0 :: hd gen_nil:cons4_0 :: Nat -> nil:cons Lemmas: ifappend(gen_nil:cons4_0(a), gen_nil:cons4_0(n6_0)) -> gen_nil:cons4_0(+(n6_0, a)), rt in Omega(1 + n6_0) Generator Equations: gen_nil:cons4_0(0) <=> nil gen_nil:cons4_0(+(x, 1)) <=> cons(hole_hd3_0, gen_nil:cons4_0(x)) The following defined symbols remain to be analysed: append They will be analysed ascendingly in the following order: append = ifappend