• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
              • Tyspecseq
              • Expr
              • Binop
              • Fileset
              • Obj-declor
              • Ident
              • Iconst
              • Obj-adeclor
              • Const
              • Fundef
              • Unop
              • File
              • Tag-declon
              • Fun-declor
              • Obj-declon
              • Iconst-length
              • Abstract-syntax-operations
              • Label
              • Struct-declon
              • Initer
              • Ext-declon
              • Fun-adeclor
              • Expr-option
              • Iconst-base
              • Initer-option
              • Iconst-option
              • Tyspecseq-option
              • Stmt-option
              • Scspecseq
              • Param-declon
              • Obj-declon-option
              • File-option
                • File-option-fix
                  • File-option-case
                  • File-option-equiv
                  • File-option-some
                  • File-option-none
                  • File-optionp
                • Tyname
                • Transunit
                • Fun-declon
                • Transunit-result
                • Param-declon-list
                • Struct-declon-list
                • Expr-list
                • Tyspecseq-list
                • Ident-set
                • Ident-list
                • Ext-declon-list
                • Unop-list
                • Tyname-list
                • Fundef-list
                • Fun-declon-list
                • Binop-list
                • Stmt-fixtypes
                • Expr-fixtypes
              • Integer-ranges
              • Implementation-environments
              • Dynamic-semantics
              • Static-semantics
              • Grammar
              • Integer-formats
              • Types
              • Portable-ascii-identifiers
              • Values
              • 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
            • Representation
            • Transformation-tools
            • Insertion-sort
            • Pack
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • 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
    • File-option

    File-option-fix

    Fixing function for file-option structures.

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

    Definitions and Theorems

    Function: file-option-fix$inline

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

    Theorem: file-optionp-of-file-option-fix

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

    Theorem: file-option-fix-when-file-optionp

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

    Function: file-option-equiv$inline

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

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

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

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

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

    Theorem: file-option-fix-under-file-option-equiv

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

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

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

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

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

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

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

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

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