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:
-
a.
parallel unification, especially proper treatment of indeterminate behavior, e.g. mutual exclusion on variable binding;
-
b.
variable binding through emulated graph node merging;
-
c.
exploitation of two levels of demand: assertive (during unification), and non-assertive (ordinary “read-only” usage), and
-
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.
This material is based upon work supported by NSF Grant DCR-8506000, and a Shared University Research Grant from the IBM Corporation.
Preview
Unable to display preview. Download preview PDF.
References
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.
K. L. Clark and S. Gregory. A relational language for parallel programming. Technical Report DOC 81/16, Imperial College, London, 1981.
S. H. Danforth. Logical variables for a functional language. Technical Report PP-120-85, Microelectronics and Computer Technology Corp., 1985.
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.
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.
R.M. Keller, G. Lindstrom, and S. Patil. A loosely-coupled applicative multi-processing system. In AFIPS Conference Proceedings, pages 613–622. June, 1979.
R.M. Keller and G. Lindstrom. Hierarchical analysis of a distributed evaluator. In Proc. International Conference on Parallel Processing, pages 299–310. August, 1980.
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.
R.M. Keller. FEL (Function Equation Language) programmer's guide. Technical Report 7, University of Utah, Department of Computer Science, AMPS Technical Memorandum, 1982.
R.M. Keller, F.C.H. Lin, and J. Tanaka. Rediflow multiprocessing. In IEEE Compcon '84, pages 410–417, Feb., 1984.
R. M. Keller and F. C. H. Lin. Simulated performance of a reduction-based multiprocessor. IEEE Computer 17(7):70–82, July, 1984.
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.
G. Lindstrom. Functional programming and the logical variable. In Symposium on Principles of Programming Languages, pages 266–280. ACM, January, 1985.
R. Milner. A theory of type polymorphism. J. of Comp. and Sys. Sci. 17(3):348–375, 1978.
R. S. Nikhil, K. Pingali, and Arvind. Id Nouveau. Technical Report Computation Structures Group Memo 265, MIT Laboratory for Computer Science, July, 1986.
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.
E.Y. Shapiro. A subset of Concurrent Prolog and its interpreter. Technical Report TR-003, Institute for New Generation Computer Technology, January, 1983.
Shapiro, E., and A. Takeuchi. Object ortented programming in Concurrent Prolog. New Generation Computing 1(1):25–48, 1983.
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.
J. Tanaka. Optimized execution of an applicative language. PhD thesis, Univ. of Utah. 1984.
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.
K. R. Traub. An abstract parallel graph reduction machine. In Proc. 12th Ann. Symp. on Computer Architecture, pages 333–341. IEEE Computer Society, 1985.
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.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1987 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Lindstrom, G. (1987). Implementing logical variables on a graph reduction architecture. In: Fasel, J.H., Keller, R.M. (eds) Graph Reduction. GR 1986. Lecture Notes in Computer Science, vol 279. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-18420-1_67
Download citation
DOI: https://doi.org/10.1007/3-540-18420-1_67
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-18420-1
Online ISBN: 978-3-540-47963-5
eBook Packages: Springer Book Archive