A Diagrammatic Algebra for Program Logics
Filippo Bonchi, Alessandro Di Giorgio, Elena Di Lavore

TL;DR
This paper introduces a diagrammatic algebra using tape diagrams extended with traces to model iteration in imperative programming, providing a proof system comparable to Hoare logic.
Contribution
It develops Kleene-Cartesian bicategories combining rig categories with trace structures, enabling diagrammatic reasoning about imperative programs.
Findings
Tape diagrams extended with traces effectively model program iteration.
The resulting proof system matches the power of Hoare logic.
The algebraic framework offers a visual and formal approach to program verification.
Abstract
Tape diagrams provide a convenient notation for arrows of rig categories, i.e., categories equipped with two monoidal products, and , where distributes over . In this work, we extend tape diagrams with traces over in order to deal with iteration in imperative programming languages. More precisely, we introduce Kleene-Cartesian bicategories, namely rig categories where the monoidal structure provided by is a cartesian bicategory, while the one provided by is what we name a Kleene bicategory. We show that the associated language of tape diagrams is expressive enough to deal with imperative programs and the corresponding laws provide a proof system that is at least as powerful as the one of Hoare logic.
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
