• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
          • Syntax-for-tools
          • Atc
          • Language
            • Abstract-syntax
            • Integer-ranges
            • Implementation-environments
            • Dynamic-semantics
            • Static-semantics
            • Grammar
            • Integer-formats
            • Types
            • Portable-ascii-identifiers
            • Values
              • Pointer
              • Member-types-of-member-values
              • Member-value-list->value-list
              • Member-value-list->name-list
              • Expr-value
              • Type-list-of-value-list
              • Type-of-value
              • Stmt-value
                • Stmt-value-case
                • Stmt-value-fix
                  • Stmt-value-equiv
                  • Stmt-value-return
                  • Stmt-valuep
                  • Stmt-value-none
                  • Stmt-value-kind
                • Value-option
                • Init-value
                • Value-result
                • Type-of-value-option
                • Value-list-result
                • Member-value-list-result
                • Init-value-result
                • Expr-value-result
                • Value-option-result
                • Signed/unsigned-byte-p-of-integer-values
                • Member-type-of-member-value
                • Bounds-of-integer-values
                • Value-promoted-arithmeticp
                • Init-type-of-init-value
                • Value-unsigned-integerp
                • Value-integerp
                • Value-signed-integerp
                • Value-arithmeticp
                • Value-scalarp
                • Value-realp
                • Values/membervalues
              • Integer-operations
              • Computation-states
              • Object-designators
              • Operations
              • Errors
              • Tag-environments
              • Function-environments
              • Character-sets
              • Flexible-array-member-removal
              • Arithmetic-operations
              • Pointer-operations
              • Bytes
              • Keywords
              • Real-operations
              • Array-operations
              • Scalar-operations
              • Structure-operations
            • Transformation-tools
            • Representation
            • Insertion-sort
            • Pack
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Riscv
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Stmt-value

    Stmt-value-fix

    Fixing function for stmt-value structures.

    Signature
    (stmt-value-fix x) → new-x
    Arguments
    x — Guard (stmt-valuep x).
    Returns
    new-x — Type (stmt-valuep new-x).

    Definitions and Theorems

    Function: stmt-value-fix$inline

    (defun stmt-value-fix$inline (x)
     (declare (xargs :guard (stmt-valuep x)))
     (let ((__function__ 'stmt-value-fix))
      (declare (ignorable __function__))
      (mbe
        :logic
        (case (stmt-value-kind x)
          (:none (cons :none (list)))
          (:return
               (b* ((value? (value-option-fix (std::da-nth 0 (cdr x)))))
                 (cons :return (list value?)))))
        :exec x)))

    Theorem: stmt-valuep-of-stmt-value-fix

    (defthm stmt-valuep-of-stmt-value-fix
      (b* ((new-x (stmt-value-fix$inline x)))
        (stmt-valuep new-x))
      :rule-classes :rewrite)

    Theorem: stmt-value-fix-when-stmt-valuep

    (defthm stmt-value-fix-when-stmt-valuep
      (implies (stmt-valuep x)
               (equal (stmt-value-fix x) x)))

    Function: stmt-value-equiv$inline

    (defun stmt-value-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (stmt-valuep acl2::x)
                                  (stmt-valuep acl2::y))))
      (equal (stmt-value-fix acl2::x)
             (stmt-value-fix acl2::y)))

    Theorem: stmt-value-equiv-is-an-equivalence

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

    Theorem: stmt-value-equiv-implies-equal-stmt-value-fix-1

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

    Theorem: stmt-value-fix-under-stmt-value-equiv

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

    Theorem: equal-of-stmt-value-fix-1-forward-to-stmt-value-equiv

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

    Theorem: equal-of-stmt-value-fix-2-forward-to-stmt-value-equiv

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

    Theorem: stmt-value-equiv-of-stmt-value-fix-1-forward

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

    Theorem: stmt-value-equiv-of-stmt-value-fix-2-forward

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

    Theorem: stmt-value-kind$inline-of-stmt-value-fix-x

    (defthm stmt-value-kind$inline-of-stmt-value-fix-x
      (equal (stmt-value-kind$inline (stmt-value-fix x))
             (stmt-value-kind$inline x)))

    Theorem: stmt-value-kind$inline-stmt-value-equiv-congruence-on-x

    (defthm stmt-value-kind$inline-stmt-value-equiv-congruence-on-x
      (implies (stmt-value-equiv x x-equiv)
               (equal (stmt-value-kind$inline x)
                      (stmt-value-kind$inline x-equiv)))
      :rule-classes :congruence)

    Theorem: consp-of-stmt-value-fix

    (defthm consp-of-stmt-value-fix
      (consp (stmt-value-fix x))
      :rule-classes :type-prescription)