• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • C
          • Syntax-for-tools
          • Atc
          • Transformation-tools
          • Language
            • Abstract-syntax
            • Integer-ranges
            • Implementation-environments
            • Dynamic-semantics
            • Static-semantics
            • Grammar
            • Types
            • Integer-formats-definitions
            • Computation-states
            • Portable-ascii-identifiers
            • Values
              • Pointer
              • Member-types-of-member-values
              • Expr-value
              • Member-value-list->value-list
              • Member-value-list->name-list
              • Type-list-of-value-list
              • Type-of-value
              • Stmt-value
              • Value-option
              • Expr-value-option
              • Init-value
              • Value-result
              • Type-of-value-option
              • Value-list-result
              • Stmt-value-result
              • Member-value-list-result
              • Init-value-result
              • Expr-value-result
              • Expr-value-option-result
              • Value-option-result
              • Signed/unsigned-byte-p-of-integer-values
              • Bounds-of-integer-values
              • Value-promoted-arithmeticp
              • Type-option-of-stmt-value
              • Member-type-of-member-value
              • Init-type-of-init-value
              • Value-unsigned-integerp
              • Value-signed-integerp
              • Value-integerp
              • Value-arithmeticp
              • Value-scalarp
              • Value-realp
              • Values/membervalues
                • Value
                • Member-value
                • Value-list
                  • Value-list-equiv
                  • Value-listp
                    • Value-listp-basics
                    • Value-list-fix
                  • Member-value-list
              • Integer-operations
              • Object-designators
              • Operations
              • Errors
              • Tag-environments
              • Function-environments
              • Character-sets
              • Flexible-array-member-removal
              • Arithmetic-operations
              • Pointer-operations
              • Real-operations
              • Array-operations
              • Scalar-operations
              • Structure-operations
            • Representation
            • Insertion-sort
            • Pack
          • Soft
          • Bv
          • Imp-language
          • Ethereum
          • Event-macros
          • Java
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Value-listp

    Value-listp-basics

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

    Definitions and Theorems

    Theorem: value-listp-of-cons

    (defthm value-listp-of-cons
      (equal (value-listp (cons acl2::a acl2::x))
             (and (valuep acl2::a)
                  (value-listp acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: value-listp-of-cdr-when-value-listp

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

    Theorem: value-listp-when-not-consp

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

    Theorem: valuep-of-car-when-value-listp

    (defthm valuep-of-car-when-value-listp
      (implies (value-listp acl2::x)
               (iff (valuep (car acl2::x))
                    (consp acl2::x)))
      :rule-classes ((:rewrite)))

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

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

    Theorem: value-listp-of-list-fix

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

    Theorem: value-listp-of-sfix

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

    Theorem: value-listp-of-insert

    (defthm value-listp-of-insert
      (iff (value-listp (insert acl2::a acl2::x))
           (and (value-listp (sfix acl2::x))
                (valuep acl2::a)))
      :rule-classes ((:rewrite)))

    Theorem: value-listp-of-delete

    (defthm value-listp-of-delete
      (implies (value-listp acl2::x)
               (value-listp (delete acl2::k acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: value-listp-of-mergesort

    (defthm value-listp-of-mergesort
      (iff (value-listp (mergesort acl2::x))
           (value-listp (list-fix acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: value-listp-of-union

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

    Theorem: value-listp-of-intersect-1

    (defthm value-listp-of-intersect-1
      (implies (value-listp acl2::x)
               (value-listp (intersect acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: value-listp-of-intersect-2

    (defthm value-listp-of-intersect-2
      (implies (value-listp acl2::y)
               (value-listp (intersect acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: value-listp-of-difference

    (defthm value-listp-of-difference
      (implies (value-listp acl2::x)
               (value-listp (difference acl2::x acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: value-listp-of-duplicated-members

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

    Theorem: value-listp-of-rev

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

    Theorem: value-listp-of-append

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

    Theorem: value-listp-of-rcons

    (defthm value-listp-of-rcons
      (iff (value-listp (rcons acl2::a acl2::x))
           (and (valuep acl2::a)
                (value-listp (list-fix acl2::x))))
      :rule-classes ((:rewrite)))

    Theorem: valuep-when-member-equal-of-value-listp

    (defthm valuep-when-member-equal-of-value-listp
      (and (implies (and (member-equal acl2::a acl2::x)
                         (value-listp acl2::x))
                    (valuep acl2::a))
           (implies (and (value-listp acl2::x)
                         (member-equal acl2::a acl2::x))
                    (valuep acl2::a)))
      :rule-classes ((:rewrite)))

    Theorem: value-listp-when-subsetp-equal

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

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

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

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

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

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

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

    Theorem: value-listp-of-union-equal

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

    Theorem: value-listp-of-take

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

    Theorem: value-listp-of-repeat

    (defthm value-listp-of-repeat
      (iff (value-listp (repeat acl2::n acl2::x))
           (or (valuep acl2::x) (zp acl2::n)))
      :rule-classes ((:rewrite)))

    Theorem: valuep-of-nth-when-value-listp

    (defthm valuep-of-nth-when-value-listp
      (implies (value-listp acl2::x)
               (iff (valuep (nth acl2::n acl2::x))
                    (< (nfix acl2::n) (len acl2::x))))
      :rule-classes ((:rewrite)))

    Theorem: value-listp-of-update-nth

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

    Theorem: value-listp-of-butlast

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

    Theorem: value-listp-of-nthcdr

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

    Theorem: value-listp-of-last

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

    Theorem: value-listp-of-remove

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

    Theorem: value-listp-of-revappend

    (defthm value-listp-of-revappend
      (equal (value-listp (revappend acl2::x acl2::y))
             (and (value-listp (list-fix acl2::x))
                  (value-listp acl2::y)))
      :rule-classes ((:rewrite)))