• 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
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
        • Transformations
        • Language
          • Abstract-syntax
          • Dynamic-semantics
            • Exec
            • Find-fun
            • Init-local
            • Write-vars-values
            • Add-vars-values
            • Add-funs
            • Eoutcome
            • Soutcome
            • Ensure-funscope-disjoint
            • Write-var-value
            • Restrict-vars
            • Add-var-value
            • Funinfo
            • Exec-top-block
            • Values
            • Cstate
            • Funinfo+funenv
            • Read-vars-values
            • Read-var-value
            • Funenv
            • Funscope-for-fundefs
            • Exec-path
            • Path-to-var
            • Funinfo+funenv-result
            • Exec-literal
            • Soutcome-result
            • Mode-set-result
            • Literal-evaluation
            • Funscope-result
            • Funinfo-result
            • Funenv-result
            • Eoutcome-result
            • Cstate-result
            • Paths-to-vars
            • Funinfo-for-fundef
            • Lstate
              • Lstate-fix
                • Lstatep
                • Lstate-equiv
              • Funscope
              • Mode-set
              • Modes
            • Concrete-syntax
            • Static-soundness
            • Static-semantics
            • Errors
          • Yul-json
        • 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
    • Lstate

    Lstate-fix

    (lstate-fix x) is a usual ACL2::fty omap fixing function.

    Signature
    (lstate-fix x) → *
    Arguments
    x — Guard (lstatep x).

    Definitions and Theorems

    Function: lstate-fix

    (defun lstate-fix (x)
      (declare (xargs :guard (lstatep x)))
      (mbe :logic (if (lstatep x) x nil)
           :exec x))

    Theorem: lstatep-of-lstate-fix

    (defthm lstatep-of-lstate-fix
      (lstatep (lstate-fix x)))

    Theorem: lstate-fix-when-lstatep

    (defthm lstate-fix-when-lstatep
      (implies (lstatep x)
               (equal (lstate-fix x) x)))

    Theorem: emptyp-lstate-fix

    (defthm emptyp-lstate-fix
      (implies (or (omap::emptyp x) (not (lstatep x)))
               (omap::emptyp (lstate-fix x))))

    Theorem: emptyp-of-lstate-fix-to-not-lstate-or-emptyp

    (defthm emptyp-of-lstate-fix-to-not-lstate-or-emptyp
      (equal (omap::emptyp (lstate-fix x))
             (or (not (lstatep x))
                 (omap::emptyp x))))

    Function: lstate-equiv$inline

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

    Theorem: lstate-equiv-is-an-equivalence

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

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

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

    Theorem: lstate-fix-under-lstate-equiv

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

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

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

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

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

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

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

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

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