• 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
        • States
          • Stat
            • Statp
            • Stat-fix
              • Stat-equiv
              • Make-stat
              • Change-stat
              • Stat->memory
              • Stat->error
              • Stat->xregs
              • Stat->pc
            • Stat-validp
            • Write-memory-unsigned64
            • Write-memory-unsigned32
            • Write-memory-unsigned8
            • Write-memory-unsigned16
            • Read-xreg-unsigned
            • Write-xreg-32
            • States64
            • Write-xreg
            • Read-memory-unsigned8
            • Read-memory-unsigned64
            • Read-memory-unsigned32
            • Read-memory-unsigned16
            • Read-xreg-signed
            • Read-xreg-unsigned32
            • States32
            • Write-pc
            • Read-xreg-signed32
            • Read-pc
            • Inc4-pc
          • 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
    • Stat

    Stat-fix

    Fixing function for stat structures.

    Signature
    (stat-fix x) → new-x
    Arguments
    x — Guard (statp x).
    Returns
    new-x — Type (statp new-x).

    Definitions and Theorems

    Function: stat-fix$inline

    (defun stat-fix$inline (x)
     (declare (xargs :guard (statp x)))
     (let ((__function__ 'stat-fix))
      (declare (ignorable __function__))
      (mbe :logic
           (b* ((xregs (cdr (std::da-nth 0 x)))
                (pc (cdr (std::da-nth 1 x)))
                (memory (acl2::ubyte8-list-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: statp-of-stat-fix

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

    Theorem: stat-fix-when-statp

    (defthm stat-fix-when-statp
      (implies (statp x)
               (equal (stat-fix x) x)))

    Function: stat-equiv$inline

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

    Theorem: stat-equiv-is-an-equivalence

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

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

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

    Theorem: stat-fix-under-stat-equiv

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

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

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

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

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

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

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

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

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