• 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
        • C
          • Syntax-for-tools
          • Atc
          • Transformation-tools
          • Language
            • Abstract-syntax
            • Integer-ranges
            • Implementation-environments
            • Dynamic-semantics
            • Static-semantics
            • Grammar
            • Types
              • Type
              • Type-name-list-to-type-list
              • Tyname-to-type
              • Member-type-list->name-list
              • Type-completep
              • Member-type
              • Member-type-add-first
              • Member-type-add-last
              • Init-type
              • Type-option
                • Type-option-fix
                  • Type-option-case
                  • Type-option-equiv
                  • Type-option-some
                  • Type-optionp
                  • Type-option-none
                • Member-type-lookup
                • Tyspecseq-to-type
                • Member-type-list-option
                • Type-promoted-arithmeticp
                • Type-list-result
                • Member-type-list-result
                • Integer-type-bits-nulfun
                • Init-type-result
                • Type-result
                • Type-nonchar-integerp
                • Type-nonchar-integer-listp
                • Type-arithmetic-listp
                • Type-integer-listp
                • Integer-type-xdoc-string
                • Type-unsigned-integerp
                • Type-signed-integerp
                • Integer-type-minbits
                • Integer-type-bits
                • Type-scalarp
                • Type-integerp
                • Type-arithmeticp
                • Type-realp
                • Type-list
                • *nonchar-integer-types*
                • Member-type-list
                • Ident-type-map
                • Type-set
                • Type-option-set
                • Symbol-type-alist
                • Type-option-list
              • Integer-formats-definitions
              • Computation-states
              • Portable-ascii-identifiers
              • Values
              • Integer-operations
              • Object-designators
              • Operations
              • Errors
              • Tag-environments
              • Function-environments
              • Character-sets
              • Flexible-array-member-removal
              • Arithmetic-operations
              • Pointer-operations
              • Real-operations
              • Array-operations
              • Scalar-operations
              • Structure-operations
            • Representation
            • Insertion-sort
            • Pack
          • Soft
          • Bv
          • Imp-language
          • Ethereum
          • Event-macros
          • Java
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Type-option

    Type-option-fix

    Fixing function for type-option structures.

    Signature
    (type-option-fix x) → new-x
    Arguments
    x — Guard (type-optionp x).
    Returns
    new-x — Type (type-optionp new-x).

    Definitions and Theorems

    Function: type-option-fix$inline

    (defun type-option-fix$inline (x)
      (declare (xargs :guard (type-optionp x)))
      (mbe :logic (cond ((not x) nil)
                        (t (b* ((fty::val (type-fix x)))
                             fty::val)))
           :exec x))

    Theorem: type-optionp-of-type-option-fix

    (defthm type-optionp-of-type-option-fix
      (b* ((new-x (type-option-fix$inline x)))
        (type-optionp new-x))
      :rule-classes :rewrite)

    Theorem: type-option-fix-when-type-optionp

    (defthm type-option-fix-when-type-optionp
      (implies (type-optionp x)
               (equal (type-option-fix x) x)))

    Function: type-option-equiv$inline

    (defun type-option-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (type-optionp acl2::x)
                                  (type-optionp acl2::y))))
      (equal (type-option-fix acl2::x)
             (type-option-fix acl2::y)))

    Theorem: type-option-equiv-is-an-equivalence

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

    Theorem: type-option-equiv-implies-equal-type-option-fix-1

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

    Theorem: type-option-fix-under-type-option-equiv

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

    Theorem: equal-of-type-option-fix-1-forward-to-type-option-equiv

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

    Theorem: equal-of-type-option-fix-2-forward-to-type-option-equiv

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

    Theorem: type-option-equiv-of-type-option-fix-1-forward

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

    Theorem: type-option-equiv-of-type-option-fix-2-forward

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

    Theorem: type-option-fix$inline-of-type-option-fix-x

    (defthm type-option-fix$inline-of-type-option-fix-x
      (equal (type-option-fix$inline (type-option-fix x))
             (type-option-fix$inline x)))

    Theorem: type-option-fix$inline-type-option-equiv-congruence-on-x

    (defthm type-option-fix$inline-type-option-equiv-congruence-on-x
      (implies (type-option-equiv x x-equiv)
               (equal (type-option-fix$inline x)
                      (type-option-fix$inline x-equiv)))
      :rule-classes :congruence)