Skip to main content
QUICK REVIEW

[Paper Review] Integrating Testing and Interactive Theorem Proving

Harsh Raju Chamarthi, Peter C. Dillinger|May 23, 2011
Software Testing and Debugging TechniquesComputer Science18 references7 citations
TL;DR

This paper presents a synergistic integration of random testing with interactive theorem proving in ACL2s, using the theorem prover's full power to simplify conjectures and generate targeted counterexamples. By leveraging ACL2's rewriting and type inference, the system automatically detects false conjectures early, enabling faster debugging and guiding theorem proving toward valid proofs, significantly improving usability and proof automation for both novices and experts.

ABSTRACT

Using an interactive theorem prover to reason about programs involves a sequence of interactions where the user challenges the theorem prover with conjectures. Invariably, many of the conjectures posed are in fact false, and users often spend considerable effort examining the theorem prover's output before realizing this. We present a synergistic integration of testing with theorem proving, implemented in the ACL2 Sedan (ACL2s), for automatically generating concrete counterexamples. Our method uses the full power of the theorem prover and associated libraries to simplify conjectures; this simplification can transform conjectures for which finding counterexamples is hard into conjectures where finding counterexamples is trivial. In fact, our approach even leads to better theorem proving, e.g. if testing shows that a generalization step leads to a false conjecture, we force the theorem prover to backtrack, allowing it to pursue more fruitful options that may yield a proof. The focus of the paper is on the engineering of a synergistic integration of testing with interactive theorem proving; this includes extending ACL2 with new functionality that we expect to be of general interest. We also discuss our experience in using ACL2s to teach freshman students how to reason about their programs.

Motivation & Objective

  • To address the challenge of users spending excessive time on false conjectures in interactive theorem proving.
  • To reduce the cognitive burden of debugging by automatically detecting and generating counterexamples for invalid conjectures.
  • To enhance theorem proving by using testing feedback to guide backtracking and improve proof search.
  • To develop a seamless, invisible testing layer that requires no user intervention, especially for teaching beginners.
  • To extend ACL2 with new capabilities for type inference, hint recording, and computed hints to support integrated testing.

Proposed method

  • The system uses ACL2's full rewriting and simplification engine to preprocess conjectures, transforming complex hypotheses into simpler, testable forms.
  • It integrates a data definition framework with type inference to generate random test cases that satisfy complex hypotheses.
  • Subgoal counterexamples are mapped back to original conjectures using recorded variable elision reasons and type information.
  • The framework employs computed hints to dynamically guide proof attempts, with enhancements to track variable elision and support testing-aware hint generation.
  • Testing feedback triggers theorem prover backtracking when generalizations lead to false conjectures, enabling exploration of more fruitful proof paths.
  • The system leverages existing ACL2 libraries for arithmetic and list reasoning to improve counterexample generation and proof automation.

Experimental results

Research questions

  • RQ1How can interactive theorem proving be enhanced by integrating lightweight, automatic testing to detect false conjectures early?
  • RQ2How can the full power of a theorem prover be used to simplify conjectures to make counterexample generation more effective?
  • RQ3In what ways can testing feedback improve the theorem proving process, such as by enabling backtracking from invalid generalizations?
  • RQ4How can counterexamples from subgoals be systematically mapped back to original conjectures in a complex proof context?
  • RQ5How can the integration of testing be made invisible and automatic, especially for novice users in educational settings?

Key findings

  • The ACL2s system successfully generated a counterexample for a conjecture that had stumped an ACL2 expert, revealing a missing hypothesis (a ≥ 1), which was then quickly corrected.
  • After strengthening the hypothesis to a ≥ 1, three ACL2 users provided successful proofs, and ACL2s achieved a proof using automatically included arithmetic libraries.
  • The system enabled the discovery that the bound a ≥ 3/4 is tight, as weakening it to a < 3/4 produced a counterexample.
  • The framework demonstrated that removing the hypotheses (< 0 b) and (< 0 c) was possible without invalidating the theorem, based on automatic counterexample detection.
  • The integration of testing reduced user cognitive load, as students did not need to enable or manage testing—counterexamples were generated automatically.
  • The enhancements to ACL2’s computed hint mechanism, including tracking variable elision, were essential for mapping subgoal counterexamples to original conjectures.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.