{"title":"用于指称语义学教学的 Coq 集合库","authors":"Qinxiang Cao, Xiwei Wu, Yalun Liang","doi":"10.4204/EPTCS.400.6","DOIUrl":null,"url":null,"abstract":"Sets and relations are very useful concepts for defining denotational semantics. In the Coq proof assistant, curried functions to Prop are used to represent sets and relations, e.g. A ->Prop, A ->B ->Prop, A ->B ->C ->Prop, etc. Further, the membership relation can be encoded by function applications, e.g. X a represents a in X if X: A ->Prop. This is very convenient for developing formal definitions and proofs for professional users, but it makes propositions more difficult to read for non-professional users, e.g. students of a program semantics course. We develop a small Coq library of sets and relations so that standard math notations can be used when teaching denotational semantics of simple imperative languages. This library is developed using Coq's type class system. It brings about zero proof-term overhead comparing with the existing formalization of sets.","PeriodicalId":30085,"journal":{"name":"Electronic Proceedings in Theoretical Computer Science","volume":"36 7","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-04-04","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"A Coq Library of Sets for Teaching Denotational Semantics\",\"authors\":\"Qinxiang Cao, Xiwei Wu, Yalun Liang\",\"doi\":\"10.4204/EPTCS.400.6\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Sets and relations are very useful concepts for defining denotational semantics. In the Coq proof assistant, curried functions to Prop are used to represent sets and relations, e.g. A ->Prop, A ->B ->Prop, A ->B ->C ->Prop, etc. Further, the membership relation can be encoded by function applications, e.g. X a represents a in X if X: A ->Prop. This is very convenient for developing formal definitions and proofs for professional users, but it makes propositions more difficult to read for non-professional users, e.g. students of a program semantics course. We develop a small Coq library of sets and relations so that standard math notations can be used when teaching denotational semantics of simple imperative languages. This library is developed using Coq's type class system. It brings about zero proof-term overhead comparing with the existing formalization of sets.\",\"PeriodicalId\":30085,\"journal\":{\"name\":\"Electronic Proceedings in Theoretical Computer Science\",\"volume\":\"36 7\",\"pages\":\"\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2024-04-04\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Electronic Proceedings in Theoretical Computer Science\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.4204/EPTCS.400.6\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q4\",\"JCRName\":\"Computer Science\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Electronic Proceedings in Theoretical Computer Science","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.4204/EPTCS.400.6","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q4","JCRName":"Computer Science","Score":null,"Total":0}
引用次数: 0
摘要
集合和关系是定义指称语义非常有用的概念。在 Coq 证明助手中,Prop 的卷曲函数用于表示集合和关系,例如 A ->Prop, A ->B ->Prop, A ->B ->C ->Prop 等。此外,成员关系也可以通过函数应用来编码,例如 X a 表示 X 中的 a,如果 X.A ->Prop:这对于为专业用户开发形式化定义和证明非常方便,但对于非专业用户,如程序语义学课程的学生来说,这使得命题更难阅读。我们开发了一个小型的集合和关系 Coq 库,以便在教授简单命令式语言的指称语义时使用标准数学符号。这个库是使用 Coq 的类型类系统开发的。与现有的集合形式化相比,它的证明期开销为零。
A Coq Library of Sets for Teaching Denotational Semantics
Sets and relations are very useful concepts for defining denotational semantics. In the Coq proof assistant, curried functions to Prop are used to represent sets and relations, e.g. A ->Prop, A ->B ->Prop, A ->B ->C ->Prop, etc. Further, the membership relation can be encoded by function applications, e.g. X a represents a in X if X: A ->Prop. This is very convenient for developing formal definitions and proofs for professional users, but it makes propositions more difficult to read for non-professional users, e.g. students of a program semantics course. We develop a small Coq library of sets and relations so that standard math notations can be used when teaching denotational semantics of simple imperative languages. This library is developed using Coq's type class system. It brings about zero proof-term overhead comparing with the existing formalization of sets.