Intrinsically Correct Sorting in Cubical Agda
Cass Alexandru, Vikraman Choudhury, Jurriaan Rot, Niels van, der Weide

TL;DR
This paper extends bialgebraic semantics-based sorting algorithms to cubical Agda by indexing data types with multisets, ensuring intrinsic correctness through the distributive law.
Contribution
It introduces an approach to define intrinsically correct sorting algorithms in cubical Agda using indexed data types and bialgebraic semantics.
Findings
Correctness of sorting algorithms is derived from the distributive law.
Indexed data types by multisets effectively capture termination and correctness.
Extension of bialgebraic semantics to the cubical Agda setting.
Abstract
The paper "Sorting with Bialgebras and Distributive Laws" by Hinze et al. uses the framework of bialgebraic semantics to define sorting algorithms. From distributive laws between functors they construct pairs of sorting algorithms using both folds and unfolds. Pairs of sorting algorithms arising this way include insertion/selection sort and quick/tree sort. We extend this work to define intrinsically correct variants in cubical Agda. Our key idea is to index our data types by multisets, which concisely captures that a sorting algorithm terminates with an ordered permutation of its input list. By lifting bialgebraic semantics to the indexed setting, we obtain the correctness of sorting algorithms purely from the distributive law.
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.
