Filtering...

def-bound-theorems-tests

books/std/util/def-bound-theorems-tests
other
(in-package "STD")
other
(include-book "def-bound-theorems")
other
(defund foo
  (x)
  (if (unsigned-byte-p 8 x)
    x
    0))
other
(defthm-unsigned-byte-p unsigned-byte-p-foo
  :bound 8
  :concl (foo x)
  :gen-type t
  :gen-linear t
  :hints (("Goal" :in-theory (enable foo))))
other
(defund bar
  (x)
  (if (unsigned-byte-p 1 x)
    x
    0))
other
(defthm-unsigned-byte-p unsigned-byte-p-bar
  :bound 1
  :concl (bar x)
  :gen-type t
  :gen-linear t
  :hints (("Goal" :in-theory (enable bar))))
other
(defund decrement (x) (+ -1 x))
other
(defthm-unsigned-byte-p unsigned-byte-p-decrement
  :bound 8
  :hyp (and (unsigned-byte-p 8 x) (< 0 x))
  :concl (decrement x)
  :gen-type t
  :gen-linear t
  :hints (("Goal" :in-theory (enable decrement))))