• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Bitcoin
      • Riscv
        • Instructions
          • Instr
          • Op-funct
          • Op-32-funct
          • Op-imm-funct
          • Load-funct
          • Branch-funct
          • Op-imms-funct
          • Store-funct
          • Op-imms-32-funct
          • Instr-validp
          • Instr-option
            • Instr-option-fix
              • Instr-option-case
              • Instr-option-equiv
              • Instr-option-some
              • Instr-option-none
              • Instr-optionp
            • Op-imm-32-funct
          • States
          • Decoding
          • Encoding
          • Features
          • Semantics
          • Execution
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • 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)