Recognizer of a list of bytes
(byte-listp x) → *
Function:
(defun byte-listp (x) (declare (xargs :guard t)) (let ((__function__ 'byte-listp)) (declare (ignorable __function__)) (if (equal x nil) t (and (consp x) (n08p (car x)) (byte-listp (cdr x))))))
Theorem:
(defthm byte-listp-implies-true-listp (implies (byte-listp x) (true-listp x)) :rule-classes :forward-chaining)
Theorem:
(defthm n08p-element-of-byte-listp (implies (and (byte-listp acc) (natp m) (< m (len acc))) (unsigned-byte-p 8 (nth m acc))) :rule-classes (:rewrite (:type-prescription :corollary (implies (and (byte-listp acc) (natp m) (< m (len acc))) (natp (nth m acc))) :hints (("Goal" :in-theory '(unsigned-byte-p integer-range-p natp)))) (:linear :corollary (implies (and (byte-listp acc) (natp m) (< m (len acc))) (and (<= 0 (nth m acc)) (< (nth m acc) 256))) :hints (("Goal" :in-theory '(unsigned-byte-p integer-range-p (:e expt)))))))
Theorem:
(defthm repeat-byte-listp (implies (unsigned-byte-p 8 m) (byte-listp (acl2::repeat n m))) :rule-classes (:type-prescription :rewrite))
Theorem:
(defthm len-of-nthcdr-byte-listp (implies (and (< m (len acc)) (natp m)) (equal (len (nthcdr m acc)) (- (len acc) m))))
Theorem:
(defthm byte-listp-revappend (implies (forced-and (byte-listp lst1) (byte-listp lst2)) (byte-listp (revappend lst1 lst2))) :rule-classes :type-prescription)
Theorem:
(defthm true-listp-make-list-ac (implies (true-listp ac) (true-listp (make-list-ac n val ac))) :rule-classes :type-prescription)
Theorem:
(defthm reverse-byte-listp (implies (byte-listp x) (byte-listp (reverse x))) :rule-classes (:type-prescription :rewrite))
Theorem:
(defthm byte-listp-append (implies (forced-and (byte-listp lst1) (byte-listp lst2)) (byte-listp (append lst1 lst2))) :rule-classes (:rewrite :type-prescription))
Theorem:
(defthm make-list-ac-byte-listp (implies (and (byte-listp x) (n08p m)) (byte-listp (make-list-ac n m x))) :rule-classes (:type-prescription :rewrite))