Functional un|unparsing

Functional un|unparsing
复制标题

函数式解|解解析

DOI:
10.1007/s10990-012-9087-2
复制
发表时间:
2012
期刊:
Higher-Order and Symbolic Computation
影响因子:
--
通讯作者:
and C.-c. Shan
and C.-c. Shan
中科院分区:
--
文献类型:
--
作者:
Asai;K.;O. Kiselyov;and C.-c. Shan

文献摘要

相似文献

丹维的功能性无法解析问题(Danvy in J.Funct.程序。8(6),621-625,1998)的目的是实现一个类型安全的‘print tf’函数,该函数根据给定的格式将一系列异类参数转换为字符串。双重问题是实现类型安全的‘scanf’函数,它通过解释(Friedman and Wand在LFP中,第348-355页,1984和在Essentials of Programming Languages中,麻省理工学院出版社,2008)与绑定零个或多个变量的同等异质模式序列相同的格式,从字符串中提取异类参数序列。我们从它们的形式规范(Theor中的Wand)导出了这两个问题的多重解(Wand in J.ACM 27(1),164-180,1980)。电脑。SCI。一方面,我们的解决方案展示了未扩展的Hindley-Milner类型系统如何允许在类型安全的静态保证下访问异类序列。另一方面,我们的解决方案演示了控制操作符的使用(Felleisen等人)。在1988年ACM会议关于LISP和函数式编程的会议记录,第52-62页,ACM出版社,纽约,1988;Wand in POPL 85:年度ACM编程语言原则研讨会的会议记录,第16卷,ACM出版社,纽约,1985年;Meyer和Wand in Logics of Programs,计算机科学讲稿,第193卷,第219-224页,柏林,Springer,1985),以与格式进行通信(Wand in the Procestions of the 1980 ACM Conference on LIPP and Functional Programming,第12卷,第285-299页,ACM Press,纽约,1980和Haynes等人)。见LFP,第293-298页,1984)。
Danvy’sfunctional unparsingproblem (Danvy in J. Funct. Program. 8(6), 621–625, 1998) is to implement a type-safe ‘printf’ function, which converts a sequence of heterogeneous arguments to a string according to a given format. The dual problem is to implement a type-safe ‘scanf’ function, which extracts a sequence of heterogeneous arguments from a string byinterpreting(Friedman and Wand in LFP, pp. 348–355, 1984 and in Essentials of Programming Languages, MIT Press, 2008) the same format as an equally heterogeneous sequence of patterns that binds zero or more variables. Wederivemultiple solutions to both problems (Wand in J. ACM 27(1), 164–180, 1980) from their formal specifications (Wand in Theor. Comput. Sci. 20(1), 3–32, 1982).On one hand, our solutions show how the Hindley-Milner type system, unextended, permits accessing heterogeneous sequences with the static assurance of type safety. On the other hand, our solutions demonstrate the use ofcontrol operators(Felleisen et al. in Proceedings of the 1988 ACM Conference on Lisp and Functional Programming, pp. 52–62, ACM Press, New York, 1988; Wand in POPL 85: Conference Record of the Annual ACM Symposium on Principles of Programming Languages, vol. 16, ACM Press, New York, 1985; Meyer and Wand in Logics of Programs, Lecture Notes in Computer Science, vol. 193, pp. 219–224, Springer, Berlin, 1985) to communicate with formats ascoroutines(Wand in Proceedings of the 1980 ACM Conference on Lisp and Functional Programming, vol. 12, pp. 285–299, ACM Press, New York, 1980 and Haynes et al. in LFP, pp. 293–298, 1984).