14.37/4.55 WORST_CASE(Omega(n^1), O(n^1)) 14.37/4.57 proof of /export/starexec/sandbox/benchmark/theBenchmark.xml 14.37/4.57 # AProVE Commit ID: 48fb2092695e11cc9f56e44b17a92a5f88ffb256 marcel 20180622 unpublished dirty 14.37/4.57 14.37/4.57 14.37/4.57 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). 14.37/4.57 14.37/4.57 (0) CpxTRS 14.37/4.57 (1) RelTrsToWeightedTrsProof [BOTH BOUNDS(ID, ID), 0 ms] 14.37/4.57 (2) CpxWeightedTrs 14.37/4.57 (3) TypeInferenceProof [BOTH BOUNDS(ID, ID), 0 ms] 14.37/4.57 (4) CpxTypedWeightedTrs 14.37/4.57 (5) CompletionProof [UPPER BOUND(ID), 0 ms] 14.37/4.57 (6) CpxTypedWeightedCompleteTrs 14.37/4.57 (7) CpxTypedWeightedTrsToRntsProof [UPPER BOUND(ID), 0 ms] 14.37/4.57 (8) CpxRNTS 14.37/4.57 (9) CompleteCoflocoProof [FINISHED, 263 ms] 14.37/4.57 (10) BOUNDS(1, n^1) 14.37/4.57 (11) RelTrsToDecreasingLoopProblemProof [LOWER BOUND(ID), 0 ms] 14.37/4.57 (12) TRS for Loop Detection 14.37/4.57 (13) DecreasingLoopProof [LOWER BOUND(ID), 0 ms] 14.37/4.57 (14) BEST 14.37/4.57 (15) proven lower bound 14.37/4.57 (16) LowerBoundPropagationProof [FINISHED, 0 ms] 14.37/4.57 (17) BOUNDS(n^1, INF) 14.37/4.57 (18) TRS for Loop Detection 14.37/4.57 14.37/4.57 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (0) 14.37/4.57 Obligation: 14.37/4.57 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). 14.37/4.57 14.37/4.57 14.37/4.57 The TRS R consists of the following rules: 14.37/4.57 14.37/4.57 or(true, y) -> true 14.37/4.57 or(x, true) -> true 14.37/4.57 or(false, false) -> false 14.37/4.57 mem(x, nil) -> false 14.37/4.57 mem(x, set(y)) -> =(x, y) 14.37/4.57 mem(x, union(y, z)) -> or(mem(x, y), mem(x, z)) 14.37/4.57 14.37/4.57 S is empty. 14.37/4.57 Rewrite Strategy: INNERMOST 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (1) RelTrsToWeightedTrsProof (BOTH BOUNDS(ID, ID)) 14.37/4.57 Transformed relative TRS to weighted TRS 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (2) 14.37/4.57 Obligation: 14.37/4.57 The Runtime Complexity (innermost) of the given CpxWeightedTrs could be proven to be BOUNDS(1, n^1). 14.37/4.57 14.37/4.57 14.37/4.57 The TRS R consists of the following rules: 14.37/4.57 14.37/4.57 or(true, y) -> true [1] 14.37/4.57 or(x, true) -> true [1] 14.37/4.57 or(false, false) -> false [1] 14.37/4.57 mem(x, nil) -> false [1] 14.37/4.57 mem(x, set(y)) -> =(x, y) [1] 14.37/4.57 mem(x, union(y, z)) -> or(mem(x, y), mem(x, z)) [1] 14.37/4.57 14.37/4.57 Rewrite Strategy: INNERMOST 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (3) TypeInferenceProof (BOTH BOUNDS(ID, ID)) 14.37/4.57 Infered types. 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (4) 14.37/4.57 Obligation: 14.37/4.57 Runtime Complexity Weighted TRS with Types. 14.37/4.57 The TRS R consists of the following rules: 14.37/4.57 14.37/4.57 or(true, y) -> true [1] 14.37/4.57 or(x, true) -> true [1] 14.37/4.57 or(false, false) -> false [1] 14.37/4.57 mem(x, nil) -> false [1] 14.37/4.57 mem(x, set(y)) -> =(x, y) [1] 14.37/4.57 mem(x, union(y, z)) -> or(mem(x, y), mem(x, z)) [1] 14.37/4.57 14.37/4.57 The TRS has the following type information: 14.37/4.57 or :: true:false:= -> true:false:= -> true:false:= 14.37/4.57 true :: true:false:= 14.37/4.57 false :: true:false:= 14.37/4.57 mem :: a -> nil:set:union -> true:false:= 14.37/4.57 nil :: nil:set:union 14.37/4.57 set :: b -> nil:set:union 14.37/4.57 = :: a -> b -> true:false:= 14.37/4.57 union :: nil:set:union -> nil:set:union -> nil:set:union 14.37/4.57 14.37/4.57 Rewrite Strategy: INNERMOST 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (5) CompletionProof (UPPER BOUND(ID)) 14.37/4.57 The TRS is a completely defined constructor system, as every type has a constant constructor and the following rules were added: 14.37/4.57 14.37/4.57 or(v0, v1) -> null_or [0] 14.37/4.57 14.37/4.57 And the following fresh constants: null_or, const, const1 14.37/4.57 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (6) 14.37/4.57 Obligation: 14.37/4.57 Runtime Complexity Weighted TRS where all functions are completely defined. The underlying TRS is: 14.37/4.57 14.37/4.57 Runtime Complexity Weighted TRS with Types. 14.37/4.57 The TRS R consists of the following rules: 14.37/4.57 14.37/4.57 or(true, y) -> true [1] 14.37/4.57 or(x, true) -> true [1] 14.37/4.57 or(false, false) -> false [1] 14.37/4.57 mem(x, nil) -> false [1] 14.37/4.57 mem(x, set(y)) -> =(x, y) [1] 14.37/4.57 mem(x, union(y, z)) -> or(mem(x, y), mem(x, z)) [1] 14.37/4.57 or(v0, v1) -> null_or [0] 14.37/4.57 14.37/4.57 The TRS has the following type information: 14.37/4.57 or :: true:false:=:null_or -> true:false:=:null_or -> true:false:=:null_or 14.37/4.57 true :: true:false:=:null_or 14.37/4.57 false :: true:false:=:null_or 14.37/4.57 mem :: a -> nil:set:union -> true:false:=:null_or 14.37/4.57 nil :: nil:set:union 14.37/4.57 set :: b -> nil:set:union 14.37/4.57 = :: a -> b -> true:false:=:null_or 14.37/4.57 union :: nil:set:union -> nil:set:union -> nil:set:union 14.37/4.57 null_or :: true:false:=:null_or 14.37/4.57 const :: a 14.37/4.57 const1 :: b 14.37/4.57 14.37/4.57 Rewrite Strategy: INNERMOST 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (7) CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID)) 14.37/4.57 Transformed the TRS into an over-approximating RNTS by (improved) Size Abstraction. 14.37/4.57 The constant constructors are abstracted as follows: 14.37/4.57 14.37/4.57 true => 1 14.37/4.57 false => 0 14.37/4.57 nil => 0 14.37/4.57 null_or => 0 14.37/4.57 const => 0 14.37/4.57 const1 => 0 14.37/4.57 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (8) 14.37/4.57 Obligation: 14.37/4.57 Complexity RNTS consisting of the following rules: 14.37/4.57 14.37/4.57 mem(z', z'') -{ 1 }-> or(mem(x, y), mem(x, z)) :|: z >= 0, z' = x, x >= 0, y >= 0, z'' = 1 + y + z 14.37/4.57 mem(z', z'') -{ 1 }-> 0 :|: z'' = 0, z' = x, x >= 0 14.37/4.57 mem(z', z'') -{ 1 }-> 1 + x + y :|: z' = x, x >= 0, y >= 0, z'' = 1 + y 14.37/4.57 or(z', z'') -{ 1 }-> 1 :|: z'' = y, y >= 0, z' = 1 14.37/4.57 or(z', z'') -{ 1 }-> 1 :|: z' = x, x >= 0, z'' = 1 14.37/4.57 or(z', z'') -{ 1 }-> 0 :|: z'' = 0, z' = 0 14.37/4.57 or(z', z'') -{ 0 }-> 0 :|: v0 >= 0, v1 >= 0, z'' = v1, z' = v0 14.37/4.57 14.37/4.57 Only complete derivations are relevant for the runtime complexity. 14.37/4.57 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (9) CompleteCoflocoProof (FINISHED) 14.37/4.57 Transformed the RNTS (where only complete derivations are relevant) into cost relations for CoFloCo: 14.37/4.57 14.37/4.57 eq(start(V, V1),0,[or(V, V1, Out)],[V >= 0,V1 >= 0]). 14.37/4.57 eq(start(V, V1),0,[mem(V, V1, Out)],[V >= 0,V1 >= 0]). 14.37/4.57 eq(or(V, V1, Out),1,[],[Out = 1,V1 = V2,V2 >= 0,V = 1]). 14.37/4.57 eq(or(V, V1, Out),1,[],[Out = 1,V = V3,V3 >= 0,V1 = 1]). 14.37/4.57 eq(or(V, V1, Out),1,[],[Out = 0,V1 = 0,V = 0]). 14.37/4.57 eq(mem(V, V1, Out),1,[],[Out = 0,V1 = 0,V = V4,V4 >= 0]). 14.37/4.57 eq(mem(V, V1, Out),1,[],[Out = 1 + V5 + V6,V = V5,V5 >= 0,V6 >= 0,V1 = 1 + V6]). 14.37/4.57 eq(mem(V, V1, Out),1,[mem(V7, V8, Ret0),mem(V7, V9, Ret1),or(Ret0, Ret1, Ret)],[Out = Ret,V9 >= 0,V = V7,V7 >= 0,V8 >= 0,V1 = 1 + V8 + V9]). 14.37/4.57 eq(or(V, V1, Out),0,[],[Out = 0,V11 >= 0,V10 >= 0,V1 = V10,V = V11]). 14.37/4.57 input_output_vars(or(V,V1,Out),[V,V1],[Out]). 14.37/4.57 input_output_vars(mem(V,V1,Out),[V,V1],[Out]). 14.37/4.57 14.37/4.57 14.37/4.57 CoFloCo proof output: 14.37/4.57 Preprocessing Cost Relations 14.37/4.57 ===================================== 14.37/4.57 14.37/4.57 #### Computed strongly connected components 14.37/4.57 0. non_recursive : [or/3] 14.37/4.57 1. recursive [non_tail,multiple] : [mem/3] 14.37/4.57 2. non_recursive : [start/2] 14.37/4.57 14.37/4.57 #### Obtained direct recursion through partial evaluation 14.37/4.57 0. SCC is partially evaluated into or/3 14.37/4.57 1. SCC is partially evaluated into mem/3 14.37/4.57 2. SCC is partially evaluated into start/2 14.37/4.57 14.37/4.57 Control-Flow Refinement of Cost Relations 14.37/4.57 ===================================== 14.37/4.57 14.37/4.57 ### Specialization of cost equations or/3 14.37/4.57 * CE 4 is refined into CE [10] 14.37/4.57 * CE 3 is refined into CE [11] 14.37/4.57 * CE 5 is refined into CE [12] 14.37/4.57 * CE 6 is refined into CE [13] 14.37/4.57 14.37/4.57 14.37/4.57 ### Cost equations --> "Loop" of or/3 14.37/4.57 * CEs [10] --> Loop 8 14.37/4.57 * CEs [11] --> Loop 9 14.37/4.57 * CEs [12,13] --> Loop 10 14.37/4.57 14.37/4.57 ### Ranking functions of CR or(V,V1,Out) 14.37/4.57 14.37/4.57 #### Partial ranking functions of CR or(V,V1,Out) 14.37/4.57 14.37/4.57 14.37/4.57 ### Specialization of cost equations mem/3 14.37/4.57 * CE 9 is refined into CE [14,15,16] 14.37/4.57 * CE 8 is refined into CE [17] 14.37/4.57 * CE 7 is refined into CE [18] 14.37/4.57 14.37/4.57 14.37/4.57 ### Cost equations --> "Loop" of mem/3 14.37/4.57 * CEs [17] --> Loop 11 14.37/4.57 * CEs [18] --> Loop 12 14.37/4.57 * CEs [15] --> Loop 13 14.37/4.57 * CEs [14] --> Loop 14 14.37/4.57 * CEs [16] --> Loop 15 14.37/4.57 14.37/4.57 ### Ranking functions of CR mem(V,V1,Out) 14.37/4.57 * RF of phase [13,14,15]: [V1] 14.37/4.57 14.37/4.57 #### Partial ranking functions of CR mem(V,V1,Out) 14.37/4.57 * Partial RF of phase [13,14,15]: 14.37/4.57 - RF of loop [13:1,13:2,14:1,14:2,15:1,15:2]: 14.37/4.57 V1 14.37/4.57 14.37/4.57 14.37/4.57 ### Specialization of cost equations start/2 14.37/4.57 * CE 1 is refined into CE [19,20,21] 14.37/4.57 * CE 2 is refined into CE [22,23,24] 14.37/4.57 14.37/4.57 14.37/4.57 ### Cost equations --> "Loop" of start/2 14.37/4.57 * CEs [20] --> Loop 16 14.37/4.57 * CEs [22] --> Loop 17 14.37/4.57 * CEs [19,21,23,24] --> Loop 18 14.37/4.57 14.37/4.57 ### Ranking functions of CR start(V,V1) 14.37/4.57 14.37/4.57 #### Partial ranking functions of CR start(V,V1) 14.37/4.57 14.37/4.57 14.37/4.57 Computing Bounds 14.37/4.57 ===================================== 14.37/4.57 14.37/4.57 #### Cost of chains of or(V,V1,Out): 14.37/4.57 * Chain [10]: 1 14.37/4.57 with precondition: [Out=0,V>=0,V1>=0] 14.37/4.57 14.37/4.57 * Chain [9]: 1 14.37/4.57 with precondition: [V=1,Out=1,V1>=0] 14.37/4.57 14.37/4.57 * Chain [8]: 1 14.37/4.57 with precondition: [V1=1,Out=1,V>=0] 14.37/4.57 14.37/4.57 14.37/4.57 #### Cost of chains of mem(V,V1,Out): 14.37/4.57 * Chain [12]: 1 14.37/4.57 with precondition: [V1=0,Out=0,V>=0] 14.37/4.57 14.37/4.57 * Chain [11]: 1 14.37/4.57 with precondition: [V+V1=Out,V>=0,V1>=1] 14.37/4.57 14.37/4.57 * Chain [multiple([13,14,15],[[12],[11]])]: 6*it(13)+1*it([11])+1*it([12])+0 14.37/4.57 Such that:it([12]) =< V1+1 14.37/4.57 it([11]) =< V1/2+1/2 14.37/4.57 aux(1) =< V1 14.37/4.57 it(13) =< aux(1) 14.37/4.57 it([11]) =< aux(1) 14.37/4.57 14.37/4.57 with precondition: [1>=Out,V>=0,V1>=1,Out>=0,V+V1>=Out+1] 14.37/4.57 14.37/4.57 14.37/4.57 #### Cost of chains of start(V,V1): 14.37/4.57 * Chain [18]: 1*s(1)+1*s(2)+6*s(4)+1 14.37/4.57 Such that:s(3) =< V1 14.37/4.57 s(1) =< V1+1 14.37/4.57 s(2) =< V1/2+1/2 14.37/4.57 s(4) =< s(3) 14.37/4.57 s(2) =< s(3) 14.37/4.57 14.37/4.57 with precondition: [V>=0,V1>=0] 14.37/4.57 14.37/4.57 * Chain [17]: 1 14.37/4.57 with precondition: [V1=0,V>=0] 14.37/4.57 14.37/4.57 * Chain [16]: 1 14.37/4.57 with precondition: [V1=1,V>=0] 14.37/4.57 14.37/4.57 14.37/4.57 Closed-form bounds of start(V,V1): 14.37/4.57 ------------------------------------- 14.37/4.57 * Chain [18] with precondition: [V>=0,V1>=0] 14.37/4.57 - Upper bound: 15/2*V1+5/2 14.37/4.57 - Complexity: n 14.37/4.57 * Chain [17] with precondition: [V1=0,V>=0] 14.37/4.57 - Upper bound: 1 14.37/4.57 - Complexity: constant 14.37/4.57 * Chain [16] with precondition: [V1=1,V>=0] 14.37/4.57 - Upper bound: 1 14.37/4.57 - Complexity: constant 14.37/4.57 14.37/4.57 ### Maximum cost of start(V,V1): 15/2*V1+5/2 14.37/4.57 Asymptotic class: n 14.37/4.57 * Total analysis performed in 171 ms. 14.37/4.57 14.37/4.57 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (10) 14.37/4.57 BOUNDS(1, n^1) 14.37/4.57 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (11) RelTrsToDecreasingLoopProblemProof (LOWER BOUND(ID)) 14.37/4.57 Transformed a relative TRS into a decreasing-loop problem. 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (12) 14.37/4.57 Obligation: 14.37/4.57 Analyzing the following TRS for decreasing loops: 14.37/4.57 14.37/4.57 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). 14.37/4.57 14.37/4.57 14.37/4.57 The TRS R consists of the following rules: 14.37/4.57 14.37/4.57 or(true, y) -> true 14.37/4.57 or(x, true) -> true 14.37/4.57 or(false, false) -> false 14.37/4.57 mem(x, nil) -> false 14.37/4.57 mem(x, set(y)) -> =(x, y) 14.37/4.57 mem(x, union(y, z)) -> or(mem(x, y), mem(x, z)) 14.37/4.57 14.37/4.57 S is empty. 14.37/4.57 Rewrite Strategy: INNERMOST 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (13) DecreasingLoopProof (LOWER BOUND(ID)) 14.37/4.57 The following loop(s) give(s) rise to the lower bound Omega(n^1): 14.37/4.57 14.37/4.57 The rewrite sequence 14.37/4.57 14.37/4.57 mem(x, union(y, z)) ->^+ or(mem(x, y), mem(x, z)) 14.37/4.57 14.37/4.57 gives rise to a decreasing loop by considering the right hand sides subterm at position [0]. 14.37/4.57 14.37/4.57 The pumping substitution is [y / union(y, z)]. 14.37/4.57 14.37/4.57 The result substitution is [ ]. 14.37/4.57 14.37/4.57 14.37/4.57 14.37/4.57 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (14) 14.37/4.57 Complex Obligation (BEST) 14.37/4.57 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (15) 14.37/4.57 Obligation: 14.37/4.57 Proved the lower bound n^1 for the following obligation: 14.37/4.57 14.37/4.57 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). 14.37/4.57 14.37/4.57 14.37/4.57 The TRS R consists of the following rules: 14.37/4.57 14.37/4.57 or(true, y) -> true 14.37/4.57 or(x, true) -> true 14.37/4.57 or(false, false) -> false 14.37/4.57 mem(x, nil) -> false 14.37/4.57 mem(x, set(y)) -> =(x, y) 14.37/4.57 mem(x, union(y, z)) -> or(mem(x, y), mem(x, z)) 14.37/4.57 14.37/4.57 S is empty. 14.37/4.57 Rewrite Strategy: INNERMOST 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (16) LowerBoundPropagationProof (FINISHED) 14.37/4.57 Propagated lower bound. 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (17) 14.37/4.57 BOUNDS(n^1, INF) 14.37/4.57 14.37/4.57 ---------------------------------------- 14.37/4.57 14.37/4.57 (18) 14.37/4.57 Obligation: 14.37/4.57 Analyzing the following TRS for decreasing loops: 14.37/4.57 14.37/4.57 The Runtime Complexity (innermost) of the given CpxTRS could be proven to be BOUNDS(n^1, n^1). 14.37/4.57 14.37/4.57 14.37/4.57 The TRS R consists of the following rules: 14.37/4.57 14.37/4.57 or(true, y) -> true 14.37/4.57 or(x, true) -> true 14.37/4.57 or(false, false) -> false 14.37/4.57 mem(x, nil) -> false 14.37/4.57 mem(x, set(y)) -> =(x, y) 14.37/4.57 mem(x, union(y, z)) -> or(mem(x, y), mem(x, z)) 14.37/4.57 14.37/4.57 S is empty. 14.37/4.57 Rewrite Strategy: INNERMOST 14.52/4.60 EOF