/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^2)) 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^2). (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) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 4 ms] (8) CpxRNTS (9) CompleteCoflocoProof [FINISHED, 2753 ms] (10) BOUNDS(1, n^2) (11) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] (12) CpxTRS (13) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] (14) typed CpxTrs (15) OrderProof [LOWER BOUND(ID), 0 ms] (16) typed CpxTrs (17) RewriteLemmaProof [LOWER BOUND(ID), 258 ms] (18) BEST (19) proven lower bound (20) LowerBoundPropagationProof [FINISHED, 0 ms] (21) BOUNDS(n^1, INF) (22) typed CpxTrs ---------------------------------------- (0) Obligation: The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). The TRS R consists of the following rules: cond1(true, x, y, z) -> cond2(gr(x, 0), x, y, z) cond2(true, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), p(x), y, z) cond2(false, x, y, z) -> cond3(gr(y, 0), x, y, z) cond3(true, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), x, p(y), z) cond3(false, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), x, y, z) gr(0, x) -> false gr(s(x), 0) -> true gr(s(x), s(y)) -> gr(x, y) or(false, false) -> false or(true, x) -> true or(x, true) -> true p(0) -> 0 p(s(x)) -> x 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^2). The TRS R consists of the following rules: cond1(true, x, y, z) -> cond2(gr(x, 0), x, y, z) [1] cond2(true, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), p(x), y, z) [1] cond2(false, x, y, z) -> cond3(gr(y, 0), x, y, z) [1] cond3(true, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), x, p(y), z) [1] cond3(false, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), x, y, z) [1] gr(0, x) -> false [1] gr(s(x), 0) -> true [1] gr(s(x), s(y)) -> gr(x, y) [1] or(false, false) -> false [1] or(true, x) -> true [1] or(x, true) -> true [1] p(0) -> 0 [1] p(s(x)) -> x [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: cond1(true, x, y, z) -> cond2(gr(x, 0), x, y, z) [1] cond2(true, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), p(x), y, z) [1] cond2(false, x, y, z) -> cond3(gr(y, 0), x, y, z) [1] cond3(true, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), x, p(y), z) [1] cond3(false, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), x, y, z) [1] gr(0, x) -> false [1] gr(s(x), 0) -> true [1] gr(s(x), s(y)) -> gr(x, y) [1] or(false, false) -> false [1] or(true, x) -> true [1] or(x, true) -> true [1] p(0) -> 0 [1] p(s(x)) -> x [1] The TRS has the following type information: cond1 :: true:false -> 0:s -> 0:s -> 0:s -> cond1:cond2:cond3 true :: true:false cond2 :: true:false -> 0:s -> 0:s -> 0:s -> cond1:cond2:cond3 gr :: 0:s -> 0:s -> true:false 0 :: 0:s or :: true:false -> true:false -> true:false p :: 0:s -> 0:s false :: true:false cond3 :: true:false -> 0:s -> 0:s -> 0:s -> cond1:cond2:cond3 s :: 0:s -> 0:s Rewrite Strategy: INNERMOST ---------------------------------------- (5) 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: cond1(v0, v1, v2, v3) -> null_cond1 [0] And the following fresh constants: null_cond1 ---------------------------------------- (6) 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: cond1(true, x, y, z) -> cond2(gr(x, 0), x, y, z) [1] cond2(true, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), p(x), y, z) [1] cond2(false, x, y, z) -> cond3(gr(y, 0), x, y, z) [1] cond3(true, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), x, p(y), z) [1] cond3(false, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), x, y, z) [1] gr(0, x) -> false [1] gr(s(x), 0) -> true [1] gr(s(x), s(y)) -> gr(x, y) [1] or(false, false) -> false [1] or(true, x) -> true [1] or(x, true) -> true [1] p(0) -> 0 [1] p(s(x)) -> x [1] cond1(v0, v1, v2, v3) -> null_cond1 [0] The TRS has the following type information: cond1 :: true:false -> 0:s -> 0:s -> 0:s -> null_cond1 true :: true:false cond2 :: true:false -> 0:s -> 0:s -> 0:s -> null_cond1 gr :: 0:s -> 0:s -> true:false 0 :: 0:s or :: true:false -> true:false -> true:false p :: 0:s -> 0:s false :: true:false cond3 :: true:false -> 0:s -> 0:s -> 0:s -> null_cond1 s :: 0:s -> 0:s null_cond1 :: null_cond1 Rewrite Strategy: INNERMOST ---------------------------------------- (7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. The constant constructors are abstracted as follows: true => 1 0 => 0 false => 0 null_cond1 => 0 ---------------------------------------- (8) Obligation: Complexity RNTS consisting of the following rules: cond1(z', z'', z1, z2) -{ 1 }-> cond2(gr(x, 0), x, y, z) :|: z1 = y, z >= 0, z2 = z, x >= 0, y >= 0, z'' = x, z' = 1 cond1(z', z'', z1, z2) -{ 0 }-> 0 :|: z2 = v3, v0 >= 0, z1 = v2, v1 >= 0, z'' = v1, v2 >= 0, v3 >= 0, z' = v0 cond2(z', z'', z1, z2) -{ 1 }-> cond3(gr(y, 0), x, y, z) :|: z1 = y, z >= 0, z2 = z, x >= 0, y >= 0, z'' = x, z' = 0 cond2(z', z'', z1, z2) -{ 1 }-> cond1(or(gr(x, z), gr(y, z)), p(x), y, z) :|: z1 = y, z >= 0, z2 = z, x >= 0, y >= 0, z'' = x, z' = 1 cond3(z', z'', z1, z2) -{ 1 }-> cond1(or(gr(x, z), gr(y, z)), x, y, z) :|: z1 = y, z >= 0, z2 = z, x >= 0, y >= 0, z'' = x, z' = 0 cond3(z', z'', z1, z2) -{ 1 }-> cond1(or(gr(x, z), gr(y, z)), x, p(y), z) :|: z1 = y, z >= 0, z2 = z, x >= 0, y >= 0, z'' = x, z' = 1 gr(z', z'') -{ 1 }-> gr(x, y) :|: z' = 1 + x, x >= 0, y >= 0, z'' = 1 + y gr(z', z'') -{ 1 }-> 1 :|: z'' = 0, z' = 1 + x, x >= 0 gr(z', z'') -{ 1 }-> 0 :|: x >= 0, z'' = x, z' = 0 or(z', z'') -{ 1 }-> 1 :|: x >= 0, z'' = x, z' = 1 or(z', z'') -{ 1 }-> 1 :|: z' = x, x >= 0, z'' = 1 or(z', z'') -{ 1 }-> 0 :|: z'' = 0, z' = 0 p(z') -{ 1 }-> x :|: z' = 1 + x, x >= 0 p(z') -{ 1 }-> 0 :|: z' = 0 Only complete derivations are relevant for the runtime complexity. ---------------------------------------- (9) CompleteCoflocoProof (FINISHED) Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: eq(start(V, V1, V6, V2),0,[cond1(V, V1, V6, V2, Out)],[V >= 0,V1 >= 0,V6 >= 0,V2 >= 0]). eq(start(V, V1, V6, V2),0,[cond2(V, V1, V6, V2, Out)],[V >= 0,V1 >= 0,V6 >= 0,V2 >= 0]). eq(start(V, V1, V6, V2),0,[cond3(V, V1, V6, V2, Out)],[V >= 0,V1 >= 0,V6 >= 0,V2 >= 0]). eq(start(V, V1, V6, V2),0,[gr(V, V1, Out)],[V >= 0,V1 >= 0]). eq(start(V, V1, V6, V2),0,[or(V, V1, Out)],[V >= 0,V1 >= 0]). eq(start(V, V1, V6, V2),0,[p(V, Out)],[V >= 0]). eq(cond1(V, V1, V6, V2, Out),1,[gr(V4, 0, Ret0),cond2(Ret0, V4, V3, V5, Ret)],[Out = Ret,V6 = V3,V5 >= 0,V2 = V5,V4 >= 0,V3 >= 0,V1 = V4,V = 1]). eq(cond2(V, V1, V6, V2, Out),1,[gr(V7, V8, Ret00),gr(V9, V8, Ret01),or(Ret00, Ret01, Ret02),p(V7, Ret1),cond1(Ret02, Ret1, V9, V8, Ret2)],[Out = Ret2,V6 = V9,V8 >= 0,V2 = V8,V7 >= 0,V9 >= 0,V1 = V7,V = 1]). eq(cond2(V, V1, V6, V2, Out),1,[gr(V10, 0, Ret03),cond3(Ret03, V11, V10, V12, Ret3)],[Out = Ret3,V6 = V10,V12 >= 0,V2 = V12,V11 >= 0,V10 >= 0,V1 = V11,V = 0]). eq(cond3(V, V1, V6, V2, Out),1,[gr(V13, V14, Ret001),gr(V15, V14, Ret011),or(Ret001, Ret011, Ret04),p(V15, Ret21),cond1(Ret04, V13, Ret21, V14, Ret4)],[Out = Ret4,V6 = V15,V14 >= 0,V2 = V14,V13 >= 0,V15 >= 0,V1 = V13,V = 1]). eq(cond3(V, V1, V6, V2, Out),1,[gr(V17, V18, Ret002),gr(V16, V18, Ret012),or(Ret002, Ret012, Ret05),cond1(Ret05, V17, V16, V18, Ret5)],[Out = Ret5,V6 = V16,V18 >= 0,V2 = V18,V17 >= 0,V16 >= 0,V1 = V17,V = 0]). eq(gr(V, V1, Out),1,[],[Out = 0,V19 >= 0,V1 = V19,V = 0]). eq(gr(V, V1, Out),1,[],[Out = 1,V1 = 0,V = 1 + V20,V20 >= 0]). eq(gr(V, V1, Out),1,[gr(V22, V21, Ret6)],[Out = Ret6,V = 1 + V22,V22 >= 0,V21 >= 0,V1 = 1 + V21]). eq(or(V, V1, Out),1,[],[Out = 0,V1 = 0,V = 0]). eq(or(V, V1, Out),1,[],[Out = 1,V23 >= 0,V1 = V23,V = 1]). eq(or(V, V1, Out),1,[],[Out = 1,V = V24,V24 >= 0,V1 = 1]). eq(p(V, Out),1,[],[Out = 0,V = 0]). eq(p(V, Out),1,[],[Out = V25,V = 1 + V25,V25 >= 0]). eq(cond1(V, V1, V6, V2, Out),0,[],[Out = 0,V2 = V28,V27 >= 0,V6 = V29,V26 >= 0,V1 = V26,V29 >= 0,V28 >= 0,V = V27]). input_output_vars(cond1(V,V1,V6,V2,Out),[V,V1,V6,V2],[Out]). input_output_vars(cond2(V,V1,V6,V2,Out),[V,V1,V6,V2],[Out]). input_output_vars(cond3(V,V1,V6,V2,Out),[V,V1,V6,V2],[Out]). input_output_vars(gr(V,V1,Out),[V,V1],[Out]). input_output_vars(or(V,V1,Out),[V,V1],[Out]). input_output_vars(p(V,Out),[V],[Out]). CoFloCo proof output: Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [gr/3] 1. non_recursive : [or/3] 2. non_recursive : [p/2] 3. recursive : [cond1/5,cond2/5,cond3/5] 4. non_recursive : [start/4] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into gr/3 1. SCC is partially evaluated into or/3 2. SCC is partially evaluated into p/2 3. SCC is partially evaluated into cond1/5 4. SCC is partially evaluated into start/4 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations gr/3 * CE 12 is refined into CE [22] * CE 11 is refined into CE [23] * CE 10 is refined into CE [24] ### Cost equations --> "Loop" of gr/3 * CEs [23] --> Loop 14 * CEs [24] --> Loop 15 * CEs [22] --> Loop 16 ### Ranking functions of CR gr(V,V1,Out) * RF of phase [16]: [V,V1] #### Partial ranking functions of CR gr(V,V1,Out) * Partial RF of phase [16]: - RF of loop [16:1]: V V1 ### Specialization of cost equations or/3 * CE 15 is refined into CE [25] * CE 14 is refined into CE [26] * CE 13 is refined into CE [27] ### Cost equations --> "Loop" of or/3 * CEs [25] --> Loop 17 * CEs [26] --> Loop 18 * CEs [27] --> Loop 19 ### Ranking functions of CR or(V,V1,Out) #### Partial ranking functions of CR or(V,V1,Out) ### Specialization of cost equations p/2 * CE 17 is refined into CE [28] * CE 16 is refined into CE [29] ### Cost equations --> "Loop" of p/2 * CEs [28] --> Loop 20 * CEs [29] --> Loop 21 ### Ranking functions of CR p(V,Out) #### Partial ranking functions of CR p(V,Out) ### Specialization of cost equations cond1/5 * CE 21 is refined into CE [30] * CE 18 is refined into CE [31,32,33,34,35,36,37,38,39,40] * CE 19 is refined into CE [41,42,43] * CE 20 is refined into CE [44] ### Cost equations --> "Loop" of cond1/5 * CEs [39,40] --> Loop 22 * CEs [38] --> Loop 23 * CEs [36] --> Loop 24 * CEs [35] --> Loop 25 * CEs [32,33] --> Loop 26 * CEs [37] --> Loop 27 * CEs [34] --> Loop 28 * CEs [31] --> Loop 29 * CEs [43] --> Loop 30 * CEs [42] --> Loop 31 * CEs [41] --> Loop 32 * CEs [44] --> Loop 33 * CEs [30] --> Loop 34 ### Ranking functions of CR cond1(V,V1,V6,V2,Out) * RF of phase [22]: [V1-1,V1-V2] * RF of phase [23]: [V1-1,V1-V2,V1-V6] * RF of phase [24]: [V1] * RF of phase [26]: [V1] * RF of phase [27]: [V1-1,V1-V2] * RF of phase [29]: [V1] * RF of phase [30]: [V6-1,V6-V2] * RF of phase [32]: [V6] #### Partial ranking functions of CR cond1(V,V1,V6,V2,Out) * Partial RF of phase [22]: - RF of loop [22:1]: V1-1 V1-V2 * Partial RF of phase [23]: - RF of loop [23:1]: V1-1 V1-V2 V1-V6 * Partial RF of phase [24]: - RF of loop [24:1]: V1 * Partial RF of phase [26]: - RF of loop [26:1]: V1 * Partial RF of phase [27]: - RF of loop [27:1]: V1-1 V1-V2 * Partial RF of phase [29]: - RF of loop [29:1]: V1 * Partial RF of phase [30]: - RF of loop [30:1]: V6-1 V6-V2 * Partial RF of phase [32]: - RF of loop [32:1]: V6 ### Specialization of cost equations start/4 * CE 1 is refined into CE [45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75] * CE 5 is refined into CE [76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106] * CE 2 is refined into CE [107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131] * CE 3 is refined into CE [132,133,134,135,136,137] * CE 4 is refined into CE [138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161] * CE 6 is refined into CE [162,163,164,165,166,167,168,169,170,171,172,173] * CE 7 is refined into CE [174,175,176,177] * CE 8 is refined into CE [178,179,180] * CE 9 is refined into CE [181,182] ### Cost equations --> "Loop" of start/4 * CEs [94] --> Loop 35 * CEs [68] --> Loop 36 * CEs [71,74] --> Loop 37 * CEs [102,105] --> Loop 38 * CEs [99] --> Loop 39 * CEs [86,89] --> Loop 40 * CEs [59,91,167] --> Loop 41 * CEs [64,65,66,96,97,168] --> Loop 42 * CEs [51,52,83,84,166] --> Loop 43 * CEs [62,180] --> Loop 44 * CEs [53,54,55,56,57,58,85,87,88,90,169] --> Loop 45 * CEs [48,79,164] --> Loop 46 * CEs [49,50,80,81,82,162,165] --> Loop 47 * CEs [46,47,77,78,163,175] --> Loop 48 * CEs [45,60,61,63,67,69,70,72,73,75,76,92,93,95,98,100,101,103,104,106,170,171,172,173,176,177,179,182] --> Loop 49 * CEs [107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,174,178,181] --> Loop 50 ### Ranking functions of CR start(V,V1,V6,V2) #### Partial ranking functions of CR start(V,V1,V6,V2) Computing Bounds ===================================== #### Cost of chains of gr(V,V1,Out): * Chain [[16],15]: 1*it(16)+1 Such that:it(16) =< V with precondition: [Out=0,V>=1,V1>=V] * Chain [[16],14]: 1*it(16)+1 Such that:it(16) =< V1 with precondition: [Out=1,V1>=1,V>=V1+1] * Chain [15]: 1 with precondition: [V=0,Out=0,V1>=0] * Chain [14]: 1 with precondition: [V1=0,Out=1,V>=1] #### Cost of chains of or(V,V1,Out): * Chain [19]: 1 with precondition: [V=0,V1=0,Out=0] * Chain [18]: 1 with precondition: [V=1,Out=1,V1>=0] * Chain [17]: 1 with precondition: [V1=1,Out=1,V>=0] #### Cost of chains of p(V,Out): * Chain [21]: 1 with precondition: [V=0,Out=0] * Chain [20]: 1 with precondition: [V=Out+1,V>=1] #### Cost of chains of cond1(V,V1,V6,V2,Out): * Chain [[32],34]: 9*it(32)+0 Such that:it(32) =< V6 with precondition: [V=1,V1=0,V2=0,Out=0,V6>=1] * Chain [[32],33,34]: 9*it(32)+8 Such that:it(32) =< V6 with precondition: [V=1,V1=0,V2=0,Out=0,V6>=1] * Chain [[30],34]: 9*it(30)+1*s(3)+0 Such that:it(30) =< V6-V2 aux(1) =< V2 s(3) =< it(30)*aux(1) with precondition: [V=1,V1=0,Out=0,V2>=1,V6>=V2+1] * Chain [[30],31,34]: 9*it(30)+1*s(3)+1*s(4)+9 Such that:it(30) =< V6-V2 aux(2) =< V2 s(4) =< aux(2) s(3) =< it(30)*aux(2) with precondition: [V=1,V1=0,Out=0,V2>=1,V6>=V2+1] * Chain [[29],34]: 7*it(29)+0 Such that:it(29) =< V1 with precondition: [V=1,V6=0,V2=0,Out=0,V1>=1] * Chain [[29],33,34]: 7*it(29)+8 Such that:it(29) =< V1 with precondition: [V=1,V6=0,V2=0,Out=0,V1>=1] * Chain [[27],34]: 7*it(27)+1*s(7)+0 Such that:it(27) =< V1-V2 aux(3) =< V2 s(7) =< it(27)*aux(3) with precondition: [V=1,V6=0,Out=0,V2>=1,V1>=V2+1] * Chain [[27],28,34]: 7*it(27)+1*s(7)+1*s(8)+7 Such that:it(27) =< V1-V2 aux(4) =< V2 s(8) =< aux(4) s(7) =< it(27)*aux(4) with precondition: [V=1,V6=0,Out=0,V2>=1,V1>=V2+1] * Chain [[26],[32],34]: 7*it(26)+9*it(32)+0 Such that:it(26) =< V1 it(32) =< V6 with precondition: [V=1,V2=0,Out=0,V1>=1,V6>=1] * Chain [[26],[32],33,34]: 7*it(26)+9*it(32)+8 Such that:it(26) =< V1 it(32) =< V6 with precondition: [V=1,V2=0,Out=0,V1>=1,V6>=1] * Chain [[26],34]: 7*it(26)+0 Such that:it(26) =< V1 with precondition: [V=1,V2=0,Out=0,V1>=1,V6>=1] * Chain [[24],[30],34]: 7*it(24)+9*it(30)+1*s(3)+1*s(13)+1*s(14)+0 Such that:it(30) =< V6-V2 aux(8) =< V1 aux(9) =< V2 it(24) =< aux(8) s(3) =< it(30)*aux(9) s(14) =< it(24)*aux(9) s(13) =< it(24)*aux(8) with precondition: [V=1,Out=0,V1>=1,V2>=V1,V6>=V2+1] * Chain [[24],[30],31,34]: 7*it(24)+9*it(30)+1*s(3)+1*s(4)+1*s(13)+1*s(14)+9 Such that:it(30) =< V6-V2 aux(10) =< V1 aux(11) =< V2 it(24) =< aux(10) s(4) =< aux(11) s(3) =< it(30)*aux(11) s(14) =< it(24)*aux(11) s(13) =< it(24)*aux(10) with precondition: [V=1,Out=0,V1>=1,V2>=V1,V6>=V2+1] * Chain [[24],34]: 7*it(24)+1*s(13)+1*s(14)+0 Such that:aux(6) =< V2 aux(12) =< V1 it(24) =< aux(12) s(14) =< it(24)*aux(6) s(13) =< it(24)*aux(12) with precondition: [V=1,Out=0,V1>=1,V2>=V1,V6>=V2+1] * Chain [[23],34]: 7*it(23)+1*s(19)+1*s(20)+0 Such that:it(23) =< V1-V2 aux(13) =< V6 aux(14) =< V2 s(19) =< it(23)*aux(14) s(20) =< it(23)*aux(13) with precondition: [V=1,Out=0,V6>=1,V2>=V6,V1>=V2+1] * Chain [[23],25,34]: 7*it(23)+1*s(19)+1*s(20)+1*s(21)+1*s(22)+7 Such that:it(23) =< V1-V2 aux(15) =< V6 aux(16) =< V2 s(22) =< aux(15) s(21) =< aux(16) s(19) =< it(23)*aux(16) s(20) =< it(23)*aux(15) with precondition: [V=1,Out=0,V6>=1,V2>=V6,V1>=V2+1] * Chain [[22],[24],[30],34]: 7*it(22)+7*it(24)+9*it(30)+1*s(3)+2*s(13)+4*s(29)+0 Such that:it(22) =< V1-V2 it(30) =< V6-V2 aux(21) =< V2 it(24) =< aux(21) s(3) =< it(30)*aux(21) s(13) =< it(24)*aux(21) s(30) =< it(22)*aux(21) s(29) =< s(30) with precondition: [V=1,Out=0,V2>=1,V1>=V2+1,V6>=V2+1] * Chain [[22],[24],[30],31,34]: 7*it(22)+8*it(24)+9*it(30)+1*s(3)+2*s(13)+4*s(29)+9 Such that:it(22) =< V1-V2 it(30) =< V6-V2 aux(22) =< V2 it(24) =< aux(22) s(3) =< it(30)*aux(22) s(13) =< it(24)*aux(22) s(30) =< it(22)*aux(22) s(29) =< s(30) with precondition: [V=1,Out=0,V2>=1,V1>=V2+1,V6>=V2+1] * Chain [[22],[24],34]: 7*it(22)+7*it(24)+2*s(13)+4*s(29)+0 Such that:it(22) =< V1-V2 aux(23) =< V2 it(24) =< aux(23) s(13) =< it(24)*aux(23) s(30) =< it(22)*aux(23) s(29) =< s(30) with precondition: [V=1,Out=0,V2>=1,V1>=V2+1,V6>=V2+1] * Chain [[22],34]: 7*it(22)+4*s(29)+0 Such that:it(22) =< V1-V2 aux(20) =< V2 s(30) =< it(22)*aux(20) s(29) =< s(30) with precondition: [V=1,Out=0,V2>=1,V1>=V2+1,V6>=V2+1] * Chain [34]: 0 with precondition: [Out=0,V>=0,V1>=0,V6>=0,V2>=0] * Chain [33,34]: 8 with precondition: [V=1,V1=0,V6=0,Out=0,V2>=0] * Chain [31,34]: 1*s(4)+9 Such that:s(4) =< V6 with precondition: [V=1,V1=0,Out=0,V6>=1,V2>=V6] * Chain [28,34]: 1*s(8)+7 Such that:s(8) =< V1 with precondition: [V=1,V6=0,Out=0,V1>=1,V2>=V1] * Chain [25,34]: 1*s(21)+1*s(22)+7 Such that:s(21) =< V1 s(22) =< V6 with precondition: [V=1,Out=0,V1>=1,V6>=1,V2>=V1,V2>=V6] #### Cost of chains of start(V,V1,V6,V2): * Chain [50]: 118*s(113)+142*s(115)+144*s(121)+16*s(123)+192*s(125)+6*s(153)+6*s(154)+1*s(158)+210*s(161)+18*s(163)+4*s(173)+64*s(194)+24*s(196)+16 Such that:s(158) =< 1 aux(67) =< V1 aux(68) =< V1-V2 aux(69) =< V6 aux(70) =< V6-V2 aux(71) =< V2 s(125) =< aux(67) s(113) =< aux(69) s(115) =< aux(71) s(161) =< aux(68) s(163) =< s(161)*aux(71) s(173) =< s(161)*aux(69) s(121) =< aux(70) s(193) =< s(161)*aux(71) s(194) =< s(193) s(196) =< s(115)*aux(71) s(123) =< s(121)*aux(71) s(153) =< s(125)*aux(71) s(154) =< s(125)*aux(67) with precondition: [V=0] * Chain [49]: 71*s(315)+10*s(316)+140*s(318)+144*s(324)+16*s(327)+9*s(328)+9*s(329)+182*s(337)+6*s(340)+6*s(341)+80*s(352)+30*s(354)+1*s(454)+14 Such that:s(454) =< V aux(88) =< V1 aux(89) =< V1-V2 aux(90) =< V6 aux(91) =< V6-V2 aux(92) =< V2 s(315) =< aux(88) s(316) =< aux(90) s(318) =< aux(92) s(324) =< aux(91) s(327) =< s(324)*aux(92) s(328) =< s(315)*aux(92) s(329) =< s(315)*aux(88) s(337) =< aux(89) s(340) =< s(337)*aux(92) s(341) =< s(337)*aux(90) s(351) =< s(337)*aux(92) s(352) =< s(351) s(354) =< s(318)*aux(92) with precondition: [V>=1] * Chain [48]: 54*s(457)+13 Such that:aux(93) =< V6 s(457) =< aux(93) with precondition: [V1=0,V>=1] * Chain [47]: 9*s(462)+54*s(466)+6*s(468)+14 Such that:aux(97) =< V6-V2 aux(98) =< V2 s(462) =< aux(98) s(466) =< aux(97) s(468) =< s(466)*aux(98) with precondition: [V>=0,V1>=0,V6>=0,V2>=0] * Chain [46]: 3*s(483)+13 Such that:aux(99) =< V6 s(483) =< aux(99) with precondition: [V=1,V1=0,V6>=1,V2>=V6] * Chain [45]: 126*s(487)+105*s(490)+13 Such that:aux(100) =< V1 aux(101) =< V6 s(490) =< aux(100) s(487) =< aux(101) with precondition: [V=1,V2=0,V1>=1,V6>=1] * Chain [44]: 1*s(510)+2*s(511)+18*s(514)+2*s(516)+14 Such that:s(510) =< 1 s(512) =< V6-V2 aux(102) =< V2 s(511) =< aux(102) s(514) =< s(512) s(516) =< s(514)*aux(102) with precondition: [V1=1,V>=0] * Chain [43]: 42*s(518)+13 Such that:aux(103) =< V1 s(518) =< aux(103) with precondition: [V=1,V6=0,V2=0,V1>=1] * Chain [42]: 9*s(523)+42*s(529)+6*s(531)+13 Such that:aux(107) =< V1-V2 aux(108) =< V2 s(523) =< aux(108) s(529) =< aux(107) s(531) =< s(529)*aux(108) with precondition: [V=1,V6=0,V2>=1,V1>=V2+1] * Chain [41]: 3*s(544)+13 Such that:aux(109) =< V1 s(544) =< aux(109) with precondition: [V=1,V6=0,V1>=1,V2>=V1] * Chain [40]: 28*s(548)+13 Such that:aux(110) =< V1 s(548) =< aux(110) with precondition: [V=1,V6=1,V2=0,V1>=1] * Chain [39]: 2*s(551)+1*s(552)+14*s(555)+2*s(557)+12 Such that:s(552) =< 1 s(553) =< V1-V2 aux(111) =< V2 s(551) =< aux(111) s(555) =< s(553) s(557) =< s(555)*aux(111) with precondition: [V=1,V6=1,V2>=1,V1>=V2+1] * Chain [38]: 8*s(558)+28*s(563)+8*s(566)+12 Such that:aux(114) =< V1-V2 aux(115) =< V2 s(558) =< aux(115) s(563) =< aux(114) s(566) =< s(563)*aux(115) with precondition: [V=1,V6=V2+1,V6>=2,V1>=V6] * Chain [37]: 48*s(578)+36*s(583)+4*s(586)+12*s(587)+14 Such that:aux(118) =< V6-V2 aux(119) =< V2 s(578) =< aux(119) s(583) =< aux(118) s(586) =< s(583)*aux(119) s(587) =< s(578)*aux(119) with precondition: [V=1,V1=V2+1,V1>=2,V6>=V1] * Chain [36]: 2*s(600)+2*s(601)+12 Such that:aux(120) =< V6 aux(121) =< V2 s(601) =< aux(120) s(600) =< aux(121) with precondition: [V=1,V1=V2+1,V6>=1,V1>=V6+1] * Chain [35]: 2*s(604)+2*s(605)+12 Such that:aux(122) =< V1 aux(123) =< V2 s(604) =< aux(122) s(605) =< aux(123) with precondition: [V=1,V6=V2+1,V1>=1,V6>=V1+1] Closed-form bounds of start(V,V1,V6,V2): ------------------------------------- * Chain [50] with precondition: [V=0] - Upper bound: nat(V1)*192+17+nat(V1)*6*nat(V1)+nat(V1)*6*nat(V2)+nat(V6)*118+nat(V6)*4*nat(V1-V2)+nat(V2)*142+nat(V2)*24*nat(V2)+nat(V2)*82*nat(V1-V2)+nat(V2)*16*nat(V6-V2)+nat(V1-V2)*210+nat(V6-V2)*144 - Complexity: n^2 * Chain [49] with precondition: [V>=1] - Upper bound: V+14+nat(V1)*71+nat(V1)*9*nat(V1)+nat(V1)*9*nat(V2)+nat(V6)*10+nat(V6)*6*nat(V1-V2)+nat(V2)*140+nat(V2)*30*nat(V2)+nat(V2)*86*nat(V1-V2)+nat(V2)*16*nat(V6-V2)+nat(V1-V2)*182+nat(V6-V2)*144 - Complexity: n^2 * Chain [48] with precondition: [V1=0,V>=1] - Upper bound: nat(V6)*54+13 - Complexity: n * Chain [47] with precondition: [V>=0,V1>=0,V6>=0,V2>=0] - Upper bound: 9*V2+14+6*V2*nat(V6-V2)+nat(V6-V2)*54 - Complexity: n^2 * Chain [46] with precondition: [V=1,V1=0,V6>=1,V2>=V6] - Upper bound: 3*V6+13 - Complexity: n * Chain [45] with precondition: [V=1,V2=0,V1>=1,V6>=1] - Upper bound: 105*V1+126*V6+13 - Complexity: n * Chain [44] with precondition: [V1=1,V>=0] - Upper bound: nat(V2)*2+15+nat(V2)*2*nat(V6-V2)+nat(V6-V2)*18 - Complexity: n^2 * Chain [43] with precondition: [V=1,V6=0,V2=0,V1>=1] - Upper bound: 42*V1+13 - Complexity: n * Chain [42] with precondition: [V=1,V6=0,V2>=1,V1>=V2+1] - Upper bound: 42*V1-42*V2+(9*V2+13+(V1-V2)*(6*V2)) - Complexity: n^2 * Chain [41] with precondition: [V=1,V6=0,V1>=1,V2>=V1] - Upper bound: 3*V1+13 - Complexity: n * Chain [40] with precondition: [V=1,V6=1,V2=0,V1>=1] - Upper bound: 28*V1+13 - Complexity: n * Chain [39] with precondition: [V=1,V6=1,V2>=1,V1>=V2+1] - Upper bound: 14*V1-14*V2+(2*V2+13+(V1-V2)*(2*V2)) - Complexity: n^2 * Chain [38] with precondition: [V=1,V6=V2+1,V6>=2,V1>=V6] - Upper bound: 28*V1-28*V2+(8*V2+12+(V1-V2)*(8*V2)) - Complexity: n^2 * Chain [37] with precondition: [V=1,V1=V2+1,V1>=2,V6>=V1] - Upper bound: 36*V6-36*V2+(48*V2+14+12*V2*V2+(V6-V2)*(4*V2)) - Complexity: n^2 * Chain [36] with precondition: [V=1,V1=V2+1,V6>=1,V1>=V6+1] - Upper bound: 2*V6+2*V2+12 - Complexity: n * Chain [35] with precondition: [V=1,V6=V2+1,V1>=1,V6>=V1+1] - Upper bound: 2*V1+2*V2+12 - Complexity: n ### Maximum cost of start(V,V1,V6,V2): max([max([nat(V6)*54,nat(V6)*126+nat(V1)*63+nat(V1)*14+nat(V1)*25+nat(V1)*3])+1,nat(V2)*2+max([max([nat(V1)*2,nat(V6)*2,nat(V2)*2*nat(V1-V2)+1+nat(V1-V2)*14,nat(V2)*2*nat(V6-V2)+3+nat(V6-V2)*18]),nat(V2)*6+max([nat(V2)*8*nat(V1-V2)+nat(V1-V2)*28,nat(V2)+1+max([nat(V2)*6*nat(V1-V2)+nat(V1-V2)*42,nat(V2)*4*nat(V6-V2)+1+nat(V6-V2)*36+max([nat(V2)*2*nat(V6-V2)+nat(V6-V2)*18,nat(V1)*6*nat(V1)+nat(V1)*71+nat(V1)*6*nat(V2)+nat(V6)*10+nat(V6)*4*nat(V1-V2)+nat(V2)*92+nat(V2)*12*nat(V2)+nat(V2)*82*nat(V1-V2)+nat(V2)*12*nat(V6-V2)+nat(V1-V2)*182+nat(V6-V2)*108+max([nat(V1)*121+3+nat(V6)*108+nat(V2)*2+nat(V1-V2)*28,nat(V1)*3*nat(V1)+V+nat(V1)*3*nat(V2)+nat(V6)*2*nat(V1-V2)+nat(V2)*6*nat(V2)+nat(V2)*4*nat(V1-V2)])+(nat(V2)*12*nat(V2)+nat(V2)*39)])])])])])+12 Asymptotic class: n^2 * Total analysis performed in 2561 ms. ---------------------------------------- (10) BOUNDS(1, n^2) ---------------------------------------- (11) RenamingProof (BOTH BOUNDS(ID, ID)) Renamed function symbols to avoid clashes with predefined symbol. ---------------------------------------- (12) 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: cond1(true, x, y, z) -> cond2(gr(x, 0'), x, y, z) cond2(true, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), p(x), y, z) cond2(false, x, y, z) -> cond3(gr(y, 0'), x, y, z) cond3(true, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), x, p(y), z) cond3(false, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), x, y, z) gr(0', x) -> false gr(s(x), 0') -> true gr(s(x), s(y)) -> gr(x, y) or(false, false) -> false or(true, x) -> true or(x, true) -> true p(0') -> 0' p(s(x)) -> x S is empty. Rewrite Strategy: INNERMOST ---------------------------------------- (13) TypeInferenceProof (BOTH BOUNDS(ID, ID)) Infered types. ---------------------------------------- (14) Obligation: Innermost TRS: Rules: cond1(true, x, y, z) -> cond2(gr(x, 0'), x, y, z) cond2(true, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), p(x), y, z) cond2(false, x, y, z) -> cond3(gr(y, 0'), x, y, z) cond3(true, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), x, p(y), z) cond3(false, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), x, y, z) gr(0', x) -> false gr(s(x), 0') -> true gr(s(x), s(y)) -> gr(x, y) or(false, false) -> false or(true, x) -> true or(x, true) -> true p(0') -> 0' p(s(x)) -> x Types: cond1 :: true:false -> 0':s -> 0':s -> 0':s -> cond1:cond2:cond3 true :: true:false cond2 :: true:false -> 0':s -> 0':s -> 0':s -> cond1:cond2:cond3 gr :: 0':s -> 0':s -> true:false 0' :: 0':s or :: true:false -> true:false -> true:false p :: 0':s -> 0':s false :: true:false cond3 :: true:false -> 0':s -> 0':s -> 0':s -> cond1:cond2:cond3 s :: 0':s -> 0':s hole_cond1:cond2:cond31_0 :: cond1:cond2:cond3 hole_true:false2_0 :: true:false hole_0':s3_0 :: 0':s gen_0':s4_0 :: Nat -> 0':s ---------------------------------------- (15) OrderProof (LOWER BOUND(ID)) Heuristically decided to analyse the following defined symbols: cond1, cond2, gr, cond3 They will be analysed ascendingly in the following order: cond1 = cond2 gr < cond1 cond1 = cond3 gr < cond2 cond2 = cond3 gr < cond3 ---------------------------------------- (16) Obligation: Innermost TRS: Rules: cond1(true, x, y, z) -> cond2(gr(x, 0'), x, y, z) cond2(true, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), p(x), y, z) cond2(false, x, y, z) -> cond3(gr(y, 0'), x, y, z) cond3(true, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), x, p(y), z) cond3(false, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), x, y, z) gr(0', x) -> false gr(s(x), 0') -> true gr(s(x), s(y)) -> gr(x, y) or(false, false) -> false or(true, x) -> true or(x, true) -> true p(0') -> 0' p(s(x)) -> x Types: cond1 :: true:false -> 0':s -> 0':s -> 0':s -> cond1:cond2:cond3 true :: true:false cond2 :: true:false -> 0':s -> 0':s -> 0':s -> cond1:cond2:cond3 gr :: 0':s -> 0':s -> true:false 0' :: 0':s or :: true:false -> true:false -> true:false p :: 0':s -> 0':s false :: true:false cond3 :: true:false -> 0':s -> 0':s -> 0':s -> cond1:cond2:cond3 s :: 0':s -> 0':s hole_cond1:cond2:cond31_0 :: cond1:cond2:cond3 hole_true:false2_0 :: true:false hole_0':s3_0 :: 0':s gen_0':s4_0 :: Nat -> 0':s Generator Equations: gen_0':s4_0(0) <=> 0' gen_0':s4_0(+(x, 1)) <=> s(gen_0':s4_0(x)) The following defined symbols remain to be analysed: gr, cond1, cond2, cond3 They will be analysed ascendingly in the following order: cond1 = cond2 gr < cond1 cond1 = cond3 gr < cond2 cond2 = cond3 gr < cond3 ---------------------------------------- (17) RewriteLemmaProof (LOWER BOUND(ID)) Proved the following rewrite lemma: gr(gen_0':s4_0(n6_0), gen_0':s4_0(n6_0)) -> false, rt in Omega(1 + n6_0) Induction Base: gr(gen_0':s4_0(0), gen_0':s4_0(0)) ->_R^Omega(1) false Induction Step: gr(gen_0':s4_0(+(n6_0, 1)), gen_0':s4_0(+(n6_0, 1))) ->_R^Omega(1) gr(gen_0':s4_0(n6_0), gen_0':s4_0(n6_0)) ->_IH false We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). ---------------------------------------- (18) Complex Obligation (BEST) ---------------------------------------- (19) Obligation: Proved the lower bound n^1 for the following obligation: Innermost TRS: Rules: cond1(true, x, y, z) -> cond2(gr(x, 0'), x, y, z) cond2(true, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), p(x), y, z) cond2(false, x, y, z) -> cond3(gr(y, 0'), x, y, z) cond3(true, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), x, p(y), z) cond3(false, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), x, y, z) gr(0', x) -> false gr(s(x), 0') -> true gr(s(x), s(y)) -> gr(x, y) or(false, false) -> false or(true, x) -> true or(x, true) -> true p(0') -> 0' p(s(x)) -> x Types: cond1 :: true:false -> 0':s -> 0':s -> 0':s -> cond1:cond2:cond3 true :: true:false cond2 :: true:false -> 0':s -> 0':s -> 0':s -> cond1:cond2:cond3 gr :: 0':s -> 0':s -> true:false 0' :: 0':s or :: true:false -> true:false -> true:false p :: 0':s -> 0':s false :: true:false cond3 :: true:false -> 0':s -> 0':s -> 0':s -> cond1:cond2:cond3 s :: 0':s -> 0':s hole_cond1:cond2:cond31_0 :: cond1:cond2:cond3 hole_true:false2_0 :: true:false hole_0':s3_0 :: 0':s gen_0':s4_0 :: Nat -> 0':s Generator Equations: gen_0':s4_0(0) <=> 0' gen_0':s4_0(+(x, 1)) <=> s(gen_0':s4_0(x)) The following defined symbols remain to be analysed: gr, cond1, cond2, cond3 They will be analysed ascendingly in the following order: cond1 = cond2 gr < cond1 cond1 = cond3 gr < cond2 cond2 = cond3 gr < cond3 ---------------------------------------- (20) LowerBoundPropagationProof (FINISHED) Propagated lower bound. ---------------------------------------- (21) BOUNDS(n^1, INF) ---------------------------------------- (22) Obligation: Innermost TRS: Rules: cond1(true, x, y, z) -> cond2(gr(x, 0'), x, y, z) cond2(true, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), p(x), y, z) cond2(false, x, y, z) -> cond3(gr(y, 0'), x, y, z) cond3(true, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), x, p(y), z) cond3(false, x, y, z) -> cond1(or(gr(x, z), gr(y, z)), x, y, z) gr(0', x) -> false gr(s(x), 0') -> true gr(s(x), s(y)) -> gr(x, y) or(false, false) -> false or(true, x) -> true or(x, true) -> true p(0') -> 0' p(s(x)) -> x Types: cond1 :: true:false -> 0':s -> 0':s -> 0':s -> cond1:cond2:cond3 true :: true:false cond2 :: true:false -> 0':s -> 0':s -> 0':s -> cond1:cond2:cond3 gr :: 0':s -> 0':s -> true:false 0' :: 0':s or :: true:false -> true:false -> true:false p :: 0':s -> 0':s false :: true:false cond3 :: true:false -> 0':s -> 0':s -> 0':s -> cond1:cond2:cond3 s :: 0':s -> 0':s hole_cond1:cond2:cond31_0 :: cond1:cond2:cond3 hole_true:false2_0 :: true:false hole_0':s3_0 :: 0':s gen_0':s4_0 :: Nat -> 0':s Lemmas: gr(gen_0':s4_0(n6_0), gen_0':s4_0(n6_0)) -> false, rt in Omega(1 + n6_0) Generator Equations: gen_0':s4_0(0) <=> 0' gen_0':s4_0(+(x, 1)) <=> s(gen_0':s4_0(x)) The following defined symbols remain to be analysed: cond2, cond1, cond3 They will be analysed ascendingly in the following order: cond1 = cond2 cond1 = cond3 cond2 = cond3