|
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.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
|
| |
2
|
|
| |
3
|
|
| |
4
|
|
| |
5
|
R. Hinze. Prolog's control constructs in a functional setting | Axioms and implementation. International Journal of Foundations of Computer Science, 2000. To appear.
|
| |
6
|
|
| |
7
|
M. P. Jones and L. Duponcheel. Composing monads. Technical Report YALEU/DCS/RR-1004, Department of Computer Science, Yale University, December 1993.
|
| |
8
|
K. L?aufer and M. Odersky. An extension of ML with first-class abstract types. In Proceedings of the 1992 ACM Workshop on ML and its Applications, San Francisco, California, pages 78-91. ACM-Press, 1992.
|
 |
9
|
Sheng Liang , Paul Hudak , Mark Jones, Monad transformers and modular interpreters, Proceedings of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.333-343, January 23-25, 1995, San Francisco, California, United States
[doi> 10.1145/199448.199528]
|
| |
10
|
E. Meijer. Calculating Compilers. PhD thesis, Nijmegen University, 1992.
|
| |
11
|
E. Moggi. An abstract view of programming languages. Technical Report ECS-LFCS-90-113, Department of Computer Science, Edinburgh University, 1990.
|
| |
12
|
|
| |
13
|
S. Peyton Jones and J. Hughes, editors. Haskell 98 | A Non-strict, Purely Functional Language, February 1999. Available from http://www.haskell.org/definition/.
|
| |
14
|
|
 |
15
|
|
 |
16
|
|
| |
17
|
|
INDEX TERMS
Primary Classification:
D.
Software
D.1
PROGRAMMING TECHNIQUES
Additional Classification:
D.
Software
D.3
PROGRAMMING LANGUAGES
D.3.2
Language Classifications
Subjects:
Applicative (functional) languages
Nouns:
PEARL;
Prolog;
Haskell
D.3.3
Language Constructs and Features
Subjects:
Polymorphism;
Control structures
F.
Theory of Computation
F.3
LOGICS AND MEANINGS OF PROGRAMS
F.3.1
Specifying and Verifying and Reasoning about Programs
Subjects:
Specification techniques
F.3.2
Semantics of Programming Languages
Subjects:
Algebraic approaches to semantics
F.3.3
Studies of Program Constructs
Subjects:
Control primitives
General Terms:
Design,
Languages,
Performance,
Theory,
Verification
Keywords:
Haskell,
Prolog,
backtracking,
continuations,
cut,
monad transformers,
monads,
program derivation
|