MAYBE Problem: nthtail(n,l) -> cond(ge(n,length(l)),n,l) cond(true(),n,l) -> l cond(false(),n,l) -> tail(nthtail(s(n),l)) tail(nil()) -> nil() tail(cons(x,l)) -> l length(nil()) -> 0() length(cons(x,l)) -> s(length(l)) ge(u,0()) -> true() ge(0(),s(v)) -> false() ge(s(u),s(v)) -> ge(u,v) Proof: DP Processor: DPs: nthtail#(n,l) -> length#(l) nthtail#(n,l) -> ge#(n,length(l)) nthtail#(n,l) -> cond#(ge(n,length(l)),n,l) cond#(false(),n,l) -> nthtail#(s(n),l) cond#(false(),n,l) -> tail#(nthtail(s(n),l)) length#(cons(x,l)) -> length#(l) ge#(s(u),s(v)) -> ge#(u,v) TRS: nthtail(n,l) -> cond(ge(n,length(l)),n,l) cond(true(),n,l) -> l cond(false(),n,l) -> tail(nthtail(s(n),l)) tail(nil()) -> nil() tail(cons(x,l)) -> l length(nil()) -> 0() length(cons(x,l)) -> s(length(l)) ge(u,0()) -> true() ge(0(),s(v)) -> false() ge(s(u),s(v)) -> ge(u,v) TDG Processor: DPs: nthtail#(n,l) -> length#(l) nthtail#(n,l) -> ge#(n,length(l)) nthtail#(n,l) -> cond#(ge(n,length(l)),n,l) cond#(false(),n,l) -> nthtail#(s(n),l) cond#(false(),n,l) -> tail#(nthtail(s(n),l)) length#(cons(x,l)) -> length#(l) ge#(s(u),s(v)) -> ge#(u,v) TRS: nthtail(n,l) -> cond(ge(n,length(l)),n,l) cond(true(),n,l) -> l cond(false(),n,l) -> tail(nthtail(s(n),l)) tail(nil()) -> nil() tail(cons(x,l)) -> l length(nil()) -> 0() length(cons(x,l)) -> s(length(l)) ge(u,0()) -> true() ge(0(),s(v)) -> false() ge(s(u),s(v)) -> ge(u,v) graph: cond#(false(),n,l) -> nthtail#(s(n),l) -> nthtail#(n,l) -> cond#(ge(n,length(l)),n,l) cond#(false(),n,l) -> nthtail#(s(n),l) -> nthtail#(n,l) -> ge#(n,length(l)) cond#(false(),n,l) -> nthtail#(s(n),l) -> nthtail#(n,l) -> length#(l) ge#(s(u),s(v)) -> ge#(u,v) -> ge#(s(u),s(v)) -> ge#(u,v) length#(cons(x,l)) -> length#(l) -> length#(cons(x,l)) -> length#(l) nthtail#(n,l) -> cond#(ge(n,length(l)),n,l) -> cond#(false(),n,l) -> tail#(nthtail(s(n),l)) nthtail#(n,l) -> cond#(ge(n,length(l)),n,l) -> cond#(false(),n,l) -> nthtail#(s(n),l) nthtail#(n,l) -> ge#(n,length(l)) -> ge#(s(u),s(v)) -> ge#(u,v) nthtail#(n,l) -> length#(l) -> length#(cons(x,l)) -> length#(l) SCC Processor: #sccs: 3 #rules: 4 #arcs: 9/49 DPs: cond#(false(),n,l) -> nthtail#(s(n),l) nthtail#(n,l) -> cond#(ge(n,length(l)),n,l) TRS: nthtail(n,l) -> cond(ge(n,length(l)),n,l) cond(true(),n,l) -> l cond(false(),n,l) -> tail(nthtail(s(n),l)) tail(nil()) -> nil() tail(cons(x,l)) -> l length(nil()) -> 0() length(cons(x,l)) -> s(length(l)) ge(u,0()) -> true() ge(0(),s(v)) -> false() ge(s(u),s(v)) -> ge(u,v) Open DPs: ge#(s(u),s(v)) -> ge#(u,v) TRS: nthtail(n,l) -> cond(ge(n,length(l)),n,l) cond(true(),n,l) -> l cond(false(),n,l) -> tail(nthtail(s(n),l)) tail(nil()) -> nil() tail(cons(x,l)) -> l length(nil()) -> 0() length(cons(x,l)) -> s(length(l)) ge(u,0()) -> true() ge(0(),s(v)) -> false() ge(s(u),s(v)) -> ge(u,v) KBO Processor: argument filtering: pi(nthtail) = 1 pi(length) = 0 pi(ge) = [0] pi(cond) = 2 pi(true) = [] pi(false) = [] pi(s) = [0] pi(tail) = 0 pi(nil) = [] pi(cons) = [0,1] pi(0) = [] pi(ge#) = [0] weight function: w0 = 1 w(ge#) = w(0) = w(cons) = w(nil) = w(tail) = w(false) = w(true) = w( cond) = w(ge) = 1 w(s) = w(length) = w(nthtail) = 0 precedence: cons ~ nil ~ s ~ true ~ cond ~ nthtail > ge# ~ 0 ~ tail ~ false ~ ge ~ length problem: DPs: TRS: nthtail(n,l) -> cond(ge(n,length(l)),n,l) cond(true(),n,l) -> l cond(false(),n,l) -> tail(nthtail(s(n),l)) tail(nil()) -> nil() tail(cons(x,l)) -> l length(nil()) -> 0() length(cons(x,l)) -> s(length(l)) ge(u,0()) -> true() ge(0(),s(v)) -> false() ge(s(u),s(v)) -> ge(u,v) Qed DPs: length#(cons(x,l)) -> length#(l) TRS: nthtail(n,l) -> cond(ge(n,length(l)),n,l) cond(true(),n,l) -> l cond(false(),n,l) -> tail(nthtail(s(n),l)) tail(nil()) -> nil() tail(cons(x,l)) -> l length(nil()) -> 0() length(cons(x,l)) -> s(length(l)) ge(u,0()) -> true() ge(0(),s(v)) -> false() ge(s(u),s(v)) -> ge(u,v) KBO Processor: argument filtering: pi(nthtail) = 1 pi(length) = 0 pi(ge) = [] pi(cond) = 2 pi(true) = [] pi(false) = [] pi(s) = [0] pi(tail) = 0 pi(nil) = [] pi(cons) = [1] pi(0) = [] pi(length#) = 0 weight function: w0 = 1 w(length#) = w(0) = w(cons) = w(nil) = w(tail) = w(s) = w(false) = w( true) = w(cond) = w(ge) = w(length) = w(nthtail) = 1 precedence: cons ~ nil ~ ge ~ nthtail > length# ~ 0 ~ tail ~ s ~ false ~ true ~ cond ~ length problem: DPs: TRS: nthtail(n,l) -> cond(ge(n,length(l)),n,l) cond(true(),n,l) -> l cond(false(),n,l) -> tail(nthtail(s(n),l)) tail(nil()) -> nil() tail(cons(x,l)) -> l length(nil()) -> 0() length(cons(x,l)) -> s(length(l)) ge(u,0()) -> true() ge(0(),s(v)) -> false() ge(s(u),s(v)) -> ge(u,v) Qed