• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
      • Std/lists
      • Omaps
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
      • Std/osets
      • Std/io
      • Std/basic
        • Maybe-stringp
        • Maybe-natp
        • Two-nats-measure
        • Impossible
        • Bytep
          • Byte
            • Byte-list
              • Byte-listp
                • Byte-listp-basics
                • Byte-list-fix
                • Byte-list20
                • Byte-list32
                • Byte-list64
                • Byte-list-equiv
              • Byte-fix
              • Bytep-additional-theorems
            • Bytes-as-digits-in-base-256
            • Bytep-additional-theorems
          • Nat-list-measure
          • Maybe-posp
          • Nibblep
          • Organize-symbols-by-pkg
          • Organize-symbols-by-name
          • Lnfix
          • Good-valuep
          • Streqv
          • Chareqv
          • Symbol-package-name-non-cl
          • Arith-equivs
          • Induction-schemes
          • Maybe-integerp
          • Char-fix
          • Pos-fix
          • Symbol-package-name-lst
          • Mbt$
          • Maybe-bitp
          • Good-pseudo-termp
          • Str-fix
          • Maybe-string-fix
          • Nonkeyword-listp
          • Lifix
          • Bfix
          • Std/basic/if*
          • Impliez
          • Tuplep
          • Std/basic/intern-in-package-of-symbol
          • Lbfix
          • Std/basic/symbol-name-lst
          • True
          • Std/basic/rfix
          • Std/basic/realfix
          • Std/basic/member-symbol-name
          • Std/basic/fix
          • False
          • Std/basic/nfix
          • Std/basic/ifix
        • Std/system
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Byte-listp

    Byte-listp-basics

    Basic theorems about byte-listp, generated by std::deflist.

    Definitions and Theorems

    Theorem: byte-listp-of-cons

    (defthm byte-listp-of-cons
      (equal (byte-listp (cons a x))
             (and (bytep a) (byte-listp x))))

    Theorem: byte-listp-of-cdr-when-byte-listp

    (defthm byte-listp-of-cdr-when-byte-listp
      (implies (byte-listp (double-rewrite x))
               (byte-listp (cdr x)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-when-not-consp

    (defthm byte-listp-when-not-consp
      (implies (not (consp x))
               (equal (byte-listp x) (not x)))
      :rule-classes ((:rewrite)))

    Theorem: bytep-of-car-when-byte-listp

    (defthm bytep-of-car-when-byte-listp
      (implies (byte-listp x)
               (iff (bytep (car x)) (consp x)))
      :rule-classes ((:rewrite)))

    Theorem: true-listp-when-byte-listp-compound-recognizer

    (defthm true-listp-when-byte-listp-compound-recognizer
      (implies (byte-listp x) (true-listp x))
      :rule-classes :compound-recognizer)

    Theorem: byte-listp-of-list-fix

    (defthm byte-listp-of-list-fix
      (implies (byte-listp x)
               (byte-listp (list-fix x)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-sfix

    (defthm byte-listp-of-sfix
      (iff (byte-listp (set::sfix x))
           (or (byte-listp x) (not (set::setp x))))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-insert

    (defthm byte-listp-of-insert
      (iff (byte-listp (set::insert a x))
           (and (byte-listp (set::sfix x))
                (bytep a)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-delete

    (defthm byte-listp-of-delete
      (implies (byte-listp x)
               (byte-listp (set::delete k x)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-mergesort

    (defthm byte-listp-of-mergesort
      (iff (byte-listp (set::mergesort x))
           (byte-listp (list-fix x)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-union

    (defthm byte-listp-of-union
      (iff (byte-listp (set::union x y))
           (and (byte-listp (set::sfix x))
                (byte-listp (set::sfix y))))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-intersect-1

    (defthm byte-listp-of-intersect-1
      (implies (byte-listp x)
               (byte-listp (set::intersect x y)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-intersect-2

    (defthm byte-listp-of-intersect-2
      (implies (byte-listp y)
               (byte-listp (set::intersect x y)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-difference

    (defthm byte-listp-of-difference
      (implies (byte-listp x)
               (byte-listp (set::difference x y)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-duplicated-members

    (defthm byte-listp-of-duplicated-members
      (implies (byte-listp x)
               (byte-listp (duplicated-members x)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-rev

    (defthm byte-listp-of-rev
      (equal (byte-listp (rev x))
             (byte-listp (list-fix x)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-append

    (defthm byte-listp-of-append
      (equal (byte-listp (append a b))
             (and (byte-listp (list-fix a))
                  (byte-listp b)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-rcons

    (defthm byte-listp-of-rcons
      (iff (byte-listp (rcons a x))
           (and (bytep a)
                (byte-listp (list-fix x))))
      :rule-classes ((:rewrite)))

    Theorem: bytep-when-member-equal-of-byte-listp

    (defthm bytep-when-member-equal-of-byte-listp
      (and (implies (and (member-equal a x) (byte-listp x))
                    (bytep a))
           (implies (and (byte-listp x) (member-equal a x))
                    (bytep a)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-when-subsetp-equal

    (defthm byte-listp-when-subsetp-equal
      (and (implies (and (subsetp-equal x y) (byte-listp y))
                    (equal (byte-listp x) (true-listp x)))
           (implies (and (byte-listp y) (subsetp-equal x y))
                    (equal (byte-listp x) (true-listp x))))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-set-difference-equal

    (defthm byte-listp-of-set-difference-equal
      (implies (byte-listp x)
               (byte-listp (set-difference-equal x y)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-intersection-equal-1

    (defthm byte-listp-of-intersection-equal-1
      (implies (byte-listp (double-rewrite x))
               (byte-listp (intersection-equal x y)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-intersection-equal-2

    (defthm byte-listp-of-intersection-equal-2
      (implies (byte-listp (double-rewrite y))
               (byte-listp (intersection-equal x y)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-union-equal

    (defthm byte-listp-of-union-equal
      (equal (byte-listp (union-equal x y))
             (and (byte-listp (list-fix x))
                  (byte-listp (double-rewrite y))))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-take

    (defthm byte-listp-of-take
      (implies (byte-listp (double-rewrite x))
               (iff (byte-listp (take n x))
                    (or (bytep nil) (<= (nfix n) (len x)))))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-repeat

    (defthm byte-listp-of-repeat
      (iff (byte-listp (repeat n x))
           (or (bytep x) (zp n)))
      :rule-classes ((:rewrite)))

    Theorem: bytep-of-nth-when-byte-listp

    (defthm bytep-of-nth-when-byte-listp
      (implies (byte-listp x)
               (iff (bytep (nth n x))
                    (< (nfix n) (len x))))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-update-nth

    (defthm byte-listp-of-update-nth
      (implies (byte-listp (double-rewrite x))
               (iff (byte-listp (update-nth n y x))
                    (and (bytep y)
                         (or (<= (nfix n) (len x))
                             (bytep nil)))))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-butlast

    (defthm byte-listp-of-butlast
      (implies (byte-listp (double-rewrite x))
               (byte-listp (butlast x n)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-nthcdr

    (defthm byte-listp-of-nthcdr
      (implies (byte-listp (double-rewrite x))
               (byte-listp (nthcdr n x)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-last

    (defthm byte-listp-of-last
      (implies (byte-listp (double-rewrite x))
               (byte-listp (last x)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-remove

    (defthm byte-listp-of-remove
      (implies (byte-listp x)
               (byte-listp (remove a x)))
      :rule-classes ((:rewrite)))

    Theorem: byte-listp-of-revappend

    (defthm byte-listp-of-revappend
      (equal (byte-listp (revappend x y))
             (and (byte-listp (true-list-fix x))
                  (byte-listp y))))