• 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-set-fix

    (mode-set-fix x) is a usual ACL2::fty set fixing function.

    Signature
    (mode-set-fix x) → *
    Arguments
    x — Guard (mode-setp x).

    In the logic, we apply mode-fix to each member of the x. In the execution, none of that is actually necessary and this is just an inlined identity function.

    Definitions and Theorems

    Function: mode-set-fix

    (defun mode-set-fix (x)
      (declare (xargs :guard (mode-setp x)))
      (mbe :logic (if (mode-setp x) x nil)
           :exec x))

    Theorem: mode-setp-of-mode-set-fix

    (defthm mode-setp-of-mode-set-fix
      (mode-setp (mode-set-fix x)))

    Theorem: mode-set-fix-when-mode-setp

    (defthm mode-set-fix-when-mode-setp
      (implies (mode-setp x)
               (equal (mode-set-fix x) x)))

    Theorem: emptyp-mode-set-fix

    (defthm emptyp-mode-set-fix
      (implies (or (emptyp x) (not (mode-setp x)))
               (emptyp (mode-set-fix x))))

    Theorem: emptyp-of-mode-set-fix

    (defthm emptyp-of-mode-set-fix
      (equal (emptyp (mode-set-fix x))
             (or (not (mode-setp x)) (emptyp x))))

    Function: mode-set-equiv$inline

    (defun mode-set-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (mode-setp acl2::x)
                                  (mode-setp acl2::y))))
      (equal (mode-set-fix acl2::x)
             (mode-set-fix acl2::y)))

    Theorem: mode-set-equiv-is-an-equivalence

    (defthm mode-set-equiv-is-an-equivalence
      (and (booleanp (mode-set-equiv x y))
           (mode-set-equiv x x)
           (implies (mode-set-equiv x y)
                    (mode-set-equiv y x))
           (implies (and (mode-set-equiv x y)
                         (mode-set-equiv y z))
                    (mode-set-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: mode-set-equiv-implies-equal-mode-set-fix-1

    (defthm mode-set-equiv-implies-equal-mode-set-fix-1
      (implies (mode-set-equiv acl2::x x-equiv)
               (equal (mode-set-fix acl2::x)
                      (mode-set-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: mode-set-fix-under-mode-set-equiv

    (defthm mode-set-fix-under-mode-set-equiv
      (mode-set-equiv (mode-set-fix acl2::x)
                      acl2::x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-mode-set-fix-1-forward-to-mode-set-equiv

    (defthm equal-of-mode-set-fix-1-forward-to-mode-set-equiv
      (implies (equal (mode-set-fix acl2::x) acl2::y)
               (mode-set-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: equal-of-mode-set-fix-2-forward-to-mode-set-equiv

    (defthm equal-of-mode-set-fix-2-forward-to-mode-set-equiv
      (implies (equal acl2::x (mode-set-fix acl2::y))
               (mode-set-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: mode-set-equiv-of-mode-set-fix-1-forward

    (defthm mode-set-equiv-of-mode-set-fix-1-forward
      (implies (mode-set-equiv (mode-set-fix acl2::x)
                               acl2::y)
               (mode-set-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: mode-set-equiv-of-mode-set-fix-2-forward

    (defthm mode-set-equiv-of-mode-set-fix-2-forward
      (implies (mode-set-equiv acl2::x (mode-set-fix acl2::y))
               (mode-set-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)