• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
        • Syntax-for-tools
          • Formalized-subset
          • Mapping-to-language-definition
          • Input-files
          • Compilation-database
          • Printer
          • Output-files
          • Abstract-syntax-operations
          • Implementation-environments
          • Abstract-syntax
          • Concrete-syntax
          • Disambiguation
          • Validation
            • Validator
            • Validation-information
              • Abstract-syntax-annop
              • Types
              • Abstract-syntax-anno-additional-theroems
              • Valid-ext-info
              • Valid-table
              • Valid-ord-info
              • Uid
              • Stmts-types
              • Lifetime
              • Init-declor-info
              • Fundef-types
              • Expr-type
              • Valid-defstatus
              • Var-info
              • Valid-ord-info-option
              • Valid-ext-info-option
              • Uid-option
              • Linkage-option
              • Linkage
              • Lifetime-option
                • Lifetime-option-fix
                  • Lifetime-option-case
                  • Lifetime-option-equiv
                  • Lifetime-option-some
                  • Lifetime-option-none
                  • Lifetime-optionp
                • Valid-table-option
                • Iconst-info
                • Param-declor-nonabstract-info
                • Fundef-info
                • Expr-null-pointer-constp
                • Valid-scope
                • Const-expr-null-pointer-constp
                • Expr-string-info
                • Expr-funcall-info
                • Expr-arrsub-info
                • Tyname-info
                • Transunit-info
                • Expr-unary-info
                • Expr-const-info
                • Expr-binary-info
                • Stmt-types
                • Block-item-list-types
                • Initer-type
                • Valid-ord-scope
                • Uid-increment
                • Uid-equal
                • Coerce-var-info
                • Valid-externals
                • Irr-var-info
                • Valid-scope-list
                • Irr-valid-table
                • Irr-lifetime
                • Irr-uid
                • Irr-linkage
                • Block-item-types
                • Comp-stmt-types
            • Gcc-builtins
            • Preprocessing
            • Parsing
          • Atc
          • Transformation-tools
          • Language
          • Representation
          • Insertion-sort
          • Pack
        • Proof-checker-array
        • Soft
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Ethereum
        • Leftist-trees
        • Java
        • Riscv
        • 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
    • Lifetime-option

    Lifetime-option-fix

    Fixing function for lifetime-option structures.

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

    Definitions and Theorems

    Function: lifetime-option-fix$inline

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

    Theorem: lifetime-optionp-of-lifetime-option-fix

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

    Theorem: lifetime-option-fix-when-lifetime-optionp

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

    Function: lifetime-option-equiv$inline

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

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

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

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

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

    Theorem: lifetime-option-fix-under-lifetime-option-equiv

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

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

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

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

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

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

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

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

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

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

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

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

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