(STRATEGY INNERMOST) (VAR k l x y) (DATATYPES A = µX.< nil, cons(X, X), s(X), zero, true, false >) (SIGNATURES app :: [A x A] -> A sum :: [A] -> A plus :: [A x A] -> A id :: [A] -> A if :: [A x A x A] -> A not :: [A] -> A gt :: [A x A] -> A) (RULES app(nil(),k) -> k app(l,nil()) -> l app(cons(x,l),k) -> cons(x ,app(l,k)) sum(cons(x,nil())) -> cons(x ,nil()) sum(cons(x,cons(y,l))) -> sum(cons(plus(x,y),l)) sum(app(l,cons(x,cons(y,k)))) -> sum(app(l ,sum(cons(x,cons(y,k))))) plus(s(x),s(y)) -> s(s(plus(if(gt(x,y),x,y) ,if(not(gt(x,y)),id(x),id(y))))) plus(s(x),x) -> plus(if(gt(x,x) ,id(x) ,id(x)) ,s(x)) plus(zero(),y) -> y plus(id(x),s(y)) -> s(plus(x ,if(gt(s(y),y),y,s(y)))) id(x) -> x if(true(),x,y) -> x if(false(),x,y) -> y not(x) -> if(x,false(),true()) gt(s(x),zero()) -> true() gt(zero(),y) -> false() gt(s(x),s(y)) -> gt(x,y))