Advertisement

Implementing logical variables on a graph reduction architecture

  • Gary Lindstrom
Relationship To Logic Programming
Part of the Lecture Notes in Computer Science book series (LNCS, volume 279)

Abstract

Logical variables offer a semantic meeting ground between functional and logic programming languages. That is, if functional languages are extended to do parameter passage by unification, much of the power of AND-parallel logic programming is obtained. However, multi-path search, by OR-parallelism or backtracking, remains the province of logic programming.

We outline an implementation strategy for FGL+LV, a functional language with logical variables, on the Rediflow multiprocessing graph reduction architecture. The aspects of logical variables receiving special consideration include:
  1. a.

    parallel unification, especially proper treatment of indeterminate behavior, e.g. mutual exclusion on variable binding;

     
  2. b.

    variable binding through emulated graph node merging;

     
  3. c.

    exploitation of two levels of demand: assertive (during unification), and non-assertive (ordinary “read-only” usage), and

     
  4. d.

    avoidance of meaningless cyclic variable bindings.

     

The existing base language implementation can be smoothly extended, with a word size increase of only one bit (needed to implement two levels of demand). Lazy evaluation in the base language is retained, except that actual parameters are now made strict to one level of evaluation. This requirement, overlooked in a previous paper on this subject, is argued to be semantically and operationally inescapable in a functional language with logical variables. It also provides insight into the vexing problem of how to apply the occur check in a language with infinite data objects. A novel technique for merging cyclic lists is used to implement logical variable binding in a distributed manner without locking or busy waiting.

Keywords

Logic Programming Mutual Exclusion Logical Variable Reduction Rule 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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [1]
    H. Abramson. A prological definition of HASL, a purely functional language with unification based conditional binding expressions. In D. DeGroot and G. Lindstrom (editors), Logic Programming: Functions, Relations, and Equations. Prentice Hall, 1986.Google Scholar
  2. [2]
    K. L. Clark and S. Gregory. A relational language for parallel programming. Technical Report DOC 81/16, Imperial College, London, 1981.Google Scholar
  3. [3]
    S. H. Danforth. Logical variables for a functional language. Technical Report PP-120-85, Microelectronics and Computer Technology Corp., 1985.Google Scholar
  4. [4]
    J. Darlington, A. J. Field, and H. Pull. The unification of functional and logic languages. In D. DeGroot and G. Lindstrom (editors), Logic Programming: Functions, Relations, and Equations. Prentice Hall, 1986.Google Scholar
  5. [5]
    J. Goguen and J. Meseguer. EQLOG: equality, types, and generic modules for logic programming. In D. DeGroot and G. Lindstrom (editors), Logic Programming: Functions, Relations, and Equations. Prentice Hall, 1986.Google Scholar
  6. [6]
    R.M. Keller, G. Lindstrom, and S. Patil. A loosely-coupled applicative multi-processing system. In AFIPS Conference Proceedings, pages 613–622. June, 1979.Google Scholar
  7. [7]
    R.M. Keller and G. Lindstrom. Hierarchical analysis of a distributed evaluator. In Proc. International Conference on Parallel Processing, pages 299–310. August, 1980.Google Scholar
  8. [8]
    R.M. Keller and G. Lindstrom. Applications of feedback in functional programming. In. Conference on functional languages and computer architecture, pages 123–130. October, 1981.Google Scholar
  9. [9]
    R.M. Keller. FEL (Function Equation Language) programmer's guide. Technical Report 7, University of Utah, Department of Computer Science, AMPS Technical Memorandum, 1982.Google Scholar
  10. [10]
    R.M. Keller, F.C.H. Lin, and J. Tanaka. Rediflow multiprocessing. In IEEE Compcon '84, pages 410–417, Feb., 1984.Google Scholar
  11. [11]
    R. M. Keller and F. C. H. Lin. Simulated performance of a reduction-based multiprocessor. IEEE Computer 17(7):70–82, July, 1984.Google Scholar
  12. [12]
    G. Lindstrom. OR-parallelism on applicative architectures. In Sten-Ake Tarnlund (editor), Proc. Second International Logic Programming Conference, pages 159–170. Uppsala University, July, 1984.Google Scholar
  13. [13]
    G. Lindstrom. Functional programming and the logical variable. In Symposium on Principles of Programming Languages, pages 266–280. ACM, January, 1985.Google Scholar
  14. [14]
    R. Milner. A theory of type polymorphism. J. of Comp. and Sys. Sci. 17(3):348–375, 1978.CrossRefGoogle Scholar
  15. [15]
    R. S. Nikhil, K. Pingali, and Arvind. Id Nouveau. Technical Report Computation Structures Group Memo 265, MIT Laboratory for Computer Science, July, 1986.Google Scholar
  16. [16]
    U.S. Reddy. On the relationship between functional and logic languages. In D. DeGroot and G. Lindstrom (editors), Logic Programming: Functions, Relations, and Equations. Prentice Hall, 1986.Google Scholar
  17. [17]
    E.Y. Shapiro. A subset of Concurrent Prolog and its interpreter. Technical Report TR-003, Institute for New Generation Computer Technology, January, 1983.Google Scholar
  18. [18]
    Shapiro, E., and A. Takeuchi. Object ortented programming in Concurrent Prolog. New Generation Computing 1(1):25–48, 1983.Google Scholar
  19. [19]
    P. A. Subrahmanyam and J.-H. You. FUNLOG: a computational model integrating logic programming and functional programming. In D. DeGroot and G. Lindstrom (editors), Logic Programming: Functions, Relations, and Equations. Prentice Hall, 1986.Google Scholar
  20. [20]
    J. Tanaka. Optimized execution of an applicative language. PhD thesis, Univ. of Utah. 1984.Google Scholar
  21. [21]
    S. Taylor, S. Safra and E. Shapiro. A parallel implementation of Flat Concurrent Prolog. October, 1986. Dept. of Computer Science, Weizmann Inst. of Science; to appear in International Journal of Parallel Programming.Google Scholar
  22. [22]
    K. R. Traub. An abstract parallel graph reduction machine. In Proc. 12th Ann. Symp. on Computer Architecture, pages 333–341. IEEE Computer Society, 1985.Google Scholar
  23. [23]
    P.C. Treleaven, D.R. Brownbridge, and R.P. Hopkins. Data-driven and demand-driven computer architecture. Computing Surveys 14(1):93–143, March, 1982.CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1987

Authors and Affiliations

  • Gary Lindstrom
    • 1
  1. 1.Department of Computer ScienceUniversity of UtahSalt Lake City

Personalised recommendations