• 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
      • Operational-semantics
      • Real
      • Start-here
        • Gentle-introduction-to-ACL2-programming
        • ACL2-tutorial
          • Introduction-to-the-theorem-prover
          • Pages Written Especially for the Tours
          • The-method
          • Advanced-features
          • Interesting-applications
          • Tips
          • Alternative-introduction
          • Tidbits
          • Annotated-ACL2-scripts
          • Startup
          • ACL2-as-standalone-program
          • ACL2-sedan
            • Defunc
            • 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
              • Ccg
              • Defdata
              • ACL2s-user-guide
              • ACL2s-tutorial
              • ACL2s-implementation-notes
              • Match
              • ACL2s-faq
              • ACL2s-intro
              • ACL2s-defaults
              • Definec
              • ACL2s-utilities
              • ACL2s-interface
              • ACL2s-installation
            • Talks
            • Nqthm-to-ACL2
            • Emacs
          • About-ACL2
        • Debugging
        • 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.