首页> 外文会议>Generic Programming >Complete Traversals as General Iteration Patterns
【24h】

Complete Traversals as General Iteration Patterns

机译:完成遍历作为一般迭代模式

获取原文
获取外文期刊封面目录资料

摘要

Iterators are of central importance in the design of generic algorithms and collections, serving as intermediaries that enable generic algorithms to be written without concern for how collections are stored and collections to be written without having to code a large number of algorithms on them. A limitation of collection frameworks such as the C++ Standard Template Library (STL), the Java 2 platform, and the Java Generic Library is that they do not allow complete traversals, in which a collection might be modified by adding elements to it while it is being traversed by means of its associated iterators. Problems requiring complete traversals are fairly common, and while there are various ad hoc ways of solving them, programmers should ideally have at their command an efficient packaged solution. After reviewing prior work on extending generic algorithms and collections to support complete traversals, this paper describes a new generic component for complete traversals based on a design pattern extracted from a commonly used implementation of STL sorted associative containers. Also presented are the results of experiments to assess the performance of complete traversal components by randomly generating abstract instances of complete traversal problems. Finally, several theoretical results relating to computability and undecidability are established. It is shown that complete traversals are general enough that any computable relation can be expressed as an instance of them. Even assuming termination, however, the problem of determining whether a given complete traversal pattern always terminates in the same collection is shown to be unde-cidable.
机译:迭代器在通用算法和集合的设计中至关重要,它充当中介,使编写通用算法时无需担心如何存储集合以及如何编写集合,而不必在其上编写大量算法。诸如C ++标准模板库(STL),Java 2平台和Java通用库之类的集合框架的局限性在于它们不允许完全遍历,在这种情况下,可以通过在集合中添加元素来修改集合。通过其关联的迭代器遍历。需要完全遍历的问题是相当普遍的,尽管有多种特殊的解决方法,但是程序员理想情况下应该在他们的命令下拥有一个有效的打包解决方案。在回顾了有关扩展通用算法和集合以支持完整遍历的先前工作之后,本文基于从常用的STL分类关联容器实现中提取的设计模式,介绍了用于完整遍历的新通用组件。还介绍了通过随机生成完整遍历问题的抽象实例来评估完整遍历组件的性能的实验结果。最后,建立了与可计算性和不确定性有关的几个理论结果。结果表明,完整的遍历足够通用,可以将任何可计算的关系表示为它们的一个实例。然而,即使假设终止,确定给定的完整遍历模式是否总是终止在同一集合中的问题也显示为无法判定的。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号