Implementing logical variables on a graph reduction architecture
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.
parallel unification, especially proper treatment of indeterminate behavior, e.g. mutual exclusion on variable binding;
variable binding through emulated graph node merging;
exploitation of two levels of demand: assertive (during unification), and non-assertive (ordinary “read-only” usage), and
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.
KeywordsLogic Programming Mutual Exclusion Logical Variable Reduction Rule Functional Programming
Unable to display preview. Download preview PDF.
- 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
- K. L. Clark and S. Gregory. A relational language for parallel programming. Technical Report DOC 81/16, Imperial College, London, 1981.Google Scholar
- S. H. Danforth. Logical variables for a functional language. Technical Report PP-120-85, Microelectronics and Computer Technology Corp., 1985.Google Scholar
- 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
- 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
- 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
- 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
- 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
- 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
- R.M. Keller, F.C.H. Lin, and J. Tanaka. Rediflow multiprocessing. In IEEE Compcon '84, pages 410–417, Feb., 1984.Google Scholar
- 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
- 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
- G. Lindstrom. Functional programming and the logical variable. In Symposium on Principles of Programming Languages, pages 266–280. ACM, January, 1985.Google Scholar
- 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
- 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
- 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
- Shapiro, E., and A. Takeuchi. Object ortented programming in Concurrent Prolog. New Generation Computing 1(1):25–48, 1983.Google Scholar
- 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
- J. Tanaka. Optimized execution of an applicative language. PhD thesis, Univ. of Utah. 1984.Google Scholar
- 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
- 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