Abs program loaded in 4 ms. Rule based representation generated in 0 ms. Rule based representation stored in /tmp/costabs/rbr.rbr RBR properties stored in /tmp/costabs/rbr.properties Class invariants generated and loaded in 0 ms. Size abstraction not supported for native Abstract compilation performed in 1 ms. sabu_memo_table_1(case_0,[A,B],[1*B>=0,1*A>=0,1*B=1],0,0) sabu_memo_table_1(case_1,[A,B],[1*B>=0,1*A>=0,1*A=1],0,0) sabu_memo_table_1(take_l,[A,B],[1*B>=0,1*A>=0,1*B=1,1*A>=0,1*B>=0],0,0) sabu_memo_table_1(case_0,[A,B],[1*A>=0,1*B>=1],1,1) sabu_memo_table_1(case_1,[A,B],[1*B>=0,1*A>=1],1,1) sabu_memo_table_1(take_l,[A,B],[1*A>=0,1*B>=1],2,1) sabu_memo_table_1(start,[],[],0,0) :- dynamic sabu_memo_table_1/5. sabu_memo_table_1(case_0, [A, B], [1*A>=0, 1*B>=1], 1, 1). sabu_memo_table_1(case_1, [B, A], [1*A>=0, 1*B>=1], 1, 1). sabu_memo_table_1(take_l, [A, B], [1*A>=0, 1*B>=1], 2, 1). sabu_memo_table_1(start, [], [], 0, 0). Size analysis performed in 2 ms. Cost relation system stored in /tmp/costabs/crs.crs Generated 30 equations Cost relation system solved by PUBS in 4 ms. Preprocessing Cost Relations ===================================== #### Computed strongly connected components 0. recursive : [case_0/2,case_1/2,take_l/2] 1. recursive : [zeros/0] 2. non_recursive : [start/1] Warning: the following predicates are never called:[and_op/2,eq/2,geq/2,gt/2,leq/2,lt/2,maxNorm/2,neg/1,neq/2,or/2,start/0] #### Obtained direct recursion through partial evaluation 0. SCC is partially evaluated into take_l/2 1. SCC is partially evaluated into zeros/0 2. SCC is partially evaluated into start/1 Control-Flow Refinement of Cost Relations ===================================== ### Specialization of cost equations take_l/2 * CE 3 is refined into CE [6] * CE 5 is refined into CE [7] * CE 4 is refined into CE [8] #### Refined cost equations take_l/2 * CE 6: take_l(A,B) = 3 [A>=0,B=1] * CE 7: take_l(A,B) = 6 [B>=1,A=1] * CE 8: take_l(A,B) = 8+ take_l(C,D) [D>=0,C>=0,D+1=B,C+1=A] ### Cost equations --> "Loop" of take_l/2 * CEs [8] --> Loop 6 * CEs [6] --> Loop 7 * CEs [7] --> Loop 8 #### Loops of take_l/2 * Loop 6: take_l(A,B)-> take_l(A',B') [B'>=0,A'>=0,B'+1=B,A'+1=A] * Loop 7: take_l(A,B) [A>=0,B=1] * Loop 8: take_l(A,B) [B>=1,A=1] ### Ranking functions of CR take_l(A,B) * RF of phase [6]: [A,B] #### Partial ranking functions of CR take_l(A,B) * Partial RF of phase [6]: - RF of loop [6:1]: A B ### Resulting Chains:take_l(A,B) * [[6],8] * [[6],7] * [8] * [7] ### Specialization of cost equations zeros/0 * CE 2 is refined into CE [9] #### Refined cost equations zeros/0 * CE 9: zeros = 3+ zeros [] ### Cost equations --> "Loop" of zeros/0 * CEs [9] --> Loop 9 #### Loops of zeros/0 * Loop 9: zeros-> zeros [] ### Ranking functions of CR zeros #### Partial ranking functions of CR zeros Warning: no base case found for predicate ### Resulting Chains:zeros * [[9]]... ### Specialization of cost equations start/1 * CE 1 is refined into CE [10,11,12,13] #### Refined cost equations start/1 * CE 10: start(A) = 2+ zeros:[[9]]+ take_l(A,B):[[6],8] [B>=A,A>=2] * CE 11: start(A) = 2+ zeros:[[9]]+ take_l(A,B):[[6],7] [A+1>=B,B>=2] * CE 12: start(A) = 2+ zeros:[[9]]+ take_l(B,C):[8] [C>=1,B=1,A=1] * CE 13: start(A) = 2+ zeros:[[9]]+ take_l(A,B):[7] [A>=0,B=1] ### Cost equations --> "Loop" of start/1 * CEs [10] --> Loop 10 * CEs [11] --> Loop 11 * CEs [13] --> Loop 12 * CEs [12] --> Loop 13 #### Loops of start/1 * Loop 10: start(A) [A>=2] * Loop 11: start(A) [A>=1] * Loop 12: start(A) [A>=0] * Loop 13: start(A) [A=1] ### Ranking functions of CR start(A) #### Partial ranking functions of CR start(A) Warning: no base case found for predicate ### Resulting Chains:start(A) * [13]... * [12]... * [11]... * [10]... Computing Bounds ===================================== #### Cost of loops [6] * loop 6:take_l(A,B) -> [take_l(A',B')] 8 #### Cost of phase [6]:take_l(A,B) -> [take_l(A',B')] 8*it(6)+0 Such that:it(6) =< A it(6) =< A-A' it(6) =< B it(6) =< B-B' it(6) >= A-A' it(6) >= B-B' #### Cost of phase [6]:take_l(A,B) -> [take_l(A',B')] 8*it(6)+0 Such that:it(6) =< A it(6) =< A-A' it(6) =< B it(6) =< B-B' it(6) >= A-A' it(6) >= B-B' #### Cost of chains of take_l(A,B): * Chain [[6],8]: 8*it(6)+6 Such that:it(6) =< A-1 it(6) >= A-1 with precondition: [A>=2,B>=A] * Chain [[6],7]: 8*it(6)+3 Such that:it(6) =< B-1 it(6) >= B-1 with precondition: [B>=2,A+1>=B] * Chain [8]: 6 with precondition: [A=1,B>=1] * Chain [7]: 3 with precondition: [B=1,A>=0] #### Cost of loops [9] * loop 9:zeros -> [zeros] 3 #### Cost of phase [9]:zeros -> [zeros] 3*it(9)+0 #### Cost of chains of zeros: * Chain [[9]]...: 3*it(9)+0 with precondition: [] #### Cost of chains of start(A): * Chain [13]...: 3*s(1)+8 with precondition: [A=1] * Chain [12]...: 3*s(2)+5 with precondition: [A>=0] * Chain [11]...: 3*s(3)+8*s(4)+5 Such that:s(4) =< A s(4) >= 1 with precondition: [A>=1] * Chain [10]...: 3*s(5)+8*s(6)+8 Such that:s(6) =< A-1 s(6) >= A-1 with precondition: [A>=2] Closed-form bounds of start(A): ------------------------------------- * Chain [13]... with precondition: [A=1] - Lower bound: 8 - Complexity: constant * Chain [12]... with precondition: [A>=0] - Lower bound: 5 - Complexity: constant * Chain [11]... with precondition: [A>=1] - Lower bound: 13 - Complexity: constant * Chain [10]... with precondition: [A>=2] - Lower bound: 8*A - Complexity: n ### Partitioned lower bound of start(A): * 5 if [A>=0] Possible lower bounds : [5] Maximum lower bound complexity: constant * Total analysis performed in 35 ms.