• 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
          • 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
    • System-utilities-non-built-in
    • Irrelevant-formals

    Chk-irrelevant-formals-ok

    Check irrelevant-formals in definitions.

    General Form:
    
     (chk-irrelevant-formals-ok def-or-defs)

    where def-or-defs evaluates to a definition, a list of definitions, or a list of definitions preceded by mutual-recursion. Each definition must be a call of a macro in the following list: (defun defund defun-nx defund-nx defun$ defunt defun-inline defund-inline defun-notinline defund-notinline).

    Example Forms:
    
    ; Success: Returns (value t).
    (chk-irrelevant-formals-ok
     '(defun f (x0 x1 x2 x3 x4 x5)
        (declare (irrelevant x1 x3 x5 x4)
                 (xargs :guard (natp x2)))
        (if (consp x0) (f (cdr x0) x1 x2 x5 x4 x3) nil)))
    
    ; Failure: Error message reports y irrelevant for both definitions.
    (chk-irrelevant-formals-ok
     '(mutual-recursion
       (defun f1 (x y)
         (if (consp x) (f2 (cdr x) y) t))
       (defun f2 (x y)
         (if (consp x) (f1 (cdr x) y) nil))))

    See irrelevant-formals-info for a related utility that returns a single value. By contrast, chk-irrelevant-formals-ok returns an error-triple, which is (mv nil t state) when the irrelevant-formals check passes for the given definition or list of definitions, and otherwise returns a soft error as in (er soft ...). Note that all relevant declare forms, including ``irrelevant'', are taken into account. For finer-grained control of the use of declarations, see irrelevant-formals-info.