• 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
        • Optimized
          • State-stobj
            • Stat1
            • Stat1-iso
            • Write1-mem64{0}
            • Stat1-from-stat
            • Read1-mem64{0}
            • Write1-mem32{0}
            • Stat1-validp{1}
              • Stat1-validp{0}
              • Stat-from-stat1
              • Write1-mem16{0}
              • Read1-mem32{0}
              • Write1-xreg{0}
              • Write1-mem8{0}
              • Read1-xreg-unsigned{0}
              • Read1-xreg-unsigned32{0}
              • Read1-xreg-signed32{0}
              • Read1-mem16{0}
              • Read1-instruction{0}
              • Write1-xreg-32{0}
              • Read1-xreg-signed{0}
              • Write1-pc{0}
              • Read1-mem8{0}
              • Make-stat1
              • Inc41-pc{0}
              • Error1{0}
              • Read1-pc{0}
              • Errorp1{0}
              • Stat1->memory
        • 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
    • State-stobj

    Stat1-validp{1}

    Simplify stat1-validp{0} after the isomorphic state transformation.

    stat1-validp{0} includes term of the form (stat->FIELD (stat-from-stat1 stat)). By enabling stat-from-stat1, those turn into (stat->FIELD (stat ... (stat1->FIELD <field>) ...)), which reduces to (stat1->FIELD <field>) as desired.

    Definitions and Theorems

    Function: stat1-validp{1}

    (defun stat1-validp{1} (stat feat)
      (declare (xargs :non-executable t))
      (declare (xargs :guard (and (stat1p stat) (featp feat))))
      (prog2$ (acl2::throw-nonexec-error 'stat1-validp{1}
                                         (list stat feat))
              (and (mbt (stat1p stat))
                   (let* ((stat.xregs (stat1->xregs stat))
                          (stat.pc (stat1->pc stat)))
                     (let nil
                       (let* ((xlen (feat->xlen feat))
                              (xnum (feat->xnum feat)))
                         (and (unsigned-byte-listp xlen stat.xregs)
                              (equal (len stat.xregs) (+ -1 xnum))
                              (unsigned-byte-p xlen stat.pc)
                              (equal (len (stat1->memory stat))
                                     (expt 2 xlen)))))))))

    Theorem: stat1-validp{0}-becomes-stat1-validp{1}

    (defthm stat1-validp{0}-becomes-stat1-validp{1}
      (equal (stat1-validp{0} stat feat)
             (stat1-validp{1} stat feat)))