Using π-RED as a teaching tool for functional programming and program execution
This paper describes an interactively controlled reduction system π-redwhich may be employed to teach both basic concepts of functional programming and program execution at the undergraduate level, and advanced topics of computer science at the graduate level.
π-redsupports the reduction languages KiR — a sugared versions of an applied λ-calculus with a full-fledged (type-free) β-reduction. Functions (λ-abstractions) are truly treated as first class objects: they may be applied to other functions or to themselves, and λ-abstractions may be computed as function values. Name clashes are resolved by an indexing scheme similar to de Bruijn indices.
Programs may be executed in a stepwise mode and intermediate programs may be displayed in high-level notation.
Special pattern matching constructs provide the means to directly specify in KiR complex term rewrite systems. In conjunction with the stepwise execution mode, this feature has been extensively used, in lab courses accompanying graduate courses on computer architecture, to rapidly prototype and study various programming and (abstract) machine models, compilation schemes, type checkers, etc.
KeywordsPattern Match Program Execution Functional Programming Abstraction Lambda Argument Term
Unable to display preview. Download preview PDF.
- [AbSus85]Abelson, H.; Sussmann, G.J.: Structure and Interpretation of Computer Programs, MIT Press, McGraw-Hill, New York, NY, 1985Google Scholar
- [Back78]Backus, J.: Can Programming Be Liberated from the von Neumann Style? A Functional Style and Its Algebra of Programs, Communications of the ACM, Vol. 21, No. 8, 1978, pp. 613–641Google Scholar
- [Berk75]Berkling, K.J.: Reduction Languages for Reduction Machines, Proceedings of the 2nd Annual Symposium on Computer Architecture, 1975, ACM/IEEE 75CH0916-7C, pp. 133–140Google Scholar
- [BeFe82b]Berkling, K.J.; Fehr, E.: A Consistent Extension of the Lambda-Calculus as a Base for Functional Programming Languages, Information and Control, Academic Press, Vol. 55, Nos. 1–3, October/November/December 1982Google Scholar
- [Car83]Cardelli, L.; McQueen, D.: The Functional Abstract Machine The ML/LCF/HOPE Newsletter, AT&T, Bell Labs, Murray Hill NJ, 1983Google Scholar
- [Brui72]DeBruijn, N.G.: Lambda-Calculus Notation with Nameless Dummies. A Tool for Automatic Formula Manipulation with Application to the Church-Rosser-Theorem, Indagationes Mathematicae, Vol. 34, 1972, pp. 381–392Google Scholar
- [GaK194]Gaertner, D., Kluge, W.E.: π-red +: An Interactive Compiling Graph Reduction System for an Applied λ-Calculus, to be published in JFPGoogle Scholar
- [Gol94]Goldson, D.: A Symbolic Calculator for Non-Strict Functional Programs The Computer Journal, Vol. 37, No. 3, 1994, pp. 177–187Google Scholar
- [HaMiTo88]Harper, R.; Milner, R.; Tofte, M.: The Definition of Standard ML Version 3, Laboratory for Foundations of Computer Science, University of Edinburgh, May 1989Google Scholar
- [HuWa88]Hudak, P.; Wadler, P. (Editors) et al.: Report on the Functional Programming Language: Haskell, Draft Proposed Standard, December 1988, Yale UniversityGoogle Scholar
- [John83]Johnsson, T.: Efficient Compilation of Lazy Evaluation SIGPLAN Compiler Construction Conference, Montreal Queb., 1984Google Scholar
- [Klu92]Kluge, W.E.: The Organization of Reduction, Data Flow, and Control Flow Systems, MIT Press, Cambridge, Mass., 1992Google Scholar
- [Klu94]Kluge, W.E.: A User's Guide for the Reduction System π-Red, Int. Report, No. 9419, Inst. f. Informatik, CAU Kiel, 1994.Google Scholar
- [Lan64]Landin, P.J.: The Mechanical Evaluation of Expressions, The Computer Journal, Vol. 6, No. 4, 1964, pp. 308–320Google Scholar
- [Lavi87]Laville, A.: Lazy Pattern Matching in the ML Language, INRIA Rapporte de Recherche, No. 664, 1987Google Scholar
- [Plas93]Plasmeijer, R., van Eekelen, M.: Functional Programming and Parallel Graph Rewriting, Addison Wesley, 1993Google Scholar
- [Pey87]Peyton-Jones, S.L.: The Implementation of Functional Programming Languages, Prentice Hall, Englewood Cliffs, NJ, 1987Google Scholar
- [Pey92]Peyton-Jones, S.L.: Implementing Lazy Functional Languages on Stock Hardware: The Spineless Tagless G-Machine, Journal of Functional Programming, Vo. 2, No. 2, 1992, pp. 127–202Google Scholar
- [RuToFi93]Runciman, C.; Toyn, I.; Firth, M.: An Incremental, Exploratory and Transformational Environment for Lazy Functional Languages, Journal of Functional Programming, Vol. 3, No. 1, 1993, pp. 93–115Google Scholar
- [Turn76]Turner, D.A.: A New Implementation Technique for Applicative Languages Software Practice and Experience, Vol. 9, No. 1, 1979, pp. 31–49Google Scholar
- [Turn86]Turner, D.A.: An Overview of Miranda, SIGPLAN Notices, Vol. 21, No. 12, 1986, pp. 158–166Google Scholar