From Traces to Program Incorrectness: A Type-Theoretic Approach

📅 2025-09-02
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This paper addresses the challenge of systematically detecting incorrect behaviors when functional programs interact with effectful library APIs. Methodologically, it introduces a trace-based type-theoretic framework that models API call sequences using symbolic regular expressions and performs compositional trace analysis via symbolic finite automata; it further designs a type inference algorithm for under-approximating erroneous behaviors of abstract data types (ADTs). Key contributions include: (i) the first trace-directed, systematic under-approximation technique for specifying incorrectness, (ii) support for modeling error propagation across function boundaries, and (iii) effective inference—within effectful library interaction contexts—of subsets of erroneous behaviors potentially triggered by ADT implementations. Empirical evaluation validates the feasibility and practicality of this compositional incorrectness analysis approach.

Technology Category

Application Category

📝 Abstract
We present a type-theoretic framework for reasoning about incorrectness in functional programs that interact with effectful, opaque library APIs. Our approach centers on traces -- temporally-ordered sequences of library API invocations -- which naturally characterize both the preconditions of individual APIs and their composite behavior. We represent these traces using symbolic regular expressions (SREs), enabling formal specification of incorrect abstract data type (ADT) behaviors across function boundaries. The core contribution is a novel type inference algorithm that operates modulo specified incorrectness properties and leverages the symbolic finite automata (SFAs) representations of regexes for compositional reasoning of traces. When the algorithm succeeds, the inferred types witness that an ADT implementation can exhibit some subset of the specified incorrect behaviors. This represents the first systematic approach to underapproximate reasoning against trace-based incorrectness specifications, enabling a new form of trace-guided compositional analysis.
Problem

Research questions and friction points this paper is trying to address.

Reasoning about incorrectness in functional programs with opaque APIs
Formal specification of incorrect abstract data type behaviors
Underapproximate reasoning against trace-based incorrectness specifications
Innovation

Methods, ideas, or system contributions that make the work stand out.

Type-theoretic framework for incorrectness reasoning
Symbolic regular expressions for trace specification
Type inference algorithm with SFA representations
🔎 Similar Papers
No similar papers found.