Free monads (and their variants) have become a popular general-purpose tool for representing the semantics of effectful programs in proof assistants. These data structures support the compositional definition of semantics parameterized by uninterpreted events, while admitting a rich equational theory of equivalence. But monads are not the only way to structure effectful computation, why should we limit ourselves? In this paper, inspired by applicative functors, selective functors, and other structures, we define a collection of data structures and theories, which we call program adverbs, that capture a variety of computational patterns. Program adverbs are themselves composable, allowing them to be used to specify the semantics of languages with multiple computation patterns. We use program adverbs as the basis for a new class of semantic embeddings called Tl\"on embeddings. Compared with embeddings based on free monads, Tl\"on embeddings allow more flexibility in computational modeling of effects, while retaining more information about the program's syntactic structure.
翻译:自由月球( 及其变体) 已成为一种常用的通用工具, 用于在证明助理中代表有效程序的语义。 这些数据结构支持未经解释的事件参数的构成定义, 同时接受丰富的等式理论。 但是, 月球并不是构建有效计算的唯一方法, 为什么我们应该限制自己? 在本文中, 我们定义了一组数据结构和理论, 我们称之为程序动词, 捕捉各种计算模式。 程序动词本身可以兼容, 允许它们用于指定多种计算模式的语言的语义。 我们使用程序动词作为新的语义嵌入类别的基础, 叫做 Tl\ “ 嵌入 。 与基于免费 monads 的嵌入相比, Tl\ “ 嵌入” 允许在计算效果模型中有更多的灵活性, 同时保留关于程序合成结构的更多信息 。