/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 (full) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). (0) CpxTRS (1) RcToIrcProof [BOTH BOUNDS(ID, ID), 0 ms] (2) CpxTRS (3) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] (4) CpxWeightedTrs (5) CpxWeightedTrsRenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (6) CpxWeightedTrs (7) TypeInferenceProof [BOTH BOUNDS(ID, ID), 2 ms] (8) CpxTypedWeightedTrs (9) CompletionProof [UPPER BOUND(ID), 0 ms] (10) CpxTypedWeightedCompleteTrs (11) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] (12) CpxRNTS (13) CompleteCoflocoProof [FINISHED, 180 ms] (14) BOUNDS(1, n^1) (15) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (16) CpxTRS (17) SlicingProof [LOWER BOUND(ID), 0 ms] (18) CpxTRS (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), 1024 ms] (24) proven lower bound (25) LowerBoundPropagationProof [FINISHED, 0 ms] (26) 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: -(0, y) -> 0 -(x, 0) -> x -(x, s(y)) -> if(greater(x, s(y)), s(-(x, p(s(y)))), 0) p(0) -> 0 p(s(x)) -> x S is empty. Rewrite Strategy: FULL ---------------------------------------- (1) RcToIrcProof (BOTH BOUNDS(ID, ID)) Converted rc-obligation to irc-obligation. The duplicating contexts are: -([], s(y)) -(x, s([])) The defined contexts are: -(x0, []) p(s([])) [] just represents basic- or constructor-terms in the following defined contexts: -(x0, []) As the TRS is an overlay system and the defined contexts and the duplicating contexts don't overlap, we have rc = irc. ---------------------------------------- (2) 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: -(0, y) -> 0 -(x, 0) -> x -(x, s(y)) -> if(greater(x, s(y)), s(-(x, p(s(y)))), 0) p(0) -> 0 p(s(x)) -> x S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (3) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) Transformed relative TRS to weighted TRS ---------------------------------------- (4) 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: -(0, y) -> 0 [1] -(x, 0) -> x [1] -(x, s(y)) -> if(greater(x, s(y)), s(-(x, p(s(y)))), 0) [1] p(0) -> 0 [1] p(s(x)) -> x [1] Rewrite Strategy: INNERMOST ---------------------------------------- (5) CpxWeightedTrsRenamingProof (BOTH BOUNDS(ID, ID)) Renamed defined symbols to avoid conflicts with arithmetic symbols: - => minus ---------------------------------------- (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: minus(0, y) -> 0 [1] minus(x, 0) -> x [1] minus(x, s(y)) -> if(greater(x, s(y)), s(minus(x, p(s(y)))), 0) [1] p(0) -> 0 [1] p(s(x)) -> 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: minus(0, y) -> 0 [1] minus(x, 0) -> x [1] minus(x, s(y)) -> if(greater(x, s(y)), s(minus(x, p(s(y)))), 0) [1] p(0) -> 0 [1] p(s(x)) -> x [1] The TRS has the following type information: minus :: 0:s:if -> 0:s:if -> 0:s:if 0 :: 0:s:if s :: 0:s:if -> 0:s:if if :: greater -> 0:s:if -> 0:s:if -> 0:s:if greater :: 0:s:if -> 0:s:if -> greater p :: 0:s:if -> 0:s:if 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: minus(v0, v1) -> null_minus [0] p(v0) -> null_p [0] And the following fresh constants: null_minus, null_p, const ---------------------------------------- (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: minus(0, y) -> 0 [1] minus(x, 0) -> x [1] minus(x, s(y)) -> if(greater(x, s(y)), s(minus(x, p(s(y)))), 0) [1] p(0) -> 0 [1] p(s(x)) -> x [1] minus(v0, v1) -> null_minus [0] p(v0) -> null_p [0] The TRS has the following type information: minus :: 0:s:if:null_minus:null_p -> 0:s:if:null_minus:null_p -> 0:s:if:null_minus:null_p 0 :: 0:s:if:null_minus:null_p s :: 0:s:if:null_minus:null_p -> 0:s:if:null_minus:null_p if :: greater -> 0:s:if:null_minus:null_p -> 0:s:if:null_minus:null_p -> 0:s:if:null_minus:null_p greater :: 0:s:if:null_minus:null_p -> 0:s:if:null_minus:null_p -> greater p :: 0:s:if:null_minus:null_p -> 0:s:if:null_minus:null_p null_minus :: 0:s:if:null_minus:null_p null_p :: 0:s:if:null_minus:null_p const :: greater 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: 0 => 0 null_minus => 0 null_p => 0 const => 0 ---------------------------------------- (12) Obligation: Complexity RNTS consisting of the following rules: minus(z, z') -{ 1 }-> x :|: x >= 0, z = x, z' = 0 minus(z, z') -{ 1 }-> 0 :|: y >= 0, z = 0, z' = y minus(z, z') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z = v0, z' = v1 minus(z, z') -{ 1 }-> 1 + (1 + x + (1 + y)) + (1 + minus(x, p(1 + y))) + 0 :|: z' = 1 + y, x >= 0, y >= 0, z = x p(z) -{ 1 }-> x :|: x >= 0, z = 1 + x p(z) -{ 1 }-> 0 :|: z = 0 p(z) -{ 0 }-> 0 :|: v0 >= 0, z = v0 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(V1, V),0,[minus(V1, V, Out)],[V1 >= 0,V >= 0]). eq(start(V1, V),0,[p(V1, Out)],[V1 >= 0]). eq(minus(V1, V, Out),1,[],[Out = 0,V2 >= 0,V1 = 0,V = V2]). eq(minus(V1, V, Out),1,[],[Out = V3,V3 >= 0,V1 = V3,V = 0]). eq(minus(V1, V, Out),1,[p(1 + V5, Ret0111),minus(V4, Ret0111, Ret011)],[Out = 4 + Ret011 + V4 + V5,V = 1 + V5,V4 >= 0,V5 >= 0,V1 = V4]). eq(p(V1, Out),1,[],[Out = 0,V1 = 0]). eq(p(V1, Out),1,[],[Out = V6,V6 >= 0,V1 = 1 + V6]). eq(minus(V1, V, Out),0,[],[Out = 0,V8 >= 0,V7 >= 0,V1 = V8,V = V7]). eq(p(V1, Out),0,[],[Out = 0,V9 >= 0,V1 = V9]). input_output_vars(minus(V1,V,Out),[V1,V],[Out]). input_output_vars(p(V1,Out),[V1],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. non_recursive : [p/2] 1. recursive : [minus/3] 2. non_recursive : [start/2] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into p/2 1. SCC is partially evaluated into minus/3 2. SCC is partially evaluated into start/2 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations p/2 * CE 8 is refined into CE [10] * CE 7 is refined into CE [11] * CE 9 is refined into CE [12] ### Cost equations --> "Loop" of p/2 * CEs [10] --> Loop 7 * CEs [11,12] --> Loop 8 ### Ranking functions of CR p(V1,Out) #### Partial ranking functions of CR p(V1,Out) ### Specialization of cost equations minus/3 * CE 4 is refined into CE [13] * CE 3 is refined into CE [14] * CE 6 is refined into CE [15] * CE 5 is refined into CE [16,17] ### Cost equations --> "Loop" of minus/3 * CEs [17] --> Loop 9 * CEs [16] --> Loop 10 * CEs [13] --> Loop 11 * CEs [14,15] --> Loop 12 ### Ranking functions of CR minus(V1,V,Out) * RF of phase [9]: [V] #### Partial ranking functions of CR minus(V1,V,Out) * Partial RF of phase [9]: - RF of loop [9:1]: V ### Specialization of cost equations start/2 * CE 1 is refined into CE [18,19,20,21,22] * CE 2 is refined into CE [23,24] ### Cost equations --> "Loop" of start/2 * CEs [18,19,20,21,22,23,24] --> Loop 13 ### Ranking functions of CR start(V1,V) #### Partial ranking functions of CR start(V1,V) Computing Bounds ===================================== #### Cost of chains of p(V1,Out): * Chain [8]: 1 with precondition: [Out=0,V1>=0] * Chain [7]: 1 with precondition: [V1=Out+1,V1>=1] #### Cost of chains of minus(V1,V,Out): * Chain [[9],12]: 2*it(9)+1 Such that:it(9) =< V with precondition: [V1>=0,V>=1,Out>=V+V1+3] * Chain [[9],11]: 2*it(9)+1 Such that:it(9) =< V with precondition: [V1>=0,V>=1,Out+1>=5*V+2*V1] * Chain [[9],10,12]: 2*it(9)+3 Such that:it(9) =< V with precondition: [V1>=0,V>=2,Out>=2*V+2*V1+5] * Chain [[9],10,11]: 2*it(9)+3 Such that:it(9) =< V with precondition: [V1>=0,V>=2,Out>=3*V1+2*V+5] * Chain [12]: 1 with precondition: [Out=0,V1>=0,V>=0] * Chain [11]: 1 with precondition: [V=0,V1=Out,V1>=0] * Chain [10,12]: 3 with precondition: [V+V1+3=Out,V>=1,Out>=V+3] * Chain [10,11]: 3 with precondition: [V+2*V1+3=Out,V1>=0,V>=1] #### Cost of chains of start(V1,V): * Chain [13]: 8*s(5)+3 Such that:aux(2) =< V s(5) =< aux(2) with precondition: [V1>=0] Closed-form bounds of start(V1,V): ------------------------------------- * Chain [13] with precondition: [V1>=0] - Upper bound: nat(V)*8+3 - Complexity: n ### Maximum cost of start(V1,V): nat(V)*8+3 Asymptotic class: n * Total analysis performed in 107 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: -(0', y) -> 0' -(x, 0') -> x -(x, s(y)) -> if(greater(x, s(y)), s(-(x, p(s(y)))), 0') p(0') -> 0' p(s(x)) -> x S is empty. Rewrite Strategy: FULL ---------------------------------------- (17) SlicingProof (LOWER BOUND(ID)) Sliced the following arguments: if/0 if/2 greater/0 greater/1 ---------------------------------------- (18) 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: -(0', y) -> 0' -(x, 0') -> x -(x, s(y)) -> if(s(-(x, p(s(y))))) p(0') -> 0' p(s(x)) -> x S is empty. Rewrite Strategy: FULL ---------------------------------------- (19) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (20) Obligation: TRS: Rules: -(0', y) -> 0' -(x, 0') -> x -(x, s(y)) -> if(s(-(x, p(s(y))))) p(0') -> 0' p(s(x)) -> x Types: - :: 0':s:if -> 0':s:if -> 0':s:if 0' :: 0':s:if s :: 0':s:if -> 0':s:if if :: 0':s:if -> 0':s:if p :: 0':s:if -> 0':s:if hole_0':s:if1_0 :: 0':s:if gen_0':s:if2_0 :: Nat -> 0':s:if ---------------------------------------- (21) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: - ---------------------------------------- (22) Obligation: TRS: Rules: -(0', y) -> 0' -(x, 0') -> x -(x, s(y)) -> if(s(-(x, p(s(y))))) p(0') -> 0' p(s(x)) -> x Types: - :: 0':s:if -> 0':s:if -> 0':s:if 0' :: 0':s:if s :: 0':s:if -> 0':s:if if :: 0':s:if -> 0':s:if p :: 0':s:if -> 0':s:if hole_0':s:if1_0 :: 0':s:if gen_0':s:if2_0 :: Nat -> 0':s:if Generator Equations: gen_0':s:if2_0(0) <=> 0' gen_0':s:if2_0(+(x, 1)) <=> s(gen_0':s:if2_0(x)) The following defined symbols remain to be analysed: - ---------------------------------------- (23) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: -(gen_0':s:if2_0(a), gen_0':s:if2_0(n4_0)) -> *3_0, rt in Omega(n4_0) Induction Base: -(gen_0':s:if2_0(a), gen_0':s:if2_0(0)) Induction Step: -(gen_0':s:if2_0(a), gen_0':s:if2_0(+(n4_0, 1))) ->_R^Omega(1) if(s(-(gen_0':s:if2_0(a), p(s(gen_0':s:if2_0(n4_0)))))) ->_R^Omega(1) if(s(-(gen_0':s:if2_0(a), gen_0':s:if2_0(n4_0)))) ->_IH if(s(*3_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: TRS: Rules: -(0', y) -> 0' -(x, 0') -> x -(x, s(y)) -> if(s(-(x, p(s(y))))) p(0') -> 0' p(s(x)) -> x Types: - :: 0':s:if -> 0':s:if -> 0':s:if 0' :: 0':s:if s :: 0':s:if -> 0':s:if if :: 0':s:if -> 0':s:if p :: 0':s:if -> 0':s:if hole_0':s:if1_0 :: 0':s:if gen_0':s:if2_0 :: Nat -> 0':s:if Generator Equations: gen_0':s:if2_0(0) <=> 0' gen_0':s:if2_0(+(x, 1)) <=> s(gen_0':s:if2_0(x)) The following defined symbols remain to be analysed: - ---------------------------------------- (25) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (26) BOUNDS(n^1, INF)