$ cora aoto.mstrs -s yices -e MSTRS with no additional rule schemes: Signature: app :: list → list → list cons :: nat → list → list len :: list → nat max :: nat → nat → nat minus :: nat → nat → nat nil :: list plus :: nat → nat → nat qrev :: list → list → list s :: nat → nat sum :: list → nat times :: nat → nat → nat zero :: nat Rules: max(zero, y) → y max(x, zero) → x max(s(x), s(y)) → s(max(x, y)) minus(zero, y) → zero minus(s(x), zero) → s(x) minus(s(x), s(y)) → minus(x, y) plus(zero, y) → y plus(s(x), y) → s(plus(x, y)) times(zero, y) → zero times(s(x), y) → plus(y, times(x, y)) len(nil) → zero len(cons(x, y)) → s(len(y)) sum(nil) → zero sum(cons(x, y)) → plus(x, sum(y)) app(nil, z) → z app(cons(x, y), z) → cons(x, app(y, z)) qrev(nil, ys) → ys qrev(cons(x, xs), ys) → qrev(xs, cons(x, ys)) Please input one or more equations, or a file: len(qrev(x, y)) = len(qrev(y, x)) Goal: len(qrev(x, y)) ≈ len(qrev(y, x)) > postulate len(qrev(x, cons(y, z))) = s(len(qrev(x, z))) Goal: len(qrev(x, cons(y, z))) ≈ s(len(qrev(x, z))) > induct Goal: len(qrev(x, cons(y, z))) ⦾ ≈ s(len(qrev(x, z))) ⦾ > case x Goal: len(qrev(nil, cons(y, z))) ⦾ ≈ s(len(qrev(nil, z))) ⦾ > auto simplify R17 l1 with [ys := cons(y, z)] simplify R12 l with [x := y, y := z] simplify R17 r1.1 with [ys := z] delete Goal: len(qrev(cons(x1, x2), cons(y, z))) ⦾ ≈ s(len(qrev(cons(x1, x2), z))) ⦾ > auto simplify R18 l1 with [x := x1, xs := x2, ys := cons(y, z)] simplify R18 r1.1 with [x := x1, xs := x2, ys := z] Goal: len(qrev(x2, cons(x1, cons(y, z)))) ≈ s(len(qrev(x2, cons(x1, z)))) > hypothesis H2 Goal: s(len(qrev(x2, cons(y, z)))) ≈ s(len(qrev(x2, cons(x1, z)))) > auto context 1 Goal: len(qrev(x2, cons(y, z))) ≈ len(qrev(x2, cons(x1, z))) > hypothesis H2 Goal: s(len(qrev(x2, z))) ≈ len(qrev(x2, cons(x1, z))) > auto hdelete H2^{-1} l with [x := x2, y := x1, z := z] Goal: len(qrev(x, y)) ≈ len(qrev(y, x)) > :ordering So far the following ordering requirements have been imposed: len(qrev(cons(x1, x2), cons(y, z))) ≻ s(len(qrev(x2, cons(y, z)))) len(qrev(cons(x1, x2), cons(y, z))) ≻ s(len(qrev(x2, z))) Goal: len(qrev(x, y)) ≈ len(qrev(y, x)) > :check horpo Sending proof request to termination checker... The current set of ordering requirements is indeed orientable. Goal: len(qrev(x, y)) ≈ len(qrev(y, x)) > induct Goal: len(qrev(x, y)) ⦾ ≈ len(qrev(y, x)) ⦾ > case x Goal: len(qrev(nil, y)) ⦾ ≈ len(qrev(y, nil)) ⦾ > auto simplify R17 l1 with [ys := y] Goal: len(y) ≈ len(qrev(y, nil)) ⦾ > induct Goal: len(y) ⦾ ≈ len(qrev(y, nil)) ⦾ > case y Goal: len(nil) ⦾ ≈ len(qrev(nil, nil)) ⦾ > auto simplify R11 l with [] simplify R17 r1 with [ys := nil] simplify R11 r with [] delete Goal: len(cons(y1, y2)) ⦾ ≈ len(qrev(cons(y1, y2), nil)) ⦾ > auto simplify R12 l with [x := y1, y := y2] simplify R18 r1 with [x := y1, xs := y2, ys := nil] Goal: s(len(y2)) ≈ len(qrev(y2, cons(y1, nil))) > hypothesis H2 r Goal: s(len(y2)) ≈ s(len(qrev(y2, nil))) > auto context 1 hdelete H17 l with [y := y2] Goal: len(qrev(cons(x1, x2), y)) ⦾ ≈ len(qrev(y, cons(x1, x2))) ⦾ > :ordering So far the following ordering requirements have been imposed: len(qrev(cons(x1, x2), cons(y, z))) ≻ s(len(qrev(x2, cons(y, z)))) len(qrev(cons(x1, x2), cons(y, z))) ≻ s(len(qrev(x2, z))) len(qrev(cons(y1, y2), nil)) ≻ s(len(qrev(y2, nil))) Goal: len(qrev(cons(x1, x2), y)) ⦾ ≈ len(qrev(y, cons(x1, x2))) ⦾ > :check horpo Sending proof request to termination checker... The current set of ordering requirements is indeed orientable. Goal: len(qrev(cons(x1, x2), y)) ⦾ ≈ len(qrev(y, cons(x1, x2))) ⦾ > simplify Goal: len(qrev(x2, cons(x1, y))) ≈ len(qrev(y, cons(x1, x2))) ⦾ > case y Goal: len(qrev(x2, cons(x1, nil))) ≈ len(qrev(nil, cons(x1, x2))) ⦾ > auto simplify R17 r1 with [ys := cons(x1, x2)] simplify R12 r with [x := x1, y := x2] Goal: len(qrev(x2, cons(x1, nil))) ≈ s(len(x2)) > hypothesis H2 Goal: s(len(qrev(x2, nil))) ≈ s(len(x2)) > auto context 1 hdelete H17^{-1} l with [y := x2] Goal: len(qrev(x2, cons(x1, cons(y1, y2)))) ≈ len(qrev(cons(y1, y2), cons(x1, x2))) ⦾ > auto simplify R18 r1 with [x := y1, xs := y2, ys := cons(x1, x2)] Goal: len(qrev(x2, cons(x1, cons(y1, y2)))) ≈ len(qrev(y2, cons(y1, cons(x1, x2)))) > :ordering So far the following ordering requirements have been imposed: len(qrev(cons(x1, x2), cons(y, z))) ≻ s(len(qrev(x2, cons(y, z)))) len(qrev(cons(x1, x2), cons(y, z))) ≻ s(len(qrev(x2, z))) len(qrev(cons(y1, y2), nil)) ≻ s(len(qrev(y2, nil))) len(qrev(cons(x1, x2), nil)) ≻ s(len(qrev(x2, nil))) Goal: len(qrev(x2, cons(x1, cons(y1, y2)))) ≈ len(qrev(y2, cons(y1, cons(x1, x2)))) > hypothesis H2 Goal: s(len(qrev(x2, cons(y1, y2)))) ≈ len(qrev(y2, cons(y1, cons(x1, x2)))) > hypothesis H2 l1 Goal: s(s(len(qrev(x2, y2)))) ≈ len(qrev(y2, cons(y1, cons(x1, x2)))) > hypothesis H2 r Goal: s(s(len(qrev(x2, y2)))) ≈ s(len(qrev(y2, cons(x1, x2)))) > hypothesis H2 r1 Goal: s(s(len(qrev(x2, y2)))) ≈ s(s(len(qrev(y2, x2)))) > auto context 1.1 hdelete H1 l with [x := x2, y := y2] All goals have been successfully removed! To complete the proof, you still need to verify that a suitable ordering exists. You can do this using the :check command. Other useful commands include: undo -- to go back to the previous proof state :quit -- to end the proof process without termination check :ordering -- to see the current ordering requirements :rules -- to see the current rules (these must also be oriented) :check verbose -- to run the termination check and see an elaborate explanation of the outcome (particularly useful if the result is a failure) > :ordering So far the following ordering requirements have been imposed: len(qrev(cons(x1, x2), cons(y, z))) ≻ s(len(qrev(x2, cons(y, z)))) len(qrev(cons(x1, x2), cons(y, z))) ≻ s(len(qrev(x2, z))) len(qrev(cons(y1, y2), nil)) ≻ s(len(qrev(y2, nil))) len(qrev(cons(x1, x2), nil)) ≻ s(len(qrev(x2, nil))) len(qrev(cons(x1, x2), cons(y1, y2))) ≻ s(len(qrev(x2, cons(y1, y2)))) len(qrev(cons(x1, x2), cons(y1, y2))) ≻ s(s(len(qrev(x2, y2)))) len(qrev(cons(y1, y2), cons(x1, x2))) ≻ s(len(qrev(y2, cons(x1, x2)))) len(qrev(cons(y1, y2), cons(x1, x2))) ≻ s(s(len(qrev(y2, x2)))) All goals have been successfully removed! To complete the proof, you still need to verify that a suitable ordering exists. You can do this using the :check command. Other useful commands include: undo -- to go back to the previous proof state :quit -- to end the proof process without termination check :ordering -- to see the current ordering requirements :rules -- to see the current rules (these must also be oriented) :check verbose -- to run the termination check and see an elaborate explanation of the outcome (particularly useful if the result is a failure) > :save lenqrev.proof Original equations and command history have been written to lenqrev.proof. All goals have been successfully removed! To complete the proof, you still need to verify that a suitable ordering exists. You can do this using the :check command. Other useful commands include: undo -- to go back to the previous proof state :quit -- to end the proof process without termination check :ordering -- to see the current ordering requirements :rules -- to see the current rules (these must also be oriented) :check verbose -- to run the termination check and see an elaborate explanation of the outcome (particularly useful if the result is a failure) > :check horpo Sending proof request to termination checker... The current set of ordering requirements is indeed orientable. YES We start the process with the following equations: E1: (• , len(qrev(x, y)) ≈ len(qrev(y, x)) , •) We apply POSTULATE to add the lemma equation len(qrev(x, cons(y, z))) ≈ s(len(qrev(x, z))) to the current proof state. This yields E2: (• , len(qrev(x, cons(y, z))) ≈ s(len(qrev(x, z))) , •) We apply INDUCT to E2, which causes len(qrev(x, cons(y, z))) ≈ s(len(qrev(x, z))) to be added to the set H of induction hypotheses. This yields E3: (len(qrev(x, cons(y, z))) , len(qrev(x, cons(y, z))) ≈ s(len(qrev(x, z))) , s(len(qrev(x, z)))) We apply CASE on the instance of x. This yields the following new equations: E4: (len(qrev(cons(x1, x2), cons(y, z))) , len(qrev(cons(x1, x2), cons(y, z))) ≈ s(len(qrev(cons(x1, x2), z))) , s(len(qrev(cons(x1, x2), z)))) E5: (len(qrev(nil, cons(y, z))) , len(qrev(nil, cons(y, z))) ≈ s(len(qrev(nil, z))) , s(len(qrev(nil, z)))) We apply SIMPLIFICATION to E5 with rule R17 and substitution [ys := cons(y, z)]. This yields E6: (len(qrev(nil, cons(y, z))) , len(cons(y, z)) ≈ s(len(qrev(nil, z))) , s(len(qrev(nil, z)))) We apply SIMPLIFICATION to E6 with rule R12 and substitution [x := y, y := z]. This yields E7: (len(qrev(nil, cons(y, z))) , s(len(z)) ≈ s(len(qrev(nil, z))) , s(len(qrev(nil, z)))) We apply SIMPLIFICATION to E7 with rule R17 and substitution [ys := z]. This yields E8: (len(qrev(nil, cons(y, z))) , s(len(z)) ≈ s(len(z)) , s(len(qrev(nil, z)))) We apply DELETION to E8 because both sides are equal. Thus, we may remove this equation from the proof state. We apply SIMPLIFICATION to E4 with rule R18 and substitution [x := x1, xs := x2, ys := cons(y, z)]. This yields E9: (len(qrev(cons(x1, x2), cons(y, z))) , len(qrev(x2, cons(x1, cons(y, z)))) ≈ s(len(qrev(cons(x1, x2), z))) , s(len(qrev(cons(x1, x2), z)))) We apply SIMPLIFICATION to E9 with rule R18 and substitution [x := x1, xs := x2, ys := z]. This yields E10: (len(qrev(cons(x1, x2), cons(y, z))) , len(qrev(x2, cons(x1, cons(y, z)))) ≈ s(len(qrev(x2, cons(x1, z)))) , s(len(qrev(cons(x1, x2), z)))) We apply HYPOTHESIS to E10 with induction hypothesis H2 and substitution [x := x2, y := x1, z := cons(y, z)]. To this end, we impose the requirement that len(qrev(cons(x1, x2), cons(y, z))) ≻ s(len(qrev(x2, cons(y, z)))). This yields E11: (len(qrev(cons(x1, x2), cons(y, z))) , s(len(qrev(x2, cons(y, z)))) ≈ s(len(qrev(x2, cons(x1, z)))) , s(len(qrev(cons(x1, x2), z)))) We apply CONTEXT to E11, splitting the immediate arguments into separate equations. This yields E12: (len(qrev(cons(x1, x2), cons(y, z))) , len(qrev(x2, cons(y, z))) ≈ len(qrev(x2, cons(x1, z))) , s(len(qrev(cons(x1, x2), z)))) We apply HYPOTHESIS to E12 with induction hypothesis H2 and substitution [x := x2, y := y, z := z]. To this end, we impose the requirement that len(qrev(cons(x1, x2), cons(y, z))) ≻ s(len(qrev(x2, z))). This yields E13: (len(qrev(cons(x1, x2), cons(y, z))) , s(len(qrev(x2, z))) ≈ len(qrev(x2, cons(x1, z))) , s(len(qrev(cons(x1, x2), z)))) We apply HDELETE to E13 with induction hypothesis H2^{-1} and substitution [x := x2, y := x1, z := z]. We apply INDUCT to E1, which causes len(qrev(x, y)) ≈ len(qrev(y, x)) to be added to the set H of induction hypotheses. This yields E14: (len(qrev(x, y)) , len(qrev(x, y)) ≈ len(qrev(y, x)) , len(qrev(y, x))) We apply CASE on the instance of x. This yields the following new equations: E15: (len(qrev(cons(x1, x2), y)) , len(qrev(cons(x1, x2), y)) ≈ len(qrev(y, cons(x1, x2))) , len(qrev(y, cons(x1, x2)))) E16: (len(qrev(nil, y)) , len(qrev(nil, y)) ≈ len(qrev(y, nil)) , len(qrev(y, nil))) We apply SIMPLIFICATION to E16 with rule R17 and substitution [ys := y]. This yields E17: (len(qrev(nil, y)) , len(y) ≈ len(qrev(y, nil)) , len(qrev(y, nil))) We apply INDUCT to E17, which causes len(y) ≈ len(qrev(y, nil)) to be added to the set H of induction hypotheses. This yields E18: (len(y) , len(y) ≈ len(qrev(y, nil)) , len(qrev(y, nil))) We apply CASE on the instance of y. This yields the following new equations: E19: (len(cons(y1, y2)) , len(cons(y1, y2)) ≈ len(qrev(cons(y1, y2), nil)) , len(qrev(cons(y1, y2), nil))) E20: (len(nil) , len(nil) ≈ len(qrev(nil, nil)) , len(qrev(nil, nil))) We apply SIMPLIFICATION to E20 with rule R11 and substitution []. This yields E21: (len(nil) , zero ≈ len(qrev(nil, nil)) , len(qrev(nil, nil))) We apply SIMPLIFICATION to E21 with rule R17 and substitution [ys := nil]. This yields E22: (len(nil) , zero ≈ len(nil) , len(qrev(nil, nil))) We apply SIMPLIFICATION to E22 with rule R11 and substitution []. This yields E23: (len(nil) , zero ≈ zero , len(qrev(nil, nil))) We apply DELETION to E23 because both sides are equal. Thus, we may remove this equation from the proof state. We apply SIMPLIFICATION to E19 with rule R12 and substitution [x := y1, y := y2]. This yields E24: (len(cons(y1, y2)) , s(len(y2)) ≈ len(qrev(cons(y1, y2), nil)) , len(qrev(cons(y1, y2), nil))) We apply SIMPLIFICATION to E24 with rule R18 and substitution [x := y1, xs := y2, ys := nil]. This yields E25: (len(cons(y1, y2)) , s(len(y2)) ≈ len(qrev(y2, cons(y1, nil))) , len(qrev(cons(y1, y2), nil))) We apply HYPOTHESIS to E25 with induction hypothesis H2 and substitution [x := y2, y := y1, z := nil]. To this end, we impose the requirement that len(qrev(cons(y1, y2), nil)) ≻ s(len(qrev(y2, nil))). This yields E26: (len(cons(y1, y2)) , s(len(y2)) ≈ s(len(qrev(y2, nil))) , len(qrev(cons(y1, y2), nil))) We apply CONTEXT to E26, splitting the immediate arguments into separate equations. This yields E27: (len(cons(y1, y2)) , len(y2) ≈ len(qrev(y2, nil)) , len(qrev(cons(y1, y2), nil))) We apply HDELETE to E27 with induction hypothesis H17 and substitution [y := y2]. We apply SIMPLIFICATION to E15 with rule R18 and substitution [x := x1, xs := x2, ys := y]. This yields E28: (len(qrev(cons(x1, x2), y)) , len(qrev(x2, cons(x1, y))) ≈ len(qrev(y, cons(x1, x2))) , len(qrev(y, cons(x1, x2)))) We apply CASE on the instance of y. This yields the following new equations: E29: (len(qrev(cons(x1, x2), cons(y1, y2))) , len(qrev(x2, cons(x1, cons(y1, y2)))) ≈ len(qrev(cons(y1, y2), cons(x1, x2))) , len(qrev(cons(y1, y2), cons(x1, x2)))) E30: (len(qrev(cons(x1, x2), nil)) , len(qrev(x2, cons(x1, nil))) ≈ len(qrev(nil, cons(x1, x2))) , len(qrev(nil, cons(x1, x2)))) We apply SIMPLIFICATION to E30 with rule R17 and substitution [ys := cons(x1, x2)]. This yields E31: (len(qrev(cons(x1, x2), nil)) , len(qrev(x2, cons(x1, nil))) ≈ len(cons(x1, x2)) , len(qrev(nil, cons(x1, x2)))) We apply SIMPLIFICATION to E31 with rule R12 and substitution [x := x1, y := x2]. This yields E32: (len(qrev(cons(x1, x2), nil)) , len(qrev(x2, cons(x1, nil))) ≈ s(len(x2)) , len(qrev(nil, cons(x1, x2)))) We apply HYPOTHESIS to E32 with induction hypothesis H2 and substitution [x := x2, y := x1, z := nil]. To this end, we impose the requirement that len(qrev(cons(x1, x2), nil)) ≻ s(len(qrev(x2, nil))). This yields E33: (len(qrev(cons(x1, x2), nil)) , s(len(qrev(x2, nil))) ≈ s(len(x2)) , len(qrev(nil, cons(x1, x2)))) We apply CONTEXT to E33, splitting the immediate arguments into separate equations. This yields E34: (len(qrev(cons(x1, x2), nil)) , len(qrev(x2, nil)) ≈ len(x2) , len(qrev(nil, cons(x1, x2)))) We apply HDELETE to E34 with induction hypothesis H17^{-1} and substitution [y := x2]. We apply SIMPLIFICATION to E29 with rule R18 and substitution [x := y1, xs := y2, ys := cons(x1, x2)]. This yields E35: (len(qrev(cons(x1, x2), cons(y1, y2))) , len(qrev(x2, cons(x1, cons(y1, y2)))) ≈ len(qrev(y2, cons(y1, cons(x1, x2)))) , len(qrev(cons(y1, y2), cons(x1, x2)))) We apply HYPOTHESIS to E35 with induction hypothesis H2 and substitution [x := x2, y := x1, z := cons(y1, y2)]. To this end, we impose the requirement that len(qrev(cons(x1, x2), cons(y1, y2))) ≻ s(len(qrev(x2, cons(y1, y2)))). This yields E36: (len(qrev(cons(x1, x2), cons(y1, y2))) , s(len(qrev(x2, cons(y1, y2)))) ≈ len(qrev(y2, cons(y1, cons(x1, x2)))) , len(qrev(cons(y1, y2), cons(x1, x2)))) We apply HYPOTHESIS to E36 with induction hypothesis H2 and substitution [x := x2, y := y1, z := y2]. To this end, we impose the requirement that len(qrev(cons(x1, x2), cons(y1, y2))) ≻ s(s(len(qrev(x2, y2)))). This yields E37: (len(qrev(cons(x1, x2), cons(y1, y2))) , s(s(len(qrev(x2, y2)))) ≈ len(qrev(y2, cons(y1, cons(x1, x2)))) , len(qrev(cons(y1, y2), cons(x1, x2)))) We apply HYPOTHESIS to E37 with induction hypothesis H2 and substitution [x := y2, y := y1, z := cons(x1, x2)]. To this end, we impose the requirement that len(qrev(cons(y1, y2), cons(x1, x2))) ≻ s(len(qrev(y2, cons(x1, x2)))). This yields E38: (len(qrev(cons(x1, x2), cons(y1, y2))) , s(s(len(qrev(x2, y2)))) ≈ s(len(qrev(y2, cons(x1, x2)))) , len(qrev(cons(y1, y2), cons(x1, x2)))) We apply HYPOTHESIS to E38 with induction hypothesis H2 and substitution [x := y2, y := x1, z := x2]. To this end, we impose the requirement that len(qrev(cons(y1, y2), cons(x1, x2))) ≻ s(s(len(qrev(y2, x2)))). This yields E39: (len(qrev(cons(x1, x2), cons(y1, y2))) , s(s(len(qrev(x2, y2)))) ≈ s(s(len(qrev(y2, x2)))) , len(qrev(cons(y1, y2), cons(x1, x2)))) We apply CONTEXT to E39, splitting the immediate arguments into separate equations. This yields E40: (len(qrev(cons(x1, x2), cons(y1, y2))) , len(qrev(x2, y2)) ≈ len(qrev(y2, x2)) , len(qrev(cons(y1, y2), cons(x1, x2)))) We apply HDELETE to E40 with induction hypothesis H1 and substitution [x := x2, y := y2]. All equations have been removed, so the proof is complete: the original equations are inductive theorems. The existence of a suitable bounding pair is guaranteed by the termination of the corresponding term rewriting systems, as is demonstrated below. We consider termination of the MSTRS with no additional rule schemes: Signature: app :: list → list → list cons :: nat → list → list len :: list → nat max :: nat → nat → nat minus :: nat → nat → nat nil :: list plus :: nat → nat → nat qrev :: list → list → list s :: nat → nat sum :: list → nat times :: nat → nat → nat zero :: nat Rules: max(zero, y) → y max(x, zero) → x max(s(x), s(y)) → s(max(x, y)) minus(zero, y) → zero minus(s(x), zero) → s(x) minus(s(x), s(y)) → minus(x, y) plus(zero, y) → y plus(s(x), y) → s(plus(x, y)) times(zero, y) → zero times(s(x), y) → plus(y, times(x, y)) len(nil) → zero len(cons(x, y)) → s(len(y)) sum(nil) → zero sum(cons(x, y)) → plus(x, sum(y)) app(nil, z) → z app(cons(x, y), z) → cons(x, app(y, z)) qrev(nil, ys) → ys qrev(cons(x, xs), ys) → qrev(xs, cons(x, ys)) len(qrev(cons(x__1, x__2), cons(y, z))) → s(len(qrev(x__2, cons(y, z)))) len(qrev(cons(x__1, x__2), cons(y, z))) → s(len(qrev(x__2, z))) len(qrev(cons(y__1, y__2), nil)) → s(len(qrev(y__2, nil))) len(qrev(cons(x__1, x__2), nil)) → s(len(qrev(x__2, nil))) len(qrev(cons(x__1, x__2), cons(y__1, y__2))) → s(len(qrev(x__2, cons(y__1, y__2)))) len(qrev(cons(x__1, x__2), cons(y__1, y__2))) → s(s(len(qrev(x__2, y__2)))) len(qrev(cons(y__1, y__2), cons(x__1, x__2))) → s(len(qrev(y__2, cons(x__1, x__2)))) len(qrev(cons(y__1, y__2), cons(x__1, x__2))) → s(s(len(qrev(y__2, x__2)))) Constrained HORPO yields: max(zero, y) ≻ y max(x, zero) ≻ x max(s(x), s(y)) ≻ s(max(x, y)) minus(zero, y) ≻ zero minus(s(x), zero) ≻ s(x) minus(s(x), s(y)) ≻ minus(x, y) plus(zero, y) ≻ y plus(s(x), y) ≻ s(plus(x, y)) times(zero, y) ≻ zero times(s(x), y) ≻ plus(y, times(x, y)) len(nil) ≻ zero len(cons(x, y)) ≻ s(len(y)) sum(nil) ≻ zero sum(cons(x, y)) ≻ plus(x, sum(y)) app(nil, z) ≻ z app(cons(x, y), z) ≻ cons(x, app(y, z)) qrev(nil, ys) ≻ ys qrev(cons(x, xs), ys) ≻ qrev(xs, cons(x, ys)) len(qrev(cons(x__1, x__2), cons(y, z))) ≻ s(len(qrev(x__2, cons(y, z)))) len(qrev(cons(x__1, x__2), cons(y, z))) ≻ s(len(qrev(x__2, z))) len(qrev(cons(y__1, y__2), nil)) ≻ s(len(qrev(y__2, nil))) len(qrev(cons(x__1, x__2), nil)) ≻ s(len(qrev(x__2, nil))) len(qrev(cons(x__1, x__2), cons(y__1, y__2))) ≻ s(len(qrev(x__2, cons(y__1, y__2)))) len(qrev(cons(x__1, x__2), cons(y__1, y__2))) ≻ s(s(len(qrev(x__2, y__2)))) len(qrev(cons(y__1, y__2), cons(x__1, x__2))) ≻ s(len(qrev(y__2, cons(x__1, x__2)))) len(qrev(cons(y__1, y__2), cons(x__1, x__2))) ≻ s(s(len(qrev(y__2, x__2)))) We do this using the following settings: * Monotonicity requirements: this is a strongly monotonic reduction pair (all arguments of function symbols were regarded). * Precedence and permutation: sum { 1 } = times { 1 2 } > app { 1 2 } = len { 1 } = max { 1 2 } = plus { 1 2 } > qrev { 1 } 2 > cons { 1 2 } = minus { 1 2 } = nil { } = s { 1 } = zero { } * Well-founded theory orderings: ⊐_{Bool} = {(true,false)} ⊐_{Int} = {(x,y) | x < 1000 ∧ x < y } Steps: postulate len(qrev(x, cons(y, z))) [=] s(len(qrev(x, z))) induct case x simplify R17 l1 with [ys := cons(y, z)] simplify R12 l with [x := y, y := z] simplify R17 r1.1 with [ys := z] delete simplify R18 l1 with [x := x1, xs := x2, ys := cons(y, z)] simplify R18 r1.1 with [x := x1, xs := x2, ys := z] hypothesis H2 l with [x := x2, y := x1, z := cons(y, z)] context 1 hypothesis H2 l with [x := x2, y := y, z := z] hdelete H2^{-1} l with [x := x2, y := x1, z := z] induct case x simplify R17 l1 with [ys := y] induct case y simplify R11 l with [] simplify R17 r1 with [ys := nil] simplify R11 r with [] delete simplify R12 l with [x := y1, y := y2] simplify R18 r1 with [x := y1, xs := y2, ys := nil] hypothesis H2 r with [x := y2, y := y1, z := nil] context 1 hdelete H17 l with [y := y2] simplify R18 l1 with [x := x1, xs := x2, ys := y] case y simplify R17 r1 with [ys := cons(x1, x2)] simplify R12 r with [x := x1, y := x2] hypothesis H2 l with [x := x2, y := x1, z := nil] context 1 hdelete H17^{-1} l with [y := x2] simplify R18 r1 with [x := y1, xs := y2, ys := cons(x1, x2)] hypothesis H2 l with [x := x2, y := x1, z := cons(y1, y2)] hypothesis H2 l1 with [x := x2, y := y1, z := y2] hypothesis H2 r with [x := y2, y := y1, z := cons(x1, x2)] hypothesis H2 r1 with [x := y2, y := x1, z := x2] context 1.1 hdelete H1 l with [x := x2, y := y2]