A Complementary Approach to Incorrectness Typing

📅 2025-10-15
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This paper addresses functional programs featuring atomic operations and pattern matching, proposing the first dually typed system supporting **unified verification of both correctness and incorrectness**. Methodologically, it defines types as sets of normal forms and introduces, for the first time in a type system, a **complement operator dual to co-implication** to model logical negation, thereby embedding multiple refutation principles. Subtyping is axiomatized to govern the complement operator, and bidirectional inference rules—combined with a decidable subtyping algorithm—guarantee both **soundness and completeness** with respect to normal forms. The system has been successfully applied to verify runtime errors in several Erlang-like programs. Its contributions include: (i) a theoretically grounded, bidirectional type-theoretic framework for simultaneous proof and refutation; and (ii) a practical, implementable methodology for error detection in functional programs.

Technology Category

Constraint Satisfaction and Optimization: Satisfiability Modulo TheoriesKnowledge Representation and Reasoning: Computational Complexity of ReasoningReasoning under Uncertainty: Other Foundations of Reasoning under Uncertainty

Application Category

Semantics and Knowledge: Data modeling to support human-machine intelligence, including LLMs agents, intelligent system behavior, explanations, and user-friendly interactionsSystems and Infrastructure for Web, Mobile and WoT: Experiences and lessons learnt from Web-based algorithms and system deploymentsSearch and Retrieval-Augmented AI: Vertical and domain-specific search
📝 Abstract
We introduce a new two-sided type system for verifying the correctness and incorrectness of functional programs with atoms and pattern matching. A key idea in the work is that types should range over sets of normal forms, rather than sets of values, and this allows us to define a complement operator on types that acts as a negation on typing formulas. We show that the complement allows us to derive a wide range of refutation principles within the system, including the type-theoretic analogue of co-implication, and we use them to certify that a number of Erlang-like programs go wrong. An expressive axiomatisation of the complement operator via subtyping is shown decidable, and the type system as a whole is shown to be not only sound, but also complete for normal forms.
Problem

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

Verifying program correctness and incorrectness via types
Defining complement operator as negation on typing formulas
Certifying Erlang-like programs' error behaviors through refutation
Innovation

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

Two-sided type system verifies correctness and incorrectness
Complement operator on types acts as logical negation
Decidable subtyping axiomatization ensures soundness and completeness
🔎 Similar Papers
No similar papers found.
💼 Related Jobs
No related jobs found.
C
Celia Mengyue Li
University of Bristol, UK
S
Sophie Pull
University of Bristol, UK
S
Steven Ramsay
University of Bristol, UK