• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
        • Defun
        • Declare
        • System-utilities
          • Saving-event-data
          • Trans-eval
          • 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
            • Get-event-data
            • Untranslate
            • Constraint-info
          • Stobj
          • State
          • Mutual-recursion
          • Memoize
          • Mbe
          • Io
          • Defpkg
          • Apply$
          • Loop$
          • Programming-with-state
          • Arrays
          • Characters
          • Time$
          • Defconst
          • Fast-alists
          • Defmacro
          • Loop$-primer
          • Evaluation
          • Guard
          • Equality-variants
          • Compilation
          • Hons
          • ACL2-built-ins
          • Developers-guide
          • System-attachments
          • Advanced-features
          • Set-check-invariant-risk
          • Numbers
          • Efficiency
          • Irrelevant-formals
          • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
          • Redefining-programs
          • Lists
          • Invariant-risk
          • Errors
          • Defabbrev
          • Conses
          • Alists
          • Set-register-invariant-risk
          • Strings
          • Program-wrapper
          • Get-internal-time
          • Basics
          • Packages
          • Oracle-eval
          • Defmacro-untouchable
          • <<
          • Primitive
          • Revert-world
          • Unmemoize
          • Set-duplicate-keys-action
          • Symbols
          • Def-list-constructor
          • Easy-simplify-term
          • Defiteration
          • Fake-oracle-eval
          • Defopen
          • Sleep
        • Operational-semantics
        • Real
        • Start-here
        • Miscellaneous
        • Output-controls
        • Bdd
        • Macros
        • Installation
        • Mailing-lists
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • 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.