• 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
      • Riscv
        • Specification
        • Executable
        • Specialized
          • Specialized-features
          • Rv64im
          • Rv32im
          • Specialized-states
            • States32i
              • Stat32i
                • Stat32ip
                • Stat32i-fix
                  • Stat32i-equiv
                  • Make-stat32i
                  • Change-stat32i
                  • Stat32i->xregs
                  • Stat32i->memory
                  • Stat32i->error
                  • Stat32i->pc
                • Memory32i
                • Xregs32i
                • Stat32i-iso
                • Stat-rv32i-p
                • Read32i-xreg-unsigned{2}
                • Read32i-xreg-unsigned{0}
                • Read32i-xreg-unsigned{1}
                • Stat32i-from-stat
                • Stat-from-stat32i
              • States64i
              • States64e
              • States32e
          • Optimized
        • Taspi
        • Bitcoin
        • 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
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Stat32i

    Stat32i-fix

    Fixing function for stat32i structures.

    Signature
    (stat32i-fix x) → new-x
    Arguments
    x — Guard (stat32ip x).
    Returns
    new-x — Type (stat32ip new-x).

    Definitions and Theorems

    Function: stat32i-fix$inline

    (defun stat32i-fix$inline (x)
      (declare (xargs :guard (stat32ip x)))
      (let ((__function__ 'stat32i-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (b* ((xregs (xregs32i-fix (cdr (std::da-nth 0 x))))
                  (pc (ubyte32-fix (cdr (std::da-nth 1 x))))
                  (memory (memory32i-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: stat32ip-of-stat32i-fix

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

    Theorem: stat32i-fix-when-stat32ip

    (defthm stat32i-fix-when-stat32ip
      (implies (stat32ip x)
               (equal (stat32i-fix x) x)))

    Function: stat32i-equiv$inline

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

    Theorem: stat32i-equiv-is-an-equivalence

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

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

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

    Theorem: stat32i-fix-under-stat32i-equiv

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

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

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

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

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

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

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

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

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