- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Inductively Defined Data Concrete and Abstract syntax电感定义的数据具体和抽象语法
Inductively Defined DataConcrete and Abstract syntax Karl Lieberherr Don’t believe the words Concrete syntax may be more abstract than abstract syntax!!! Both Abstract and Concrete Exp ::= Identifier var-exp (id) ::= “(lambda” “(“Identifier”)” Exp”)” lambda-exp (id body) ::= “(“ Exp “(“ Exp “)” “)” app-exp (rator rand) Both Abstract and Concrete Exp ::= Id var-exp (id) ::= “(lambda” “(“ Id ”)” Exp ”)” lambda-exp (id body) ::= “(“ Exp “(“ Exp “)” “)” app-exp (rator rand) (define-datatype Exp Exp? (var-exp (id Id?)) (lambda-exp (id Id?) (body Exp?)) (app-exp (rator Exp?) (rand Exp?))) Represent Id as symbol Exp ::= Id var-exp (id) ::= “(lambda” “(“ Id ”)” Exp ”)” lambda-exp (id body) ::= “(“ Exp “(“ Exp “)” “)” app-exp (rator rand) (define-datatype Exp Exp? (var-exp (id symbol?)) (lambda-exp (id symbol?) (body Exp?)) (app-exp (rator Exp?) (rand Exp?))) cases (define occurs-free? (lambda (var exp) (cases Exp e (var-exp (id) (eqv? id var)) (lambda-exp (id body) and (not (eqv? id var)) (occurs-free? var body))) (app-exp (rator rand) (or … )))))) Exercises for define-datatype Arithmetic expressions ( * (+ 3 5) 7) two arguments only include evaluator Nested containers Exercise: Test data type Contains in first a Lambda expression lambda-exp and in second an Application app-exp. Would like something like: (define-struct Test ( first ;; type lambda-exp second ;; type app-exp ) but with the dynamic checking benefit of define-datatype. Better Way: variants are first class Exp ::= Id var-exp (id) ::= “(lambda” “(“ Id ”)” Exp ”)” lambda-exp (id body) ::= “(“ Exp “(“ Exp “)” “)” app-exp (rator rand) (define-datatype Exp Exp? (var-exp (id symbol?)) (lambda-exp (id sym
您可能关注的文档
- Fernand Van Gansbeke, Director DG Enforcement and Mediation弗尔南多范gansbeke,导演DG执法和调解.ppt
- Field Day at W3AO Potomac Valley RC & Columbia ARA一天在波托马克河谷场w3ao哥伦比亚ARA RC &;.ppt
- Fibroblast Growth Factor 3 (FGF3) int-2 Brandon Williams成纤维细胞生长因子3(FGF3)int-2布兰登威廉姆斯.ppt
- Fiduciary Funds - The University of Tennessee at Martin - http 信托基金-田纳西大学马丁- HTTP.ppt
- Field Effect Transistors (FETs)场效应晶体管(FET).ppt
- Fiber Optics Communications光纤通信.ppt
- Field Emission Display Screen场发射显示器.ppt
- FIELD EMISSION DISPLAY场发射显示器.ppt
- Fibroblast Growth Factors (FGFs) - The University of North 成纤维细胞生长因子(FGF)的北卡罗来纳大学.ppt
- Field Emission Measurements From Cesiated Titanium and 从cesiated钛场发射测量.ppt
- Individual Tests of Intelligence - Instruct Uwo个人的智力测试-指导二.ppt
- Individual Incentive Plans个人激励计划.ppt
- Inferential Confidence Intervals and Equivalence Testing推理的置信区间和等价测试.ppt
- Information in the Digital Domain - Furman Engaged Learning at 在数字域信息弗曼从事学习.ppt
- Informationist and Expert Searcher Critical New Roles for Health 专家搜索信息学家和健康至关重要的新角色.ppt
- Inhibition of Experimental Corneal Neovascularization by 实验性角膜新生血管的抑制作用.ppt
- Information Literacy at AUC The Future Flexibility, Technology 在AUC未来的灵活性,信息素养,技术.ppt
- Inflation & Aggregate Supply - homemanhattanedu通货膨胀&;总供给- homemanhattanedu.ppt
- Inhibition - jonesLab抑制- joneslab.ppt
- Information Input and Output - faraday信息输入与输出的法拉第.ppt
原创力文档


文档评论(0)