{"title":"Monads, Partial Evaluations, and Rewriting","authors":"Tobias Fritz, Paolo Perrone","doi":"10.1016/j.entcs.2020.09.007","DOIUrl":null,"url":null,"abstract":"<div><p>Monads can be interpreted as encoding formal expressions, or formal operations in the sense of universal algebra. We give a construction which formalizes the idea of “evaluating an expression partially”: for example, “2+3” can be obtained as a partial evaluation of “2+2+1”. This construction can be given for any monad, and it is linked to the famous <em>bar construction</em> [Saunders Mac Lane, Categories for the Working Mathematician, Springer, 2000, VII.6], of which it gives an operational interpretation: the bar construction is a simplicial set, and its 1-cells are partial evaluations.</p><p>We study the properties of partial evaluations for general monads. We prove that whenever the monad is weakly cartesian, partial evaluations can be composed via the usual Kan filler property of simplicial sets, of which we give an interpretation in terms of substitution of terms.</p><p>For the case of probability monads, partial evaluations correspond to what probabilists call <em>conditional expectation</em> of random variables, and partial evaluation relation is known as <em>second-order stochastic dominance</em>.</p><p>In terms of rewritings, partial evaluations give an abstract reduction system which is reflexive, confluent, and transitive whenever the monad is weakly cartesian. This manuscript is part of a work in progress on a general rewriting interpretation of the bar construction.</p></div>","PeriodicalId":38770,"journal":{"name":"Electronic Notes in Theoretical Computer Science","volume":"352 ","pages":"Pages 129-148"},"PeriodicalIF":0.0000,"publicationDate":"2020-10-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/j.entcs.2020.09.007","citationCount":"7","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Electronic Notes in Theoretical Computer Science","FirstCategoryId":"1085","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S1571066120300530","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"Computer Science","Score":null,"Total":0}
引用次数: 7
Abstract
Monads can be interpreted as encoding formal expressions, or formal operations in the sense of universal algebra. We give a construction which formalizes the idea of “evaluating an expression partially”: for example, “2+3” can be obtained as a partial evaluation of “2+2+1”. This construction can be given for any monad, and it is linked to the famous bar construction [Saunders Mac Lane, Categories for the Working Mathematician, Springer, 2000, VII.6], of which it gives an operational interpretation: the bar construction is a simplicial set, and its 1-cells are partial evaluations.
We study the properties of partial evaluations for general monads. We prove that whenever the monad is weakly cartesian, partial evaluations can be composed via the usual Kan filler property of simplicial sets, of which we give an interpretation in terms of substitution of terms.
For the case of probability monads, partial evaluations correspond to what probabilists call conditional expectation of random variables, and partial evaluation relation is known as second-order stochastic dominance.
In terms of rewritings, partial evaluations give an abstract reduction system which is reflexive, confluent, and transitive whenever the monad is weakly cartesian. This manuscript is part of a work in progress on a general rewriting interpretation of the bar construction.
单子可以被解释为编码形式表达式,或者通用代数意义上的形式运算。我们给出了一个形式化“部分求值”概念的构造:例如,“2+3”可以作为“2+2+1”的部分求值得到。这种结构可以给出任何单子,它与著名的条形结构相关联[Saunders Mac Lane, Categories for the Working数学家,Springer, 2000, VII.6],它给出了一个操作解释:条形结构是一个简单集合,它的1单元是部分评估。研究了一般单子的部分求值的性质。证明了只要单子是弱笛卡儿的,就可以利用简单集的一般Kan填充性质来组成部分求值,并给出了项的替换解释。对于概率单子的情况,偏评价对应于概率学家所说的随机变量的条件期望,偏评价关系被称为二阶随机优势。在重写方面,部分求值给出了一个抽象约简系统,当单子是弱笛卡儿时,它是自反的、汇合的和传递的。这份手稿是一项正在进行的对酒吧结构的一般重写解释的工作的一部分。
期刊介绍:
ENTCS is a venue for the rapid electronic publication of the proceedings of conferences, of lecture notes, monographs and other similar material for which quick publication and the availability on the electronic media is appropriate. Organizers of conferences whose proceedings appear in ENTCS, and authors of other material appearing as a volume in the series are allowed to make hard copies of the relevant volume for limited distribution. For example, conference proceedings may be distributed to participants at the meeting, and lecture notes can be distributed to those taking a course based on the material in the volume.