Affiliation:
1. Institut Für Informatik III, Universität Bonn, Römerstraβe 164, 53117 Bonn, Germany
Abstract
In a paper about pretty printing J. Hughes introduced two fundamental techniques for deriving programs from their specification, where a specification consists of a signature and properties that the operations of the signature are required to satisfy. Briefly, the first technique, the term implementation, represents the operations by terms and works by defining a mapping from operations to observations --- this mapping can be seen as defining a simple interpreter. The second, the context-passing implementation, represents operations as functions from their calling context to observations. We apply both techniques to derive a backtracking monad transformer that adds backtracking to an arbitrary monad. In addition to the usual backtracking operations --- failure and nondeterministic choice --- the prolog cut and an operation for delimiting the effect of a cut are supported.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Cited by
32 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Algebras for weighted search;Proceedings of the ACM on Programming Languages;2021-08-22
2. Not by equations alone: Reasoning with extensible effects;Journal of Functional Programming;2021-01-27
3. State Will do;Lecture Notes in Computer Science;2020
4. Causal commutative arrows revisited;ACM SIGPLAN Notices;2018-07-19
5. A unified view of monadic and applicative non-determinism;Science of Computer Programming;2018-01