• 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-funct-fix
                  • Op-funct-case
                  • Op-funct-p
                  • Op-funct-equiv
                  • Op-funct-kind
                  • Op-funct-xor
                  • Op-funct-sub
                  • Op-funct-srl
                  • Op-funct-sra
                  • Op-funct-sltu
                  • Op-funct-slt
                  • Op-funct-sll
                  • Op-funct-remu
                  • Op-funct-rem
                  • Op-funct-or
                  • Op-funct-mulhu
                  • Op-funct-mulhsu
                  • Op-funct-mulh
                  • Op-funct-mul
                  • Op-funct-divu
                  • Op-funct-div
                  • Op-funct-and
                  • Op-funct-add
                • Op-32-funct
                • Op-imm-funct
                • Load-funct
                • Instr-validp
                • Branch-funct
                • Op-imms-funct
                • Store-funct
                • Op-imms-32-funct
                • Instr-option
                • 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
    • Op-funct

    Op-funct-fix

    Fixing function for op-funct structures.

    Signature
    (op-funct-fix x) → new-x
    Arguments
    x — Guard (op-funct-p x).
    Returns
    new-x — Type (op-funct-p new-x).

    Definitions and Theorems

    Function: op-funct-fix$inline

    (defun op-funct-fix$inline (x)
      (declare (xargs :guard (op-funct-p x)))
      (let ((__function__ 'op-funct-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (case (op-funct-kind x)
               (:add (cons :add (list)))
               (:sub (cons :sub (list)))
               (:slt (cons :slt (list)))
               (:sltu (cons :sltu (list)))
               (:and (cons :and (list)))
               (:or (cons :or (list)))
               (:xor (cons :xor (list)))
               (:sll (cons :sll (list)))
               (:srl (cons :srl (list)))
               (:sra (cons :sra (list)))
               (:mul (cons :mul (list)))
               (:mulh (cons :mulh (list)))
               (:mulhu (cons :mulhu (list)))
               (:mulhsu (cons :mulhsu (list)))
               (:div (cons :div (list)))
               (:divu (cons :divu (list)))
               (:rem (cons :rem (list)))
               (:remu (cons :remu (list))))
             :exec x)))

    Theorem: op-funct-p-of-op-funct-fix

    (defthm op-funct-p-of-op-funct-fix
      (b* ((new-x (op-funct-fix$inline x)))
        (op-funct-p new-x))
      :rule-classes :rewrite)

    Theorem: op-funct-fix-when-op-funct-p

    (defthm op-funct-fix-when-op-funct-p
      (implies (op-funct-p x)
               (equal (op-funct-fix x) x)))

    Function: op-funct-equiv$inline

    (defun op-funct-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (op-funct-p acl2::x)
                                  (op-funct-p acl2::y))))
      (equal (op-funct-fix acl2::x)
             (op-funct-fix acl2::y)))

    Theorem: op-funct-equiv-is-an-equivalence

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

    Theorem: op-funct-equiv-implies-equal-op-funct-fix-1

    (defthm op-funct-equiv-implies-equal-op-funct-fix-1
      (implies (op-funct-equiv acl2::x x-equiv)
               (equal (op-funct-fix acl2::x)
                      (op-funct-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: op-funct-fix-under-op-funct-equiv

    (defthm op-funct-fix-under-op-funct-equiv
      (op-funct-equiv (op-funct-fix acl2::x)
                      acl2::x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-op-funct-fix-1-forward-to-op-funct-equiv

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

    Theorem: equal-of-op-funct-fix-2-forward-to-op-funct-equiv

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

    Theorem: op-funct-equiv-of-op-funct-fix-1-forward

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

    Theorem: op-funct-equiv-of-op-funct-fix-2-forward

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

    Theorem: op-funct-kind$inline-of-op-funct-fix-x

    (defthm op-funct-kind$inline-of-op-funct-fix-x
      (equal (op-funct-kind$inline (op-funct-fix x))
             (op-funct-kind$inline x)))

    Theorem: op-funct-kind$inline-op-funct-equiv-congruence-on-x

    (defthm op-funct-kind$inline-op-funct-equiv-congruence-on-x
      (implies (op-funct-equiv x x-equiv)
               (equal (op-funct-kind$inline x)
                      (op-funct-kind$inline x-equiv)))
      :rule-classes :congruence)

    Theorem: consp-of-op-funct-fix

    (defthm consp-of-op-funct-fix
      (consp (op-funct-fix x))
      :rule-classes :type-prescription)