• 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
          • Xargs
            • Guard
              • Verify-guards
              • Mbe
              • Set-guard-checking
              • Ec-call
              • Print-gv
              • The
              • Guards-and-evaluation
              • Guard-debug
              • Set-check-invariant-risk
              • Guard-evaluation-table
              • Guard-evaluation-examples-log
              • Guard-example
              • Defthmg
              • Invariant-risk
              • With-guard-checking
              • Guard-miscellany
              • Guard-holders
              • Guard-formula-utilities
                • Guard-simplification
                • Guard-obligation
                • Gthm
                • Verify-guards-formula
                • Guard-theorem-example
                • Guard-theorem
                  • ACL2-pc::prove-guard
                    • Guard-theorem-example
                  • Verify-guard-implication
                • Set-verify-guards-eagerness
                • Guard-quick-reference
                • Set-register-invariant-risk
                • Guards-for-specification
                • Guard-evaluation-examples-script
                • Guard-introduction
                • Program-only
                • Non-exec
                • Set-guard-msg
                • Safe-mode
                • Set-print-gv-defaults
                • Guard-theorem-example
                • With-guard-checking-event
                • With-guard-checking-error-triple
                • Guard-checking-inhibited
                • Extra-info
              • Otf-flg
              • Normalize
            • Type-spec
            • Declare-stobjs
            • Set-ignore-ok
            • Set-irrelevant-formals-ok
          • System-utilities
          • Stobj
          • State
          • Mutual-recursion
          • Memoize
          • Mbe
          • Io
          • Defpkg
          • Apply$
          • Loop$
          • Programming-with-state
          • Arrays
          • Characters
          • Time$
          • Defmacro
          • Loop$-primer
          • Fast-alists
          • Defconst
          • Evaluation
          • Guard
            • Verify-guards
            • Mbe
            • Set-guard-checking
            • Ec-call
            • Print-gv
            • The
            • Guards-and-evaluation
            • Guard-debug
            • Set-check-invariant-risk
            • Guard-evaluation-table
            • Guard-evaluation-examples-log
            • Guard-example
            • Defthmg
            • Invariant-risk
            • With-guard-checking
            • Guard-miscellany
            • Guard-holders
            • Guard-formula-utilities
              • Guard-simplification
              • Guard-obligation
              • Gthm
              • Verify-guards-formula
              • Guard-theorem-example
              • Guard-theorem
                • ACL2-pc::prove-guard
                  • Guard-theorem-example
                • Verify-guard-implication
              • Set-verify-guards-eagerness
              • Guard-quick-reference
              • Set-register-invariant-risk
              • Guards-for-specification
              • Guard-evaluation-examples-script
              • Guard-introduction
              • Program-only
              • Non-exec
              • Set-guard-msg
              • Safe-mode
              • Set-print-gv-defaults
              • Guard-theorem-example
              • With-guard-checking-event
              • With-guard-checking-error-triple
              • Guard-checking-inhibited
              • Extra-info
            • 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
      • Proof-builder-commands
      • Verify-guards
      • Guard-theorem

      ACL2-pc::prove-guard

      (macro) Verify guards efficiently by using a previous guard theorem.

      Example:
      (prove-guard f1 (disable h))
      
      Example of typical usage:
      (defun f2 (x)
        (declare
         (xargs :guard
                (g x)
                :guard-hints
                (("Goal"
                  :instructions
                  ((prove-guard f1
                                (disable h)))))))
        (f2-body x))
      
      General Forms:
      (prove-guard fn)
      (prove-guard fn thy)
      (prove-guard fn thy alt-thy)
      (prove-guard fn thy alt-thy verbose)

      where fn is a known function symbol and thy and alt-thy, when supplied and non-nil, are theory expressions.

      This proof-builder macro attempts to prove a theorem, typically a guard proof obligation, by applying the hint :guard-theorem fn in a carefully controlled, efficient manner (using the :fancy-use proof-builder macro). This proof is attempted in the theory, thy, if supplied and non-nil, else in the current-theory. If that proof fails, then a single, ordinary prover call is made with that :use hint and in the following theory: alt-thy if supplied and non-nil, else thy if supplied and non-nil, else the current-theory. If the proof has not yet succeeded and the original theory is not nil or (current-theory :here), then a final proof is attempted in the same careful manner as the first proof attempt.

      Output is inhibited by default. However, if verbose is t then output is as specified by the enclosing environment; and if verbose is any other non-nil value, then output is mostly inhibited for that attempt by use of the proof-builder command, :quiet. In all of those non-nil cases for the verbose input, a little message will be started at the beginning of the second and third proof attempts, if any.

      For a few small examples, see community book kestrel/utilities/proof-builder-macros-tests.lisp.

      For a way to use lemma instances other than guard theorems, see ACL2-pc::fancy-use.

      Hacker tip: Invoke (trace$ acl2::pc-fancy-use-fn) to see the proof-builder instruction created when invoking prove-guard.