Coinductive Soundness of Corecursive Type Class Resolution
Franti\v{s}ek Farka, Ekaterina Komendantskaya, and Kevin Hammond

TL;DR
This paper proves that corecursive type class resolution in Haskell is coinductively sound with respect to greatest Herbrand models, but not inductively sound, and discusses related incompleteness results.
Contribution
It establishes the coinductive soundness of corecursive type class resolution and introduces new theoretical insights into its limitations and properties.
Findings
Corecursive resolution is coinductively sound for greatest Herbrand models.
It is not inductively sound for least Herbrand models.
Incompleteness results are established for various proof system fragments.
Abstract
Horn clauses and first-order resolution are commonly used to implement type classes in Haskell. Several corecursive extensions to type class resolution have recently been proposed, with the goal of allowing (co)recursive dictionary construction where resolution does not termi- nate. This paper shows, for the first time, that corecursive type class resolution and its extensions are coinductively sound with respect to the greatest Herbrand models of logic programs and that they are induc- tively unsound with respect to the least Herbrand models. We establish incompleteness results for various fragments of the proof system.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Logic, Reasoning, and Knowledge · Formal Methods in Verification
