• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
      • Break-rewrite
      • Proof-builder
      • Accumulated-persistence
      • Cgen
        • Defdata
        • Test?
        • ACL2s-defaults
        • Prove/cgen
          • Register-type
          • With-timeout
          • Defdata-attach
          • Testing-enabled
          • Defdata-aliasing-enabled
          • Cgen-single-test-timeout
          • Verbosity-level
          • Search-strategy
          • Num-print-counterexamples
          • Cgen-timeout
          • Cgen-local-timeout
          • Num-witnesses
          • Num-trials
          • Num-print-witnesses
          • Test-then-skip-proofs
          • Sampling-method
          • Recursively-fix
          • Num-counterexamples
          • Backtrack-limit
          • Print-cgen-summary
          • Cgen::flush
          • Backtrack-bad-generalizations
          • Use-fixers
          • Thm-no-test
          • Defthmd-no-test
          • Defthm-no-test
        • 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
            • Defdata
            • Test?
            • ACL2s-defaults
            • Prove/cgen
              • Register-type
              • With-timeout
              • Defdata-attach
              • Testing-enabled
              • Defdata-aliasing-enabled
              • Cgen-single-test-timeout
              • Verbosity-level
              • Search-strategy
              • Num-print-counterexamples
              • Cgen-timeout
              • Cgen-local-timeout
              • Num-witnesses
              • Num-trials
              • Num-print-witnesses
              • Test-then-skip-proofs
              • Sampling-method
              • Recursively-fix
              • Num-counterexamples
              • Backtrack-limit
              • Print-cgen-summary
              • Cgen::flush
              • Backtrack-bad-generalizations
              • Use-fixers
              • Thm-no-test
              • Defthmd-no-test
              • Defthm-no-test
            • 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
      • Cgen

      Prove/cgen

      top-level API function for Cgen/testing.

      Introduction

      This is the main API function to test/check a form for counterexamples with the full power of prove (and hints), i.e. prove/cgen actually calls prove as a subfunction. You can accomplish the same thing using thm, defthm with the acl2s defaults parameter testing-enabled set to T, but this function gives the user/caller more control: the user is responsible to pass cgen-state (use make-cgen-state to construct one), that provides the context for cgen/testing; the results and statistics summarizing Cgen/testing are collected in cgen-state and this is returned to the caller.

      General Form:

      (prove/cgen form hints cgen-state state) => (mv erp cgen-state state)

      The erp part of result is nil, if call to prove was successful, it is :falsifiable if there is at least one counterexample (not necessarily top-level), it is t if there was a error in trans-eval call of prove (usually a hard/raw lisp error), it is :? otherwise, which points out that we could neither prove nor disprove the conjecture under consideration

      Example

      For an example of the use of prove/cgen, you can study the implementation of the test? macro itself found in cgen/top.lisp. To see the structure of cgen-state, you can study the print-testing-summary-fn function which deconstructs it and prints its information in a human-readable form.