Filtering...

mv-proof

books/acl2s/defdata/mv-proof
other
(in-package "DEFDATA")
my-mv-nthfunction
(defun my-mv-nth
  (n v)
  (declare (xargs :guard nil))
  (if (zp n)
    (car v)
    (my-mv-nth (- n 1) (cdr v))))
other
(defthm my-mv-nth--nil
  (equal (my-mv-nth x nil) nil))
other
(defthm my-mv-nth--reduce1
  (implies (and (syntaxp (integerp n))
      (integerp n)
      (< 0 n))
    (equal (my-mv-nth n v)
      (my-mv-nth (- n 1) (cdr v)))))
other
(defthm my-mv-nth--reduce2
  (implies (or (not (integerp n)) (<= n 0))
    (equal (my-mv-nth n v)
      (car v))))
other
(defthmd mv-nth--to--my-mv-nth
  (equal (mv-nth x y)
    (my-mv-nth x y)))