Backtracking

Christopher A. Welty, Louis J. Hoebel
{"title":"Backtracking","authors":"Christopher A. Welty, Louis J. Hoebel","doi":"10.1145/333175.333183","DOIUrl":null,"url":null,"abstract":"Iterating over the elements of an abstract collection is usu ally done in ML using a fold-like higher-order function provided by th e data structure. This article discusses a different paradigm of i teration based on purely functional, immutable cursors. Contrary to foldlike iterators, the iteration can be cleanly interrupted at any step. Contrary to imperative cursors (such as those found in C++ an d Java libraries) it is possible to backtrack the iterator to a previous step. Several ways to iterate over binary trees are examined a d close links with Gérard Huet’s Zipperare established. Incidentally, we show the well-known two-lists implementation of functio nal queues arising from a Zipper-based breadth-first traversal.","PeriodicalId":8272,"journal":{"name":"Appl. Intell.","volume":"28 1","pages":"60"},"PeriodicalIF":0.0000,"publicationDate":"1900-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"20","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Appl. Intell.","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/333175.333183","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 20

Abstract

Iterating over the elements of an abstract collection is usu ally done in ML using a fold-like higher-order function provided by th e data structure. This article discusses a different paradigm of i teration based on purely functional, immutable cursors. Contrary to foldlike iterators, the iteration can be cleanly interrupted at any step. Contrary to imperative cursors (such as those found in C++ an d Java libraries) it is possible to backtrack the iterator to a previous step. Several ways to iterate over binary trees are examined a d close links with Gérard Huet’s Zipperare established. Incidentally, we show the well-known two-lists implementation of functio nal queues arising from a Zipper-based breadth-first traversal.
回溯
在ML中,迭代抽象集合的元素通常使用数据结构提供的类似折叠的高阶函数来完成。本文讨论了基于纯函数式、不可变游标的另一种迭代范式。与类似折叠的迭代器相反,迭代可以在任何步骤被清晰地中断。与命令式游标(如c++和Java库中的游标)相反,可以将迭代器回溯到前一步。研究了几种遍历二叉树的方法,并建立了与gsamrard Huet的zipperer的密切联系。顺便说一下,我们展示了基于zipper的宽度优先遍历产生的函数队列的著名的双列表实现。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信