1091.55/291.51 WORST_CASE(Omega(n^1), O(n^2)) 1091.80/291.54 proof of /export/starexec/sandbox2/benchmark/theBenchmark.xml 1091.80/291.54 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 1091.80/291.54 1091.80/291.54 1091.80/291.54 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). 1091.80/291.54 1091.80/291.54 (0) CpxTRS 1091.80/291.54 (1) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] 1091.80/291.54 (2) CpxWeightedTrs 1091.80/291.54 (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] 1091.80/291.54 (4) CpxTypedWeightedTrs 1091.80/291.54 (5) CompletionProof [UPPER BOUND(ID), 0 ms] 1091.80/291.54 (6) CpxTypedWeightedCompleteTrs 1091.80/291.54 (7) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] 1091.80/291.54 (8) CpxRNTS 1091.80/291.54 (9) CompleteCoflocoProof [FINISHED, 804 ms] 1091.80/291.54 (10) BOUNDS(1, n^2) 1091.80/291.54 (11) RenamingProof [BOTH BOUNDS(ID, ID), 0 ms] 1091.80/291.54 (12) CpxTRS 1091.80/291.54 (13) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] 1091.80/291.54 (14) typed CpxTrs 1091.80/291.54 (15) OrderProof [LOWER BOUND(ID), 0 ms] 1091.80/291.54 (16) typed CpxTrs 1091.80/291.54 (17) RewriteLemmaProof [LOWER BOUND(ID), 293 ms] 1091.80/291.54 (18) BEST 1091.80/291.54 (19) proven lower bound 1091.80/291.54 (20) LowerBoundPropagationProof [FINISHED, 0 ms] 1091.80/291.54 (21) BOUNDS(n^1, INF) 1091.80/291.54 (22) typed CpxTrs 1091.80/291.54 (23) RewriteLemmaProof [LOWER BOUND(ID), 94 ms] 1091.80/291.54 (24) typed CpxTrs 1091.80/291.54 1091.80/291.54 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (0) 1091.80/291.54 Obligation: 1091.80/291.54 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^2). 1091.80/291.54 1091.80/291.54 1091.80/291.54 The TRS R consists of the following rules: 1091.80/291.54 1091.80/291.54 gt(s(x), 0) -> true 1091.80/291.54 gt(0, y) -> false 1091.80/291.54 gt(s(x), s(y)) -> gt(x, y) 1091.80/291.54 divides(x, y) -> div(x, y, y) 1091.80/291.54 div(0, 0, z) -> true 1091.80/291.54 div(0, s(x), z) -> false 1091.80/291.54 div(s(x), 0, s(z)) -> div(s(x), s(z), s(z)) 1091.80/291.54 div(s(x), s(y), z) -> div(x, y, z) 1091.80/291.54 prime(x) -> test(x, s(s(0))) 1091.80/291.54 test(x, y) -> if1(gt(x, y), x, y) 1091.80/291.54 if1(true, x, y) -> if2(divides(x, y), x, y) 1091.80/291.54 if1(false, x, y) -> true 1091.80/291.54 if2(true, x, y) -> false 1091.80/291.54 if2(false, x, y) -> test(x, s(y)) 1091.80/291.54 1091.80/291.54 S is empty. 1091.80/291.54 Rewrite Strategy: INNERMOST 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (1) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) 1091.80/291.54 Transformed relative TRS to weighted TRS 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (2) 1091.80/291.54 Obligation: 1091.80/291.54 The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^2). 1091.80/291.54 1091.80/291.54 1091.80/291.54 The TRS R consists of the following rules: 1091.80/291.54 1091.80/291.54 gt(s(x), 0) -> true [1] 1091.80/291.54 gt(0, y) -> false [1] 1091.80/291.54 gt(s(x), s(y)) -> gt(x, y) [1] 1091.80/291.54 divides(x, y) -> div(x, y, y) [1] 1091.80/291.54 div(0, 0, z) -> true [1] 1091.80/291.54 div(0, s(x), z) -> false [1] 1091.80/291.54 div(s(x), 0, s(z)) -> div(s(x), s(z), s(z)) [1] 1091.80/291.54 div(s(x), s(y), z) -> div(x, y, z) [1] 1091.80/291.54 prime(x) -> test(x, s(s(0))) [1] 1091.80/291.54 test(x, y) -> if1(gt(x, y), x, y) [1] 1091.80/291.54 if1(true, x, y) -> if2(divides(x, y), x, y) [1] 1091.80/291.54 if1(false, x, y) -> true [1] 1091.80/291.54 if2(true, x, y) -> false [1] 1091.80/291.54 if2(false, x, y) -> test(x, s(y)) [1] 1091.80/291.54 1091.80/291.54 Rewrite Strategy: INNERMOST 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (3) TypeInferenceProof (BOTH BOUNDS(ID, ID)) 1091.80/291.54 Infered types. 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (4) 1091.80/291.54 Obligation: 1091.80/291.54 Runtime Complexity Weighted TRS with Types. 1091.80/291.54 The TRS R consists of the following rules: 1091.80/291.54 1091.80/291.54 gt(s(x), 0) -> true [1] 1091.80/291.54 gt(0, y) -> false [1] 1091.80/291.54 gt(s(x), s(y)) -> gt(x, y) [1] 1091.80/291.54 divides(x, y) -> div(x, y, y) [1] 1091.80/291.54 div(0, 0, z) -> true [1] 1091.80/291.54 div(0, s(x), z) -> false [1] 1091.80/291.54 div(s(x), 0, s(z)) -> div(s(x), s(z), s(z)) [1] 1091.80/291.54 div(s(x), s(y), z) -> div(x, y, z) [1] 1091.80/291.54 prime(x) -> test(x, s(s(0))) [1] 1091.80/291.54 test(x, y) -> if1(gt(x, y), x, y) [1] 1091.80/291.54 if1(true, x, y) -> if2(divides(x, y), x, y) [1] 1091.80/291.54 if1(false, x, y) -> true [1] 1091.80/291.54 if2(true, x, y) -> false [1] 1091.80/291.54 if2(false, x, y) -> test(x, s(y)) [1] 1091.80/291.54 1091.80/291.54 The TRS has the following type information: 1091.80/291.54 gt :: s:0 -> s:0 -> true:false 1091.80/291.54 s :: s:0 -> s:0 1091.80/291.54 0 :: s:0 1091.80/291.54 true :: true:false 1091.80/291.54 false :: true:false 1091.80/291.54 divides :: s:0 -> s:0 -> true:false 1091.80/291.54 div :: s:0 -> s:0 -> s:0 -> true:false 1091.80/291.54 prime :: s:0 -> true:false 1091.80/291.54 test :: s:0 -> s:0 -> true:false 1091.80/291.54 if1 :: true:false -> s:0 -> s:0 -> true:false 1091.80/291.54 if2 :: true:false -> s:0 -> s:0 -> true:false 1091.80/291.54 1091.80/291.54 Rewrite Strategy: INNERMOST 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (5) CompletionProof (UPPER BOUND(ID)) 1091.80/291.54 The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: 1091.80/291.54 1091.80/291.54 div(v0, v1, v2) -> null_div [0] 1091.80/291.54 if1(v0, v1, v2) -> null_if1 [0] 1091.80/291.54 if2(v0, v1, v2) -> null_if2 [0] 1091.80/291.54 1091.80/291.54 And the following fresh constants: null_div, null_if1, null_if2 1091.80/291.54 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (6) 1091.80/291.54 Obligation: 1091.80/291.54 Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: 1091.80/291.54 1091.80/291.54 Runtime Complexity Weighted TRS with Types. 1091.80/291.54 The TRS R consists of the following rules: 1091.80/291.54 1091.80/291.54 gt(s(x), 0) -> true [1] 1091.80/291.54 gt(0, y) -> false [1] 1091.80/291.54 gt(s(x), s(y)) -> gt(x, y) [1] 1091.80/291.54 divides(x, y) -> div(x, y, y) [1] 1091.80/291.54 div(0, 0, z) -> true [1] 1091.80/291.54 div(0, s(x), z) -> false [1] 1091.80/291.54 div(s(x), 0, s(z)) -> div(s(x), s(z), s(z)) [1] 1091.80/291.54 div(s(x), s(y), z) -> div(x, y, z) [1] 1091.80/291.54 prime(x) -> test(x, s(s(0))) [1] 1091.80/291.54 test(x, y) -> if1(gt(x, y), x, y) [1] 1091.80/291.54 if1(true, x, y) -> if2(divides(x, y), x, y) [1] 1091.80/291.54 if1(false, x, y) -> true [1] 1091.80/291.54 if2(true, x, y) -> false [1] 1091.80/291.54 if2(false, x, y) -> test(x, s(y)) [1] 1091.80/291.54 div(v0, v1, v2) -> null_div [0] 1091.80/291.54 if1(v0, v1, v2) -> null_if1 [0] 1091.80/291.54 if2(v0, v1, v2) -> null_if2 [0] 1091.80/291.54 1091.80/291.54 The TRS has the following type information: 1091.80/291.54 gt :: s:0 -> s:0 -> true:false:null_div:null_if1:null_if2 1091.80/291.54 s :: s:0 -> s:0 1091.80/291.54 0 :: s:0 1091.80/291.54 true :: true:false:null_div:null_if1:null_if2 1091.80/291.54 false :: true:false:null_div:null_if1:null_if2 1091.80/291.54 divides :: s:0 -> s:0 -> true:false:null_div:null_if1:null_if2 1091.80/291.54 div :: s:0 -> s:0 -> s:0 -> true:false:null_div:null_if1:null_if2 1091.80/291.54 prime :: s:0 -> true:false:null_div:null_if1:null_if2 1091.80/291.54 test :: s:0 -> s:0 -> true:false:null_div:null_if1:null_if2 1091.80/291.54 if1 :: true:false:null_div:null_if1:null_if2 -> s:0 -> s:0 -> true:false:null_div:null_if1:null_if2 1091.80/291.54 if2 :: true:false:null_div:null_if1:null_if2 -> s:0 -> s:0 -> true:false:null_div:null_if1:null_if2 1091.80/291.54 null_div :: true:false:null_div:null_if1:null_if2 1091.80/291.54 null_if1 :: true:false:null_div:null_if1:null_if2 1091.80/291.54 null_if2 :: true:false:null_div:null_if1:null_if2 1091.80/291.54 1091.80/291.54 Rewrite Strategy: INNERMOST 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) 1091.80/291.54 Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. 1091.80/291.54 The constant constructors are abstracted as follows: 1091.80/291.54 1091.80/291.54 0 => 0 1091.80/291.54 true => 2 1091.80/291.54 false => 1 1091.80/291.54 null_div => 0 1091.80/291.54 null_if1 => 0 1091.80/291.54 null_if2 => 0 1091.80/291.54 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (8) 1091.80/291.54 Obligation: 1091.80/291.54 Complexity RNTS consisting of the following rules: 1091.80/291.54 1091.80/291.54 div(z', z'', z1) -{ 1 }-> div(x, y, z) :|: z' = 1 + x, z1 = z, z >= 0, x >= 0, y >= 0, z'' = 1 + y 1091.80/291.54 div(z', z'', z1) -{ 1 }-> div(1 + x, 1 + z, 1 + z) :|: z'' = 0, z' = 1 + x, z >= 0, x >= 0, z1 = 1 + z 1091.80/291.54 div(z', z'', z1) -{ 1 }-> 2 :|: z'' = 0, z1 = z, z >= 0, z' = 0 1091.80/291.54 div(z', z'', z1) -{ 1 }-> 1 :|: z1 = z, z >= 0, x >= 0, z'' = 1 + x, z' = 0 1091.80/291.54 div(z', z'', z1) -{ 0 }-> 0 :|: v0 >= 0, z1 = v2, v1 >= 0, z'' = v1, v2 >= 0, z' = v0 1091.80/291.54 divides(z', z'') -{ 1 }-> div(x, y, y) :|: z' = x, z'' = y, x >= 0, y >= 0 1091.80/291.54 gt(z', z'') -{ 1 }-> gt(x, y) :|: z' = 1 + x, x >= 0, y >= 0, z'' = 1 + y 1091.80/291.54 gt(z', z'') -{ 1 }-> 2 :|: z'' = 0, z' = 1 + x, x >= 0 1091.80/291.54 gt(z', z'') -{ 1 }-> 1 :|: z'' = y, y >= 0, z' = 0 1091.80/291.54 if1(z', z'', z1) -{ 1 }-> if2(divides(x, y), x, y) :|: z1 = y, z' = 2, x >= 0, y >= 0, z'' = x 1091.80/291.54 if1(z', z'', z1) -{ 1 }-> 2 :|: z1 = y, x >= 0, y >= 0, z'' = x, z' = 1 1091.80/291.54 if1(z', z'', z1) -{ 0 }-> 0 :|: v0 >= 0, z1 = v2, v1 >= 0, z'' = v1, v2 >= 0, z' = v0 1091.80/291.54 if2(z', z'', z1) -{ 1 }-> test(x, 1 + y) :|: z1 = y, x >= 0, y >= 0, z'' = x, z' = 1 1091.80/291.54 if2(z', z'', z1) -{ 1 }-> 1 :|: z1 = y, z' = 2, x >= 0, y >= 0, z'' = x 1091.80/291.54 if2(z', z'', z1) -{ 0 }-> 0 :|: v0 >= 0, z1 = v2, v1 >= 0, z'' = v1, v2 >= 0, z' = v0 1091.80/291.54 prime(z') -{ 1 }-> test(x, 1 + (1 + 0)) :|: z' = x, x >= 0 1091.80/291.54 test(z', z'') -{ 1 }-> if1(gt(x, y), x, y) :|: z' = x, z'' = y, x >= 0, y >= 0 1091.80/291.54 1091.80/291.54 Only complete derivations are relevant for the runtime complexity. 1091.80/291.54 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (9) CompleteCoflocoProof (FINISHED) 1091.80/291.54 Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: 1091.80/291.54 1091.80/291.54 eq(start(V, V1, V9),0,[gt(V, V1, Out)],[V >= 0,V1 >= 0]). 1091.80/291.54 eq(start(V, V1, V9),0,[divides(V, V1, Out)],[V >= 0,V1 >= 0]). 1091.80/291.54 eq(start(V, V1, V9),0,[div(V, V1, V9, Out)],[V >= 0,V1 >= 0,V9 >= 0]). 1091.80/291.54 eq(start(V, V1, V9),0,[prime(V, Out)],[V >= 0]). 1091.80/291.54 eq(start(V, V1, V9),0,[test(V, V1, Out)],[V >= 0,V1 >= 0]). 1091.80/291.54 eq(start(V, V1, V9),0,[if1(V, V1, V9, Out)],[V >= 0,V1 >= 0,V9 >= 0]). 1091.80/291.54 eq(start(V, V1, V9),0,[if2(V, V1, V9, Out)],[V >= 0,V1 >= 0,V9 >= 0]). 1091.80/291.54 eq(gt(V, V1, Out),1,[],[Out = 2,V1 = 0,V = 1 + V2,V2 >= 0]). 1091.80/291.54 eq(gt(V, V1, Out),1,[],[Out = 1,V1 = V3,V3 >= 0,V = 0]). 1091.80/291.54 eq(gt(V, V1, Out),1,[gt(V4, V5, Ret)],[Out = Ret,V = 1 + V4,V4 >= 0,V5 >= 0,V1 = 1 + V5]). 1091.80/291.54 eq(divides(V, V1, Out),1,[div(V7, V6, V6, Ret1)],[Out = Ret1,V = V7,V1 = V6,V7 >= 0,V6 >= 0]). 1091.80/291.54 eq(div(V, V1, V9, Out),1,[],[Out = 2,V1 = 0,V9 = V8,V8 >= 0,V = 0]). 1091.80/291.54 eq(div(V, V1, V9, Out),1,[],[Out = 1,V9 = V11,V11 >= 0,V10 >= 0,V1 = 1 + V10,V = 0]). 1091.80/291.54 eq(div(V, V1, V9, Out),1,[div(1 + V12, 1 + V13, 1 + V13, Ret2)],[Out = Ret2,V1 = 0,V = 1 + V12,V13 >= 0,V12 >= 0,V9 = 1 + V13]). 1091.80/291.54 eq(div(V, V1, V9, Out),1,[div(V16, V14, V15, Ret3)],[Out = Ret3,V = 1 + V16,V9 = V15,V15 >= 0,V16 >= 0,V14 >= 0,V1 = 1 + V14]). 1091.80/291.54 eq(prime(V, Out),1,[test(V17, 1 + (1 + 0), Ret4)],[Out = Ret4,V = V17,V17 >= 0]). 1091.80/291.54 eq(test(V, V1, Out),1,[gt(V19, V18, Ret0),if1(Ret0, V19, V18, Ret5)],[Out = Ret5,V = V19,V1 = V18,V19 >= 0,V18 >= 0]). 1091.80/291.54 eq(if1(V, V1, V9, Out),1,[divides(V21, V20, Ret01),if2(Ret01, V21, V20, Ret6)],[Out = Ret6,V9 = V20,V = 2,V21 >= 0,V20 >= 0,V1 = V21]). 1091.80/291.54 eq(if1(V, V1, V9, Out),1,[],[Out = 2,V9 = V22,V23 >= 0,V22 >= 0,V1 = V23,V = 1]). 1091.80/291.54 eq(if2(V, V1, V9, Out),1,[],[Out = 1,V9 = V24,V = 2,V25 >= 0,V24 >= 0,V1 = V25]). 1091.80/291.54 eq(if2(V, V1, V9, Out),1,[test(V27, 1 + V26, Ret7)],[Out = Ret7,V9 = V26,V27 >= 0,V26 >= 0,V1 = V27,V = 1]). 1091.80/291.54 eq(div(V, V1, V9, Out),0,[],[Out = 0,V29 >= 0,V9 = V30,V28 >= 0,V1 = V28,V30 >= 0,V = V29]). 1091.80/291.54 eq(if1(V, V1, V9, Out),0,[],[Out = 0,V33 >= 0,V9 = V31,V32 >= 0,V1 = V32,V31 >= 0,V = V33]). 1091.80/291.54 eq(if2(V, V1, V9, Out),0,[],[Out = 0,V36 >= 0,V9 = V34,V35 >= 0,V1 = V35,V34 >= 0,V = V36]). 1091.80/291.54 input_output_vars(gt(V,V1,Out),[V,V1],[Out]). 1091.80/291.54 input_output_vars(divides(V,V1,Out),[V,V1],[Out]). 1091.80/291.54 input_output_vars(div(V,V1,V9,Out),[V,V1,V9],[Out]). 1091.80/291.54 input_output_vars(prime(V,Out),[V],[Out]). 1091.80/291.54 input_output_vars(test(V,V1,Out),[V,V1],[Out]). 1091.80/291.54 input_output_vars(if1(V,V1,V9,Out),[V,V1,V9],[Out]). 1091.80/291.54 input_output_vars(if2(V,V1,V9,Out),[V,V1,V9],[Out]). 1091.80/291.54 1091.80/291.54 1091.80/291.54 CoFloCo proof output: 1091.80/291.54 Preprocessing Cost Relations 1091.80/291.54 ===================================== 1091.80/291.54 1091.80/291.54 #### Computed strongly connected components 1091.80/291.54 0. recursive : [(div)/4] 1091.80/291.54 1. non_recursive : [divides/3] 1091.80/291.54 2. recursive : [gt/3] 1091.80/291.54 3. recursive : [if1/4,if2/4,test/3] 1091.80/291.54 4. non_recursive : [prime/2] 1091.80/291.54 5. non_recursive : [start/3] 1091.80/291.54 1091.80/291.54 #### Obtained direct recursion through partial evaluation 1091.80/291.54 0. SCC is partially evaluated into (div)/4 1091.80/291.54 1. SCC is completely evaluated into other SCCs 1091.80/291.54 2. SCC is partially evaluated into gt/3 1091.80/291.54 3. SCC is partially evaluated into test/3 1091.80/291.54 4. SCC is completely evaluated into other SCCs 1091.80/291.54 5. SCC is partially evaluated into start/3 1091.80/291.54 1091.80/291.54 Control-Flow Refinement of Cost Relations 1091.80/291.54 ===================================== 1091.80/291.54 1091.80/291.54 ### Specialization of cost equations (div)/4 1091.80/291.54 * CE 17 is refined into CE [26] 1091.80/291.54 * CE 14 is refined into CE [27] 1091.80/291.54 * CE 13 is refined into CE [28] 1091.80/291.54 * CE 16 is refined into CE [29] 1091.80/291.54 * CE 15 is refined into CE [30] 1091.80/291.54 1091.80/291.54 1091.80/291.54 ### Cost equations --> "Loop" of (div)/4 1091.80/291.54 * CEs [29] --> Loop 15 1091.80/291.54 * CEs [30] --> Loop 16 1091.80/291.54 * CEs [26] --> Loop 17 1091.80/291.54 * CEs [27] --> Loop 18 1091.80/291.54 * CEs [28] --> Loop 19 1091.80/291.54 1091.80/291.54 ### Ranking functions of CR div(V,V1,V9,Out) 1091.80/291.54 1091.80/291.54 #### Partial ranking functions of CR div(V,V1,V9,Out) 1091.80/291.54 * Partial RF of phase [15,16]: 1091.80/291.54 - RF of loop [15:1]: 1091.80/291.54 V 1091.80/291.54 V1 depends on loops [16:1] 1091.80/291.54 - RF of loop [16:1]: 1091.80/291.54 -V1+1 depends on loops [15:1] 1091.80/291.54 1091.80/291.54 1091.80/291.54 ### Specialization of cost equations gt/3 1091.80/291.54 * CE 25 is refined into CE [31] 1091.80/291.54 * CE 23 is refined into CE [32] 1091.80/291.54 * CE 24 is refined into CE [33] 1091.80/291.54 1091.80/291.54 1091.80/291.54 ### Cost equations --> "Loop" of gt/3 1091.80/291.54 * CEs [32] --> Loop 20 1091.80/291.54 * CEs [33] --> Loop 21 1091.80/291.54 * CEs [31] --> Loop 22 1091.80/291.54 1091.80/291.54 ### Ranking functions of CR gt(V,V1,Out) 1091.80/291.54 * RF of phase [22]: [V,V1] 1091.80/291.54 1091.80/291.54 #### Partial ranking functions of CR gt(V,V1,Out) 1091.80/291.54 * Partial RF of phase [22]: 1091.80/291.54 - RF of loop [22:1]: 1091.80/291.54 V 1091.80/291.54 V1 1091.80/291.54 1091.80/291.54 1091.80/291.54 ### Specialization of cost equations test/3 1091.80/291.54 * CE 22 is refined into CE [34,35] 1091.80/291.54 * CE 20 is refined into CE [36] 1091.80/291.54 * CE 18 is refined into CE [37,38,39,40] 1091.80/291.54 * CE 21 is refined into CE [41,42,43,44] 1091.80/291.54 * CE 19 is refined into CE [45] 1091.80/291.54 1091.80/291.54 1091.80/291.54 ### Cost equations --> "Loop" of test/3 1091.80/291.54 * CEs [45] --> Loop 23 1091.80/291.54 * CEs [35] --> Loop 24 1091.80/291.54 * CEs [36] --> Loop 25 1091.80/291.54 * CEs [38,39,40,44] --> Loop 26 1091.80/291.54 * CEs [43] --> Loop 27 1091.80/291.54 * CEs [37,42] --> Loop 28 1091.80/291.54 * CEs [34] --> Loop 29 1091.80/291.54 * CEs [41] --> Loop 30 1091.80/291.54 1091.80/291.54 ### Ranking functions of CR test(V,V1,Out) 1091.80/291.54 * RF of phase [23]: [V-V1] 1091.80/291.54 1091.80/291.54 #### Partial ranking functions of CR test(V,V1,Out) 1091.80/291.54 * Partial RF of phase [23]: 1091.80/291.54 - RF of loop [23:1]: 1091.80/291.54 V-V1 1091.80/291.54 1091.80/291.54 1091.80/291.54 ### Specialization of cost equations start/3 1091.80/291.54 * CE 1 is refined into CE [46,47,48,49,50] 1091.80/291.54 * CE 3 is refined into CE [51,52,53,54,55,56,57] 1091.80/291.54 * CE 5 is refined into CE [58,59] 1091.80/291.54 * CE 6 is refined into CE [60] 1091.80/291.54 * CE 2 is refined into CE [61] 1091.80/291.54 * CE 4 is refined into CE [62,63,64,65,66,67,68] 1091.80/291.54 * CE 7 is refined into CE [69] 1091.80/291.54 * CE 8 is refined into CE [70,71,72,73] 1091.80/291.54 * CE 9 is refined into CE [74,75,76,77,78] 1091.80/291.54 * CE 10 is refined into CE [79,80,81,82,83] 1091.80/291.54 * CE 11 is refined into CE [84,85,86,87,88,89,90] 1091.80/291.54 * CE 12 is refined into CE [91,92,93,94,95,96,97,98] 1091.80/291.54 1091.80/291.54 1091.80/291.54 ### Cost equations --> "Loop" of start/3 1091.80/291.54 * CEs [87,88,90] --> Loop 31 1091.80/291.54 * CEs [47,51,52,71,93] --> Loop 32 1091.80/291.54 * CEs [46,48,49,50,53,54,55,56,57,58,59,60,61,72,73,76,77,78,81,82,83,94,95,96,97,98] --> Loop 33 1091.80/291.54 * CEs [62,63,64,65,66,67,68,69,86,89] --> Loop 34 1091.80/291.54 * CEs [70,74,75,79,80,84,85,91,92] --> Loop 35 1091.80/291.54 1091.80/291.54 ### Ranking functions of CR start(V,V1,V9) 1091.80/291.54 1091.80/291.54 #### Partial ranking functions of CR start(V,V1,V9) 1091.80/291.54 1091.80/291.54 1091.80/291.54 Computing Bounds 1091.80/291.54 ===================================== 1091.80/291.54 1091.80/291.54 #### Cost of chains of div(V,V1,V9,Out): 1091.80/291.54 * Chain [[15,16],19]: 1*it(15)+1*it(16)+1 1091.80/291.54 Such that:it(15) =< V 1091.80/291.54 aux(6) =< -V1 1091.80/291.54 aux(5) =< -V1+1 1091.80/291.54 it(16) =< it(15)+aux(6) 1091.80/291.54 it(16) =< it(15)+aux(5) 1091.80/291.54 1091.80/291.54 with precondition: [Out=2,V>=1,V1>=0,V9>=0,V>=V1,V1+V9>=1] 1091.80/291.54 1091.80/291.54 * Chain [[15,16],18]: 1*it(15)+1*it(16)+1 1091.80/291.54 Such that:it(15) =< V 1091.80/291.54 aux(5) =< -V1+1 1091.80/291.54 it(16) =< it(15)+aux(5) 1091.80/291.54 1091.80/291.54 with precondition: [Out=1,V>=1,V1>=0,V9>=0,V1+V9>=1] 1091.80/291.54 1091.80/291.54 * Chain [[15,16],17]: 1*it(15)+1*it(16)+0 1091.80/291.54 Such that:it(15) =< V 1091.80/291.54 aux(5) =< -V1+1 1091.80/291.54 it(16) =< it(15)+aux(5) 1091.80/291.54 1091.80/291.54 with precondition: [Out=0,V>=1,V1>=0,V9>=0,V1+V9>=1] 1091.80/291.54 1091.80/291.54 * Chain [19]: 1 1091.80/291.54 with precondition: [V=0,V1=0,Out=2,V9>=0] 1091.80/291.54 1091.80/291.54 * Chain [18]: 1 1091.80/291.54 with precondition: [V=0,Out=1,V1>=1,V9>=0] 1091.80/291.54 1091.80/291.54 * Chain [17]: 0 1091.80/291.54 with precondition: [Out=0,V>=0,V1>=0,V9>=0] 1091.80/291.54 1091.80/291.54 1091.80/291.54 #### Cost of chains of gt(V,V1,Out): 1091.80/291.54 * Chain [[22],21]: 1*it(22)+1 1091.80/291.54 Such that:it(22) =< V 1091.80/291.54 1091.80/291.54 with precondition: [Out=1,V>=1,V1>=V] 1091.80/291.54 1091.80/291.54 * Chain [[22],20]: 1*it(22)+1 1091.80/291.54 Such that:it(22) =< V1 1091.80/291.54 1091.80/291.54 with precondition: [Out=2,V1>=1,V>=V1+1] 1091.80/291.54 1091.80/291.54 * Chain [21]: 1 1091.80/291.54 with precondition: [V=0,Out=1,V1>=0] 1091.80/291.54 1091.80/291.54 * Chain [20]: 1 1091.80/291.54 with precondition: [V1=0,Out=2,V>=1] 1091.80/291.54 1091.80/291.54 1091.80/291.54 #### Cost of chains of test(V,V1,Out): 1091.80/291.54 * Chain [[23],27]: 6*it(23)+1*s(4)+2*s(13)+1*s(15)+2 1091.80/291.54 Such that:s(16) =< -V1+1 1091.80/291.54 aux(14) =< V 1091.80/291.54 aux(15) =< V-V1 1091.80/291.54 s(4) =< aux(14) 1091.80/291.54 it(23) =< aux(15) 1091.80/291.54 s(16) =< aux(15) 1091.80/291.54 s(13) =< it(23)*aux(14) 1091.80/291.54 s(15) =< s(13)+s(16) 1091.80/291.54 1091.80/291.54 with precondition: [Out=0,V1>=1,V>=V1+1] 1091.80/291.54 1091.80/291.54 * Chain [[23],26]: 6*it(23)+2*s(13)+1*s(15)+7*s(17)+3*s(20)+5 1091.80/291.54 Such that:s(16) =< -V1+1 1091.80/291.54 aux(19) =< V 1091.80/291.54 aux(20) =< V-V1 1091.80/291.54 aux(21) =< -V1 1091.80/291.54 it(23) =< aux(20) 1091.80/291.54 s(16) =< aux(20) 1091.80/291.54 s(17) =< aux(19) 1091.80/291.54 s(20) =< s(17)+aux(21) 1091.80/291.54 s(13) =< it(23)*aux(19) 1091.80/291.54 s(15) =< s(13)+s(16) 1091.80/291.54 1091.80/291.54 with precondition: [Out=0,V1>=1,V>=V1+2] 1091.80/291.54 1091.80/291.54 * Chain [[23],25]: 6*it(23)+2*s(13)+1*s(15)+2*s(31)+1*s(35)+6 1091.80/291.54 Such that:s(16) =< -V1+1 1091.80/291.54 aux(22) =< V 1091.80/291.54 aux(23) =< V-V1 1091.80/291.54 aux(24) =< -V1 1091.80/291.54 s(31) =< aux(22) 1091.80/291.54 it(23) =< aux(23) 1091.80/291.54 s(16) =< aux(23) 1091.80/291.54 s(35) =< s(31)+aux(24) 1091.80/291.54 s(13) =< it(23)*aux(22) 1091.80/291.54 s(15) =< s(13)+s(16) 1091.80/291.54 1091.80/291.54 with precondition: [Out=1,V1>=1,V>=V1+2] 1091.80/291.54 1091.80/291.54 * Chain [[23],24]: 6*it(23)+2*s(13)+1*s(15)+1*s(36)+3 1091.80/291.54 Such that:s(16) =< -V1+1 1091.80/291.54 aux(25) =< V 1091.80/291.54 aux(26) =< V-V1 1091.80/291.54 s(36) =< aux(25) 1091.80/291.54 it(23) =< aux(26) 1091.80/291.54 s(16) =< aux(26) 1091.80/291.54 s(13) =< it(23)*aux(25) 1091.80/291.54 s(15) =< s(13)+s(16) 1091.80/291.54 1091.80/291.54 with precondition: [Out=2,V1>=1,V>=V1+1] 1091.80/291.54 1091.80/291.54 * Chain [30]: 2 1091.80/291.54 with precondition: [V=0,Out=0,V1>=0] 1091.80/291.54 1091.80/291.54 * Chain [29]: 3 1091.80/291.54 with precondition: [V=0,Out=2,V1>=0] 1091.80/291.54 1091.80/291.54 * Chain [28]: 1*s(37)+1*s(39)+4 1091.80/291.54 Such that:s(38) =< 1 1091.80/291.54 s(37) =< V 1091.80/291.54 s(39) =< s(37)+s(38) 1091.80/291.54 1091.80/291.54 with precondition: [V1=0,Out=0,V>=1] 1091.80/291.54 1091.80/291.54 * Chain [27]: 1*s(4)+2 1091.80/291.54 Such that:s(4) =< V 1091.80/291.54 1091.80/291.54 with precondition: [Out=0,V>=1,V1>=V] 1091.80/291.54 1091.80/291.54 * Chain [26]: 4*s(17)+3*s(18)+2*s(20)+1*s(29)+5 1091.80/291.54 Such that:s(27) =< -V1 1091.80/291.54 aux(16) =< V 1091.80/291.54 aux(17) =< -V1+1 1091.80/291.54 aux(18) =< V1 1091.80/291.54 s(18) =< aux(16) 1091.80/291.54 s(17) =< aux(18) 1091.80/291.54 s(20) =< s(18)+aux(17) 1091.80/291.54 s(29) =< s(18)+s(27) 1091.80/291.54 s(29) =< s(18)+aux(17) 1091.80/291.54 1091.80/291.54 with precondition: [Out=0,V1>=1,V>=V1+1] 1091.80/291.54 1091.80/291.54 * Chain [25]: 1*s(31)+1*s(32)+1*s(35)+6 1091.80/291.54 Such that:s(32) =< V 1091.80/291.54 s(33) =< -V1 1091.80/291.54 s(34) =< -V1+1 1091.80/291.54 s(31) =< V1 1091.80/291.54 s(35) =< s(32)+s(33) 1091.80/291.54 s(35) =< s(32)+s(34) 1091.80/291.54 1091.80/291.54 with precondition: [Out=1,V1>=1,V>=V1+1] 1091.80/291.54 1091.80/291.54 * Chain [24]: 1*s(36)+3 1091.80/291.54 Such that:s(36) =< V 1091.80/291.54 1091.80/291.54 with precondition: [Out=2,V>=1,V1>=V] 1091.80/291.54 1091.80/291.54 1091.80/291.54 #### Cost of chains of start(V,V1,V9): 1091.80/291.54 * Chain [35]: 4 1091.80/291.54 with precondition: [V=0] 1091.80/291.54 1091.80/291.54 * Chain [34]: 17*s(78)+5*s(86)+8*s(87)+24*s(89)+8*s(91)+4*s(92)+2*s(113)+7 1091.80/291.54 Such that:aux(36) =< V 1091.80/291.54 aux(37) =< V1 1091.80/291.54 aux(38) =< V1-V9 1091.80/291.54 aux(39) =< -V9 1091.80/291.54 aux(40) =< V9+1 1091.80/291.54 s(113) =< aux(36) 1091.80/291.54 s(78) =< aux(37) 1091.80/291.54 s(84) =< aux(39) 1091.80/291.54 s(86) =< aux(40) 1091.80/291.54 s(87) =< s(78)+aux(39) 1091.80/291.54 s(89) =< aux(38) 1091.80/291.54 s(84) =< aux(38) 1091.80/291.54 s(91) =< s(89)*aux(37) 1091.80/291.54 s(92) =< s(91)+s(84) 1091.80/291.54 1091.80/291.54 with precondition: [2>=V,V>=1] 1091.80/291.54 1091.80/291.54 * Chain [33]: 32*s(115)+7*s(117)+2*s(124)+5*s(139)+8*s(140)+24*s(142)+8*s(144)+4*s(145)+24*s(179)+6*s(183)+4*s(190)+24*s(212)+4*s(213)+8*s(214)+4*s(215)+10 1091.80/291.54 Such that:aux(48) =< V 1091.80/291.54 aux(49) =< V-V1 1091.80/291.54 aux(50) =< -V1 1091.80/291.54 aux(51) =< -V1+1 1091.80/291.54 aux(52) =< V1 1091.80/291.54 aux(53) =< V1-V9 1091.80/291.54 aux(54) =< -V9 1091.80/291.54 aux(55) =< -V9+1 1091.80/291.54 aux(56) =< V9+1 1091.80/291.54 s(179) =< aux(48) 1091.80/291.54 s(207) =< aux(51) 1091.80/291.54 s(115) =< aux(52) 1091.80/291.54 s(137) =< aux(54) 1091.80/291.54 s(139) =< aux(56) 1091.80/291.54 s(183) =< s(179)+aux(51) 1091.80/291.54 s(190) =< s(179)+aux(50) 1091.80/291.54 s(190) =< s(179)+aux(51) 1091.80/291.54 s(212) =< aux(49) 1091.80/291.54 s(207) =< aux(49) 1091.80/291.54 s(213) =< s(179)+aux(50) 1091.80/291.54 s(214) =< s(212)*aux(48) 1091.80/291.54 s(215) =< s(214)+s(207) 1091.80/291.54 s(117) =< s(115)+aux(55) 1091.80/291.54 s(124) =< s(115)+aux(54) 1091.80/291.54 s(124) =< s(115)+aux(55) 1091.80/291.54 s(140) =< s(115)+aux(54) 1091.80/291.54 s(142) =< aux(53) 1091.80/291.54 s(137) =< aux(53) 1091.80/291.54 s(144) =< s(142)*aux(52) 1091.80/291.54 s(145) =< s(144)+s(137) 1091.80/291.54 1091.80/291.54 with precondition: [V>=0,V1>=0] 1091.80/291.54 1091.80/291.54 * Chain [32]: 1*s(237)+1*s(238)+7 1091.80/291.54 Such that:s(236) =< 1 1091.80/291.54 s(237) =< V 1091.80/291.54 s(238) =< s(237)+s(236) 1091.80/291.54 1091.80/291.54 with precondition: [V1=0,V>=1] 1091.80/291.54 1091.80/291.54 * Chain [31]: 39*s(245)+5*s(246)+8*s(247)+8*s(251)+4*s(252)+7 1091.80/291.54 Such that:aux(62) =< 2 1091.80/291.54 aux(63) =< V 1091.80/291.54 s(246) =< aux(62) 1091.80/291.54 s(245) =< aux(63) 1091.80/291.54 s(247) =< s(245) 1091.80/291.54 s(251) =< s(245)*aux(63) 1091.80/291.54 s(252) =< s(251) 1091.80/291.54 1091.80/291.54 with precondition: [V>=3] 1091.80/291.54 1091.80/291.54 1091.80/291.54 Closed-form bounds of start(V,V1,V9): 1091.80/291.54 ------------------------------------- 1091.80/291.54 * Chain [35] with precondition: [V=0] 1091.80/291.54 - Upper bound: 4 1091.80/291.54 - Complexity: constant 1091.80/291.54 * Chain [34] with precondition: [2>=V,V>=1] 1091.80/291.54 - Upper bound: 2*V+7+nat(V1)*25+nat(V1)*12*nat(V1-V9)+nat(-V9)*12+nat(V9+1)*5+nat(V1-V9)*24 1091.80/291.54 - Complexity: n^2 1091.80/291.54 * Chain [33] with precondition: [V>=0,V1>=0] 1091.80/291.54 - Upper bound: 38*V+10+12*V*nat(V-V1)+49*V1+12*V1*nat(V1-V9)+nat(-V9)*14+nat(V9+1)*5+nat(-V1+1)*10+nat(-V9+1)*7+nat(V-V1)*24+nat(V1-V9)*24 1091.80/291.54 - Complexity: n^2 1091.80/291.54 * Chain [32] with precondition: [V1=0,V>=1] 1091.80/291.54 - Upper bound: 2*V+8 1091.80/291.54 - Complexity: n 1091.80/291.54 * Chain [31] with precondition: [V>=3] 1091.80/291.54 - Upper bound: 47*V+17+12*V*V 1091.80/291.54 - Complexity: n^2 1091.80/291.54 1091.80/291.54 ### Maximum cost of start(V,V1,V9): 2*V+3+max([max([1,nat(V1)*12*nat(V1-V9)+nat(V1)*25+nat(-V9)*12+nat(V9+1)*5+nat(V1-V9)*24]),36*V+3+max([9*V+7+12*V*V,12*V*nat(V-V1)+nat(V1)*49+nat(V1)*12*nat(V1-V9)+nat(-V9)*14+nat(V9+1)*5+nat(-V1+1)*10+nat(-V9+1)*7+nat(V-V1)*24+nat(V1-V9)*24])])+4 1091.80/291.54 Asymptotic class: n^2 1091.80/291.54 * Total analysis performed in 671 ms. 1091.80/291.54 1091.80/291.54 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (10) 1091.80/291.54 BOUNDS(1, n^2) 1091.80/291.54 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (11) RenamingProof (BOTH BOUNDS(ID, ID)) 1091.80/291.54 Renamed function symbols to avoid clashes with predefined symbol. 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (12) 1091.80/291.54 Obligation: 1091.80/291.54 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, INF). 1091.80/291.54 1091.80/291.54 1091.80/291.54 The TRS R consists of the following rules: 1091.80/291.54 1091.80/291.54 gt(s(x), 0') -> true 1091.80/291.54 gt(0', y) -> false 1091.80/291.54 gt(s(x), s(y)) -> gt(x, y) 1091.80/291.54 divides(x, y) -> div(x, y, y) 1091.80/291.54 div(0', 0', z) -> true 1091.80/291.54 div(0', s(x), z) -> false 1091.80/291.54 div(s(x), 0', s(z)) -> div(s(x), s(z), s(z)) 1091.80/291.54 div(s(x), s(y), z) -> div(x, y, z) 1091.80/291.54 prime(x) -> test(x, s(s(0'))) 1091.80/291.54 test(x, y) -> if1(gt(x, y), x, y) 1091.80/291.54 if1(true, x, y) -> if2(divides(x, y), x, y) 1091.80/291.54 if1(false, x, y) -> true 1091.80/291.54 if2(true, x, y) -> false 1091.80/291.54 if2(false, x, y) -> test(x, s(y)) 1091.80/291.54 1091.80/291.54 S is empty. 1091.80/291.54 Rewrite Strategy: INNERMOST 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (13) TypeInferenceProof (BOTH BOUNDS(ID, ID)) 1091.80/291.54 Infered types. 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (14) 1091.80/291.54 Obligation: 1091.80/291.54 Innermost TRS: 1091.80/291.54 Rules: 1091.80/291.54 gt(s(x), 0') -> true 1091.80/291.54 gt(0', y) -> false 1091.80/291.54 gt(s(x), s(y)) -> gt(x, y) 1091.80/291.54 divides(x, y) -> div(x, y, y) 1091.80/291.54 div(0', 0', z) -> true 1091.80/291.54 div(0', s(x), z) -> false 1091.80/291.54 div(s(x), 0', s(z)) -> div(s(x), s(z), s(z)) 1091.80/291.54 div(s(x), s(y), z) -> div(x, y, z) 1091.80/291.54 prime(x) -> test(x, s(s(0'))) 1091.80/291.54 test(x, y) -> if1(gt(x, y), x, y) 1091.80/291.54 if1(true, x, y) -> if2(divides(x, y), x, y) 1091.80/291.54 if1(false, x, y) -> true 1091.80/291.54 if2(true, x, y) -> false 1091.80/291.54 if2(false, x, y) -> test(x, s(y)) 1091.80/291.54 1091.80/291.54 Types: 1091.80/291.54 gt :: s:0' -> s:0' -> true:false 1091.80/291.54 s :: s:0' -> s:0' 1091.80/291.54 0' :: s:0' 1091.80/291.54 true :: true:false 1091.80/291.54 false :: true:false 1091.80/291.54 divides :: s:0' -> s:0' -> true:false 1091.80/291.54 div :: s:0' -> s:0' -> s:0' -> true:false 1091.80/291.54 prime :: s:0' -> true:false 1091.80/291.54 test :: s:0' -> s:0' -> true:false 1091.80/291.54 if1 :: true:false -> s:0' -> s:0' -> true:false 1091.80/291.54 if2 :: true:false -> s:0' -> s:0' -> true:false 1091.80/291.54 hole_true:false1_0 :: true:false 1091.80/291.54 hole_s:0'2_0 :: s:0' 1091.80/291.54 gen_s:0'3_0 :: Nat -> s:0' 1091.80/291.54 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (15) OrderProof (LOWER BOUND(ID)) 1091.80/291.54 Heuristically decided to analyse the following defined symbols: 1091.80/291.54 gt, div, test 1091.80/291.54 1091.80/291.54 They will be analysed ascendingly in the following order: 1091.80/291.54 gt < test 1091.80/291.54 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (16) 1091.80/291.54 Obligation: 1091.80/291.54 Innermost TRS: 1091.80/291.54 Rules: 1091.80/291.54 gt(s(x), 0') -> true 1091.80/291.54 gt(0', y) -> false 1091.80/291.54 gt(s(x), s(y)) -> gt(x, y) 1091.80/291.54 divides(x, y) -> div(x, y, y) 1091.80/291.54 div(0', 0', z) -> true 1091.80/291.54 div(0', s(x), z) -> false 1091.80/291.54 div(s(x), 0', s(z)) -> div(s(x), s(z), s(z)) 1091.80/291.54 div(s(x), s(y), z) -> div(x, y, z) 1091.80/291.54 prime(x) -> test(x, s(s(0'))) 1091.80/291.54 test(x, y) -> if1(gt(x, y), x, y) 1091.80/291.54 if1(true, x, y) -> if2(divides(x, y), x, y) 1091.80/291.54 if1(false, x, y) -> true 1091.80/291.54 if2(true, x, y) -> false 1091.80/291.54 if2(false, x, y) -> test(x, s(y)) 1091.80/291.54 1091.80/291.54 Types: 1091.80/291.54 gt :: s:0' -> s:0' -> true:false 1091.80/291.54 s :: s:0' -> s:0' 1091.80/291.54 0' :: s:0' 1091.80/291.54 true :: true:false 1091.80/291.54 false :: true:false 1091.80/291.54 divides :: s:0' -> s:0' -> true:false 1091.80/291.54 div :: s:0' -> s:0' -> s:0' -> true:false 1091.80/291.54 prime :: s:0' -> true:false 1091.80/291.54 test :: s:0' -> s:0' -> true:false 1091.80/291.54 if1 :: true:false -> s:0' -> s:0' -> true:false 1091.80/291.54 if2 :: true:false -> s:0' -> s:0' -> true:false 1091.80/291.54 hole_true:false1_0 :: true:false 1091.80/291.54 hole_s:0'2_0 :: s:0' 1091.80/291.54 gen_s:0'3_0 :: Nat -> s:0' 1091.80/291.54 1091.80/291.54 1091.80/291.54 Generator Equations: 1091.80/291.54 gen_s:0'3_0(0) <=> 0' 1091.80/291.54 gen_s:0'3_0(+(x, 1)) <=> s(gen_s:0'3_0(x)) 1091.80/291.54 1091.80/291.54 1091.80/291.54 The following defined symbols remain to be analysed: 1091.80/291.54 gt, div, test 1091.80/291.54 1091.80/291.54 They will be analysed ascendingly in the following order: 1091.80/291.54 gt < test 1091.80/291.54 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (17) RewriteLemmaProof (LOWER BOUND(ID)) 1091.80/291.54 Proved the following rewrite lemma: 1091.80/291.54 gt(gen_s:0'3_0(+(1, n5_0)), gen_s:0'3_0(n5_0)) -> true, rt in Omega(1 + n5_0) 1091.80/291.54 1091.80/291.54 Induction Base: 1091.80/291.54 gt(gen_s:0'3_0(+(1, 0)), gen_s:0'3_0(0)) ->_R^Omega(1) 1091.80/291.54 true 1091.80/291.54 1091.80/291.54 Induction Step: 1091.80/291.54 gt(gen_s:0'3_0(+(1, +(n5_0, 1))), gen_s:0'3_0(+(n5_0, 1))) ->_R^Omega(1) 1091.80/291.54 gt(gen_s:0'3_0(+(1, n5_0)), gen_s:0'3_0(n5_0)) ->_IH 1091.80/291.54 true 1091.80/291.54 1091.80/291.54 We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (18) 1091.80/291.54 Complex Obligation (BEST) 1091.80/291.54 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (19) 1091.80/291.54 Obligation: 1091.80/291.54 Proved the lower bound n^1 for the following obligation: 1091.80/291.54 1091.80/291.54 Innermost TRS: 1091.80/291.54 Rules: 1091.80/291.54 gt(s(x), 0') -> true 1091.80/291.54 gt(0', y) -> false 1091.80/291.54 gt(s(x), s(y)) -> gt(x, y) 1091.80/291.54 divides(x, y) -> div(x, y, y) 1091.80/291.54 div(0', 0', z) -> true 1091.80/291.54 div(0', s(x), z) -> false 1091.80/291.54 div(s(x), 0', s(z)) -> div(s(x), s(z), s(z)) 1091.80/291.54 div(s(x), s(y), z) -> div(x, y, z) 1091.80/291.54 prime(x) -> test(x, s(s(0'))) 1091.80/291.54 test(x, y) -> if1(gt(x, y), x, y) 1091.80/291.54 if1(true, x, y) -> if2(divides(x, y), x, y) 1091.80/291.54 if1(false, x, y) -> true 1091.80/291.54 if2(true, x, y) -> false 1091.80/291.54 if2(false, x, y) -> test(x, s(y)) 1091.80/291.54 1091.80/291.54 Types: 1091.80/291.54 gt :: s:0' -> s:0' -> true:false 1091.80/291.54 s :: s:0' -> s:0' 1091.80/291.54 0' :: s:0' 1091.80/291.54 true :: true:false 1091.80/291.54 false :: true:false 1091.80/291.54 divides :: s:0' -> s:0' -> true:false 1091.80/291.54 div :: s:0' -> s:0' -> s:0' -> true:false 1091.80/291.54 prime :: s:0' -> true:false 1091.80/291.54 test :: s:0' -> s:0' -> true:false 1091.80/291.54 if1 :: true:false -> s:0' -> s:0' -> true:false 1091.80/291.54 if2 :: true:false -> s:0' -> s:0' -> true:false 1091.80/291.54 hole_true:false1_0 :: true:false 1091.80/291.54 hole_s:0'2_0 :: s:0' 1091.80/291.54 gen_s:0'3_0 :: Nat -> s:0' 1091.80/291.54 1091.80/291.54 1091.80/291.54 Generator Equations: 1091.80/291.54 gen_s:0'3_0(0) <=> 0' 1091.80/291.54 gen_s:0'3_0(+(x, 1)) <=> s(gen_s:0'3_0(x)) 1091.80/291.54 1091.80/291.54 1091.80/291.54 The following defined symbols remain to be analysed: 1091.80/291.54 gt, div, test 1091.80/291.54 1091.80/291.54 They will be analysed ascendingly in the following order: 1091.80/291.54 gt < test 1091.80/291.54 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (20) LowerBoundPropagationProof (FINISHED) 1091.80/291.54 Propagated lower bound. 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (21) 1091.80/291.54 BOUNDS(n^1, INF) 1091.80/291.54 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (22) 1091.80/291.54 Obligation: 1091.80/291.54 Innermost TRS: 1091.80/291.54 Rules: 1091.80/291.54 gt(s(x), 0') -> true 1091.80/291.54 gt(0', y) -> false 1091.80/291.54 gt(s(x), s(y)) -> gt(x, y) 1091.80/291.54 divides(x, y) -> div(x, y, y) 1091.80/291.54 div(0', 0', z) -> true 1091.80/291.54 div(0', s(x), z) -> false 1091.80/291.54 div(s(x), 0', s(z)) -> div(s(x), s(z), s(z)) 1091.80/291.54 div(s(x), s(y), z) -> div(x, y, z) 1091.80/291.54 prime(x) -> test(x, s(s(0'))) 1091.80/291.54 test(x, y) -> if1(gt(x, y), x, y) 1091.80/291.54 if1(true, x, y) -> if2(divides(x, y), x, y) 1091.80/291.54 if1(false, x, y) -> true 1091.80/291.54 if2(true, x, y) -> false 1091.80/291.54 if2(false, x, y) -> test(x, s(y)) 1091.80/291.54 1091.80/291.54 Types: 1091.80/291.54 gt :: s:0' -> s:0' -> true:false 1091.80/291.54 s :: s:0' -> s:0' 1091.80/291.54 0' :: s:0' 1091.80/291.54 true :: true:false 1091.80/291.54 false :: true:false 1091.80/291.54 divides :: s:0' -> s:0' -> true:false 1091.80/291.54 div :: s:0' -> s:0' -> s:0' -> true:false 1091.80/291.54 prime :: s:0' -> true:false 1091.80/291.54 test :: s:0' -> s:0' -> true:false 1091.80/291.54 if1 :: true:false -> s:0' -> s:0' -> true:false 1091.80/291.54 if2 :: true:false -> s:0' -> s:0' -> true:false 1091.80/291.54 hole_true:false1_0 :: true:false 1091.80/291.54 hole_s:0'2_0 :: s:0' 1091.80/291.54 gen_s:0'3_0 :: Nat -> s:0' 1091.80/291.54 1091.80/291.54 1091.80/291.54 Lemmas: 1091.80/291.54 gt(gen_s:0'3_0(+(1, n5_0)), gen_s:0'3_0(n5_0)) -> true, rt in Omega(1 + n5_0) 1091.80/291.54 1091.80/291.54 1091.80/291.54 Generator Equations: 1091.80/291.54 gen_s:0'3_0(0) <=> 0' 1091.80/291.54 gen_s:0'3_0(+(x, 1)) <=> s(gen_s:0'3_0(x)) 1091.80/291.54 1091.80/291.54 1091.80/291.54 The following defined symbols remain to be analysed: 1091.80/291.54 div, test 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (23) RewriteLemmaProof (LOWER BOUND(ID)) 1091.80/291.54 Proved the following rewrite lemma: 1091.80/291.54 div(gen_s:0'3_0(n276_0), gen_s:0'3_0(n276_0), gen_s:0'3_0(c)) -> true, rt in Omega(1 + n276_0) 1091.80/291.54 1091.80/291.54 Induction Base: 1091.80/291.54 div(gen_s:0'3_0(0), gen_s:0'3_0(0), gen_s:0'3_0(c)) ->_R^Omega(1) 1091.80/291.54 true 1091.80/291.54 1091.80/291.54 Induction Step: 1091.80/291.54 div(gen_s:0'3_0(+(n276_0, 1)), gen_s:0'3_0(+(n276_0, 1)), gen_s:0'3_0(c)) ->_R^Omega(1) 1091.80/291.54 div(gen_s:0'3_0(n276_0), gen_s:0'3_0(n276_0), gen_s:0'3_0(c)) ->_IH 1091.80/291.54 true 1091.80/291.54 1091.80/291.54 We have rt in Omega(n^1) and sz in O(n). Thus, we have irc_R in Omega(n). 1091.80/291.54 ---------------------------------------- 1091.80/291.54 1091.80/291.54 (24) 1091.80/291.54 Obligation: 1091.80/291.54 Innermost TRS: 1091.80/291.54 Rules: 1091.80/291.54 gt(s(x), 0') -> true 1091.80/291.54 gt(0', y) -> false 1091.80/291.54 gt(s(x), s(y)) -> gt(x, y) 1091.80/291.54 divides(x, y) -> div(x, y, y) 1091.80/291.54 div(0', 0', z) -> true 1091.80/291.54 div(0', s(x), z) -> false 1091.80/291.54 div(s(x), 0', s(z)) -> div(s(x), s(z), s(z)) 1091.80/291.54 div(s(x), s(y), z) -> div(x, y, z) 1091.80/291.54 prime(x) -> test(x, s(s(0'))) 1091.80/291.54 test(x, y) -> if1(gt(x, y), x, y) 1091.80/291.54 if1(true, x, y) -> if2(divides(x, y), x, y) 1091.80/291.54 if1(false, x, y) -> true 1091.80/291.54 if2(true, x, y) -> false 1091.80/291.54 if2(false, x, y) -> test(x, s(y)) 1091.80/291.54 1091.80/291.54 Types: 1091.80/291.54 gt :: s:0' -> s:0' -> true:false 1091.80/291.54 s :: s:0' -> s:0' 1091.80/291.54 0' :: s:0' 1091.80/291.54 true :: true:false 1091.80/291.54 false :: true:false 1091.80/291.54 divides :: s:0' -> s:0' -> true:false 1091.80/291.54 div :: s:0' -> s:0' -> s:0' -> true:false 1091.80/291.54 prime :: s:0' -> true:false 1091.80/291.54 test :: s:0' -> s:0' -> true:false 1091.80/291.54 if1 :: true:false -> s:0' -> s:0' -> true:false 1091.80/291.54 if2 :: true:false -> s:0' -> s:0' -> true:false 1091.80/291.54 hole_true:false1_0 :: true:false 1091.80/291.54 hole_s:0'2_0 :: s:0' 1091.80/291.54 gen_s:0'3_0 :: Nat -> s:0' 1091.80/291.54 1091.80/291.54 1091.80/291.54 Lemmas: 1091.80/291.54 gt(gen_s:0'3_0(+(1, n5_0)), gen_s:0'3_0(n5_0)) -> true, rt in Omega(1 + n5_0) 1091.80/291.54 div(gen_s:0'3_0(n276_0), gen_s:0'3_0(n276_0), gen_s:0'3_0(c)) -> true, rt in Omega(1 + n276_0) 1091.80/291.54 1091.80/291.54 1091.80/291.54 Generator Equations: 1091.80/291.54 gen_s:0'3_0(0) <=> 0' 1091.80/291.54 gen_s:0'3_0(+(x, 1)) <=> s(gen_s:0'3_0(x)) 1091.80/291.54 1091.80/291.54 1091.80/291.54 The following defined symbols remain to be analysed: 1091.80/291.54 test 1091.90/291.57 EOF