• 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

    Guard-theorem-no-simplify$

    A logic-mode guard-verified version of guard-theorem-no-simplify.

    Signature
    (guard-theorem-no-simplify$ fn guard-debug safe-mode gc-off state) 
      → 
    term
    Arguments
    fn — Guard (symbolp fn).
    Returns
    term — Type (pseudo-termp term).

    This has a stronger guard than guard-theorem-no-simplify and always returns a pseudo-term (if it does not cause an error). We use magic-ev-fncall to call guard-theorem-no-simplify, and check that the result is a pseudo-term. Hard errors happening in guard-theorem are not suppressed, i.e. cause guard-theorem$ to stop with those hard errors. If magic-ev-fncall fails, or if the result is not a pseudo-term, we also stop with hard errors.

    Compared to guard-theorem-no-simplify, this utility requires a state argument. It may also be slightly less efficient due the magic-ev-fncall overhead. However, it can be used in logic-mode guard-verified code that follows a statically typed discipline.

    Definitions and Theorems

    Function: guard-theorem-no-simplify$

    (defun guard-theorem-no-simplify$
           (fn guard-debug safe-mode gc-off state)
           (declare (xargs :stobjs (state)))
           (declare (xargs :guard (symbolp fn)))
           (let ((__function__ 'guard-theorem-no-simplify$))
                (declare (ignorable __function__))
                (b* (((mv erp term)
                      (magic-ev-fncall 'guard-theorem-no-simplify
                                       (list fn guard-debug (w state)
                                             safe-mode gc-off)
                                       state nil t))
                     ((when erp)
                      (raise "Internal error: ~@0" term))
                     ((unless (pseudo-termp term))
                      (raise "Internal error: ~x0 is not a pseudo-term."
                             term)))
                    term)))

    Theorem: pseudo-termp-of-guard-theorem-no-simplify$

    (defthm pseudo-termp-of-guard-theorem-no-simplify$
            (b* ((term (guard-theorem-no-simplify$
                            fn guard-debug safe-mode gc-off state)))
                (pseudo-termp term))
            :rule-classes :rewrite)