Interactive Programs and Weakly Final Coalgebras in Dependent Type Theory (Extended Version)
SASetzer, AntonHancock, Peter
SASetzer, Anton
Hancock, Peter
+2
This paper reworks the authors' earlier representation of interactive programs in dependent type theory, replacing the previous ad hoc definition with a weakly final coalgebra for a general form of polynomial functor. Two versions are given: one with a fixed interface to the real world, and one in which possible interactions may depend on the history of prior interactions, the latter suited to specifications of interactive programs. Focusing on command-response interfaces and both client and server programs, the authors provide formation, introduction, elimination, and equality rules for these coalgebras, explored along two dimensions: coiterative versus corecursive, and monadic versus non-monadic. They relate these rules to guarded induction, showing the introduction rules are a slightly restricted form of it, written via an elimination operator rather than recursive equations, since the latter break normalisation and make type checking undecidable.

Dagstuhl DROPS · 2005