• 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
                • Branch-funct-fix
                  • Branch-funct-case
                  • Branch-funct-equiv
                  • Branch-funct-p
                  • Branch-funct-kind
                  • Branch-funct-bne
                  • Branch-funct-bltu
                  • Branch-funct-blt
                  • Branch-funct-bgeu
                  • Branch-funct-bge
                  • Branch-funct-beq
                • 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
    • Branch-funct

    Branch-funct-fix

    Fixing function for branch-funct structures.

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

    Definitions and Theorems

    Function: branch-funct-fix$inline

    (defun branch-funct-fix$inline (x)
      (declare (xargs :guard (branch-funct-p x)))
      (let ((__function__ 'branch-funct-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (case (branch-funct-kind x)
               (:beq (cons :beq (list)))
               (:bne (cons :bne (list)))
               (:blt (cons :blt (list)))
               (:bltu (cons :bltu (list)))
               (:bge (cons :bge (list)))
               (:bgeu (cons :bgeu (list))))
             :exec x)))

    Theorem: branch-funct-p-of-branch-funct-fix

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

    Theorem: branch-funct-fix-when-branch-funct-p

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

    Function: branch-funct-equiv$inline

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

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

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

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

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

    Theorem: branch-funct-fix-under-branch-funct-equiv

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

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

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

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

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

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

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

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

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

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

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

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

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

    Theorem: consp-of-branch-funct-fix

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