• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
      • Break-rewrite
      • Proof-builder
      • Accumulated-persistence
      • Cgen
      • Forward-chaining-reports
      • Proof-tree
      • Print-gv
      • Dmr
      • With-brr-data
      • Splitter
      • Guard-debug
      • Set-debugger-enable
      • Redo-flat
      • Time-tracker
      • Set-check-invariant-risk
      • Removable-runes
      • Efficiency
      • Explain-near-miss
      • Tail-biting
      • Failed-forcing
      • Sneaky
      • Invariant-risk
      • Failure
      • Measure-debug
      • Dead-events
      • Compare-objects
      • Prettygoals
      • Remove-hyps
        • Type-prescription-debugging
        • Pstack
        • Trace
        • Set-register-invariant-risk
        • Walkabout
        • Disassemble$
        • Nil-goal
        • Cw-gstack
        • Set-guard-msg
        • Find-lemmas
        • Watch
        • Quick-and-dirty-subsumption-replacement-step
        • Profile-all
        • Profile-ACL2
        • Set-print-gv-defaults
        • Minimal-runes
        • Spacewalk
        • Try-gl-concls
        • Near-misses
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
        • Theories
        • Rule-classes
        • Proof-builder
        • Recursion-and-induction
        • Hons-and-memoization
        • Events
        • Parallelism
        • History
        • Programming
        • Operational-semantics
        • Real
        • Start-here
        • Debugging
          • Break-rewrite
          • Proof-builder
          • Accumulated-persistence
          • Cgen
          • Forward-chaining-reports
          • Proof-tree
          • Print-gv
          • Dmr
          • With-brr-data
          • Splitter
          • Guard-debug
          • Set-debugger-enable
          • Redo-flat
          • Time-tracker
          • Set-check-invariant-risk
          • Removable-runes
          • Efficiency
          • Explain-near-miss
          • Tail-biting
          • Failed-forcing
          • Sneaky
          • Invariant-risk
          • Failure
          • Measure-debug
          • Dead-events
          • Compare-objects
          • Prettygoals
          • Remove-hyps
            • Type-prescription-debugging
            • Pstack
            • Trace
            • Set-register-invariant-risk
            • Walkabout
            • Disassemble$
            • Nil-goal
            • Cw-gstack
            • Set-guard-msg
            • Find-lemmas
            • Watch
            • Quick-and-dirty-subsumption-replacement-step
            • Profile-all
            • Profile-ACL2
            • Set-print-gv-defaults
            • Minimal-runes
            • Spacewalk
            • Try-gl-concls
            • Near-misses
          • Miscellaneous
          • Output-controls
          • Macros
          • Interfacing-tools
        • Interfacing-tools
        • Hardware-verification
        • Software-verification
        • Math
        • Testing-utilities
      • Proof-automation
      • Debugging

      Remove-hyps

      Macro for defining a theorem with a minimal set of hypotheses

      For a call of defthm, defthmd, or thm, the application of remove-hyps attempts to produce a minimal set of hypotheses. For example:

      (remove-hyps
       (defthm nth-append
         (implies (and (true-listp x)
                       (natp n)
                       (true-listp y))
                  (equal (nth n (append x y))
                         (if (< n (len x))
                             (nth n x)
                           (nth (- n (len x)) y))))
         :rule-classes nil))

      generates:

      (DEFTHM NTH-APPEND
        (IMPLIES (NATP N)
                 (EQUAL (NTH N (APPEND X Y))
                        (IF (< N (LEN X))
                            (NTH N X)
                          (NTH (- N (LEN X)) Y))))
        :RULE-CLASSES NIL)

      Note however that remove-hyps works by removing one hypothesis at a time, with each resulting proof attempt made using a limited number of steps (see with-prover-step-limit) that depends on the number of steps taken before removing the hypothesis. So if the removal of a hypothesis requires a proof that takes sufficiently many more steps than the original proof, or if two or more hypotheses must be removed together for the proof to succeed with fewer hypotheses, then the result will not have a minimal set of hypotheses.

      Acceptable forms are as follows, where HYP can be a conjunction of hypotheses, (and HYP1 ... HYPn), and ``defthm NAME'' may be replaced by ``defthmd NAME'' or ``THM''.

      (defthm NAME (implies HYP CONCL) ...)
      (defthm NAME CONCL ...)
      (defthm NAME (let ... (implies HYP CONCL)) ...)
      (defthm NAME (let ... CONCL) ...)
      (defthm NAME (let* ... (implies HYP CONCL)) ...)
      (defthm NAME (let* ... CONCL) ...)

      Normally, before using remove-hyps, one succesfully submits the given call of defthm, defthmd, or thm. Thus by default, remove-hyps evaluates silently. To see output from proof attempts, add a non-nil optional argument. For example, for event E, use (remove-hyps E t).

      Unless there is an error (for example, due to malformed input), then in the case of a call of thm, the value returned is the keyword, :REMOVE-HYPS-COMPLETED; otherwise, the value returned is the name of the theorem. (Technically, the value returned is an error triple with such a value; see error-triple.)

      Consider the case that a call of remove-hyps is made in a context where proofs are normally skipped (see ld-skip-proofsp). If this happens while including a certified book with include-book, then proofs will indeed be skipped, because the earlier result of this remove-hyps call was saved in the book's certificate. But otherwise, the tool temporarily turns off the skipping of proofs (that is, restores the act of doing proofs) while it tries to remove hypotheses, to avoid the undesirable situation that all hypotheses are removed merely because all proofs succeed when skipping proofs.

      Finally, note that when remove-hyps is applied to a call of defthm or defthmd, then remove-hyps will conclude by submitting the generated event to ACL2. But since thm does not modify the logical world, remove-hyps does not perform an extra such call at the end for calls of thm.