• 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
            • Escape
            • Swcase-list->value-list
            • Hex-digit-list->chars
            • Fundef-list->name-list
            • Literal
            • Path
            • Hex-string-rest-element
            • Plain-string
            • String-element
            • Hex-string-content-option
            • Hex-string-content
            • Identifier
            • Funcall-option
              • Funcall-option-fix
                • Funcall-option-case
                • Funcall-option-equiv
                • Funcall-option-some
                • Funcall-optionp
                • Funcall-option-none
              • Expression-option
              • Statement-option
              • Literal-option
              • Identifier-option
              • Hex-string
              • Hex-quad
              • Hex-digit
              • Hex-pair
              • Data-value
              • Data-item
              • Statements-to-fundefs
              • String-element-list-result
              • Identifier-identifier-map-result
              • Swcase-result
              • String-element-result
              • Statement-result
              • Literal-result
              • Identifier-set-result
              • Identifier-result
              • Identifier-list-result
              • Fundef-result
              • Funcall-result
              • Expression-result
              • Escape-result
              • Path-result
              • Block-result
              • Objects
              • Statements/blocks/cases/fundefs
              • Identifier-list
              • Identifier-set
              • Identifier-identifier-map
              • Identifier-identifier-alist
              • Hex-string-rest-element-list
              • String-element-list
              • Path-list
              • Hex-digit-list
              • Literal-list
              • Fundef-list
              • Expressions/funcalls
              • Abstract-syntax-induction-schemas
            • Dynamic-semantics
            • 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
    • Funcall-option

    Funcall-option-fix

    Fixing function for funcall-option structures.

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

    Definitions and Theorems

    Function: funcall-option-fix$inline

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

    Theorem: funcall-optionp-of-funcall-option-fix

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

    Theorem: funcall-option-fix-when-funcall-optionp

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

    Function: funcall-option-equiv$inline

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

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

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

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

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

    Theorem: funcall-option-fix-under-funcall-option-equiv

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

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

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

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

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

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

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

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

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