(0) Obligation:

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

sub(0, 0) → 0
sub(s(x), 0) → s(x)
sub(0, s(x)) → 0
sub(s(x), s(y)) → sub(x, y)
zero(nil) → zero2(0, nil)
zero(cons(x, xs)) → zero2(sub(x, x), cons(x, xs))
zero2(0, nil) → nil
zero2(0, cons(x, xs)) → cons(sub(x, x), zero(xs))
zero2(s(y), nil) → zero(nil)
zero2(s(y), cons(x, xs)) → zero(cons(x, xs))

Q is empty.

(1) Overlay + Local Confluence (EQUIVALENT transformation)

The TRS is overlay and locally confluent. By [NOC] we can switch to innermost.

(2) Obligation:

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

sub(0, 0) → 0
sub(s(x), 0) → s(x)
sub(0, s(x)) → 0
sub(s(x), s(y)) → sub(x, y)
zero(nil) → zero2(0, nil)
zero(cons(x, xs)) → zero2(sub(x, x), cons(x, xs))
zero2(0, nil) → nil
zero2(0, cons(x, xs)) → cons(sub(x, x), zero(xs))
zero2(s(y), nil) → zero(nil)
zero2(s(y), cons(x, xs)) → zero(cons(x, xs))

The set Q consists of the following terms:

sub(0, 0)
sub(s(x0), 0)
sub(0, s(x0))
sub(s(x0), s(x1))
zero(nil)
zero(cons(x0, x1))
zero2(0, nil)
zero2(0, cons(x0, x1))
zero2(s(x0), nil)
zero2(s(x0), cons(x1, x2))

(3) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LPAR04] we result in the following initial DP problem.

(4) Obligation:

Q DP problem:
The TRS P consists of the following rules:

SUB(s(x), s(y)) → SUB(x, y)
ZERO(nil) → ZERO2(0, nil)
ZERO(cons(x, xs)) → ZERO2(sub(x, x), cons(x, xs))
ZERO(cons(x, xs)) → SUB(x, x)
ZERO2(0, cons(x, xs)) → SUB(x, x)
ZERO2(0, cons(x, xs)) → ZERO(xs)
ZERO2(s(y), nil) → ZERO(nil)
ZERO2(s(y), cons(x, xs)) → ZERO(cons(x, xs))

The TRS R consists of the following rules:

sub(0, 0) → 0
sub(s(x), 0) → s(x)
sub(0, s(x)) → 0
sub(s(x), s(y)) → sub(x, y)
zero(nil) → zero2(0, nil)
zero(cons(x, xs)) → zero2(sub(x, x), cons(x, xs))
zero2(0, nil) → nil
zero2(0, cons(x, xs)) → cons(sub(x, x), zero(xs))
zero2(s(y), nil) → zero(nil)
zero2(s(y), cons(x, xs)) → zero(cons(x, xs))

The set Q consists of the following terms:

sub(0, 0)
sub(s(x0), 0)
sub(0, s(x0))
sub(s(x0), s(x1))
zero(nil)
zero(cons(x0, x1))
zero2(0, nil)
zero2(0, cons(x0, x1))
zero2(s(x0), nil)
zero2(s(x0), cons(x1, x2))

We have to consider all minimal (P,Q,R)-chains.

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 2 SCCs with 4 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

Q DP problem:
The TRS P consists of the following rules:

SUB(s(x), s(y)) → SUB(x, y)

The TRS R consists of the following rules:

sub(0, 0) → 0
sub(s(x), 0) → s(x)
sub(0, s(x)) → 0
sub(s(x), s(y)) → sub(x, y)
zero(nil) → zero2(0, nil)
zero(cons(x, xs)) → zero2(sub(x, x), cons(x, xs))
zero2(0, nil) → nil
zero2(0, cons(x, xs)) → cons(sub(x, x), zero(xs))
zero2(s(y), nil) → zero(nil)
zero2(s(y), cons(x, xs)) → zero(cons(x, xs))

The set Q consists of the following terms:

sub(0, 0)
sub(s(x0), 0)
sub(0, s(x0))
sub(s(x0), s(x1))
zero(nil)
zero(cons(x0, x1))
zero2(0, nil)
zero2(0, cons(x0, x1))
zero2(s(x0), nil)
zero2(s(x0), cons(x1, x2))

We have to consider all minimal (P,Q,R)-chains.

(8) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(9) Obligation:

Q DP problem:
The TRS P consists of the following rules:

SUB(s(x), s(y)) → SUB(x, y)

R is empty.
The set Q consists of the following terms:

sub(0, 0)
sub(s(x0), 0)
sub(0, s(x0))
sub(s(x0), s(x1))
zero(nil)
zero(cons(x0, x1))
zero2(0, nil)
zero2(0, cons(x0, x1))
zero2(s(x0), nil)
zero2(s(x0), cons(x1, x2))

We have to consider all minimal (P,Q,R)-chains.

(10) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

sub(0, 0)
sub(s(x0), 0)
sub(0, s(x0))
sub(s(x0), s(x1))
zero(nil)
zero(cons(x0, x1))
zero2(0, nil)
zero2(0, cons(x0, x1))
zero2(s(x0), nil)
zero2(s(x0), cons(x1, x2))

(11) Obligation:

Q DP problem:
The TRS P consists of the following rules:

SUB(s(x), s(y)) → SUB(x, y)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.

(12) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • SUB(s(x), s(y)) → SUB(x, y)
    The graph contains the following edges 1 > 1, 2 > 2

(13) YES

(14) Obligation:

Q DP problem:
The TRS P consists of the following rules:

ZERO(cons(x, xs)) → ZERO2(sub(x, x), cons(x, xs))
ZERO2(0, cons(x, xs)) → ZERO(xs)
ZERO2(s(y), cons(x, xs)) → ZERO(cons(x, xs))

The TRS R consists of the following rules:

sub(0, 0) → 0
sub(s(x), 0) → s(x)
sub(0, s(x)) → 0
sub(s(x), s(y)) → sub(x, y)
zero(nil) → zero2(0, nil)
zero(cons(x, xs)) → zero2(sub(x, x), cons(x, xs))
zero2(0, nil) → nil
zero2(0, cons(x, xs)) → cons(sub(x, x), zero(xs))
zero2(s(y), nil) → zero(nil)
zero2(s(y), cons(x, xs)) → zero(cons(x, xs))

The set Q consists of the following terms:

sub(0, 0)
sub(s(x0), 0)
sub(0, s(x0))
sub(s(x0), s(x1))
zero(nil)
zero(cons(x0, x1))
zero2(0, nil)
zero2(0, cons(x0, x1))
zero2(s(x0), nil)
zero2(s(x0), cons(x1, x2))

We have to consider all minimal (P,Q,R)-chains.

(15) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(16) Obligation:

Q DP problem:
The TRS P consists of the following rules:

ZERO(cons(x, xs)) → ZERO2(sub(x, x), cons(x, xs))
ZERO2(0, cons(x, xs)) → ZERO(xs)
ZERO2(s(y), cons(x, xs)) → ZERO(cons(x, xs))

The TRS R consists of the following rules:

sub(0, 0) → 0
sub(s(x), s(y)) → sub(x, y)
sub(s(x), 0) → s(x)
sub(0, s(x)) → 0

The set Q consists of the following terms:

sub(0, 0)
sub(s(x0), 0)
sub(0, s(x0))
sub(s(x0), s(x1))
zero(nil)
zero(cons(x0, x1))
zero2(0, nil)
zero2(0, cons(x0, x1))
zero2(s(x0), nil)
zero2(s(x0), cons(x1, x2))

We have to consider all minimal (P,Q,R)-chains.

(17) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

zero(nil)
zero(cons(x0, x1))
zero2(0, nil)
zero2(0, cons(x0, x1))
zero2(s(x0), nil)
zero2(s(x0), cons(x1, x2))

(18) Obligation:

Q DP problem:
The TRS P consists of the following rules:

ZERO(cons(x, xs)) → ZERO2(sub(x, x), cons(x, xs))
ZERO2(0, cons(x, xs)) → ZERO(xs)
ZERO2(s(y), cons(x, xs)) → ZERO(cons(x, xs))

The TRS R consists of the following rules:

sub(0, 0) → 0
sub(s(x), s(y)) → sub(x, y)
sub(s(x), 0) → s(x)
sub(0, s(x)) → 0

The set Q consists of the following terms:

sub(0, 0)
sub(s(x0), 0)
sub(0, s(x0))
sub(s(x0), s(x1))

We have to consider all minimal (P,Q,R)-chains.

(19) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04].


The following pairs can be oriented strictly and are deleted.


ZERO2(0, cons(x, xs)) → ZERO(xs)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(0) = 0   
POL(ZERO(x1)) = x1   
POL(ZERO2(x1, x2)) = x2   
POL(cons(x1, x2)) = 1 + x2   
POL(s(x1)) = 0   
POL(sub(x1, x2)) = 0   

The following usable rules [FROCOS05] were oriented: none

(20) Obligation:

Q DP problem:
The TRS P consists of the following rules:

ZERO(cons(x, xs)) → ZERO2(sub(x, x), cons(x, xs))
ZERO2(s(y), cons(x, xs)) → ZERO(cons(x, xs))

The TRS R consists of the following rules:

sub(0, 0) → 0
sub(s(x), s(y)) → sub(x, y)
sub(s(x), 0) → s(x)
sub(0, s(x)) → 0

The set Q consists of the following terms:

sub(0, 0)
sub(s(x0), 0)
sub(0, s(x0))
sub(s(x0), s(x1))

We have to consider all minimal (P,Q,R)-chains.

(21) Induction-Processor (SOUND transformation)


This DP could be deleted by the Induction-Processor:
ZERO(cons(x, xs)) → ZERO2(sub(x, x), cons(x, xs))


This order was computed:
Polynomial interpretation [POLO]:

POL(0) = 0   
POL(ZERO(x1)) = 1   
POL(ZERO2(x1, x2)) = x1   
POL(cons(x1, x2)) = 0   
POL(s(x1)) = 1   
POL(sub(x1, x2)) = 1   

At least one of these decreasing rules is always used after the deleted DP:
sub(0, 0) → 0
sub(0, s(x91)) → 0


The following formula is valid:
x:sort[a12].sub'(, )=true


The transformed set:
sub'(0, 0) → true
sub'(s(x1), s(y')) → sub'(x1, y')
sub'(s(x5), 0) → false
sub'(0, s(x9)) → true
sub(0, 0) → 0
sub(s(x1), s(y')) → sub(x1, y')
sub(s(x5), 0) → s(x5)
sub(0, s(x9)) → 0
equal_bool(true, false) → false
equal_bool(false, true) → false
equal_bool(true, true) → true
equal_bool(false, false) → true
and(true, x) → x
and(false, x) → false
or(true, x) → true
or(false, x) → x
not(false) → true
not(true) → false
isa_true(true) → true
isa_true(false) → false
isa_false(true) → false
isa_false(false) → true
equal_sort[a12](0, 0) → true
equal_sort[a12](0, s(x0)) → false
equal_sort[a12](s(x0), 0) → false
equal_sort[a12](s(x0), s(x1)) → equal_sort[a12](x0, x1)
equal_sort[a5](witness_sort[a5], witness_sort[a5]) → true
equal_sort[a19](cons(x0, x1), cons(x2, x3)) → and(equal_sort[a19](x0, x2), equal_sort[a19](x1, x3))
equal_sort[a19](cons(x0, x1), witness_sort[a19]) → false
equal_sort[a19](witness_sort[a19], cons(x0, x1)) → false
equal_sort[a19](witness_sort[a19], witness_sort[a19]) → true
equal_sort[a16](witness_sort[a16], witness_sort[a16]) → true


The proof given by the theorem prover:
The following input was given to ACL2:
(set-ruler-extenders :all)

(defun trs_isbool (x)
  (or
    (and
      (consp
        x
      )
      (eq
        'trs_true
        (car
          x
        )
      )
      (eq
        (cdr
          x
        )
        'nil
      )
    )
    (and
      (consp
        x
      )
      (eq
        'trs_false
        (car
          x
        )
      )
      (eq
        (cdr
          x
        )
        'nil
      )
    )
  )
)
(defun trs_issort[a12] (x)
  (or
    (and
      (consp
        x
      )
      (eq
        'trs_0
        (car
          x
        )
      )
      (eq
        (cdr
          x
        )
        'nil
      )
    )
    (and
      (consp
        x
      )
      (consp
        (cdr
          x
        )
      )
      (eq
        'trs_s
        (car
          x
        )
      )
      (trs_issort[a12]
        (car
          (cdr
            x
          )
        )
      )
      (eq
        (cdr
          (cdr
            x
          )
        )
        'nil
      )
    )
  )
)
(defun trs_issort[a5] (x)
  (or
    (and
      (consp
        x
      )
      (eq
        'trs_witness_sort[a5]
        (car
          x
        )
      )
      (eq
        (cdr
          x
        )
        'nil
      )
    )
  )
)
(defun trs_issort[a16] (x)
  (or
    (and
      (consp
        x
      )
      (eq
        'trs_witness_sort[a16]
        (car
          x
        )
      )
      (eq
        (cdr
          x
        )
        'nil
      )
    )
  )
)
(defun trs_issort[a19] (x)
  (or
    (and
      (consp
        x
      )
      (consp
        (cdr
          x
        )
      )
      (consp
        (cdr
          (cdr
            x
          )
        )
      )
      (eq
        'trs_cons
        (car
          x
        )
      )
      (trs_issort[a12]
        (car
          (cdr
            x
          )
        )
      )
      (trs_issort[a5]
        (car
          (cdr
            (cdr
              x
            )
          )
        )
      )
      (eq
        (cdr
          (cdr
            (cdr
              x
            )
          )
        )
        'nil
      )
    )
    (and
      (consp
        x
      )
      (eq
        'trs_witness_sort[a19]
        (car
          x
        )
      )
      (eq
        (cdr
          x
        )
        'nil
      )
    )
  )
)
(defun trs_sub (x0 x1)
  (if
    (and
      (trs_issort[a12]
        x0
      )
      (trs_issort[a12]
        x1
      )
    )
    (if
      (and
        (eq
          (car
            x0
          )
          'trs_0
        )
        (eq
          (car
            x1
          )
          'trs_0
        )
      )
      (list 'trs_0
      )
      (if
        (and
          (eq
            (car
              x0
            )
            'trs_s
          )
          (eq
            (car
              x1
            )
            'trs_s
          )
        )
        (trs_sub
          (car
            (cdr
              x0
            )
          )
          (car
            (cdr
              x1
            )
          )
        )
        (if
          (and
            (eq
              (car
                x0
              )
              'trs_s
            )
            (eq
              (car
                x1
              )
              'trs_0
            )
          )
          (list 'trs_s
            (car
              (cdr
                x0
              )
            )
          )
          (if
            (and
            )
            (list 'trs_0
            )
            (list 'trs_0
            )
          )
        )
      )
    )
    (list 'trs_0
    )
  )
)
(defun trs_subprime (x0 x1)
  (if
    (and
      (trs_issort[a12]
        x0
      )
      (trs_issort[a12]
        x1
      )
    )
    (if
      (and
        (eq
          (car
            x0
          )
          'trs_0
        )
        (eq
          (car
            x1
          )
          'trs_0
        )
      )
      (list 'trs_true
      )
      (if
        (and
          (eq
            (car
              x0
            )
            'trs_s
          )
          (eq
            (car
              x1
            )
            'trs_s
          )
        )
        (trs_subprime
          (car
            (cdr
              x0
            )
          )
          (car
            (cdr
              x1
            )
          )
        )
        (if
          (and
            (eq
              (car
                x0
              )
              'trs_s
            )
            (eq
              (car
                x1
              )
              'trs_0
            )
          )
          (list 'trs_false
          )
          (if
            (and
            )
            (list 'trs_true
            )
            (list 'trs_true
            )
          )
        )
      )
    )
    (list 'trs_true
    )
  )
)
(defun trs_equal_sort[a16] (x0 x1)
  (if
    (and
      (trs_issort[a16]
        x0
      )
      (trs_issort[a16]
        x1
      )
    )
    (if
      (and
      )
      (list 'trs_true
      )
      (list 'trs_true
      )
    )
    (list 'trs_true
    )
  )
)
(defun trs_equal_sort[a5] (x0 x1)
  (if
    (and
      (trs_issort[a5]
        x0
      )
      (trs_issort[a5]
        x1
      )
    )
    (if
      (and
      )
      (list 'trs_true
      )
      (list 'trs_true
      )
    )
    (list 'trs_true
    )
  )
)
(defun trs_equal_sort[a12] (x0 x1)
  (if
    (and
      (trs_issort[a12]
        x0
      )
      (trs_issort[a12]
        x1
      )
    )
    (if
      (and
        (eq
          (car
            x0
          )
          'trs_0
        )
        (eq
          (car
            x1
          )
          'trs_0
        )
      )
      (list 'trs_true
      )
      (if
        (and
          (eq
            (car
              x0
            )
            'trs_0
          )
          (eq
            (car
              x1
            )
            'trs_s
          )
        )
        (list 'trs_false
        )
        (if
          (and
            (eq
              (car
                x0
              )
              'trs_s
            )
            (eq
              (car
                x1
              )
              'trs_0
            )
          )
          (list 'trs_false
          )
          (if
            (and
            )
            (trs_equal_sort[a12]
              (car
                (cdr
                  x0
                )
              )
              (car
                (cdr
                  x1
                )
              )
            )
            (list 'trs_true
            )
          )
        )
      )
    )
    (list 'trs_true
    )
  )
)
(defun trs_isa_false (x0)
  (if
    (and
      (trs_isbool
        x0
      )
    )
    (if
      (and
        (eq
          (car
            x0
          )
          'trs_true
        )
      )
      (list 'trs_false
      )
      (if
        (and
        )
        (list 'trs_true
        )
        (list 'trs_true
        )
      )
    )
    (list 'trs_true
    )
  )
)
(defun trs_isa_true (x0)
  (if
    (and
      (trs_isbool
        x0
      )
    )
    (if
      (and
        (eq
          (car
            x0
          )
          'trs_true
        )
      )
      (list 'trs_true
      )
      (if
        (and
        )
        (list 'trs_false
        )
        (list 'trs_true
        )
      )
    )
    (list 'trs_true
    )
  )
)
(defun trs_not (x0)
  (if
    (and
      (trs_isbool
        x0
      )
    )
    (if
      (and
        (eq
          (car
            x0
          )
          'trs_false
        )
      )
      (list 'trs_true
      )
      (if
        (and
        )
        (list 'trs_false
        )
        (list 'trs_true
        )
      )
    )
    (list 'trs_true
    )
  )
)
(defun trs_or (x0 x1)
  (if
    (and
      (trs_isbool
        x0
      )
      (trs_isbool
        x1
      )
    )
    (if
      (and
        (eq
          (car
            x0
          )
          'trs_true
        )
      )
      (list 'trs_true
      )
      (if
        (and
        )
        x1
        (list 'trs_true
        )
      )
    )
    (list 'trs_true
    )
  )
)
(defun trs_and (x0 x1)
  (if
    (and
      (trs_isbool
        x0
      )
      (trs_isbool
        x1
      )
    )
    (if
      (and
        (eq
          (car
            x0
          )
          'trs_true
        )
      )
      x1
      (if
        (and
        )
        (list 'trs_false
        )
        (list 'trs_true
        )
      )
    )
    (list 'trs_true
    )
  )
)
(defun trs_equal_bool (x0 x1)
  (if
    (and
      (trs_isbool
        x0
      )
      (trs_isbool
        x1
      )
    )
    (if
      (and
        (eq
          (car
            x0
          )
          'trs_true
        )
        (eq
          (car
            x1
          )
          'trs_false
        )
      )
      (list 'trs_false
      )
      (if
        (and
          (eq
            (car
              x0
            )
            'trs_false
          )
          (eq
            (car
              x1
            )
            'trs_true
          )
        )
        (list 'trs_false
        )
        (if
          (and
            (eq
              (car
                x0
              )
              'trs_true
            )
            (eq
              (car
                x1
              )
              'trs_true
            )
          )
          (list 'trs_true
          )
          (if
            (and
            )
            (list 'trs_true
            )
            (list 'trs_true
            )
          )
        )
      )
    )
    (list 'trs_true
    )
  )
)
(defun trs_equal_sort[a19] (x0 x1)
  (if
    (and
      (trs_issort[a19]
        x0
      )
      (trs_issort[a19]
        x1
      )
    )
    (if
      (and
        (eq
          (car
            x0
          )
          'trs_cons
        )
        (eq
          (car
            x1
          )
          'trs_cons
        )
      )
      (trs_and
        (trs_equal_sort[a19]
          (car
            (cdr
              x0
            )
          )
          (car
            (cdr
              x1
            )
          )
        )
        (trs_equal_sort[a19]
          (car
            (cdr
              (cdr
                x0
              )
            )
          )
          (car
            (cdr
              (cdr
                x1
              )
            )
          )
        )
      )
      (if
        (and
          (eq
            (car
              x0
            )
            'trs_cons
          )
          (eq
            (car
              x1
            )
            'trs_witness_sort[a19]
          )
        )
        (list 'trs_false
        )
        (if
          (and
            (eq
              (car
                x0
              )
              'trs_witness_sort[a19]
            )
            (eq
              (car
                x1
              )
              'trs_cons
            )
          )
          (list 'trs_false
          )
          (if
            (and
            )
            (list 'trs_true
            )
            (list 'trs_true
            )
          )
        )
      )
    )
    (list 'trs_true
    )
  )
)
(with-prover-time-limit 3
  (defthm test
    (implies
      (and
        (trs_issort[a12] trs_x)
      )
      (eq
        (trs_subprime
          trs_x
          trs_x
        )
        (list 'trs_true
        )
      )
    )
    :hints (("Goal" :do-not '(generalize)))
  )
)


The following output was given by ACL2:
This is SBCL 1.0.29.11.debian, an implementation of ANSI Common Lisp.
More information about SBCL is available at .

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses.  See the CREDITS and COPYING files in the
distribution for more information.

 ACL2 Version 3.6 built February 12, 2010  14:59:57.
 Copyright (C) 2009  University of Texas at Austin
 ACL2 comes with ABSOLUTELY NO WARRANTY.  This is free software and you
 are welcome to redistribute it under certain conditions.  For details,
 see the GNU General Public License.

 Initialized with (INITIALIZE-ACL2 'INCLUDE-BOOK *ACL2-PASS-2-FILES*).
 See the documentation topic note-3-6 for recent changes.
 Note: We have modified the prompt in some underlying Lisps to further
 distinguish it from the ACL2 prompt.

ACL2 Version 3.6.  Level 1.  Cbd "/home/petersk/workspace/benchmark/".
Distributed books directory "/home/petersk/download/acl2-sources/books/".
Type :help for help.
Type (good-bye) to quit completely out of ACL2.

ACL2 !> :ALL
ACL2 !>
Since TRS_ISBOOL is non-recursive, its admission is trivial.  We observe
that the type of TRS_ISBOOL is described by the theorem 
(OR (EQUAL (TRS_ISBOOL X) T) (EQUAL (TRS_ISBOOL X) NIL)).  We used
the :executable-counterpart of EQUAL and primitive type reasoning.

Summary
Form:  ( DEFUN TRS_ISBOOL ...)
Rules: ((:EXECUTABLE-COUNTERPART EQUAL)
        (:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings:  None
Time:  0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
 TRS_ISBOOL
ACL2 !>
For the admission of TRS_ISSORT[A12] we will use the relation O< (which
is known to be well-founded on the domain recognized by O-P) and the
measure (ACL2-COUNT X).  The non-trivial part of the measure conjecture
is

Goal
(IMPLIES (AND (NOT (AND (CONSP X)
                        (EQ 'TRS_0 (CAR X))
                        (EQ (CDR X) NIL)))
              (CONSP X)
              (CONSP (CDR X))
              (EQ 'TRS_S (CAR X)))
         (O< (ACL2-COUNT (CADR X))
             (ACL2-COUNT X))).

By the simple :definition EQ we reduce the conjecture to

Goal'
(IMPLIES (AND (NOT (AND (CONSP X)
                        (EQUAL 'TRS_0 (CAR X))
                        (EQUAL (CDR X) NIL)))
              (CONSP X)
              (CONSP (CDR X))
              (EQUAL 'TRS_S (CAR X)))
         (O< (ACL2-COUNT (CADR X))
             (ACL2-COUNT X))).

This simplifies, using the :definitions ACL2-COUNT, FIX, O-FINP and
O<, the :executable-counterparts of ACL2-COUNT and EQUAL, primitive
type reasoning, the :rewrite rule UNICITY-OF-0 and the :type-prescription
rule ACL2-COUNT, to

Goal''
(IMPLIES (AND (CONSP X)
              (CONSP (CDR X))
              (EQUAL 'TRS_S (CAR X)))
         (< (ACL2-COUNT (CADR X))
            (+ 1 (ACL2-COUNT (CDR X))))).

The destructor terms (CAR X) and (CDR X) can be eliminated.  Furthermore,
those terms are at the root of a chain of two rounds of destructor
elimination. (1) Use CAR-CDR-ELIM to replace X by (CONS X1 X2), (CAR X)
by X1 and (CDR X) by X2 and restrict the type of the new variable X1
to be that of the term it replaces.  (2) Use CAR-CDR-ELIM, again, to
replace X2 by (CONS X3 X4), (CAR X2) by X3 and (CDR X2) by X4.    These
steps produce the following goal.

Goal'''
(IMPLIES (AND (CONSP (CONS X3 X4))
              (SYMBOLP X1)
              (NOT (EQUAL X1 T))
              (NOT (EQUAL X1 NIL))
              (CONSP (LIST* X1 X3 X4))
              (EQUAL 'TRS_S X1))
         (< (ACL2-COUNT X3)
            (+ 1 (ACL2-COUNT (CONS X3 X4))))).

By case analysis we reduce the conjecture to

Goal'4'
(IMPLIES (AND (CONSP (CONS X3 X4))
              (SYMBOLP X1)
              (NOT (EQUAL X1 T))
              X1 (CONSP (LIST* X1 X3 X4))
              (EQUAL 'TRS_S X1))
         (< (ACL2-COUNT X3)
            (+ 1 (ACL2-COUNT (CONS X3 X4))))).

This simplifies, using the :definition ACL2-COUNT, the :executable-
counterparts of EQUAL, NOT and SYMBOLP, primitive type reasoning and
the :rewrite rules CAR-CONS and CDR-CONS, to

Goal'5'
(< (ACL2-COUNT X3)
   (+ 1 1 (ACL2-COUNT X3)
      (ACL2-COUNT X4))).

But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule ACL2-COUNT.

Q.E.D.

That completes the proof of the measure theorem for TRS_ISSORT[A12].
Thus, we admit this function under the principle of definition.  We
observe that the type of TRS_ISSORT[A12] is described by the theorem
(OR (EQUAL (TRS_ISSORT[A12] X) T) (EQUAL (TRS_ISSORT[A12] X) NIL)).
We used the :executable-counterpart of EQUAL and primitive type reasoning.

Summary
Form:  ( DEFUN TRS_ISSORT[A12] ...)
Rules: ((:DEFINITION ACL2-COUNT)
        (:DEFINITION EQ)
        (:DEFINITION FIX)
        (:DEFINITION NOT)
        (:DEFINITION O-FINP)
        (:DEFINITION O<)
        (:ELIM CAR-CDR-ELIM)
        (:EXECUTABLE-COUNTERPART ACL2-COUNT)
        (:EXECUTABLE-COUNTERPART EQUAL)
        (:EXECUTABLE-COUNTERPART NOT)
        (:EXECUTABLE-COUNTERPART SYMBOLP)
        (:FAKE-RUNE-FOR-LINEAR NIL)
        (:FAKE-RUNE-FOR-TYPE-SET NIL)
        (:REWRITE CAR-CONS)
        (:REWRITE CDR-CONS)
        (:REWRITE UNICITY-OF-0)
        (:TYPE-PRESCRIPTION ACL2-COUNT))
Warnings:  None
Time:  0.01 seconds (prove: 0.00, print: 0.01, other: 0.00)
 TRS_ISSORT[A12]
ACL2 !>
Since TRS_ISSORT[A5] is non-recursive, its admission is trivial.  We
observe that the type of TRS_ISSORT[A5] is described by the theorem
(OR (EQUAL (TRS_ISSORT[A5] X) T) (EQUAL (TRS_ISSORT[A5] X) NIL)). 
We used primitive type reasoning.

Summary
Form:  ( DEFUN TRS_ISSORT[A5] ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings:  None
Time:  0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
 TRS_ISSORT[A5]
ACL2 !>
Since TRS_ISSORT[A16] is non-recursive, its admission is trivial. 
We observe that the type of TRS_ISSORT[A16] is described by the theorem
(OR (EQUAL (TRS_ISSORT[A16] X) T) (EQUAL (TRS_ISSORT[A16] X) NIL)).
We used primitive type reasoning.

Summary
Form:  ( DEFUN TRS_ISSORT[A16] ...)
Rules: ((:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings:  None
Time:  0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
 TRS_ISSORT[A16]
ACL2 !>
Since TRS_ISSORT[A19] is non-recursive, its admission is trivial. 
We observe that the type of TRS_ISSORT[A19] is described by the theorem
(OR (EQUAL (TRS_ISSORT[A19] X) T) (EQUAL (TRS_ISSORT[A19] X) NIL)).
We used the :executable-counterpart of EQUAL, primitive type reasoning
and the :type-prescription rules TRS_ISSORT[A12] and TRS_ISSORT[A5].

Summary
Form:  ( DEFUN TRS_ISSORT[A19] ...)
Rules: ((:EXECUTABLE-COUNTERPART EQUAL)
        (:FAKE-RUNE-FOR-TYPE-SET NIL)
        (:TYPE-PRESCRIPTION TRS_ISSORT[A12])
        (:TYPE-PRESCRIPTION TRS_ISSORT[A5]))
Warnings:  None
Time:  0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
 TRS_ISSORT[A19]
ACL2 !>
For the admission of TRS_SUB we will use the relation O< (which is
known to be well-founded on the domain recognized by O-P) and the measure
(ACL2-COUNT X0).  The non-trivial part of the measure conjecture is

Goal
(IMPLIES (AND (AND (TRS_ISSORT[A12] X0)
                   (TRS_ISSORT[A12] X1))
              (NOT (AND (EQ (CAR X0) 'TRS_0)
                        (EQ (CAR X1) 'TRS_0)))
              (AND (EQ (CAR X0) 'TRS_S)
                   (EQ (CAR X1) 'TRS_S)))
         (O< (ACL2-COUNT (CADR X0))
             (ACL2-COUNT X0))).

By the simple :definition EQ we reduce the conjecture to

Goal'
(IMPLIES (AND (TRS_ISSORT[A12] X0)
              (TRS_ISSORT[A12] X1)
              (NOT (AND (EQUAL (CAR X0) 'TRS_0)
                        (EQUAL (CAR X1) 'TRS_0)))
              (EQUAL (CAR X0) 'TRS_S)
              (EQUAL (CAR X1) 'TRS_S))
         (O< (ACL2-COUNT (CADR X0))
             (ACL2-COUNT X0))).

This simplifies, using the :definitions ACL2-COUNT, FIX, O-FINP, O<
and TRS_ISSORT[A12], the :executable-counterparts of ACL2-COUNT and
EQUAL, primitive type reasoning, the :rewrite rules COMMUTATIVITY-OF-+
and UNICITY-OF-0 and the :type-prescription rule ACL2-COUNT, to

Goal''
(IMPLIES (AND (CONSP X0)
              (CONSP (CDR X0))
              (TRS_ISSORT[A12] (CADR X0))
              (NOT (CDDR X0))
              (TRS_ISSORT[A12] X1)
              (EQUAL (CAR X0) 'TRS_S)
              (EQUAL (CAR X1) 'TRS_S))
         (< (ACL2-COUNT (CADR X0))
            (+ 1 1 (ACL2-COUNT (CADR X0))))).

But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule ACL2-COUNT.

Q.E.D.

That completes the proof of the measure theorem for TRS_SUB.  Thus,
we admit this function under the principle of definition.  We observe
that the type of TRS_SUB is described by the theorem 
(AND (CONSP (TRS_SUB X0 X1)) (TRUE-LISTP (TRS_SUB X0 X1))).  We used
the :executable-counterpart of EQUAL and primitive type reasoning.

Summary
Form:  ( DEFUN TRS_SUB ...)
Rules: ((:DEFINITION ACL2-COUNT)
        (:DEFINITION EQ)
        (:DEFINITION FIX)
        (:DEFINITION NOT)
        (:DEFINITION O-FINP)
        (:DEFINITION O<)
        (:DEFINITION TRS_ISSORT[A12])
        (:EXECUTABLE-COUNTERPART ACL2-COUNT)
        (:EXECUTABLE-COUNTERPART EQUAL)
        (:FAKE-RUNE-FOR-LINEAR NIL)
        (:FAKE-RUNE-FOR-TYPE-SET NIL)
        (:REWRITE COMMUTATIVITY-OF-+)
        (:REWRITE UNICITY-OF-0)
        (:TYPE-PRESCRIPTION ACL2-COUNT))
Warnings:  None
Time:  0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
 TRS_SUB
ACL2 !>
For the admission of TRS_SUBPRIME we will use the relation O< (which
is known to be well-founded on the domain recognized by O-P) and the
measure (ACL2-COUNT X0).  The non-trivial part of the measure conjecture
is

Goal
(IMPLIES (AND (AND (TRS_ISSORT[A12] X0)
                   (TRS_ISSORT[A12] X1))
              (NOT (AND (EQ (CAR X0) 'TRS_0)
                        (EQ (CAR X1) 'TRS_0)))
              (AND (EQ (CAR X0) 'TRS_S)
                   (EQ (CAR X1) 'TRS_S)))
         (O< (ACL2-COUNT (CADR X0))
             (ACL2-COUNT X0))).

By the simple :definition EQ we reduce the conjecture to

Goal'
(IMPLIES (AND (TRS_ISSORT[A12] X0)
              (TRS_ISSORT[A12] X1)
              (NOT (AND (EQUAL (CAR X0) 'TRS_0)
                        (EQUAL (CAR X1) 'TRS_0)))
              (EQUAL (CAR X0) 'TRS_S)
              (EQUAL (CAR X1) 'TRS_S))
         (O< (ACL2-COUNT (CADR X0))
             (ACL2-COUNT X0))).

This simplifies, using the :definitions ACL2-COUNT, FIX, O-FINP, O<
and TRS_ISSORT[A12], the :executable-counterparts of ACL2-COUNT and
EQUAL, primitive type reasoning, the :rewrite rules COMMUTATIVITY-OF-+
and UNICITY-OF-0 and the :type-prescription rule ACL2-COUNT, to

Goal''
(IMPLIES (AND (CONSP X0)
              (CONSP (CDR X0))
              (TRS_ISSORT[A12] (CADR X0))
              (NOT (CDDR X0))
              (TRS_ISSORT[A12] X1)
              (EQUAL (CAR X0) 'TRS_S)
              (EQUAL (CAR X1) 'TRS_S))
         (< (ACL2-COUNT (CADR X0))
            (+ 1 1 (ACL2-COUNT (CADR X0))))).

But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule ACL2-COUNT.

Q.E.D.

That completes the proof of the measure theorem for TRS_SUBPRIME. 
Thus, we admit this function under the principle of definition.  We
observe that the type of TRS_SUBPRIME is described by the theorem 
(AND (CONSP (TRS_SUBPRIME X0 X1)) (TRUE-LISTP (TRS_SUBPRIME X0 X1))).
We used the :executable-counterpart of EQUAL and primitive type reasoning.

Summary
Form:  ( DEFUN TRS_SUBPRIME ...)
Rules: ((:DEFINITION ACL2-COUNT)
        (:DEFINITION EQ)
        (:DEFINITION FIX)
        (:DEFINITION NOT)
        (:DEFINITION O-FINP)
        (:DEFINITION O<)
        (:DEFINITION TRS_ISSORT[A12])
        (:EXECUTABLE-COUNTERPART ACL2-COUNT)
        (:EXECUTABLE-COUNTERPART EQUAL)
        (:FAKE-RUNE-FOR-LINEAR NIL)
        (:FAKE-RUNE-FOR-TYPE-SET NIL)
        (:REWRITE COMMUTATIVITY-OF-+)
        (:REWRITE UNICITY-OF-0)
        (:TYPE-PRESCRIPTION ACL2-COUNT))
Warnings:  None
Time:  0.01 seconds (prove: 0.00, print: 0.01, other: 0.00)
 TRS_SUBPRIME
ACL2 !>
Since TRS_EQUAL_SORT[A16] is non-recursive, its admission is trivial.
We observe that the type of TRS_EQUAL_SORT[A16] is described by the
theorem 
(AND (CONSP (TRS_EQUAL_SORT[A16] X0 X1))
     (TRUE-LISTP (TRS_EQUAL_SORT[A16] X0 X1))).

Summary
Form:  ( DEFUN TRS_EQUAL_SORT[A16] ...)
Rules: NIL
Warnings:  None
Time:  0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
 TRS_EQUAL_SORT[A16]
ACL2 !>
Since TRS_EQUAL_SORT[A5] is non-recursive, its admission is trivial.
We observe that the type of TRS_EQUAL_SORT[A5] is described by the
theorem 
(AND (CONSP (TRS_EQUAL_SORT[A5] X0 X1))
     (TRUE-LISTP (TRS_EQUAL_SORT[A5] X0 X1))).

Summary
Form:  ( DEFUN TRS_EQUAL_SORT[A5] ...)
Rules: NIL
Warnings:  None
Time:  0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
 TRS_EQUAL_SORT[A5]
ACL2 !>
For the admission of TRS_EQUAL_SORT[A12] we will use the relation O<
(which is known to be well-founded on the domain recognized by O-P)
and the measure (ACL2-COUNT X0).  The non-trivial part of the measure
conjecture is

Goal
(IMPLIES (AND (AND (TRS_ISSORT[A12] X0)
                   (TRS_ISSORT[A12] X1))
              (NOT (AND (EQ (CAR X0) 'TRS_0)
                        (EQ (CAR X1) 'TRS_0)))
              (NOT (AND (EQ (CAR X0) 'TRS_0)
                        (EQ (CAR X1) 'TRS_S)))
              (NOT (AND (EQ (CAR X0) 'TRS_S)
                        (EQ (CAR X1) 'TRS_0)))
              T)
         (O< (ACL2-COUNT (CADR X0))
             (ACL2-COUNT X0))).

By the simple :definition EQ we reduce the conjecture to

Goal'
(IMPLIES (AND (TRS_ISSORT[A12] X0)
              (TRS_ISSORT[A12] X1)
              (NOT (AND (EQUAL (CAR X0) 'TRS_0)
                        (EQUAL (CAR X1) 'TRS_0)))
              (NOT (AND (EQUAL (CAR X0) 'TRS_0)
                        (EQUAL (CAR X1) 'TRS_S)))
              (NOT (AND (EQUAL (CAR X0) 'TRS_S)
                        (EQUAL (CAR X1) 'TRS_0))))
         (O< (ACL2-COUNT (CADR X0))
             (ACL2-COUNT X0))).

This simplifies, using the :definitions ACL2-COUNT, FIX, O-FINP, O<
and TRS_ISSORT[A12], the :executable-counterparts of ACL2-COUNT and
EQUAL, primitive type reasoning, the :rewrite rules COMMUTATIVITY-OF-+
and UNICITY-OF-0 and the :type-prescription rule ACL2-COUNT, to

Goal''
(IMPLIES (AND (CONSP X0)
              (CONSP (CDR X0))
              (EQUAL 'TRS_S (CAR X0))
              (TRS_ISSORT[A12] (CADR X0))
              (NOT (CDDR X0))
              (TRS_ISSORT[A12] X1)
              (NOT (EQUAL (CAR X1) 'TRS_0)))
         (< (ACL2-COUNT (CADR X0))
            (+ 1 1 (ACL2-COUNT (CADR X0))))).

But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule ACL2-COUNT.

Q.E.D.

That completes the proof of the measure theorem for TRS_EQUAL_SORT[A12].
Thus, we admit this function under the principle of definition.  We
observe that the type of TRS_EQUAL_SORT[A12] is described by the theorem
(AND (CONSP (TRS_EQUAL_SORT[A12] X0 X1))
     (TRUE-LISTP (TRS_EQUAL_SORT[A12] X0 X1))).
We used the :executable-counterpart of EQUAL and primitive type reasoning.

Summary
Form:  ( DEFUN TRS_EQUAL_SORT[A12] ...)
Rules: ((:DEFINITION ACL2-COUNT)
        (:DEFINITION EQ)
        (:DEFINITION FIX)
        (:DEFINITION NOT)
        (:DEFINITION O-FINP)
        (:DEFINITION O<)
        (:DEFINITION TRS_ISSORT[A12])
        (:EXECUTABLE-COUNTERPART ACL2-COUNT)
        (:EXECUTABLE-COUNTERPART EQUAL)
        (:FAKE-RUNE-FOR-LINEAR NIL)
        (:FAKE-RUNE-FOR-TYPE-SET NIL)
        (:REWRITE COMMUTATIVITY-OF-+)
        (:REWRITE UNICITY-OF-0)
        (:TYPE-PRESCRIPTION ACL2-COUNT))
Warnings:  None
Time:  0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
 TRS_EQUAL_SORT[A12]
ACL2 !>
Since TRS_ISA_FALSE is non-recursive, its admission is trivial.  We
observe that the type of TRS_ISA_FALSE is described by the theorem
(AND (CONSP (TRS_ISA_FALSE X0)) (TRUE-LISTP (TRS_ISA_FALSE X0))). 

Summary
Form:  ( DEFUN TRS_ISA_FALSE ...)
Rules: NIL
Warnings:  None
Time:  0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
 TRS_ISA_FALSE
ACL2 !>
Since TRS_ISA_TRUE is non-recursive, its admission is trivial.  We
observe that the type of TRS_ISA_TRUE is described by the theorem 
(AND (CONSP (TRS_ISA_TRUE X0)) (TRUE-LISTP (TRS_ISA_TRUE X0))).  

Summary
Form:  ( DEFUN TRS_ISA_TRUE ...)
Rules: NIL
Warnings:  None
Time:  0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
 TRS_ISA_TRUE
ACL2 !>
Since TRS_NOT is non-recursive, its admission is trivial.  We observe
that the type of TRS_NOT is described by the theorem 
(AND (CONSP (TRS_NOT X0)) (TRUE-LISTP (TRS_NOT X0))).  

Summary
Form:  ( DEFUN TRS_NOT ...)
Rules: NIL
Warnings:  None
Time:  0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
 TRS_NOT
ACL2 !>
Since TRS_OR is non-recursive, its admission is trivial.  We observe
that the type of TRS_OR is described by the theorem 
(OR (AND (CONSP (TRS_OR X0 X1))
         (TRUE-LISTP (TRS_OR X0 X1)))
    (EQUAL (TRS_OR X0 X1) X1)).

Summary
Form:  ( DEFUN TRS_OR ...)
Rules: NIL
Warnings:  None
Time:  0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
 TRS_OR
ACL2 !>
Since TRS_AND is non-recursive, its admission is trivial.  We observe
that the type of TRS_AND is described by the theorem 
(OR (AND (CONSP (TRS_AND X0 X1))
         (TRUE-LISTP (TRS_AND X0 X1)))
    (EQUAL (TRS_AND X0 X1) X1)).

Summary
Form:  ( DEFUN TRS_AND ...)
Rules: NIL
Warnings:  None
Time:  0.01 seconds (prove: 0.00, print: 0.00, other: 0.01)
 TRS_AND
ACL2 !>
Since TRS_EQUAL_BOOL is non-recursive, its admission is trivial.  We
observe that the type of TRS_EQUAL_BOOL is described by the theorem
(AND (CONSP (TRS_EQUAL_BOOL X0 X1)) (TRUE-LISTP (TRS_EQUAL_BOOL X0 X1))).
We used the :executable-counterpart of EQUAL and primitive type reasoning.

Summary
Form:  ( DEFUN TRS_EQUAL_BOOL ...)
Rules: ((:EXECUTABLE-COUNTERPART EQUAL)
        (:FAKE-RUNE-FOR-TYPE-SET NIL))
Warnings:  None
Time:  0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
 TRS_EQUAL_BOOL
ACL2 !>
For the admission of TRS_EQUAL_SORT[A19] we will use the relation O<
(which is known to be well-founded on the domain recognized by O-P)
and the measure (ACL2-COUNT X0).  The non-trivial part of the measure
conjecture is

Goal
(AND (IMPLIES (AND (AND (TRS_ISSORT[A19] X0)
                        (TRS_ISSORT[A19] X1))
                   (AND (EQ (CAR X0) 'TRS_CONS)
                        (EQ (CAR X1) 'TRS_CONS)))
              (O< (ACL2-COUNT (CADDR X0))
                  (ACL2-COUNT X0)))
     (IMPLIES (AND (AND (TRS_ISSORT[A19] X0)
                        (TRS_ISSORT[A19] X1))
                   (AND (EQ (CAR X0) 'TRS_CONS)
                        (EQ (CAR X1) 'TRS_CONS)))
              (O< (ACL2-COUNT (CADR X0))
                  (ACL2-COUNT X0)))).

By the simple :definitions EQ and TRS_ISSORT[A19] we reduce the conjecture
to the following two conjectures.

Subgoal 2
(IMPLIES (AND (CONSP X0)
              (COND ((CONSP (CDR X0))
                     (AND (CONSP (CDDR X0))
                          (EQUAL 'TRS_CONS (CAR X0))
                          (TRS_ISSORT[A12] (CADR X0))
                          (TRS_ISSORT[A5] (CADDR X0))
                          (EQUAL (CDDDR X0) NIL)))
                    ((EQUAL 'TRS_WITNESS_SORT[A19] (CAR X0))
                     (EQUAL (CDR X0) NIL))
                    (T NIL))
              (CONSP X1)
              (COND ((CONSP (CDR X1))
                     (AND (CONSP (CDDR X1))
                          (EQUAL 'TRS_CONS (CAR X1))
                          (TRS_ISSORT[A12] (CADR X1))
                          (TRS_ISSORT[A5] (CADDR X1))
                          (EQUAL (CDDDR X1) NIL)))
                    ((EQUAL 'TRS_WITNESS_SORT[A19] (CAR X1))
                     (EQUAL (CDR X1) NIL))
                    (T NIL))
              (EQUAL (CAR X0) 'TRS_CONS)
              (EQUAL (CAR X1) 'TRS_CONS))
         (O< (ACL2-COUNT (CADDR X0))
             (ACL2-COUNT X0))).

This simplifies, using the :definitions ACL2-COUNT, FIX, O-FINP, O<
and TRS_ISSORT[A5], the :executable-counterparts of ACL2-COUNT, BINARY-+,
EQUAL and O-FINP, primitive type reasoning, the :rewrite rules 
COMMUTATIVITY-OF-+ and UNICITY-OF-0 and the :type-prescription rule
ACL2-COUNT, to

Subgoal 2'
(IMPLIES (AND (CONSP X0)
              (CONSP (CDR X0))
              (CONSP (CDDR X0))
              (TRS_ISSORT[A12] (CADR X0))
              (CONSP (CADDR X0))
              (EQUAL 'TRS_WITNESS_SORT[A5]
                     (CAADDR X0))
              (NOT (CDADDR X0))
              (NOT (CDDDR X0))
              (CONSP X1)
              (CONSP (CDR X1))
              (CONSP (CDDR X1))
              (TRS_ISSORT[A12] (CADR X1))
              (CONSP (CADDR X1))
              (EQUAL 'TRS_WITNESS_SORT[A5]
                     (CAADDR X1))
              (NOT (CDADDR X1))
              (NOT (CDDDR X1))
              (EQUAL (CAR X0) 'TRS_CONS)
              (EQUAL (CAR X1) 'TRS_CONS))
         (< 1 (+ 1 1 2 (ACL2-COUNT (CADR X0))))).

But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule ACL2-COUNT.

Subgoal 1
(IMPLIES (AND (CONSP X0)
              (COND ((CONSP (CDR X0))
                     (AND (CONSP (CDDR X0))
                          (EQUAL 'TRS_CONS (CAR X0))
                          (TRS_ISSORT[A12] (CADR X0))
                          (TRS_ISSORT[A5] (CADDR X0))
                          (EQUAL (CDDDR X0) NIL)))
                    ((EQUAL 'TRS_WITNESS_SORT[A19] (CAR X0))
                     (EQUAL (CDR X0) NIL))
                    (T NIL))
              (CONSP X1)
              (COND ((CONSP (CDR X1))
                     (AND (CONSP (CDDR X1))
                          (EQUAL 'TRS_CONS (CAR X1))
                          (TRS_ISSORT[A12] (CADR X1))
                          (TRS_ISSORT[A5] (CADDR X1))
                          (EQUAL (CDDDR X1) NIL)))
                    ((EQUAL 'TRS_WITNESS_SORT[A19] (CAR X1))
                     (EQUAL (CDR X1) NIL))
                    (T NIL))
              (EQUAL (CAR X0) 'TRS_CONS)
              (EQUAL (CAR X1) 'TRS_CONS))
         (O< (ACL2-COUNT (CADR X0))
             (ACL2-COUNT X0))).

This simplifies, using the :definitions ACL2-COUNT, FIX, O-FINP, O<
and TRS_ISSORT[A5], the :executable-counterparts of ACL2-COUNT, BINARY-+
and EQUAL, primitive type reasoning, the :rewrite rules COMMUTATIVITY-OF-+
and UNICITY-OF-0 and the :type-prescription rule ACL2-COUNT, to

Subgoal 1'
(IMPLIES (AND (CONSP X0)
              (CONSP (CDR X0))
              (CONSP (CDDR X0))
              (TRS_ISSORT[A12] (CADR X0))
              (CONSP (CADDR X0))
              (EQUAL 'TRS_WITNESS_SORT[A5]
                     (CAADDR X0))
              (NOT (CDADDR X0))
              (NOT (CDDDR X0))
              (CONSP X1)
              (CONSP (CDR X1))
              (CONSP (CDDR X1))
              (TRS_ISSORT[A12] (CADR X1))
              (CONSP (CADDR X1))
              (EQUAL 'TRS_WITNESS_SORT[A5]
                     (CAADDR X1))
              (NOT (CDADDR X1))
              (NOT (CDDDR X1))
              (EQUAL (CAR X0) 'TRS_CONS)
              (EQUAL (CAR X1) 'TRS_CONS))
         (< (ACL2-COUNT (CADR X0))
            (+ 1 1 2 (ACL2-COUNT (CADR X0))))).

But simplification reduces this to T, using linear arithmetic, primitive
type reasoning and the :type-prescription rule ACL2-COUNT.

Q.E.D.

That completes the proof of the measure theorem for TRS_EQUAL_SORT[A19].
Thus, we admit this function under the principle of definition.  We
observe that the type of TRS_EQUAL_SORT[A19] is described by the theorem
(AND (CONSP (TRS_EQUAL_SORT[A19] X0 X1))
     (TRUE-LISTP (TRS_EQUAL_SORT[A19] X0 X1))).
We used the :executable-counterpart of EQUAL, primitive type reasoning
and the :type-prescription rule TRS_AND.

Summary
Form:  ( DEFUN TRS_EQUAL_SORT[A19] ...)
Rules: ((:DEFINITION ACL2-COUNT)
        (:DEFINITION EQ)
        (:DEFINITION FIX)
        (:DEFINITION NOT)
        (:DEFINITION O-FINP)
        (:DEFINITION O<)
        (:DEFINITION TRS_ISSORT[A19])
        (:DEFINITION TRS_ISSORT[A5])
        (:EXECUTABLE-COUNTERPART ACL2-COUNT)
        (:EXECUTABLE-COUNTERPART BINARY-+)
        (:EXECUTABLE-COUNTERPART EQUAL)
        (:EXECUTABLE-COUNTERPART O-FINP)
        (:FAKE-RUNE-FOR-LINEAR NIL)
        (:FAKE-RUNE-FOR-TYPE-SET NIL)
        (:REWRITE COMMUTATIVITY-OF-+)
        (:REWRITE UNICITY-OF-0)
        (:TYPE-PRESCRIPTION ACL2-COUNT)
        (:TYPE-PRESCRIPTION TRS_AND))
Warnings:  None
Time:  0.02 seconds (prove: 0.01, print: 0.00, other: 0.01)
 TRS_EQUAL_SORT[A19]
ACL2 !>
[Note:  A hint was supplied for our processing of the goal above. 
Thanks!]

By the simple :definition EQ we reduce the conjecture to

Goal'
(IMPLIES (TRS_ISSORT[A12] TRS_X)
         (EQUAL (TRS_SUBPRIME TRS_X TRS_X)
                '(TRS_TRUE))).

Name the formula above *1.

Perhaps we can prove *1 by induction.  Two induction schemes are suggested
by this conjecture.  These merge into one derived induction scheme.

We will induct according to a scheme suggested by (TRS_SUBPRIME TRS_X TRS_X).
This suggestion was produced using the :induction rules TRS_ISSORT[A12]
and TRS_SUBPRIME.  If we let (:P TRS_X) denote *1 above then the induction
scheme we'll use is
(AND (IMPLIES (NOT (AND (TRS_ISSORT[A12] TRS_X)
                        (TRS_ISSORT[A12] TRS_X)))
              (:P TRS_X))
     (IMPLIES (AND (AND (TRS_ISSORT[A12] TRS_X)
                        (TRS_ISSORT[A12] TRS_X))
                   (NOT (AND (EQ (CAR TRS_X) 'TRS_0)
                             (EQ (CAR TRS_X) 'TRS_0)))
                   (NOT (AND (EQ (CAR TRS_X) 'TRS_S)
                             (EQ (CAR TRS_X) 'TRS_S)))
                   (NOT (AND (EQ (CAR TRS_X) 'TRS_S)
                             (EQ (CAR TRS_X) 'TRS_0)))
                   T)
              (:P TRS_X))
     (IMPLIES (AND (AND (TRS_ISSORT[A12] TRS_X)
                        (TRS_ISSORT[A12] TRS_X))
                   (NOT (AND (EQ (CAR TRS_X) 'TRS_0)
                             (EQ (CAR TRS_X) 'TRS_0)))
                   (NOT (AND (EQ (CAR TRS_X) 'TRS_S)
                             (EQ (CAR TRS_X) 'TRS_S)))
                   (AND (EQ (CAR TRS_X) 'TRS_S)
                        (EQ (CAR TRS_X) 'TRS_0)))
              (:P TRS_X))
     (IMPLIES (AND (AND (TRS_ISSORT[A12] TRS_X)
                        (TRS_ISSORT[A12] TRS_X))
                   (NOT (AND (EQ (CAR TRS_X) 'TRS_0)
                             (EQ (CAR TRS_X) 'TRS_0)))
                   (AND (EQ (CAR TRS_X) 'TRS_S)
                        (EQ (CAR TRS_X) 'TRS_S))
                   (:P (CADR TRS_X)))
              (:P TRS_X))
     (IMPLIES (AND (AND (TRS_ISSORT[A12] TRS_X)
                        (TRS_ISSORT[A12] TRS_X))
                   (AND (EQ (CAR TRS_X) 'TRS_0)
                        (EQ (CAR TRS_X) 'TRS_0)))
              (:P TRS_X))).
This induction is justified by the same argument used to admit TRS_SUBPRIME.
When applied to the goal at hand the above induction scheme produces
four nontautological subgoals.

Subgoal *1/4
(IMPLIES (AND (AND (TRS_ISSORT[A12] TRS_X)
                   (TRS_ISSORT[A12] TRS_X))
              (NOT (AND (EQ (CAR TRS_X) 'TRS_0)
                        (EQ (CAR TRS_X) 'TRS_0)))
              (NOT (AND (EQ (CAR TRS_X) 'TRS_S)
                        (EQ (CAR TRS_X) 'TRS_S)))
              (NOT (AND (EQ (CAR TRS_X) 'TRS_S)
                        (EQ (CAR TRS_X) 'TRS_0)))
              T (TRS_ISSORT[A12] TRS_X))
         (EQUAL (TRS_SUBPRIME TRS_X TRS_X)
                '(TRS_TRUE))).

By the simple :definition EQ we reduce the conjecture to

Subgoal *1/4'
(IMPLIES (AND (TRS_ISSORT[A12] TRS_X)
              (NOT (AND (EQUAL (CAR TRS_X) 'TRS_0)
                        (EQUAL (CAR TRS_X) 'TRS_0)))
              (NOT (AND (EQUAL (CAR TRS_X) 'TRS_S)
                        (EQUAL (CAR TRS_X) 'TRS_S)))
              (NOT (AND (EQUAL (CAR TRS_X) 'TRS_S)
                        (EQUAL (CAR TRS_X) 'TRS_0))))
         (EQUAL (TRS_SUBPRIME TRS_X TRS_X)
                '(TRS_TRUE))).

But simplification reduces this to T, using the :definition TRS_ISSORT[A12]
and primitive type reasoning.

Subgoal *1/3
(IMPLIES (AND (AND (TRS_ISSORT[A12] TRS_X)
                   (TRS_ISSORT[A12] TRS_X))
              (NOT (AND (EQ (CAR TRS_X) 'TRS_0)
                        (EQ (CAR TRS_X) 'TRS_0)))
              (AND (EQ (CAR TRS_X) 'TRS_S)
                   (EQ (CAR TRS_X) 'TRS_S))
              (EQUAL (TRS_SUBPRIME (CADR TRS_X) (CADR TRS_X))
                     '(TRS_TRUE))
              (TRS_ISSORT[A12] TRS_X))
         (EQUAL (TRS_SUBPRIME TRS_X TRS_X)
                '(TRS_TRUE))).

By the simple :definition EQ we reduce the conjecture to

Subgoal *1/3'
(IMPLIES (AND (TRS_ISSORT[A12] TRS_X)
              (NOT (AND (EQUAL (CAR TRS_X) 'TRS_0)
                        (EQUAL (CAR TRS_X) 'TRS_0)))
              (EQUAL (CAR TRS_X) 'TRS_S)
              (EQUAL (TRS_SUBPRIME (CADR TRS_X) (CADR TRS_X))
                     '(TRS_TRUE)))
         (EQUAL (TRS_SUBPRIME TRS_X TRS_X)
                '(TRS_TRUE))).

But simplification reduces this to T, using the :definitions TRS_ISSORT[A12]
and TRS_SUBPRIME, the :executable-counterpart of EQUAL, primitive type
reasoning and the :type-prescription rule TRS_ISSORT[A12].

Subgoal *1/2
(IMPLIES (AND (AND (TRS_ISSORT[A12] TRS_X)
                   (TRS_ISSORT[A12] TRS_X))
              (NOT (AND (EQ (CAR TRS_X) 'TRS_0)
                        (EQ (CAR TRS_X) 'TRS_0)))
              (AND (EQ (CAR TRS_X) 'TRS_S)
                   (EQ (CAR TRS_X) 'TRS_S))
              (NOT (TRS_ISSORT[A12] (CADR TRS_X)))
              (TRS_ISSORT[A12] TRS_X))
         (EQUAL (TRS_SUBPRIME TRS_X TRS_X)
                '(TRS_TRUE))).

By the simple :definition EQ we reduce the conjecture to

Subgoal *1/2'
(IMPLIES (AND (TRS_ISSORT[A12] TRS_X)
              (NOT (AND (EQUAL (CAR TRS_X) 'TRS_0)
                        (EQUAL (CAR TRS_X) 'TRS_0)))
              (EQUAL (CAR TRS_X) 'TRS_S)
              (NOT (TRS_ISSORT[A12] (CADR TRS_X))))
         (EQUAL (TRS_SUBPRIME TRS_X TRS_X)
                '(TRS_TRUE))).

But simplification reduces this to T, using the :definition TRS_ISSORT[A12]
and the :executable-counterpart of EQUAL.

Subgoal *1/1
(IMPLIES (AND (AND (TRS_ISSORT[A12] TRS_X)
                   (TRS_ISSORT[A12] TRS_X))
              (AND (EQ (CAR TRS_X) 'TRS_0)
                   (EQ (CAR TRS_X) 'TRS_0))
              (TRS_ISSORT[A12] TRS_X))
         (EQUAL (TRS_SUBPRIME TRS_X TRS_X)
                '(TRS_TRUE))).

By the simple :definition EQ we reduce the conjecture to

Subgoal *1/1'
(IMPLIES (AND (TRS_ISSORT[A12] TRS_X)
              (EQUAL (CAR TRS_X) 'TRS_0))
         (EQUAL (TRS_SUBPRIME TRS_X TRS_X)
                '(TRS_TRUE))).

But simplification reduces this to T, using the :definitions TRS_ISSORT[A12]
and TRS_SUBPRIME, the :executable-counterpart of EQUAL and primitive
type reasoning.

That completes the proof of *1.

Q.E.D.

Summary
Form:  ( DEFTHM TEST ...)
Rules: ((:DEFINITION EQ)
        (:DEFINITION NOT)
        (:DEFINITION TRS_ISSORT[A12])
        (:DEFINITION TRS_SUBPRIME)
        (:EXECUTABLE-COUNTERPART EQUAL)
        (:FAKE-RUNE-FOR-TYPE-SET NIL)
        (:INDUCTION TRS_ISSORT[A12])
        (:INDUCTION TRS_SUBPRIME)
        (:TYPE-PRESCRIPTION TRS_ISSORT[A12]))
Warnings:  None
Time:  0.00 seconds (prove: 0.00, print: 0.00, other: 0.00)
 TEST
ACL2 !>Bye.

(22) Complex Obligation (AND)

(23) Obligation:

Q DP problem:
The TRS P consists of the following rules:

ZERO2(s(y), cons(x, xs)) → ZERO(cons(x, xs))

The TRS R consists of the following rules:

sub(0, 0) → 0
sub(s(x), s(y)) → sub(x, y)
sub(s(x), 0) → s(x)
sub(0, s(x)) → 0

The set Q consists of the following terms:

sub(0, 0)
sub(s(x0), 0)
sub(0, s(x0))
sub(s(x0), s(x1))

We have to consider all minimal (P,Q,R)-chains.

(24) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.

(25) TRUE

(26) Obligation:

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

sub'(0, 0) → true
sub'(s(x1), s(y')) → sub'(x1, y')
sub'(s(x5), 0) → false
sub'(0, s(x9)) → true
sub(0, 0) → 0
sub(s(x1), s(y')) → sub(x1, y')
sub(s(x5), 0) → s(x5)
sub(0, s(x9)) → 0
equal_bool(true, false) → false
equal_bool(false, true) → false
equal_bool(true, true) → true
equal_bool(false, false) → true
and(true, x) → x
and(false, x) → false
or(true, x) → true
or(false, x) → x
not(false) → true
not(true) → false
isa_true(true) → true
isa_true(false) → false
isa_false(true) → false
isa_false(false) → true
equal_sort[a12](0, 0) → true
equal_sort[a12](0, s(x0)) → false
equal_sort[a12](s(x0), 0) → false
equal_sort[a12](s(x0), s(x1)) → equal_sort[a12](x0, x1)
equal_sort[a5](witness_sort[a5], witness_sort[a5]) → true
equal_sort[a19](cons(x0, x1), cons(x2, x3)) → and(equal_sort[a19](x0, x2), equal_sort[a19](x1, x3))
equal_sort[a19](cons(x0, x1), witness_sort[a19]) → false
equal_sort[a19](witness_sort[a19], cons(x0, x1)) → false
equal_sort[a19](witness_sort[a19], witness_sort[a19]) → true
equal_sort[a16](witness_sort[a16], witness_sort[a16]) → true

Q is empty.

(27) QTRSRRRProof (EQUIVALENT transformation)

Used ordering:
Polynomial interpretation [POLO]:

POL(0) = 0   
POL(and(x1, x2)) = 1 + x1 + x2   
POL(cons(x1, x2)) = 1 + x1 + x2   
POL(equal_bool(x1, x2)) = x1 + x2   
POL(equal_sort[a12](x1, x2)) = 2 + x1 + x2   
POL(equal_sort[a16](x1, x2)) = 1 + x1 + x2   
POL(equal_sort[a19](x1, x2)) = x1 + x2   
POL(equal_sort[a5](x1, x2)) = 1 + x1 + x2   
POL(false) = 2   
POL(isa_false(x1)) = 3 + x1   
POL(isa_true(x1)) = x1   
POL(not(x1)) = 3 + x1   
POL(or(x1, x2)) = 1 + x1 + x2   
POL(s(x1)) = x1   
POL(sub(x1, x2)) = 1 + x1 + x2   
POL(sub'(x1, x2)) = 3 + x1 + x2   
POL(true) = 0   
POL(witness_sort[a16]) = 0   
POL(witness_sort[a19]) = 1   
POL(witness_sort[a5]) = 0   
With this ordering the following rules can be removed by the rule removal processor [LPAR04] because they are oriented strictly:

sub'(0, 0) → true
sub'(s(x5), 0) → false
sub'(0, s(x9)) → true
sub(0, 0) → 0
sub(s(x5), 0) → s(x5)
sub(0, s(x9)) → 0
equal_bool(false, false) → true
and(true, x) → x
and(false, x) → false
or(true, x) → true
or(false, x) → x
not(false) → true
not(true) → false
isa_false(true) → false
isa_false(false) → true
equal_sort[a12](0, 0) → true
equal_sort[a5](witness_sort[a5], witness_sort[a5]) → true
equal_sort[a19](cons(x0, x1), cons(x2, x3)) → and(equal_sort[a19](x0, x2), equal_sort[a19](x1, x3))
equal_sort[a19](witness_sort[a19], witness_sort[a19]) → true
equal_sort[a16](witness_sort[a16], witness_sort[a16]) → true


(28) Obligation:

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

sub'(s(x1), s(y')) → sub'(x1, y')
sub(s(x1), s(y')) → sub(x1, y')
equal_bool(true, false) → false
equal_bool(false, true) → false
equal_bool(true, true) → true
isa_true(true) → true
isa_true(false) → false
equal_sort[a12](0, s(x0)) → false
equal_sort[a12](s(x0), 0) → false
equal_sort[a12](s(x0), s(x1)) → equal_sort[a12](x0, x1)
equal_sort[a19](cons(x0, x1), witness_sort[a19]) → false
equal_sort[a19](witness_sort[a19], cons(x0, x1)) → false

Q is empty.

(29) QTRSRRRProof (EQUIVALENT transformation)

Used ordering:
Polynomial interpretation [POLO]:

POL(0) = 0   
POL(cons(x1, x2)) = 2 + x1 + x2   
POL(equal_bool(x1, x2)) = 2 + 2·x1 + 2·x2   
POL(equal_sort[a12](x1, x2)) = x1 + x2   
POL(equal_sort[a19](x1, x2)) = 2 + 2·x1 + x2   
POL(false) = 1   
POL(isa_true(x1)) = 2 + 2·x1   
POL(s(x1)) = 1 + x1   
POL(sub(x1, x2)) = 2·x1 + 2·x2   
POL(sub'(x1, x2)) = 2·x1 + 2·x2   
POL(true) = 2   
POL(witness_sort[a19]) = 2   
With this ordering the following rules can be removed by the rule removal processor [LPAR04] because they are oriented strictly:

sub'(s(x1), s(y')) → sub'(x1, y')
sub(s(x1), s(y')) → sub(x1, y')
equal_bool(true, false) → false
equal_bool(false, true) → false
equal_bool(true, true) → true
isa_true(true) → true
isa_true(false) → false
equal_sort[a12](s(x0), s(x1)) → equal_sort[a12](x0, x1)
equal_sort[a19](cons(x0, x1), witness_sort[a19]) → false
equal_sort[a19](witness_sort[a19], cons(x0, x1)) → false


(30) Obligation:

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

equal_sort[a12](0, s(x0)) → false
equal_sort[a12](s(x0), 0) → false

Q is empty.

(31) QTRSRRRProof (EQUIVALENT transformation)

Used ordering:
Polynomial interpretation [POLO]:

POL(0) = 2   
POL(equal_sort[a12](x1, x2)) = 2 + 2·x1 + x2   
POL(false) = 1   
POL(s(x1)) = 2 + x1   
With this ordering the following rules can be removed by the rule removal processor [LPAR04] because they are oriented strictly:

equal_sort[a12](0, s(x0)) → false
equal_sort[a12](s(x0), 0) → false


(32) Obligation:

Q restricted rewrite system:
R is empty.
Q is empty.

(33) RisEmptyProof (EQUIVALENT transformation)

The TRS R is empty. Hence, termination is trivially proven.

(34) YES