Back to search

Chalmers University of Technology

Finding Bugs in Functional Programs using Theorem Provers

Abstract

dc:description.abstract

This thesis investigates whether automated first-order theorem provers can be efficiently used to discover bugs in Haskell programs by extracting counterexamples to incorrect program properties. To enable counterexample extraction, we present an alternative translation from Haskell programs to first-order logic that reformulates programs to purely equational first-order theories and properties to existential conjectures. The translation to the proposed encoding builds on the pre-existing Haskell → TIP → TPTP translation pipeline by introducing a sequence of transformations that preserve the semantics of the original program with the goal of making the resulting theories better suited for equational theorem provers. The approach is evaluated using the theorem provers Twee, E and Vampire on a collection of Haskell benchmarks. The results show that provers are capable of successfully extracting counterexamples to incorrect Haskell properties, and that the proposed encoding does in fact improve their performance compared with the one produced by the pre-existing translation. Among the evaluated provers, Twee consistently produced the strongest results on the proposed encoding, while E achieved the best overall performance when combined with an appropriate lexicographic path ordering that approximates goal-directed proof search. The evaluation identifies weak goal direction as the principal practical limitation of theorem-prover counterexample extraction and the resulting time inefficiency, as its main disadvantage in comparison to property-based testing. However, our work also demonstrates that theorem-prover counterexample extraction offers capabilities which property-based testing doesn’t, including the successful extraction of counterexamples to higher-order properties, ultimately making it a promising direction for future research on automated bug finding in functional programs.

Degree

thesis:*
Level thesis:degree_level
H
Department dc:contributor.department
Chalmers tekniska högskola / Institutionen för data och informationsteknik
Year dc:date.issued
2026

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Tsioka, Thaleia
Advisor dc:contributor.supervisor
  • Claessen, Koen
Committee member dc:contributor.committeemember
  • Russo, Alejandro

Rights

Language dc:language.iso
eng

Identifiers

dc:identifier.*
Dc Identifier Coursecode
DATX05

Chain of custody

source
Harvested from
Chalmers University of Technology
Base URL
odr.chalmers.se/oai/request
Last updated
2026-11-19
Source record
OAI-PMH GetRecord
related terms
citation

Tsioka, Thaleia. Finding Bugs in Functional Programs using Theorem Provers. H thesis, 2026. https://hdl.handle.net/20.500.12380/312184