other
(in-package "STR")
other
(include-book "std/strings/hex" :dir :system)
other
(include-book "std/util/deflist" :dir :system)
other
(include-book "std/util/defrule" :dir :system)
other
(include-book "xdoc/constructors" :dir :system)
other
(local (include-book "kestrel/built-ins/disable" :dir :system))
other
(local (disable-most-builtin-logic-defuns))
other
(local (disable-builtin-rewrite-rules-for-defaults))
other
(set-induction-depth-limit 0)
other
(deflist hex-digit-char-listp (x) :parents (hex) :short "Recognize lists of hexadecimal digit characters." :long (topstring (p "Unlike @(tsee hex-digit-char-list*p), this requires true list (i.e. @('nil')-terminated.") (p "Since there are functions in @(see std/strings) that operate on @(tsee hex-digit-char-list*p), we provide a bridge theorem between the two recognizers, which we can use to satisfy the guards of those functions.")) (hex-digit-char-p x) :true-listp t :elementp-of-nil nil /// (defthm hex-digit-char-list*p-when-hex-digit-char-listp (implies (hex-digit-char-listp x) (hex-digit-char-list*p x)) :hints (("Goal" :induct t :in-theory (enable hex-digit-char-list*p)))))
other
(defsection hex-digit-char-listp-results :parents (hex-digit-char-listp) :short "Theorems about results of @(see std/strings) functions that return lists of hexadecimal digit characters." :long (topstring (p "Those @(see std/strings) are accompanied by theorems that they return @(tsee hex-digit-char-list*p), but they in fact return true lists, so here we add theorems that they return @(tsee hex-digit-char-listp).")) (defrule hex-digit-char-listp-of-basic-nat-to-hex-chars (hex-digit-char-listp (basic-nat-to-hex-chars nat)) :induct t :enable (basic-nat-to-hex-chars hex-digit-char-listp digit-to-char)) (defrule hex-digit-char-listp-of-nat-to-hex-chars-aux (implies (hex-digit-char-listp acc) (hex-digit-char-listp (nat-to-hex-chars-aux nat acc))) :enable nat-to-hex-chars-aux) (defrule hex-digit-char-listp-of-nat-to-hex-chars (hex-digit-char-listp (nat-to-hex-chars nat)) :enable nat-to-hex-chars))