• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
      • Std/io
      • Std/osets
      • Std/system
        • Fresh-logical-name-with-$s-suffix
        • Irrelevant-formals-info
        • Std/system/function-queries
          • Defun-sk-queries
          • Tail-recursive-p
          • Termination-theorem$
          • Measure
          • Arity+
          • Unwrapped-nonexec-body+
            • Ubody
            • Ruler-extenders+
            • Recursive-calls
            • Guard-theorem-no-simplify$
            • Well-founded-relation+
            • Unwrapped-nonexec-body
            • Measured-subset+
            • Measure+
            • Ruler-extenders
            • Number-of-results+
            • Induction-machine+
            • Non-executablep+
            • Pure-raw-p
            • Irecursivep+
            • Formals+
            • Stobjs-out+
            • Induction-machine
            • Definedp+
            • Number-of-results
            • Ubody+
            • Guard-theorem-no-simplify
            • Uguard
            • Rawp
            • Irecursivep
            • Defchoose-queries
            • Uguard+
            • Stobjs-in+
            • No-stobjs-p+
            • Well-founded-relation
            • Definedp
            • Primitivep+
            • Guard-verified-p+
            • No-stobjs-p
            • Measured-subset
            • Guard-verified-p
            • Primitivep
            • Non-executablep
            • Fundef-enabledp
            • Fundef-disabledp
            • Ibody
            • Std/system/arity
          • Std/system/term-queries
          • Std/system/term-transformations
          • Std/system/enhanced-utilities
          • Install-not-normalized-event-lst
          • Install-not-normalized-event
          • Std/system/term-function-recognizers
          • Pseudo-tests-and-call-listp
          • Genvar$
          • Std/system/event-name-queries
          • Maybe-pseudo-event-formp
          • Add-suffix-to-fn-or-const
          • Chk-irrelevant-formals-ok
          • Std/system/good-atom-listp
          • Pseudo-tests-and-callp
          • Table-alist+
          • Add-suffix-to-fn-or-const-lst
          • Known-packages+
          • Add-suffix-to-fn-lst
          • Unquote-term
          • Event-landmark-names
          • Add-suffix-lst
          • Std/system/theorem-queries
          • Unquote-term-list
          • Std/system/macro-queries
          • Pseudo-event-landmark-listp
          • Pseudo-command-landmark-listp
          • Install-not-normalized$
          • Rune-disabledp
          • Known-packages
          • Std/system/partition-rest-and-keyword-args
          • Rune-enabledp
          • Included-books
          • Std/system/pseudo-event-formp
          • Std/system/plist-worldp-with-formals
          • Std/system/w
          • Std/system/geprops
          • Std/system/arglistp
          • Std/system-extensions
          • Std/system/constant-queries
        • Std/basic
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
        • Std-extensions
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Std/system/function-queries

    Unwrapped-nonexec-body+

    Enhanced variant of unwrapped-nonexec-body.

    Signature
    (unwrapped-nonexec-body+ fn wrld) → unwrapped-body
    Arguments
    fn — Guard (symbolp fn).
    wrld — Guard (plist-worldp wrld).
    Returns
    unwrapped-body — Type (pseudo-termp unwrapped-body).

    This returns the same result as unwrapped-nonexec-body, but it is guard-verified and includes a run-time check (which should always succeed) on the result that allows us to prove the return type theorem without strengthening the guard on wrld. This utility also includes a run-time check (which should always succeed) that the wrapper around the body has the expected form, via the built-in function throw-nonexec-error-p; this allows us to verify the guards without strengthening the guard of wrld. Furthermore, this utility causes an error if called on a symbol that does not name a function (the error is caused via the call to non-executablep+), or if the function is executable (i.e. :non-executable is nil, or if the function does not have an unnormalized-body (which is retrieved and unwrapped).

    Definitions and Theorems

    Function: unwrapped-nonexec-body+

    (defun
     unwrapped-nonexec-body+ (fn wrld)
     (declare (xargs :guard (and (symbolp fn) (plist-worldp wrld))))
     (let
      ((__function__ 'unwrapped-nonexec-body+))
      (declare (ignorable __function__))
      (b*
       (((unless (non-executablep fn wrld))
         (raise "The function ~x0 is executable." fn))
        (body (ubody+ fn wrld))
        ((unless body)
         (raise "The function ~x0 does not have an unnormalized body."
                fn))
        ((unless (and (throw-nonexec-error-p body fn (formals+ fn wrld))
                      (consp (cdddr body))))
         (raise
          "Internal error: ~
                    the body ~x0 of the non-executable function ~x1 ~
                    does not have the expected wrapper."
          body fn))
        (unwrapped-body (fourth body))
        ((unless (pseudo-termp unwrapped-body))
         (raise
          "Internal error: ~
                    the unwrapped body ~x0 of the non-executable function ~x1 ~
                    is not a pseudo-term."
          unwrapped-body fn)))
       unwrapped-body)))

    Theorem: pseudo-termp-of-unwrapped-nonexec-body+

    (defthm pseudo-termp-of-unwrapped-nonexec-body+
            (b* ((unwrapped-body (unwrapped-nonexec-body+ fn wrld)))
                (pseudo-termp unwrapped-body))
            :rule-classes :rewrite)