• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
          • Directed-untranslate
          • Include-book-paths
          • Ubi
          • Numbered-names
          • Digits-any-base
          • Context-message-pair
          • With-auto-termination
          • Make-termination-theorem
          • Theorems-about-true-list-lists
          • Checkpoint-list
          • Sublis-expr+
          • Integers-from-to
          • Prove$
          • Defthm<w
          • System-utilities-non-built-in
            • Pseudo-event-formp
            • Pseudo-event-form-listp
            • Directed-untranslate
            • Irrelevant-formals-info
            • Numbered-names
            • Context-message-pair
            • Prove$
            • Minimize-ruler-extenders
            • Paired-names
            • Orelse
            • Fresh-name-in-world-with-$s
            • Encapsulate-report-errors
            • On-failure
            • Chk-irrelevant-formals-ok
              • Named-formulas
              • Pseudo-event-landmarkp
              • All-program-fns
              • All-logic-fns
              • Trans-eval-error-triple
              • Trans-eval-state
              • Pseudo-tests-and-callsp
              • User-interface
              • Pseudo-command-landmarkp
              • Pseudo-tests-and-calls-listp
              • Pseudo-command-formp
              • Orelse*
              • Identity-macro
            • Integer-range-fix
            • Minimize-ruler-extenders
            • Add-const-to-untranslate-preprocess
            • Unsigned-byte-fix
            • Signed-byte-fix
            • Defthmr
            • Paired-names
            • Unsigned-byte-list-fix
            • Signed-byte-list-fix
            • Show-books
            • Skip-in-book
            • Typed-tuplep
            • List-utilities
            • Checkpoint-list-pretty
            • Defunt
            • Keyword-value-list-to-alist
            • Magic-macroexpand
            • Top-command-number-fn
            • Bits-as-digits-in-base-2
            • Show-checkpoint-list
            • Ubyte11s-as-digits-in-base-2048
            • Named-formulas
            • Bytes-as-digits-in-base-256
            • String-utilities
            • Make-keyword-value-list-from-keys-and-value
            • Defmacroq
            • Integer-range-listp
            • Apply-fn-if-known
            • Trans-eval-error-triple
            • Checkpoint-info-list
            • Previous-subsumer-hints
            • Fms!-lst
            • Zp-listp
            • Trans-eval-state
            • Injections
            • Doublets-to-alist
            • Theorems-about-osets
            • Typed-list-utilities
            • Message-utilities
            • Book-runes-alist
            • User-interface
            • Bits/ubyte11s-digit-grouping
            • Bits/bytes-digit-grouping
            • Subsetp-eq-linear
            • Oset-utilities
            • Strict-merge-sort-<
            • Miscellaneous-enumerations
            • Maybe-unquote
            • Thm<w
            • Defthmd<w
            • Io-utilities
          • Set
          • C
          • Soft
          • Bv
          • Imp-language
          • Ethereum
          • Event-macros
          • Java
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • 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.