• 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
        • Optimized
          • State-stobj
            • Stat1
            • Stat1-iso
            • Stat1-from-stat
              • Write1-memory-unsigned64
              • Stat-from-stat1
              • Read1-memory-unsigned64
              • Write1-memory-unsigned32
              • Make-stat1
              • Write1-xreg
              • Write1-memory-unsigned8
              • Write1-memory-unsigned16
              • Stat1->memory
              • Read1-memory-unsigned32
              • Read1-instruction
              • Write1-xreg-32
              • Write1-pc
              • Read1-memory-unsigned16
              • Stat1-validp
              • Read1-xreg-unsigned32
              • Read1-xreg-unsigned
              • Read1-xreg-signed32
              • Read1-memory-unsigned8
              • Inc1-4-pc
              • Error1
              • Read1-xreg-signed
              • Read1-pc
              • Errorp1
        • 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
    • State-stobj

    Stat1-from-stat

    Turn a stat value into a stat1 value.

    Signature
    (stat1-from-stat stat) → stat1
    Arguments
    stat — Guard (statp stat).
    Returns
    stat1 — Type (stat1p stat1).

    A transformation that generates the stobj definition from stat could also generate this conversion function.

    This is executable, but the values it returns are unrelated to the live stobj.

    Definitions and Theorems

    Function: stat1-from-stat

    (defun stat1-from-stat (stat)
      (declare (xargs :guard (statp stat)))
      (let ((__function__ 'stat1-from-stat))
        (declare (ignorable __function__))
        (make-stat1 (stat->xregs stat)
                    (stat->pc stat)
                    (stat->memory stat)
                    (stat->error stat))))

    Theorem: stat1p-of-stat1-from-stat

    (defthm stat1p-of-stat1-from-stat
      (b* ((stat1 (stat1-from-stat stat)))
        (stat1p stat1))
      :rule-classes :rewrite)

    Theorem: stat1-from-stat-of-stat-fix-stat

    (defthm stat1-from-stat-of-stat-fix-stat
      (equal (stat1-from-stat (stat-fix stat))
             (stat1-from-stat stat)))

    Theorem: stat1-from-stat-stat-equiv-congruence-on-stat

    (defthm stat1-from-stat-stat-equiv-congruence-on-stat
      (implies (stat-equiv stat stat-equiv)
               (equal (stat1-from-stat stat)
                      (stat1-from-stat stat-equiv)))
      :rule-classes :congruence)