• 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
        • 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
          • Macro-keyword-args
          • Macro-keyword-args+
          • Macro-required-args
          • Macro-required-args+
          • Macro-args+
          • 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/macro-queries

    Macro-args+

    Enhanced variant of macro-args.

    Signature
    (macro-args+ mac wrld) → result
    Arguments
    mac — Guard (symbolp mac).
    wrld — Guard (plist-worldp wrld).
    Returns
    result — Type (true-listp result).

    This returns the same result as macro-args, but it has 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. Furthermore, this utility causes an error if called on a symbol that does not name a macro.

    Definitions and Theorems

    Function: macro-args+

    (defun
     macro-args+ (mac wrld)
     (declare (xargs :guard (and (symbolp mac)
                                 (plist-worldp wrld))))
     (let
      ((__function__ 'macro-args+))
      (declare (ignorable __function__))
      (if
       (not (macro-symbolp mac wrld))
       (raise "The symbol ~x0 does not name a macro."
              mac)
       (b*
        ((result (macro-args mac wrld)))
        (if
         (true-listp result)
         result
         (raise
          "Internal error: ~
                    the MACRO-ARGS property ~x0 of ~x1 is not a true list."
          result mac))))))

    Theorem: true-listp-of-macro-args+

    (defthm true-listp-of-macro-args+
            (b* ((result (macro-args+ mac wrld)))
                (true-listp result))
            :rule-classes :rewrite)