(0) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

cond(true, x, y, z) → cond(and(gr(x, z), gr(y, z)), p(x), p(y), z)
and(true, true) → true
and(x, false) → false
and(false, x) → false
gr(0, 0) → false
gr(0, x) → false
gr(s(x), 0) → true
gr(s(x), s(y)) → gr(x, y)
p(0) → 0
p(s(x)) → x

Q is empty.