• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
          • Transformations
          • Language
            • Abstract-syntax
            • Dynamic-semantics
              • Exec
              • Find-fun
              • Init-local
              • Write-vars-values
              • Add-vars-values
              • Add-funs
              • Eoutcome
              • Soutcome
              • Ensure-funscope-disjoint
              • Write-var-value
              • Restrict-vars
              • Add-var-value
              • Funinfo
              • Exec-top-block
              • Values
              • Cstate
              • Funinfo+funenv
              • Read-vars-values
              • Read-var-value
              • Funenv
              • Funscope-for-fundefs
              • Exec-path
              • Path-to-var
              • Funinfo+funenv-result
              • Exec-literal
              • Soutcome-result
              • Mode-set-result
              • Literal-evaluation
              • Funscope-result
              • Funinfo-result
              • Funenv-result
              • Eoutcome-result
              • Cstate-result
              • Paths-to-vars
              • Funinfo-for-fundef
              • Lstate
              • Funscope
              • Mode-set
                • Mode-set-fix
                • Mode-setp
                  • Mode-set-equiv
                • Modes
              • Concrete-syntax
              • Static-soundness
              • Static-semantics
              • Errors
            • Yul-json
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Mode-set

    Mode-setp

    Recognizer for mode-set.

    Signature
    (mode-setp x) → *

    Definitions and Theorems

    Function: mode-setp

    (defun mode-setp (x)
      (declare (xargs :guard t))
      (if (atom x)
          (null x)
        (and (modep (car x))
             (or (null (cdr x))
                 (and (consp (cdr x))
                      (acl2::fast-<< (car x) (cadr x))
                      (mode-setp (cdr x)))))))

    Theorem: booleanp-ofmode-setp

    (defthm booleanp-ofmode-setp
      (booleanp (mode-setp x)))

    Theorem: setp-when-mode-setp

    (defthm setp-when-mode-setp
      (implies (mode-setp x) (setp x))
      :rule-classes (:rewrite))

    Theorem: modep-of-head-when-mode-setp

    (defthm modep-of-head-when-mode-setp
      (implies (mode-setp x)
               (equal (modep (head x))
                      (not (emptyp x)))))

    Theorem: mode-setp-of-tail-when-mode-setp

    (defthm mode-setp-of-tail-when-mode-setp
      (implies (mode-setp x)
               (mode-setp (tail x))))

    Theorem: mode-setp-of-insert

    (defthm mode-setp-of-insert
      (equal (mode-setp (insert a x))
             (and (modep a) (mode-setp (sfix x)))))

    Theorem: modep-when-in-mode-setp-binds-free-x

    (defthm modep-when-in-mode-setp-binds-free-x
      (implies (and (in a x) (mode-setp x))
               (modep a)))

    Theorem: not-in-mode-setp-when-not-modep

    (defthm not-in-mode-setp-when-not-modep
      (implies (and (mode-setp x) (not (modep a)))
               (not (in a x))))

    Theorem: mode-setp-of-union

    (defthm mode-setp-of-union
      (equal (mode-setp (union x y))
             (and (mode-setp (sfix x))
                  (mode-setp (sfix y)))))

    Theorem: mode-setp-of-intersect

    (defthm mode-setp-of-intersect
      (implies (and (mode-setp x) (mode-setp y))
               (mode-setp (intersect x y))))

    Theorem: mode-setp-of-difference

    (defthm mode-setp-of-difference
      (implies (mode-setp x)
               (mode-setp (difference x y))))

    Theorem: mode-setp-of-delete

    (defthm mode-setp-of-delete
      (implies (mode-setp x)
               (mode-setp (delete a x))))