Abstract
This work investigates three notions of program equivalence for a higher-order functional language with recursion and general algebraic effects, in which programs are written in continuation-passing style. Our main contribution is the following: we define a logic whose formulas express program properties and show that, under certain conditions which we identify, the induced program equivalence coincides with a contextual equivalence. Moreover, we show that this logical equivalence also coincides with an applicative bisimilarity. We exemplify our general results with the nondeterminism, probabilistic choice, global store and I/O effects.
Highlights
Logic is a fundamental tool for specifying the behaviour of programs
We have studied program equivalence for a higher-order continuation-passing style (CPS) language with general algebraic effects and general recursion
Our main contribution is a logic F of program properties (Sect. 3) whose induced program equivalence coincides with contextual equivalence
Summary
Logic is a fundamental tool for specifying the behaviour of programs. A general approach is to consider that a logical formula φ encodes a program property, and the satisfaction relation of the logic, t |= φ, asserts that program t enjoys property φ. We aim to find a logic describing general algebraic effects, and to compare it to existing notions of program equivalence. Program equivalence for general algebraic effects has been studied by Johann, Simpson and Voigtlander [17] who define a notion of contextual equivalence and a corresponding logical relation. Call-by-value setting, Simpson and Voorneveld [38] propose a modal logic for effectful programs whose induced program equivalence coincides with applicative bisimilarity, but not with contextual equivalence Dal Lago, Gavazzo and Tanaka [8] propose a notion of applicative similarity that coincides with contextual equivalence for an untyped, call-by-name effectful calculus These papers provide the main starting point for our work. Our goal is to find a logic of program properties which characterizes contextual equivalence for a higher-order language with algebraic effects. Proofs are omitted but they can be found in [21]
Talk to us
Join us for a 30 min session where you can share your feedback and ask us any queries you have