• 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
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Riscv
          • Specification
            • Semantics
            • Features
            • Instructions
              • Instr
              • Op-funct
              • Op-32-funct
              • Op-imm-funct
              • Load-funct
              • Instr-validp
              • Branch-funct
              • Op-imms-funct
              • Store-funct
              • Op-imms-32-funct
              • Instr-option
                • Instr-option-fix
                  • Instr-option-case
                  • Instr-option-equiv
                  • Instr-option-some
                  • Instr-option-none
                  • Instr-optionp
                • Op-imm-32-funct
              • Encoding
              • States
              • Reads-over-writes
              • Semantics-equivalences
              • Decoding
              • Execution
            • Executable
            • Specialized
            • Optimized
          • Bitcoin
          • Ethereum
          • Yul
          • 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
    • Instr-option

    Instr-option-fix

    Fixing function for instr-option structures.

    Signature
    (instr-option-fix x) → new-x
    Arguments
    x — Guard (instr-optionp x).
    Returns
    new-x — Type (instr-optionp new-x).

    Definitions and Theorems

    Function: instr-option-fix$inline

    (defun instr-option-fix$inline (x)
      (declare (xargs :guard (instr-optionp x)))
      (let ((__function__ 'instr-option-fix))
        (declare (ignorable __function__))
        (mbe :logic (cond ((not x) nil)
                          (t (b* ((fty::val (instr-fix x)))
                               fty::val)))
             :exec x)))

    Theorem: instr-optionp-of-instr-option-fix

    (defthm instr-optionp-of-instr-option-fix
      (b* ((new-x (instr-option-fix$inline x)))
        (instr-optionp new-x))
      :rule-classes :rewrite)

    Theorem: instr-option-fix-when-instr-optionp

    (defthm instr-option-fix-when-instr-optionp
      (implies (instr-optionp x)
               (equal (instr-option-fix x) x)))

    Function: instr-option-equiv$inline

    (defun instr-option-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (instr-optionp acl2::x)
                                  (instr-optionp acl2::y))))
      (equal (instr-option-fix acl2::x)
             (instr-option-fix acl2::y)))

    Theorem: instr-option-equiv-is-an-equivalence

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

    Theorem: instr-option-equiv-implies-equal-instr-option-fix-1

    (defthm instr-option-equiv-implies-equal-instr-option-fix-1
      (implies (instr-option-equiv acl2::x x-equiv)
               (equal (instr-option-fix acl2::x)
                      (instr-option-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: instr-option-fix-under-instr-option-equiv

    (defthm instr-option-fix-under-instr-option-equiv
      (instr-option-equiv (instr-option-fix acl2::x)
                          acl2::x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-instr-option-fix-1-forward-to-instr-option-equiv

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

    Theorem: equal-of-instr-option-fix-2-forward-to-instr-option-equiv

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

    Theorem: instr-option-equiv-of-instr-option-fix-1-forward

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

    Theorem: instr-option-equiv-of-instr-option-fix-2-forward

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