$ 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: plus(x, plus(y, z)) = plus(plus(x, y), z) ; plus(x, y) = plus(y, x) ; times(x, y) = times(y, x) Goal: times(x, y) ≈ times(y, x) > skip Goal: plus(x, y) ≈ plus(y, x) > induct Goal: plus(x, y) ⦾ ≈ plus(y, x) ⦾ > case x Goal: plus(zero, y) ⦾ ≈ plus(y, zero) ⦾ > auto simplify R7 l with [y := y] Goal: y ≈ plus(y, zero) ⦾ > induct Goal: y ⦾ ≈ plus(y, zero) ⦾ > case y Goal: zero ⦾ ≈ plus(zero, zero) ⦾ > auto simplify R7 r with [y := zero] delete Goal: s(y1) ⦾ ≈ plus(s(y1), zero) ⦾ > auto simplify R8 r with [x := y1, y := zero] context 1 hdelete H7 l with [y := y1] Goal: plus(s(x1), y) ⦾ ≈ plus(y, s(x1)) ⦾ > auto simplify R8 l with [x := x1, y := y] Goal: s(plus(x1, y)) ≈ plus(y, s(x1)) ⦾ > case y Goal: s(plus(x1, zero)) ≈ plus(zero, s(x1)) ⦾ > auto simplify R7 r with [y := s(x1)] context 1 hdelete H7^{-1} l with [y := x1] Goal: s(plus(x1, s(y1))) ≈ plus(s(y1), s(x1)) ⦾ > auto simplify R8 r with [x := y1, y := s(x1)] context 1 Goal: plus(x1, s(y1)) ≈ plus(y1, s(x1)) > :hypotheses You currently have the following induction hypotheses available: H2: plus(x, y) ≈ plus(y, x) H7: y ≈ plus(y, zero) Goal: plus(x1, s(y1)) ≈ plus(y1, s(x1)) > hypothesis H2 l Goal: plus(s(y1), x1) ≈ plus(y1, s(x1)) > hypothesis H2 r Goal: plus(s(y1), x1) ≈ plus(s(x1), y1) > auto simplify R8 l with [x := y1, y := x1] simplify R8 r with [x := x1, y := y1] context 1 hdelete H2 l with [x := y1, y := x1] Goal: plus(x, plus(y, z)) ≈ plus(plus(x, y), z) > induct Goal: plus(x, plus(y, z)) ⦾ ≈ plus(plus(x, y), z) ⦾ > case x Goal: plus(zero, plus(y, z)) ⦾ ≈ plus(plus(zero, y), z) ⦾ > auto simplify R7 l with [y := plus(y, z)] simplify R7 r1 with [y := y] delete Goal: plus(s(x1), plus(y, z)) ⦾ ≈ plus(plus(s(x1), y), z) ⦾ > auto simplify R8 l with [x := x1, y := plus(y, z)] simplify R8 r1 with [x := x1, y := y] simplify R8 r with [x := plus(x1, y), y := z] context 1 hdelete H1 l with [x := x1, y := y, z := z] Goal: times(x, y) ≈ times(y, x) > :save plustimes1.proof Original equations and command history have been written to plustimes1.proof. Goal: times(x, y) ≈ times(y, x) > induct Goal: times(x, y) ⦾ ≈ times(y, x) ⦾ > case x Goal: times(zero, y) ⦾ ≈ times(y, zero) ⦾ > auto simplify R9 l with [y := y] Goal: zero ≈ times(y, zero) ⦾ > induct Goal: zero ⦾ ≈ times(y, zero) ⦾ > case y Goal: zero ⦾ ≈ times(zero, zero) ⦾ > auto simplify R9 r with [y := zero] delete Goal: zero ⦾ ≈ times(s(y1), zero) ⦾ > auto simplify R10 r with [x := y1, y := zero] simplify R7 r with [y := times(y1, zero)] hdelete H38 l with [y := y1] Goal: times(s(x1), y) ⦾ ≈ times(y, s(x1)) ⦾ > auto simplify R10 l with [x := x1, y := y] Goal: plus(y, times(x1, y)) ≈ times(y, s(x1)) ⦾ > case y Goal: plus(zero, times(x1, zero)) ≈ times(zero, s(x1)) ⦾ > auto simplify R7 l with [y := times(x1, zero)] simplify R9 r with [y := s(x1)] hdelete H38^{-1} l with [y := x1] Goal: plus(s(y1), times(x1, s(y1))) ≈ times(s(y1), s(x1)) ⦾ > auto simplify R8 l with [x := y1, y := times(x1, s(y1))] simplify R10 r with [x := y1, y := s(x1)] simplify R8 r with [x := x1, y := times(y1, s(x1))] context 1 Goal: plus(y1, times(x1, s(y1))) ≈ plus(x1, times(y1, s(x1))) > :hypotheses You currently have the following induction hypotheses available: H2: plus(x, y) ≈ plus(y, x) H7: y ≈ plus(y, zero) H1: plus(x, plus(y, z)) ≈ plus(plus(x, y), z) H3: times(x, y) ≈ times(y, x) H38: zero ≈ times(y, zero) Goal: plus(y1, times(x1, s(y1))) ≈ plus(x1, times(y1, s(x1))) > hypothesis H3 l2 Goal: plus(y1, times(s(y1), x1)) ≈ plus(x1, times(y1, s(x1))) > hypothesis H3 r2 Goal: plus(y1, times(s(y1), x1)) ≈ plus(x1, times(s(x1), y1)) > auto simplify R10 l2 with [x := y1, y := x1] simplify R10 r2 with [x := x1, y := y1] Goal: plus(y1, plus(x1, times(y1, x1))) ≈ plus(x1, plus(y1, times(x1, y1))) > hypothesis H2 l Goal: plus(plus(x1, times(y1, x1)), y1) ≈ plus(x1, plus(y1, times(x1, y1))) > hypothesis H1-inverse l Goal: plus(x1, plus(times(y1, x1), y1)) ≈ plus(x1, plus(y1, times(x1, y1))) > hypothesis H2 l2 Goal: plus(x1, plus(y1, times(y1, x1))) ≈ plus(x1, plus(y1, times(x1, y1))) > auto hdelete H3 l2.2 with [x := y1, y := x1] 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: plus(s(x1), s(y1)) ≻ plus(s(y1), x1) plus(s(y1), s(x1)) ≻ plus(s(x1), y1) times(s(x1), s(y1)) ≻ plus(y1, times(s(y1), x1)) times(s(y1), s(x1)) ≻ plus(x1, times(s(x1), y1)) times(s(x1), s(y1)) ≻ plus(plus(x1, times(y1, x1)), y1) times(s(x1), s(y1)) ≻ plus(x1, plus(times(y1, x1), y1)) times(s(x1), s(y1)) ≻ plus(x1, plus(y1, times(y1, x1))) 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 plustimes1.proof Original equations and command history have been written to plustimes1.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: (• , plus(x, plus(y, z)) ≈ plus(plus(x, y), z) , •) E2: (• , plus(x, y) ≈ plus(y, x) , •) E3: (• , times(x, y) ≈ times(y, x) , •) We apply SKIP, which does not change the existing equations, but does allow us to focus on a different one. We apply INDUCT to E2, which causes plus(x, y) ≈ plus(y, x) to be added to the set H of induction hypotheses. This yields E4: (plus(x, y) , plus(x, y) ≈ plus(y, x) , plus(y, x)) We apply CASE on the instance of x. This yields the following new equations: E5: (plus(s(x1), y) , plus(s(x1), y) ≈ plus(y, s(x1)) , plus(y, s(x1))) E6: (plus(zero, y) , plus(zero, y) ≈ plus(y, zero) , plus(y, zero)) We apply SIMPLIFICATION to E6 with rule R7 and substitution [y := y]. This yields E7: (plus(zero, y) , y ≈ plus(y, zero) , plus(y, zero)) We apply INDUCT to E7, which causes y ≈ plus(y, zero) to be added to the set H of induction hypotheses. This yields E8: (y , y ≈ plus(y, zero) , plus(y, zero)) We apply CASE on the instance of y. This yields the following new equations: E9: (s(y1) , s(y1) ≈ plus(s(y1), zero) , plus(s(y1), zero)) E10: (zero , zero ≈ plus(zero, zero) , plus(zero, zero)) We apply SIMPLIFICATION to E10 with rule R7 and substitution [y := zero]. This yields E11: (zero , zero ≈ zero , plus(zero, zero)) We apply DELETION to E11 because both sides are equal. Thus, we may remove this equation from the proof state. We apply SIMPLIFICATION to E9 with rule R8 and substitution [x := y1, y := zero]. This yields E12: (s(y1) , s(y1) ≈ s(plus(y1, zero)) , plus(s(y1), zero)) We apply CONTEXT to E12, splitting the immediate arguments into separate equations. We preserve the completeness flag. This yields E13: (s(y1) , y1 ≈ plus(y1, zero) , plus(s(y1), zero)) We apply HDELETE to E13 with induction hypothesis H7 and substitution [y := y1]. We apply SIMPLIFICATION to E5 with rule R8 and substitution [x := x1, y := y]. This yields E14: (plus(s(x1), y) , s(plus(x1, y)) ≈ plus(y, s(x1)) , plus(y, s(x1))) We apply CASE on the instance of y. This yields the following new equations: E15: (plus(s(x1), s(y1)) , s(plus(x1, s(y1))) ≈ plus(s(y1), s(x1)) , plus(s(y1), s(x1))) E16: (plus(s(x1), zero) , s(plus(x1, zero)) ≈ plus(zero, s(x1)) , plus(zero, s(x1))) We apply SIMPLIFICATION to E16 with rule R7 and substitution [y := s(x1)]. This yields E17: (plus(s(x1), zero) , s(plus(x1, zero)) ≈ s(x1) , plus(zero, s(x1))) We apply CONTEXT to E17, splitting the immediate arguments into separate equations. We preserve the completeness flag. This yields E18: (plus(s(x1), zero) , plus(x1, zero) ≈ x1 , plus(zero, s(x1))) We apply HDELETE to E18 with induction hypothesis H7^{-1} and substitution [y := x1]. We apply SIMPLIFICATION to E15 with rule R8 and substitution [x := y1, y := s(x1)]. This yields E19: (plus(s(x1), s(y1)) , s(plus(x1, s(y1))) ≈ s(plus(y1, s(x1))) , plus(s(y1), s(x1))) We apply CONTEXT to E19, splitting the immediate arguments into separate equations. We preserve the completeness flag. This yields E20: (plus(s(x1), s(y1)) , plus(x1, s(y1)) ≈ plus(y1, s(x1)) , plus(s(y1), s(x1))) We apply HYPOTHESIS to E20 with induction hypothesis H2 and substitution [x := x1, y := s(y1)]. To this end, we impose the requirement that plus(s(x1), s(y1)) ≻ plus(s(y1), x1). This yields E21: (plus(s(x1), s(y1)) , plus(s(y1), x1) ≈ plus(y1, s(x1)) , plus(s(y1), s(x1))) We apply HYPOTHESIS to E21 with induction hypothesis H2 and substitution [x := y1, y := s(x1)]. To this end, we impose the requirement that plus(s(y1), s(x1)) ≻ plus(s(x1), y1). This yields E22: (plus(s(x1), s(y1)) , plus(s(y1), x1) ≈ plus(s(x1), y1) , plus(s(y1), s(x1))) We apply SIMPLIFICATION to E22 with rule R8 and substitution [x := y1, y := x1]. This yields E23: (plus(s(x1), s(y1)) , s(plus(y1, x1)) ≈ plus(s(x1), y1) , plus(s(y1), s(x1))) We apply SIMPLIFICATION to E23 with rule R8 and substitution [x := x1, y := y1]. This yields E24: (plus(s(x1), s(y1)) , s(plus(y1, x1)) ≈ s(plus(x1, y1)) , plus(s(y1), s(x1))) We apply CONTEXT to E24, splitting the immediate arguments into separate equations. We preserve the completeness flag. This yields E25: (plus(s(x1), s(y1)) , plus(y1, x1) ≈ plus(x1, y1) , plus(s(y1), s(x1))) We apply HDELETE to E25 with induction hypothesis H2 and substitution [x := y1, y := x1]. We apply INDUCT to E1, which causes plus(x, plus(y, z)) ≈ plus(plus(x, y), z) to be added to the set H of induction hypotheses. This yields E26: (plus(x, plus(y, z)) , plus(x, plus(y, z)) ≈ plus(plus(x, y), z) , plus(plus(x, y), z)) We apply CASE on the instance of x. This yields the following new equations: E27: (plus(s(x1), plus(y, z)) , plus(s(x1), plus(y, z)) ≈ plus(plus(s(x1), y), z) , plus(plus(s(x1), y), z)) E28: (plus(zero, plus(y, z)) , plus(zero, plus(y, z)) ≈ plus(plus(zero, y), z) , plus(plus(zero, y), z)) We apply SIMPLIFICATION to E28 with rule R7 and substitution [y := plus(y, z)]. This yields E29: (plus(zero, plus(y, z)) , plus(y, z) ≈ plus(plus(zero, y), z) , plus(plus(zero, y), z)) We apply SIMPLIFICATION to E29 with rule R7 and substitution [y := y]. This yields E30: (plus(zero, plus(y, z)) , plus(y, z) ≈ plus(y, z) , plus(plus(zero, y), z)) We apply DELETION to E30 because both sides are equal. Thus, we may remove this equation from the proof state. We apply SIMPLIFICATION to E27 with rule R8 and substitution [x := x1, y := plus(y, z)]. This yields E31: (plus(s(x1), plus(y, z)) , s(plus(x1, plus(y, z))) ≈ plus(plus(s(x1), y), z) , plus(plus(s(x1), y), z)) We apply SIMPLIFICATION to E31 with rule R8 and substitution [x := x1, y := y]. This yields E32: (plus(s(x1), plus(y, z)) , s(plus(x1, plus(y, z))) ≈ plus(s(plus(x1, y)), z) , plus(plus(s(x1), y), z)) We apply SIMPLIFICATION to E32 with rule R8 and substitution [x := plus(x1, y), y := z]. This yields E33: (plus(s(x1), plus(y, z)) , s(plus(x1, plus(y, z))) ≈ s(plus(plus(x1, y), z)) , plus(plus(s(x1), y), z)) We apply CONTEXT to E33, splitting the immediate arguments into separate equations. We preserve the completeness flag. This yields E34: (plus(s(x1), plus(y, z)) , plus(x1, plus(y, z)) ≈ plus(plus(x1, y), z) , plus(plus(s(x1), y), z)) We apply HDELETE to E34 with induction hypothesis H1 and substitution [x := x1, y := y, z := z]. We apply INDUCT to E3, which causes times(x, y) ≈ times(y, x) to be added to the set H of induction hypotheses. This yields E35: (times(x, y) , times(x, y) ≈ times(y, x) , times(y, x)) We apply CASE on the instance of x. This yields the following new equations: E36: (times(s(x1), y) , times(s(x1), y) ≈ times(y, s(x1)) , times(y, s(x1))) E37: (times(zero, y) , times(zero, y) ≈ times(y, zero) , times(y, zero)) We apply SIMPLIFICATION to E37 with rule R9 and substitution [y := y]. This yields E38: (times(zero, y) , zero ≈ times(y, zero) , times(y, zero)) We apply INDUCT to E38, which causes zero ≈ times(y, zero) to be added to the set H of induction hypotheses. This yields E39: (zero , zero ≈ times(y, zero) , times(y, zero)) We apply CASE on the instance of y. This yields the following new equations: E40: (zero , zero ≈ times(s(y1), zero) , times(s(y1), zero)) E41: (zero , zero ≈ times(zero, zero) , times(zero, zero)) We apply SIMPLIFICATION to E41 with rule R9 and substitution [y := zero]. This yields E42: (zero , zero ≈ zero , times(zero, zero)) We apply DELETION to E42 because both sides are equal. Thus, we may remove this equation from the proof state. We apply SIMPLIFICATION to E40 with rule R10 and substitution [x := y1, y := zero]. This yields E43: (zero , zero ≈ plus(zero, times(y1, zero)) , times(s(y1), zero)) We apply SIMPLIFICATION to E43 with rule R7 and substitution [y := times(y1, zero)]. This yields E44: (zero , zero ≈ times(y1, zero) , times(s(y1), zero)) We apply HDELETE to E44 with induction hypothesis H38 and substitution [y := y1]. We apply SIMPLIFICATION to E36 with rule R10 and substitution [x := x1, y := y]. This yields E45: (times(s(x1), y) , plus(y, times(x1, y)) ≈ times(y, s(x1)) , times(y, s(x1))) We apply CASE on the instance of y. This yields the following new equations: E46: (times(s(x1), s(y1)) , plus(s(y1), times(x1, s(y1))) ≈ times(s(y1), s(x1)) , times(s(y1), s(x1))) E47: (times(s(x1), zero) , plus(zero, times(x1, zero)) ≈ times(zero, s(x1)) , times(zero, s(x1))) We apply SIMPLIFICATION to E47 with rule R7 and substitution [y := times(x1, zero)]. This yields E48: (times(s(x1), zero) , times(x1, zero) ≈ times(zero, s(x1)) , times(zero, s(x1))) We apply SIMPLIFICATION to E48 with rule R9 and substitution [y := s(x1)]. This yields E49: (times(s(x1), zero) , times(x1, zero) ≈ zero , times(zero, s(x1))) We apply HDELETE to E49 with induction hypothesis H38^{-1} and substitution [y := x1]. We apply SIMPLIFICATION to E46 with rule R8 and substitution [x := y1, y := times(x1, s(y1))]. This yields E50: (times(s(x1), s(y1)) , s(plus(y1, times(x1, s(y1)))) ≈ times(s(y1), s(x1)) , times(s(y1), s(x1))) We apply SIMPLIFICATION to E50 with rule R10 and substitution [x := y1, y := s(x1)]. This yields E51: (times(s(x1), s(y1)) , s(plus(y1, times(x1, s(y1)))) ≈ plus(s(x1), times(y1, s(x1))) , times(s(y1), s(x1))) We apply SIMPLIFICATION to E51 with rule R8 and substitution [x := x1, y := times(y1, s(x1))]. This yields E52: (times(s(x1), s(y1)) , s(plus(y1, times(x1, s(y1)))) ≈ s(plus(x1, times(y1, s(x1)))) , times(s(y1), s(x1))) We apply CONTEXT to E52, splitting the immediate arguments into separate equations. We preserve the completeness flag. This yields E53: (times(s(x1), s(y1)) , plus(y1, times(x1, s(y1))) ≈ plus(x1, times(y1, s(x1))) , times(s(y1), s(x1))) We apply HYPOTHESIS to E53 with induction hypothesis H3 and substitution [x := x1, y := s(y1)]. To this end, we impose the requirement that times(s(x1), s(y1)) ≻ plus(y1, times(s(y1), x1)). This yields E54: (times(s(x1), s(y1)) , plus(y1, times(s(y1), x1)) ≈ plus(x1, times(y1, s(x1))) , times(s(y1), s(x1))) We apply HYPOTHESIS to E54 with induction hypothesis H3 and substitution [x := y1, y := s(x1)]. To this end, we impose the requirement that times(s(y1), s(x1)) ≻ plus(x1, times(s(x1), y1)). This yields E55: (times(s(x1), s(y1)) , plus(y1, times(s(y1), x1)) ≈ plus(x1, times(s(x1), y1)) , times(s(y1), s(x1))) We apply SIMPLIFICATION to E55 with rule R10 and substitution [x := y1, y := x1]. This yields E56: (times(s(x1), s(y1)) , plus(y1, plus(x1, times(y1, x1))) ≈ plus(x1, times(s(x1), y1)) , times(s(y1), s(x1))) We apply SIMPLIFICATION to E56 with rule R10 and substitution [x := x1, y := y1]. This yields E57: (times(s(x1), s(y1)) , plus(y1, plus(x1, times(y1, x1))) ≈ plus(x1, plus(y1, times(x1, y1))) , times(s(y1), s(x1))) We apply HYPOTHESIS to E57 with induction hypothesis H2 and substitution [x := y1, y := plus(x1, times(y1, x1))]. To this end, we impose the requirement that times(s(x1), s(y1)) ≻ plus(plus(x1, times(y1, x1)), y1). This yields E58: (times(s(x1), s(y1)) , plus(plus(x1, times(y1, x1)), y1) ≈ plus(x1, plus(y1, times(x1, y1))) , times(s(y1), s(x1))) We apply HYPOTHESIS to E58 with induction hypothesis H1^{-1} and substitution [x := x1, y := times(y1, x1), z := y1]. To this end, we impose the requirement that times(s(x1), s(y1)) ≻ plus(x1, plus(times(y1, x1), y1)). This yields E59: (times(s(x1), s(y1)) , plus(x1, plus(times(y1, x1), y1)) ≈ plus(x1, plus(y1, times(x1, y1))) , times(s(y1), s(x1))) We apply HYPOTHESIS to E59 with induction hypothesis H2 and substitution [x := times(y1, x1), y := y1]. To this end, we impose the requirement that times(s(x1), s(y1)) ≻ plus(x1, plus(y1, times(y1, x1))). This yields E60: (times(s(x1), s(y1)) , plus(x1, plus(y1, times(y1, x1))) ≈ plus(x1, plus(y1, times(x1, y1))) , times(s(y1), s(x1))) We apply HDELETE to E60 with induction hypothesis H3 and substitution [x := y1, y := x1]. 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)) plus(s(x), s(y)) → plus(s(y), x) plus(s(y), s(x)) → plus(s(x), y) times(s(x), s(y)) → plus(y, times(s(y), x)) times(s(y), s(x)) → plus(x, times(s(x), y)) times(s(x), s(y)) → plus(plus(x, times(y, x)), y) times(s(x), s(y)) → plus(x, plus(times(y, x), y)) times(s(x), s(y)) → plus(x, plus(y, times(y, x))) 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)) plus(s(x), s(y)) ≻ plus(s(y), x) plus(s(y), s(x)) ≻ plus(s(x), y) times(s(x), s(y)) ≻ plus(y, times(s(y), x)) times(s(y), s(x)) ≻ plus(x, times(s(x), y)) times(s(x), s(y)) ≻ plus(plus(x, times(y, x)), y) times(s(x), s(y)) ≻ plus(x, plus(times(y, x), y)) times(s(x), s(y)) ≻ plus(x, plus(y, times(y, x))) 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 } = max { 1 2 } = plus { 1 2 } = qrev { 1 } 2 > cons { 1 2 } = len { 1 } = minus { 1 2 } = nil { } = s { 1 } = zero { } * Well-founded theory orderings: ⊐_{Bool} = {(true,false)} ⊐_{Int} = {(x,y) | x < 1000 ∧ x < y } Steps: skip induct case x simplify R7 l with [y := y] induct case y simplify R7 r with [y := zero] delete simplify R8 r with [x := y1, y := zero] context 1 hdelete H7 l with [y := y1] simplify R8 l with [x := x1, y := y] case y simplify R7 r with [y := s(x1)] context 1 hdelete H7^{-1} l with [y := x1] simplify R8 r with [x := y1, y := s(x1)] context 1 hypothesis H2 l with [x := x1, y := s(y1)] hypothesis H2 r with [x := y1, y := s(x1)] simplify R8 l with [x := y1, y := x1] simplify R8 r with [x := x1, y := y1] context 1 hdelete H2 l with [x := y1, y := x1] induct case x simplify R7 l with [y := plus(y, z)] simplify R7 r1 with [y := y] delete simplify R8 l with [x := x1, y := plus(y, z)] simplify R8 r1 with [x := x1, y := y] simplify R8 r with [x := plus(x1, y), y := z] context 1 hdelete H1 l with [x := x1, y := y, z := z] induct case x simplify R9 l with [y := y] induct case y simplify R9 r with [y := zero] delete simplify R10 r with [x := y1, y := zero] simplify R7 r with [y := times(y1, zero)] hdelete H38 l with [y := y1] simplify R10 l with [x := x1, y := y] case y simplify R7 l with [y := times(x1, zero)] simplify R9 r with [y := s(x1)] hdelete H38^{-1} l with [y := x1] simplify R8 l with [x := y1, y := times(x1, s(y1))] simplify R10 r with [x := y1, y := s(x1)] simplify R8 r with [x := x1, y := times(y1, s(x1))] context 1 hypothesis H3 l2 with [x := x1, y := s(y1)] hypothesis H3 r2 with [x := y1, y := s(x1)] simplify R10 l2 with [x := y1, y := x1] simplify R10 r2 with [x := x1, y := y1] hypothesis H2 l with [x := y1, y := plus(x1, times(y1, x1))] hypothesis H1^{-1} l with [x := x1, y := times(y1, x1), z := y1] hypothesis H2 l2 with [x := times(y1, x1), y := y1] hdelete H3 l2.2 with [x := y1, y := x1]