WORST_CASE(Omega(n^1),O(n^1)) * Step 1: Sum WORST_CASE(Omega(n^1),O(n^1)) + Considered Problem: - Strict TRS: fold(a,xs) -> Cons(foldl(a,xs),Cons(foldr(a,xs),Nil())) foldl(a,Nil()) -> a foldl(x,Cons(S(0()),xs)) -> foldl(S(x),xs) foldl(S(0()),Cons(x,xs)) -> foldl(S(x),xs) foldr(a,Cons(x,xs)) -> op(x,foldr(a,xs)) foldr(a,Nil()) -> a notEmpty(Cons(x,xs)) -> True() notEmpty(Nil()) -> False() op(x,S(0())) -> S(x) op(S(0()),y) -> S(y) - Signature: {fold/2,foldl/2,foldr/2,notEmpty/1,op/2} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0} - Obligation: innermost runtime complexity wrt. defined symbols {fold,foldl,foldr,notEmpty,op} and constructors {0,Cons ,False,Nil,S,True} + Applied Processor: Sum {left = someStrategy, right = someStrategy} + Details: () ** Step 1.a:1: DecreasingLoops WORST_CASE(Omega(n^1),?) + Considered Problem: - Strict TRS: fold(a,xs) -> Cons(foldl(a,xs),Cons(foldr(a,xs),Nil())) foldl(a,Nil()) -> a foldl(x,Cons(S(0()),xs)) -> foldl(S(x),xs) foldl(S(0()),Cons(x,xs)) -> foldl(S(x),xs) foldr(a,Cons(x,xs)) -> op(x,foldr(a,xs)) foldr(a,Nil()) -> a notEmpty(Cons(x,xs)) -> True() notEmpty(Nil()) -> False() op(x,S(0())) -> S(x) op(S(0()),y) -> S(y) - Signature: {fold/2,foldl/2,foldr/2,notEmpty/1,op/2} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0} - Obligation: innermost runtime complexity wrt. defined symbols {fold,foldl,foldr,notEmpty,op} and constructors {0,Cons ,False,Nil,S,True} + Applied Processor: DecreasingLoops {bound = AnyLoop, narrow = 10} + Details: The system has following decreasing Loops: foldl(x,y){y -> Cons(S(0()),y)} = foldl(x,Cons(S(0()),y)) ->^+ foldl(S(x),y) = C[foldl(S(x),y) = foldl(x,y){x -> S(x)}] ** Step 1.b:1: NaturalPI WORST_CASE(?,O(n^1)) + Considered Problem: - Strict TRS: fold(a,xs) -> Cons(foldl(a,xs),Cons(foldr(a,xs),Nil())) foldl(a,Nil()) -> a foldl(x,Cons(S(0()),xs)) -> foldl(S(x),xs) foldl(S(0()),Cons(x,xs)) -> foldl(S(x),xs) foldr(a,Cons(x,xs)) -> op(x,foldr(a,xs)) foldr(a,Nil()) -> a notEmpty(Cons(x,xs)) -> True() notEmpty(Nil()) -> False() op(x,S(0())) -> S(x) op(S(0()),y) -> S(y) - Signature: {fold/2,foldl/2,foldr/2,notEmpty/1,op/2} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0} - Obligation: innermost runtime complexity wrt. defined symbols {fold,foldl,foldr,notEmpty,op} and constructors {0,Cons ,False,Nil,S,True} + Applied Processor: NaturalPI {shape = Linear, restrict = Restrict, uargs = UArgs, urules = URules, selector = Just any strict-rules} + Details: We apply a polynomial interpretation of kind constructor-based(linear): The following argument positions are considered usable: uargs(Cons) = {1,2}, uargs(op) = {2} Following symbols are considered usable: {fold,foldl,foldr,notEmpty,op} TcT has computed the following interpretation: p(0) = 0 p(Cons) = 1 + x1 + x2 p(False) = 13 p(Nil) = 1 p(S) = 0 p(True) = 10 p(fold) = 11 + 9*x1 + 7*x2 p(foldl) = 4*x1 + 4*x2 p(foldr) = x1 + 3*x2 p(notEmpty) = 12 + 12*x1 p(op) = 2 + x2 Following rules are strictly oriented: fold(a,xs) = 11 + 9*a + 7*xs > 3 + 5*a + 7*xs = Cons(foldl(a,xs),Cons(foldr(a,xs),Nil())) foldl(a,Nil()) = 4 + 4*a > a = a foldl(x,Cons(S(0()),xs)) = 4 + 4*x + 4*xs > 4*xs = foldl(S(x),xs) foldl(S(0()),Cons(x,xs)) = 4 + 4*x + 4*xs > 4*xs = foldl(S(x),xs) foldr(a,Cons(x,xs)) = 3 + a + 3*x + 3*xs > 2 + a + 3*xs = op(x,foldr(a,xs)) foldr(a,Nil()) = 3 + a > a = a notEmpty(Cons(x,xs)) = 24 + 12*x + 12*xs > 10 = True() notEmpty(Nil()) = 24 > 13 = False() op(x,S(0())) = 2 > 0 = S(x) op(S(0()),y) = 2 + y > 0 = S(y) Following rules are (at-least) weakly oriented: ** Step 1.b:2: EmptyProcessor WORST_CASE(?,O(1)) + Considered Problem: - Weak TRS: fold(a,xs) -> Cons(foldl(a,xs),Cons(foldr(a,xs),Nil())) foldl(a,Nil()) -> a foldl(x,Cons(S(0()),xs)) -> foldl(S(x),xs) foldl(S(0()),Cons(x,xs)) -> foldl(S(x),xs) foldr(a,Cons(x,xs)) -> op(x,foldr(a,xs)) foldr(a,Nil()) -> a notEmpty(Cons(x,xs)) -> True() notEmpty(Nil()) -> False() op(x,S(0())) -> S(x) op(S(0()),y) -> S(y) - Signature: {fold/2,foldl/2,foldr/2,notEmpty/1,op/2} / {0/0,Cons/2,False/0,Nil/0,S/1,True/0} - Obligation: innermost runtime complexity wrt. defined symbols {fold,foldl,foldr,notEmpty,op} and constructors {0,Cons ,False,Nil,S,True} + Applied Processor: EmptyProcessor + Details: The problem is already closed. The intended complexity is O(1). WORST_CASE(Omega(n^1),O(n^1))