/export/starexec/sandbox/solver/bin/starexec_run_complexity /export/starexec/sandbox/benchmark/theBenchmark.xml /export/starexec/sandbox/output/output_files -------------------------------------------------------------------------------- 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 Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). (0) CpxTRS (1) NestedDefinedSymbolProof [UPPER BOUND(ID), 0 ms] (2) CpxTRS (3) RcToIrcProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxTRS (5) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CpxWeightedTrs (7) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (8) CpxTypedWeightedTrs (9) CompletionProof [UPPER BOUND(ID), 0 ms] (10) CpxTypedWeightedCompleteTrs (11) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 2 ms] (12) CpxRNTS (13) CompleteCoflocoProof [FINISHED, 200 ms] (14) BOUNDS(1, n^1) (15) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (16) CpxTRS (17) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (18) typed CpxTrs (19) OrderProof [LOWER BOUND(ID), 0 ms] (20) typed CpxTrs (21) RewriteLemmaProof [LOWER BOUND(ID), 6178 ms] (22) proven lower bound (23) LowerBoundPropagationProof [FINISHED, 0 ms] (24) BOUNDS(n^1, INF) ---------------------------------------- (0) Obligation: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). The TRS R consists of the following rules: f(a) -> b f(c) -> d f(g(x, y)) -> g(f(x), f(y)) f(h(x, y)) -> g(h(y, f(x)), h(x, f(y))) g(x, x) -> h(e, x) S is empty. Rewrite Strategy: FULL ---------------------------------------- (1) NestedDefinedSymbolProof (UPPER BOUND(ID)) The following defined symbols can occur below the 0th argument of g: f, g The following defined symbols can occur below the 1th argument of g: f, g Hence, the left-hand sides of the following rules are not basic-reachable and can be removed: f(g(x, y)) -> g(f(x), f(y)) ---------------------------------------- (2) Obligation: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(1, n^1). The TRS R consists of the following rules: f(a) -> b f(c) -> d f(h(x, y)) -> g(h(y, f(x)), h(x, f(y))) g(x, x) -> h(e, x) S is empty. Rewrite Strategy: FULL ---------------------------------------- (3) RcToIrcProof (BOTH BOUNDS(ID, ID)) Converted rc-obligation to irc-obligation. The duplicating contexts are: f(h(x, [])) f(h([], y)) The defined contexts are: g(h(x0, []), h(x2, x3)) g(h(x0, x1), h(x2, [])) As the TRS is an overlay system and the defined contexts and the duplicating contexts don't overlap, we have rc = irc. ---------------------------------------- (4) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(1, n^1). The TRS R consists of the following rules: f(a) -> b f(c) -> d f(h(x, y)) -> g(h(y, f(x)), h(x, f(y))) g(x, x) -> h(e, x) S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (5) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (6) Obligation: The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^1). The TRS R consists of the following rules: f(a) -> b [1] f(c) -> d [1] f(h(x, y)) -> g(h(y, f(x)), h(x, f(y))) [1] g(x, x) -> h(e, x) [1] Rewrite Strategy: INNERMOST ---------------------------------------- (7) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (8) Obligation: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: f(a) -> b [1] f(c) -> d [1] f(h(x, y)) -> g(h(y, f(x)), h(x, f(y))) [1] g(x, x) -> h(e, x) [1] The TRS has the following type information: f :: a:b:c:d:h:e -> a:b:c:d:h:e a :: a:b:c:d:h:e b :: a:b:c:d:h:e c :: a:b:c:d:h:e d :: a:b:c:d:h:e h :: a:b:c:d:h:e -> a:b:c:d:h:e -> a:b:c:d:h:e g :: a:b:c:d:h:e -> a:b:c:d:h:e -> a:b:c:d:h:e e :: a:b:c:d:h:e Rewrite Strategy: INNERMOST ---------------------------------------- (9) CompletionProof (UPPER BOUND(ID)) The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: f(v0) -> null_f [0] g(v0, v1) -> null_g [0] And the following fresh constants: null_f, null_g ---------------------------------------- (10) Obligation: Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules: f(a) -> b [1] f(c) -> d [1] f(h(x, y)) -> g(h(y, f(x)), h(x, f(y))) [1] g(x, x) -> h(e, x) [1] f(v0) -> null_f [0] g(v0, v1) -> null_g [0] The TRS has the following type information: f :: a:b:c:d:h:e:null_f:null_g -> a:b:c:d:h:e:null_f:null_g a :: a:b:c:d:h:e:null_f:null_g b :: a:b:c:d:h:e:null_f:null_g c :: a:b:c:d:h:e:null_f:null_g d :: a:b:c:d:h:e:null_f:null_g h :: a:b:c:d:h:e:null_f:null_g -> a:b:c:d:h:e:null_f:null_g -> a:b:c:d:h:e:null_f:null_g g :: a:b:c:d:h:e:null_f:null_g -> a:b:c:d:h:e:null_f:null_g -> a:b:c:d:h:e:null_f:null_g e :: a:b:c:d:h:e:null_f:null_g null_f :: a:b:c:d:h:e:null_f:null_g null_g :: a:b:c:d:h:e:null_f:null_g Rewrite Strategy: INNERMOST ---------------------------------------- (11) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: a => 0 b => 1 c => 2 d => 3 e => 4 null_f => 0 null_g => 0 ---------------------------------------- (12) Obligation: Complexity RNTS consisting of the following rules: f(z) -{ 1 }-> g(1 + y + f(x), 1 + x + f(y)) :|: z = 1 + x + y, x >= 0, y >= 0 f(z) -{ 1 }-> 3 :|: z = 2 f(z) -{ 1 }-> 1 :|: z = 0 f(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 g(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 g(z, z') -{ 1 }-> 1 + 4 + x :|: z' = x, x >= 0, z = x Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (13) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V, V3),0,[f(V, Out)],[V >= 0]). eq(start(V, V3),0,[g(V, V3, Out)],[V >= 0,V3 >= 0]). eq(f(V, Out),1,[],[Out = 1,V = 0]). eq(f(V, Out),1,[],[Out = 3,V = 2]). eq(f(V, Out),1,[f(V2, Ret01),f(V1, Ret11),g(1 + V1 + Ret01, 1 + V2 + Ret11, Ret)],[Out = Ret,V = 1 + V1 + V2,V2 >= 0,V1 >= 0]). eq(g(V, V3, Out),1,[],[Out = 5 + V4,V3 = V4,V4 >= 0,V = V4]). eq(f(V, Out),0,[],[Out = 0,V5 >= 0,V = V5]). eq(g(V, V3, Out),0,[],[Out = 0,V7 >= 0,V6 >= 0,V = V7,V3 = V6]). input_output_vars(f(V,Out),[V],[Out]). input_output_vars(g(V,V3,Out),[V,V3],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. non_recursive : [g/3] 1. recursive [non_tail,multiple] : [f/2] 2. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into g/3 1. SCC is partially evaluated into f/2 2. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations g/3 * CE 7 is refined into CE [9] * CE 8 is refined into CE [10] ### Cost equations --> "Loop" of g/3 * CEs [9] --> Loop 8 * CEs [10] --> Loop 9 ### Ranking functions of CR g(V,V3,Out) #### Partial ranking functions of CR g(V,V3,Out) ### Specialization of cost equations f/2 * CE 6 is refined into CE [11] * CE 4 is refined into CE [12] * CE 3 is refined into CE [13] * CE 5 is refined into CE [14,15] ### Cost equations --> "Loop" of f/2 * CEs [15] --> Loop 10 * CEs [14] --> Loop 11 * CEs [11] --> Loop 12 * CEs [12] --> Loop 13 * CEs [13] --> Loop 14 ### Ranking functions of CR f(V,Out) * RF of phase [10,11]: [V] #### Partial ranking functions of CR f(V,Out) * Partial RF of phase [10,11]: - RF of loop [10:1,10:2,11:1,11:2]: V ### Specialization of cost equations start/2 * CE 1 is refined into CE [16,17,18] * CE 2 is refined into CE [19,20] ### Cost equations --> "Loop" of start/2 * CEs [20] --> Loop 15 * CEs [16,17,18,19] --> Loop 16 ### Ranking functions of CR start(V,V3) #### Partial ranking functions of CR start(V,V3) Computing Bounds ===================================== #### Cost of chains of g(V,V3,Out): * Chain [9]: 0 with precondition: [Out=0,V>=0,V3>=0] * Chain [8]: 1 with precondition: [V=V3,V+5=Out,V>=0] #### Cost of chains of f(V,Out): * Chain [14]: 1 with precondition: [V=0,Out=1] * Chain [13]: 1 with precondition: [V=2,Out=3] * Chain [12]: 0 with precondition: [Out=0,V>=0] * Chain [multiple([10,11],[[14],[13],[12]])]: 2*it(10)+1*it(11)+1*it([13])+1*it([14])+0 Such that:it([13]) =< V/3+1/3 aux(1) =< V+1 aux(2) =< 10/9*V+1/9 aux(3) =< 12/11*V+1/11 it([13]) =< aux(1) it([14]) =< aux(1) it(10) =< aux(2) it(11) =< aux(2) it([13]) =< aux(2) it(11) =< aux(3) it([13]) =< aux(3) with precondition: [V>=1,Out>=0,7*V+7>=2*Out] #### Cost of chains of start(V,V3): * Chain [16]: 1*s(9)+1*s(12)+2*s(13)+1*s(14)+1 Such that:s(8) =< V+1 s(9) =< V/3+1/3 s(10) =< 10/9*V+1/9 s(11) =< 12/11*V+1/11 s(9) =< s(8) s(12) =< s(8) s(13) =< s(10) s(14) =< s(10) s(9) =< s(10) s(14) =< s(11) s(9) =< s(11) with precondition: [V>=0] * Chain [15]: 1 with precondition: [V=V3,V>=0] Closed-form bounds of start(V,V3): ------------------------------------- * Chain [16] with precondition: [V>=0] - Upper bound: 14/3*V+8/3 - Complexity: n * Chain [15] with precondition: [V=V3,V>=0] - Upper bound: 1 - Complexity: constant ### Maximum cost of start(V,V3): 14/3*V+8/3 Asymptotic class: n * Total analysis performed in 128 ms. ---------------------------------------- (14) BOUNDS(1, n^1) ---------------------------------------- (15) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (16) Obligation: The Runtime Complexity (full) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). The TRS R consists of the following rules: f(a) -> b f(c) -> d f(g(x, y)) -> g(f(x), f(y)) f(h(x, y)) -> g(h(y, f(x)), h(x, f(y))) g(x, x) -> h(e, x) S is empty. Rewrite Strategy: FULL ---------------------------------------- (17) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (18) Obligation: TRS: Rules: f(a) -> b f(c) -> d f(g(x, y)) -> g(f(x), f(y)) f(h(x, y)) -> g(h(y, f(x)), h(x, f(y))) g(x, x) -> h(e, x) Types: f :: a:b:c:d:h:e -> a:b:c:d:h:e a :: a:b:c:d:h:e b :: a:b:c:d:h:e c :: a:b:c:d:h:e d :: a:b:c:d:h:e g :: a:b:c:d:h:e -> a:b:c:d:h:e -> a:b:c:d:h:e h :: a:b:c:d:h:e -> a:b:c:d:h:e -> a:b:c:d:h:e e :: a:b:c:d:h:e hole_a:b:c:d:h:e1_0 :: a:b:c:d:h:e gen_a:b:c:d:h:e2_0 :: Nat -> a:b:c:d:h:e ---------------------------------------- (19) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: f ---------------------------------------- (20) Obligation: TRS: Rules: f(a) -> b f(c) -> d f(g(x, y)) -> g(f(x), f(y)) f(h(x, y)) -> g(h(y, f(x)), h(x, f(y))) g(x, x) -> h(e, x) Types: f :: a:b:c:d:h:e -> a:b:c:d:h:e a :: a:b:c:d:h:e b :: a:b:c:d:h:e c :: a:b:c:d:h:e d :: a:b:c:d:h:e g :: a:b:c:d:h:e -> a:b:c:d:h:e -> a:b:c:d:h:e h :: a:b:c:d:h:e -> a:b:c:d:h:e -> a:b:c:d:h:e e :: a:b:c:d:h:e hole_a:b:c:d:h:e1_0 :: a:b:c:d:h:e gen_a:b:c:d:h:e2_0 :: Nat -> a:b:c:d:h:e Generator Equations: gen_a:b:c:d:h:e2_0(0) <=> a gen_a:b:c:d:h:e2_0(+(x, 1)) <=> h(a, gen_a:b:c:d:h:e2_0(x)) The following defined symbols remain to be analysed: f ---------------------------------------- (21) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: f(gen_a:b:c:d:h:e2_0(n4_0)) -> *3_0, rt in Omega(n4_0) Induction Base: f(gen_a:b:c:d:h:e2_0(0)) Induction Step: f(gen_a:b:c:d:h:e2_0(+(n4_0, 1))) ->_R^Omega(1) g(h(gen_a:b:c:d:h:e2_0(n4_0), f(a)), h(a, f(gen_a:b:c:d:h:e2_0(n4_0)))) ->_R^Omega(1) g(h(gen_a:b:c:d:h:e2_0(n4_0), b), h(a, f(gen_a:b:c:d:h:e2_0(n4_0)))) ->_IH g(h(gen_a:b:c:d:h:e2_0(n4_0), b), h(a, *3_0)) We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (22) Obligation: Proved the lower bound n^1 for the following obligation: TRS: Rules: f(a) -> b f(c) -> d f(g(x, y)) -> g(f(x), f(y)) f(h(x, y)) -> g(h(y, f(x)), h(x, f(y))) g(x, x) -> h(e, x) Types: f :: a:b:c:d:h:e -> a:b:c:d:h:e a :: a:b:c:d:h:e b :: a:b:c:d:h:e c :: a:b:c:d:h:e d :: a:b:c:d:h:e g :: a:b:c:d:h:e -> a:b:c:d:h:e -> a:b:c:d:h:e h :: a:b:c:d:h:e -> a:b:c:d:h:e -> a:b:c:d:h:e e :: a:b:c:d:h:e hole_a:b:c:d:h:e1_0 :: a:b:c:d:h:e gen_a:b:c:d:h:e2_0 :: Nat -> a:b:c:d:h:e Generator Equations: gen_a:b:c:d:h:e2_0(0) <=> a gen_a:b:c:d:h:e2_0(+(x, 1)) <=> h(a, gen_a:b:c:d:h:e2_0(x)) The following defined symbols remain to be analysed: f ---------------------------------------- (23) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (24) BOUNDS(n^1, INF)