• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
        • Specification
        • Executable
        • Specialized
          • Specialized-rv64im-le
          • Specialized-rv32im-le
            • Rv32im-le-semantics
            • Rv32im-le-states
              • Write32-xreg
              • Stat32
                • Stat32p
                • Stat32-fix
                  • Stat32-equiv
                  • Make-stat32
                  • Change-stat32
                  • Stat32->xregs
                  • Stat32->memory
                  • Stat32->error
                  • Stat32->pc
                • Write32-mem-ubyte16-lendian
                • Memory
                • Xregs
                • Write32-pc
                • Write32-mem-ubyte32-lendian
                • Read32-xreg-unsigned
                • Read32-mem-ubyte16-lendian
                • Read32-mem-ubyte8
                • Read32-mem-ubyte32-lendian
                • Write32-mem-ubyte8
                • Stat32-iso
                • Read32-xreg-unsigned{3}
                • Read32-xreg-signed
                • Inc32-pc
                • Read32-xreg-signed{3}
                • Stat-from-stat32
                • Read32-xreg-unsigned{2}
                • Read32-xreg-signed{2}
                • Stat-rv32im-le-p
                • Read32-xreg-signed{4}
                • Read32-xreg-unsigned{1}
                • Read32-xreg-signed{1}
                • Read32-pc
                • Read32-xreg-unsigned{0}
                • Error32p
                • Error32
                • Stat32-from-stat
                • Read32-xreg-signed{0}
                • Read-xreg-unsigned-to-read32-xreg-unsigned{3}
              • Rv32im-le-execution
              • Rv32im-le-features
          • Optimized
        • Taspi
        • Bitcoin
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Stat32

    Stat32-fix

    Fixing function for stat32 structures.

    Signature
    (stat32-fix x) → new-x
    Arguments
    x — Guard (stat32p x).
    Returns
    new-x — Type (stat32p new-x).

    Definitions and Theorems

    Function: stat32-fix$inline

    (defun stat32-fix$inline (x)
      (declare (xargs :guard (stat32p x)))
      (mbe :logic
           (b* ((xregs (xregs-fix (cdr (std::da-nth 0 x))))
                (pc (ubyte32-fix (cdr (std::da-nth 1 x))))
                (memory (memory-fix (cdr (std::da-nth 2 x))))
                (error (acl2::bool-fix (cdr (std::da-nth 3 x)))))
             (list (cons 'xregs xregs)
                   (cons 'pc pc)
                   (cons 'memory memory)
                   (cons 'error error)))
           :exec x))

    Theorem: stat32p-of-stat32-fix

    (defthm stat32p-of-stat32-fix
      (b* ((new-x (stat32-fix$inline x)))
        (stat32p new-x))
      :rule-classes :rewrite)

    Theorem: stat32-fix-when-stat32p

    (defthm stat32-fix-when-stat32p
      (implies (stat32p x)
               (equal (stat32-fix x) x)))

    Function: stat32-equiv$inline

    (defun stat32-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (stat32p acl2::x)
                                  (stat32p acl2::y))))
      (equal (stat32-fix acl2::x)
             (stat32-fix acl2::y)))

    Theorem: stat32-equiv-is-an-equivalence

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

    Theorem: stat32-equiv-implies-equal-stat32-fix-1

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

    Theorem: stat32-fix-under-stat32-equiv

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

    Theorem: equal-of-stat32-fix-1-forward-to-stat32-equiv

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

    Theorem: equal-of-stat32-fix-2-forward-to-stat32-equiv

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

    Theorem: stat32-equiv-of-stat32-fix-1-forward

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

    Theorem: stat32-equiv-of-stat32-fix-2-forward

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

    Theorem: stat32-fix$inline-of-stat32-fix-x

    (defthm stat32-fix$inline-of-stat32-fix-x
      (equal (stat32-fix$inline (stat32-fix x))
             (stat32-fix$inline x)))

    Theorem: stat32-fix$inline-stat32-equiv-congruence-on-x

    (defthm stat32-fix$inline-stat32-equiv-congruence-on-x
      (implies (stat32-equiv x x-equiv)
               (equal (stat32-fix$inline x)
                      (stat32-fix$inline x-equiv)))
      :rule-classes :congruence)