Template-based Theory Exploration: Discovering Properties of Functional Programs by Testing
Paper in proceeding, 2020

We present RoughSpec, a template-based extension of the theory exploration tool QuickSpec. QuickSpec uses testing to automatically discover equational properties about functions in a Haskell program. These properties can help the user understand the program or be used as a source of possible lemmas in proofs of the program's correctness. In RoughSpec, the user supplies templates, which describe families of laws such as associativity and distributivity, and we only consider properties that match the templates. This restriction limits the search space and ensures that only relevant properties are discovered. In this way, we sacrifice broad search for more direction towards desirable property patterns, which makes theory exploration tractable and scalable. We also combine RoughSpec with QuickSpec, using QuickSpec to perform a complete search for smaller term sizes, while using templates for larger, more complex properties, in order to leverage the strengths of both systems.

Theory exploration

Program understanding

Algebraic properties

Property-based testing

QuickSpec

Functional programming

Author

Sólrún Einarsdóttir

Chalmers, Computer Science and Engineering (Chalmers), Functional Programming

Nicholas Smallbone

Chalmers, Computer Science and Engineering (Chalmers), Functional Programming

Moa Johansson

Chalmers, Computer Science and Engineering (Chalmers), Formal methods

ACM International Conference Proceeding Series

67-78
9781450389631 (ISBN)

32nd Symposium on Implementation and Application of Functional Languages, IFL 2020
Virtual, Online, United Kingdom,

Subject Categories

Computer Science

Computer Systems

Mathematical Analysis

DOI

10.1145/3462172.3462192

More information

Latest update

5/19/2022