WORST_CASE(?,O(n^2)) * Step 1: NaturalPI WORST_CASE(?,O(n^2)) + Considered Problem: - Strict TRS: domatch(patcs,Cons(x,xs),n) -> domatch[Ite](prefix(patcs,Cons(x,xs)),patcs,Cons(x,xs),n) domatch(Cons(x,xs),Nil(),n) -> Nil() domatch(Nil(),Nil(),n) -> Cons(n,Nil()) eqNatList(Cons(x,xs),Cons(y,ys)) -> eqNatList[Ite](!EQ(x,y),y,ys,x,xs) eqNatList(Cons(x,xs),Nil()) -> False() eqNatList(Nil(),Cons(y,ys)) -> False() eqNatList(Nil(),Nil()) -> True() notEmpty(Cons(x,xs)) -> True() notEmpty(Nil()) -> False() prefix(Cons(x,xs),Nil()) -> False() prefix(Cons(x',xs'),Cons(x,xs)) -> and(!EQ(x',x),prefix(xs',xs)) prefix(Nil(),cs) -> True() strmatch(patstr,str) -> domatch(patstr,str,Nil()) - Weak TRS: !EQ(0(),0()) -> True() !EQ(0(),S(y)) -> False() !EQ(S(x),0()) -> False() !EQ(S(x),S(y)) -> !EQ(x,y) and(False(),False()) -> False() and(False(),True()) -> False() and(True(),False()) -> False() and(True(),True()) -> True() domatch[Ite](False(),patcs,Cons(x,xs),n) -> domatch(patcs,xs,Cons(n,Cons(Nil(),Nil()))) domatch[Ite](True(),patcs,Cons(x,xs),n) -> Cons(n,domatch(patcs,xs,Cons(n,Cons(Nil(),Nil())))) eqNatList[Ite](False(),y,ys,x,xs) -> False() eqNatList[Ite](True(),y,ys,x,xs) -> eqNatList(xs,ys) - Signature: {!EQ/2,and/2,domatch/3,domatch[Ite]/4,eqNatList/2,eqNatList[Ite]/5,notEmpty/1,prefix/2,strmatch/2} / {0/0 ,Cons/2,False/0,Nil/0,S/1,True/0} - Obligation: innermost runtime complexity wrt. defined symbols {!EQ,and,domatch,domatch[Ite],eqNatList,eqNatList[Ite] ,notEmpty,prefix,strmatch} and constructors {0,Cons,False,Nil,S,True} + Applied Processor: NaturalPI {shape = Quadratic, restrict = NoRestrict, uargs = UArgs, urules = URules, selector = Nothing} + Details: We apply a polynomial interpretation of kind constructor-based(quadratic): The following argument positions are considered usable: uargs(Cons) = {2}, uargs(and) = {1,2}, uargs(domatch[Ite]) = {1}, uargs(eqNatList[Ite]) = {1} Following symbols are considered usable: {!EQ,and,domatch,domatch[Ite],eqNatList,eqNatList[Ite],notEmpty,prefix,strmatch} TcT has computed the following interpretation: p(!EQ) = 0 p(0) = 0 p(Cons) = 1 + x2 p(False) = 0 p(Nil) = 0 p(S) = 0 p(True) = 0 p(and) = 2*x1 + x2 p(domatch) = 2 + 3*x2 + x2^2 p(domatch[Ite]) = 1 + x1 + x3 + x3^2 p(eqNatList) = 1 + 2*x1^2 + 2*x2 + x2^2 p(eqNatList[Ite]) = 2 + 2*x1 + 3*x3 + x3^2 + 2*x5^2 p(notEmpty) = 1 + x1^2 p(prefix) = 1 + x2 p(strmatch) = 3 + 3*x2 + x2^2 Following rules are strictly oriented: domatch(patcs,Cons(x,xs),n) = 6 + 5*xs + xs^2 > 5 + 4*xs + xs^2 = domatch[Ite](prefix(patcs,Cons(x,xs)),patcs,Cons(x,xs),n) domatch(Cons(x,xs),Nil(),n) = 2 > 0 = Nil() domatch(Nil(),Nil(),n) = 2 > 1 = Cons(n,Nil()) eqNatList(Cons(x,xs),Cons(y,ys)) = 6 + 4*xs + 2*xs^2 + 4*ys + ys^2 > 2 + 2*xs^2 + 3*ys + ys^2 = eqNatList[Ite](!EQ(x,y),y,ys,x,xs) eqNatList(Cons(x,xs),Nil()) = 3 + 4*xs + 2*xs^2 > 0 = False() eqNatList(Nil(),Cons(y,ys)) = 4 + 4*ys + ys^2 > 0 = False() eqNatList(Nil(),Nil()) = 1 > 0 = True() notEmpty(Cons(x,xs)) = 2 + 2*xs + xs^2 > 0 = True() notEmpty(Nil()) = 1 > 0 = False() prefix(Cons(x,xs),Nil()) = 1 > 0 = False() prefix(Cons(x',xs'),Cons(x,xs)) = 2 + xs > 1 + xs = and(!EQ(x',x),prefix(xs',xs)) prefix(Nil(),cs) = 1 + cs > 0 = True() strmatch(patstr,str) = 3 + 3*str + str^2 > 2 + 3*str + str^2 = domatch(patstr,str,Nil()) Following rules are (at-least) weakly oriented: !EQ(0(),0()) = 0 >= 0 = True() !EQ(0(),S(y)) = 0 >= 0 = False() !EQ(S(x),0()) = 0 >= 0 = False() !EQ(S(x),S(y)) = 0 >= 0 = !EQ(x,y) and(False(),False()) = 0 >= 0 = False() and(False(),True()) = 0 >= 0 = False() and(True(),False()) = 0 >= 0 = False() and(True(),True()) = 0 >= 0 = True() domatch[Ite](False(),patcs,Cons(x,xs),n) = 3 + 3*xs + xs^2 >= 2 + 3*xs + xs^2 = domatch(patcs,xs,Cons(n,Cons(Nil(),Nil()))) domatch[Ite](True(),patcs,Cons(x,xs),n) = 3 + 3*xs + xs^2 >= 3 + 3*xs + xs^2 = Cons(n,domatch(patcs,xs,Cons(n,Cons(Nil(),Nil())))) eqNatList[Ite](False(),y,ys,x,xs) = 2 + 2*xs^2 + 3*ys + ys^2 >= 0 = False() eqNatList[Ite](True(),y,ys,x,xs) = 2 + 2*xs^2 + 3*ys + ys^2 >= 1 + 2*xs^2 + 2*ys + ys^2 = eqNatList(xs,ys) WORST_CASE(?,O(n^2))