• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
        • Stobj
        • State
        • Mutual-recursion
        • Memoize
        • Mbe
        • Io
        • Defpkg
        • Apply$
          • Lambda
          • Warrant
          • Defwarrant
          • Badge
          • Lambda$
          • Tame
          • Defbadge
          • Print-cl-cache
          • Introduction-to-apply$
          • Well-formed-lambda-objectp
          • Rewriting-calls-of-apply$-ev$-and-loop$-scions
          • Mixed-mode-functions
          • Explain-giant-lambda-object
          • Gratuitous-lambda-object-restrictions
          • Scion
          • Ilk
          • Ev$
          • Translam
          • Fn-equal
          • Apply$-guard
            • L<
            • Apply$-lambda-guard
            • Apply$-userfn
            • Badge-userfn
            • Defun$
            • Apply$-lambda
          • Loop$
          • Programming-with-state
          • Arrays
          • Characters
          • Time$
          • Defmacro
          • Loop$-primer
          • Fast-alists
          • Defconst
          • 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
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Apply$

    Apply$-guard

    The guard on apply$

    The guard on (apply$ fn lst) is (apply$-guard fn lst) which is extraordinarily weak.

    Function: apply$-guard

    (defun apply$-guard (fn args)
      (declare (xargs :guard t))
      (if (atom fn)
          (true-listp args)
        (apply$-lambda-guard fn args)))

    where

    Function: apply$-lambda-guard

    (defun apply$-lambda-guard (fn args)
      (declare (xargs :guard t))
      (and (consp fn)
           (consp (cdr fn))
           (true-listp args)
           (equal (len (cadr fn)) (length args))))

    This guard is just strong enough to allow the definitions of the functions in the apply$ clique to be guard verified. It does not guarantee that fn is tame or well-formed or that args satisfy the guard of fn. The last condition is in fact impossible to state given the untyped nature of ACL2. Thus, (apply$ fn args) has to check tameness, well-formedness, guard verified, and that fn's guard is satisfied by args when the apply$ is executed in the evaluation theory.

    The issue of guards and guard verification of definitions involving apply$ is further discussed in apply$ and in verify-guards.