WORST_CASE(?,O(n^1)) * Step 1: WeightGap 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: WeightGap {wgDimension = 1, wgDegree = 1, wgKind = Algebraic, wgUArgs = UArgs, wgOn = WgOnAny} + Details: The weightgap principle applies using the following nonconstant growth matrix-interpretation: We apply a matrix interpretation of kind constructor based matrix interpretation: The following argument positions are considered usable: uargs(Cons) = {1,2}, uargs(op) = {2} Following symbols are considered usable: all TcT has computed the following interpretation: p(0) = [1] p(Cons) = [1] x1 + [1] x2 + [3] p(False) = [0] p(Nil) = [0] p(S) = [1] x1 + [0] p(True) = [0] p(fold) = [5] x1 + [4] x2 + [8] p(foldl) = [3] x1 + [3] x2 + [0] p(foldr) = [2] x1 + [1] x2 + [0] p(notEmpty) = [0] p(op) = [1] x1 + [1] x2 + [0] Following rules are strictly oriented: fold(a,xs) = [5] a + [4] xs + [8] > [5] a + [4] xs + [6] = Cons(foldl(a,xs),Cons(foldr(a,xs),Nil())) foldl(x,Cons(S(0()),xs)) = [3] x + [3] xs + [12] > [3] x + [3] xs + [0] = foldl(S(x),xs) foldl(S(0()),Cons(x,xs)) = [3] x + [3] xs + [12] > [3] x + [3] xs + [0] = foldl(S(x),xs) foldr(a,Cons(x,xs)) = [2] a + [1] x + [1] xs + [3] > [2] a + [1] x + [1] xs + [0] = op(x,foldr(a,xs)) op(x,S(0())) = [1] x + [1] > [1] x + [0] = S(x) op(S(0()),y) = [1] y + [1] > [1] y + [0] = S(y) Following rules are (at-least) weakly oriented: foldl(a,Nil()) = [3] a + [0] >= [1] a + [0] = a foldr(a,Nil()) = [2] a + [0] >= [1] a + [0] = a notEmpty(Cons(x,xs)) = [0] >= [0] = True() notEmpty(Nil()) = [0] >= [0] = False() Further, it can be verified that all rules not oriented are covered by the weightgap condition. * Step 2: NaturalMI WORST_CASE(?,O(n^1)) + Considered Problem: - Strict TRS: foldl(a,Nil()) -> a foldr(a,Nil()) -> a notEmpty(Cons(x,xs)) -> True() notEmpty(Nil()) -> False() - Weak TRS: fold(a,xs) -> Cons(foldl(a,xs),Cons(foldr(a,xs),Nil())) 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)) 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: NaturalMI {miDimension = 1, miDegree = 1, miKind = Algebraic, uargs = UArgs, urules = URules, selector = Just any strict-rules} + Details: We apply a matrix interpretation of kind constructor based matrix interpretation: 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 + [1] x2 + [0] p(False) = [0] p(Nil) = [1] p(S) = [1] x1 + [4] p(True) = [0] p(fold) = [8] x1 + [3] x2 + [2] p(foldl) = [2] x1 + [2] x2 + [0] p(foldr) = [1] x1 + [1] x2 + [1] p(notEmpty) = [8] p(op) = [1] x1 + [1] x2 + [0] Following rules are strictly oriented: foldl(a,Nil()) = [2] a + [2] > [1] a + [0] = a foldr(a,Nil()) = [1] a + [2] > [1] a + [0] = a notEmpty(Cons(x,xs)) = [8] > [0] = True() notEmpty(Nil()) = [8] > [0] = False() Following rules are (at-least) weakly oriented: fold(a,xs) = [8] a + [3] xs + [2] >= [3] a + [3] xs + [2] = Cons(foldl(a,xs),Cons(foldr(a,xs),Nil())) foldl(x,Cons(S(0()),xs)) = [2] x + [2] xs + [8] >= [2] x + [2] xs + [8] = foldl(S(x),xs) foldl(S(0()),Cons(x,xs)) = [2] x + [2] xs + [8] >= [2] x + [2] xs + [8] = foldl(S(x),xs) foldr(a,Cons(x,xs)) = [1] a + [1] x + [1] xs + [1] >= [1] a + [1] x + [1] xs + [1] = op(x,foldr(a,xs)) op(x,S(0())) = [1] x + [4] >= [1] x + [4] = S(x) op(S(0()),y) = [1] y + [4] >= [1] y + [4] = S(y) * Step 3: 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(?,O(n^1))