How to Use Guarded Functional Programming

  • Roland Dietrich
Conference paper
Part of the Workshops in Computing book series (WORKSHOPS COMP.)


Guarded functional programming (GFP) has been proposed as an approach to integrate functional programming, represented by equations and rewriting, and logic programming, represented by Horn clauses and SLD resolution. The basic programming constructs are guarded equations, i.e. equations conditioned by guards which are Horn logic goals. When an equation is applied to rewrite an expression, its guard must be solved first. If a guard has more than one solutions, only one is considered (committed choice). In an extension of GFP, list comprehensions can be used to collect all solutions of a goal (GFP*). This paper presents a systematic approach how to use GFP* with respect to a classification of functions and relations regarding non-determinism properties. A sample problem is described whereof a taxonomy of functions and relations is derived. It is shown how the programming constructs of GFP* reflect this taxonomy and a systematic solution of the sample problem is outlined.


Inference System Inference Rule Logic Programming Sample Problem Functional Programming 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [Cha91]
    M. M. T. Chakravarty. Die funktional logische Programmiersprache Guarded termml: Sprachdefinition. Technical report, GMD Research Laboratory Karlsruhe, May 1991.Google Scholar
  2. [Die90]
    R. Dietrich. Vergleichende Analyse von Inferenzsystemen. GMD-Bericht Nr. 188. R. Oldenbourg Verlag, 1990.Google Scholar
  3. [Die91]
    R. Dietrich. The PHOENIX case study: EXIS - an environment for experimenting with inference systems. GMD-Studie Nr. 190, April 1991.Google Scholar
  4. [DL91]
    R. Dietrich and H. C. R. Lock. Exploiting non-determinism through laziness in guarded functional languages. In TAPSOFT’91, Colloquium on Combining Paradigms for Software Development, Brighton, England, April 1991.Google Scholar
  5. [DP91]
    R. Dietrich and H. Pull. Case studies in declarative programming. GMD Forschungsstelle Karlsruhe and Imperial College, London, PHOENIX-Deliverable A. 2. 1, March 1991.Google Scholar
  6. [Dra87]
    W. Drabent. Do logic programs resemble conventional programs. In 4th IEEE Symposium on Logic Programming, San Francisco, pages 389–397, 1987.Google Scholar
  7. [GL90]
    Yi-Ke Guo and H. C. R. Lock. A Classification Scheme for Declarative Programming Languages. - Syntax, Semantics, and Operational Models. GMD-Studien Nr. 182, August 1990.Google Scholar
  8. Loc88] Hendrik C.R. Lock. Guarded Term ML. In Workshop on Implementations of Lazy. Functional Languages,Aspenas, Sept. 1988. Report 53, PMG, Univ. of Goteborg, Sweden.Google Scholar
  9. MMTC91] H. C. R. Lock M. M. T. Chackravarty. The Implementation of Lazy Narrowing. In Programming Language Implementation and Logic Programming (PLILP’91), Passau,August 1991. Springer LNCS (to appear).Google Scholar
  10. [Ni182]
    N. J. Nilsson. Principles of Artificial Intelligence. Springer, 1982.Google Scholar
  11. [Rob65]
    J. A. Robinson. A machine oriented logic based on the resolution principle. JACM, 12, No. 1: 23–41, January 1965.CrossRefMATHGoogle Scholar

Copyright information

© Springer-Verlag London 1992

Authors and Affiliations

  • Roland Dietrich
    • 1
  1. 1.GMD Research Laboratory KarlsruheKarlsruheGermany

Personalised recommendations