• 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
                  • 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
                • 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
      • Guard-formula-utilities

      Guard-simplification

      Levels of simplification for guard proof obligations

      ACL2 provides several features for obtaining the proof obligations generated for guard verification. Each of these features can be invoked with an argument that controls the level of simplification to be applied before returning those proof obligations. This topic examines those simplification levels. It starts by splitting the features into two groups; then continues by explaining the three levels of simplification; and finally, makes the key point that one group allows the top two levels of simplification and the other group allows the bottom two levels.

      These features can be partitioned into two groups, which we reference below as the ``AT'' and ``AFTER'' groups, as follows. These correspond respectively to the two groups discussed in the documentation topic, guard-formula-utilities, for capturing formulas produced either during guard verification or when a :guard-theorem is supplied for a :use hint.

      • Simplification AT guard-verification time:
        • the xargs keyword :guard-simplify,
        • the guard-obligation utility, and
        • the verify-guards-formula utility.
      • Simplification AFTER guard-verification time:
        • the :gthm utility, and
        • the :guard-theorem lemma-instance (and related low-level utility, guard-theorem.

      Each feature above has an argument (possibly optional) that controls the level of simplification. Each such argument can take any of three values, as follows. But NOTE: T and :LIMITED are the only legal values for the “AT” (first) group, and :LIMITED and NIL are the only legal values for the “AFTER'' (second) group.

      • T:
        Full simplification, which is the default behavior for verify-guards
      • :LIMITED:
        Reduced simplification, skipping simplifications that depend on the set of currently enabled rules
      • NIL:
        No simplification

      The key point of this topic is the following specification of the values allowed for the simplification argument, for the features in each group. For features in the AT group, T and :LIMITED are the legal values. For features in the AFTER group, :LIMITED and NIL are the legal levels. Let's see why this is reasonable and discuss whether the missing value for each group might be allowed in the future.

      First consider the AFTER group. A :guard-theorem :use hint obtains the guard theorem proved for a previously guard-verified function. The current-theory at the time of that :use hint may be very different from what it was at guard-verification time. Thus, when processing that hint it would be misleading to allow the current theory to participate in simplification that produces the guard theorem, since the result could be very different from the guard theorem generated during the earlier guard verification. That is why the value T is not allowed for the simplification argument of a :guard-theorem hint. Instead, the default is :LIMITED. The gthm utility provides a way to show the formula that would be provided by a :guard-theorem lemma instance, so gthm also disallows T, and its default is also :LIMITED. Note that the utility verify-guards-formula is more appropriate than gthm to view the formula to be proved if one is about to verify guards for a function. (If gthm were to be used for that purpose too, then T might be allowed as a simplification argument; but that could lead to confusion, in particular about the default.)

      Now consider the AT group, which relates to guard verification. T is a reasonable default: it is generally useful to maximize simplification while generating the guard theorem before attempting its proof. But one may prefer more control, by avoiding simplification until the proof is attempted. :LIMITED has proved to be a good compromise: it limits simplification to basic operations, in particular avoiding goals that are subsumed by other goals or are instances of trivial built-in-clause rules. If the need arises to support NIL as a simplification value, perhaps ACL2 will change to support that.