期刊文献+

使递归算法泛型化 被引量:1

Making Recursive Algorithms Generic
下载PDF
导出
摘要 对于泛型程序设计来说,类型理论中的参数化多态是其理论框架,因为参数化多态引入了类型变量,使得类型参数化,从而完全支持类型上的抽象。然而对于现行的泛型算法,无论是C++标准模版库中的泛型算法还是基于函数式程序设计语言的算法,函数功能的定义比较具体化、单一化,因而缺乏可扩展性和高度的复用性。将对递归算法进行抽象,构造原始递归构造子,使得一般的泛型算法都可以通过该算子来构造,从而加强泛型算法的可复用型与可扩展性。除此之外,分析了递归算法构造子与泛型程序设计中的iterator概念和用于描叙泛型概念的形式化语言Tecton中所提倡的reuse概念的一致性。也给出算法复杂度的定量分析,并用函数式语言ML来实现。 Parametric polymorphism is crucial to generic programming in that it adopts parameterized types and therefore fully supports the abstraction on types. However, current generic algorithms, both developed in C+ + standard template library and in functional programming, have sole and concrete functional definitions, which lack scalability and reusability. Presents the abstraction on algorithms and primitive recursion eonstructor, aiming to reinforce the high reusability and extensibility of generic algorithms. In addition, analyzes the consistency of this algorithmic abstraction with generic iterator concepts and Tecton concepts, presents quantitative time- complexity analysis, and gives the practical implementation in ML.
出处 《计算机技术与发展》 2008年第7期96-99,共4页 Computer Technology and Development
基金 国家自然科学基金资助项目(60373075)
关键词 泛型编程 泛型算法 原始递归 函数式程序设计 generic programming generic algorithms primitive recursion functional programming
  • 相关文献

参考文献9

  • 1Pierce B. Types and programming languages[ M ]. [ s. 1. ] : MIT Press, 2002.
  • 2Pitts A. Parametric polymorphism and operational equivalence [J ]. Mathematical Structures in Computer Science, 2000 (10) :231 - 259.
  • 3Gibbons J. Design patterns as higher - order datatype - generic programs[C]//International Conference on Functional Programming, Proceedings of 2006 ACM SIGPLAN Workshop on Generic Programming. Portland, Oregon, USA: [s.n. ]. 2006 : 1 - 12.
  • 4Ruehr K. Analytical and structural polymorphism expressed using patterns over types[D]. USA:University of Michigan, 1992.
  • 5Pierce B. Advanced topics in types and programming languages[M]. [s. 1. ] : MIT Press, 2005.
  • 6Sumii E, Pierce B. A bisimulation for type abstraction and recursion[J]. Journal of the ACM,2007,54(5):26- 30.
  • 7Musser D, Shao Zhiqing. Concept use or concept refinement: an important distinction in building generic specifications[ C] ff 4th International CoHerence on Formal Engineering Methods, volume 2495 of lecture Notes in Computer Science. New York: Springer-Verlag, 2002.
  • 8Mnsser D, Sheo Zhiqing. The Teeton concept description language (revised version)[R]. Computer Science Department, Rensselaer Polytechnic Institute. Troy, New York: [s. n. ]. 2002.
  • 9Dreyer D, Crary K, Harper R. A type system for higher- order modules[C] // 30th ACM SIGPLAN - SIGACT Symposium on Principles of Programming Langanges (POPL' 03). New Orleans, Louisiana, USA: [s. n. ] ,2003:236 - 249.

同被引文献17

  • 1孙斌.面向对象、泛型程序设计与类型约束检查[J].计算机学报,2004,27(11):1492-1504. 被引量:14
  • 2陈叶旺,余金山.泛型编程与设计模式[J].计算机科学,2006,33(4):253-257. 被引量:8
  • 3吴拥民.泛型设计的理论研究[J].闽江学院学报,2006,27(2):72-76. 被引量:4
  • 4韩玉坤,王冬星.浅谈C++中泛型编程方法的运用[J].电脑学习,2007(2):47-48. 被引量:2
  • 5Jones S P, Shields M. Practical type inference for arbitrary- rank types[ R]. Microsoft Research ,2003.
  • 6Ltih A. Exploring Generic Haskell [ D ]. Netherlands : Utrecht University ,2004.
  • 7Pierce B C. Types and Programming Languages [ R ]. [ s. 1. ] : The MIT Press,2002.
  • 8Loh A, Clarke D, Jeuring J. Dependency- style Generic HaskeU[ C ]//Proceedings of the eighth ACM SIGPLAN inter- national conference on functional programming. [ s. 1. ] : ACM Press,2003 : 141 - 152.
  • 9Jay B. The pattern calculus [ J ]. ACM Transactions on Pro- gramming Languages and Systems,2004,26 (6) :911-937.
  • 10Wadler P, Blott S. How to make ad-hoc polymorphism less ad -hoc[C]//Proceedings of the 16th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. [ s. 1. ] : ACM Press, 1989:60-76.

引证文献1

二级引证文献2

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部