Skip to main content

A functional and logic language with polymorphic types

  • Software Environments And Languages
  • Conference paper
  • First Online:
Book cover Design and Implementation of Symbolic Computation Systems (DISCO 1990)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 429))

Abstract

We have presented an equational logic language with a polymorphic type system. The language integrates two interesting programming styles in a type secure way: functional and logic programming. In contrast to other proposals for polymorphically typed logic programming languages, it is possible to apply higher-order programming techniques in our framework. The language has a well-defined semantics and programs can be efficiently executed if the same drawbacks as in Prolog (incompleteness because of infinite derivations) are accepted. The language is explicitly typed, i.e., each syntactic unit is annotated with a type expression, but the implementation contains a type inference procedure so that the programmer can omit all type annotations in clauses. Further work remains to be done in the area of run-time optimizations with the aim to reduce the cases where type information is required for correct unification.

Extended abstract

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. H. Aït-Kaci and R. Nasr. LOGIN: A Logic Programming Language with Built-In Inheritance. Journal of Logic Programming (3), pp. 185–215, 1986.

    Google Scholar 

  2. P.G. Bosco and E. Giovannetti. IDEAL: An Ideal Deductive Applicative Language. In Proc. IEEE Internat. Symposium on Logic Programming, pp. 89–94, Salt Lake City, 1986.

    Google Scholar 

  3. H. Bertling and H. Ganzinger. Completion-Time Optimization of Rewrite-Time Goal Solving. In Proc. of the Conference on Rewriting Techniques and Applications, pp. 45–58. Springer LNCS 355, 1989.

    Google Scholar 

  4. R.M. Burstall, D.B. MacQueen, and D.T. Sannella. HOPE: An Experimental Applicative Language. In Conference Record of the 1980 LISP Conference, pp. 136–143. ACM, 1980.

    Google Scholar 

  5. W.F. Clocksin and C.S. Mellish. Programming in Prolog. Springer, third rev. and ext. edition, 1987.

    Google Scholar 

  6. R. Dietrich and F. Hagl. A polymorphic type system with subtypes for Prolog. In Proc. ESOP 88, Nancy, pp. 79–93. Springer LNCS 300, 1988.

    Google Scholar 

  7. D. DeGroot and G. Lindstrom, editors. Logic Programming, Functions, Relations, and Equations. Prentice Hall, 1986.

    Google Scholar 

  8. L. Damas and R. Milner. Principal type-schemes for functional programs. In Proc. 9th Annual Symposium on Principles of Programming Languages, pp. 207–212, 1982.

    Google Scholar 

  9. H. Ehrig and B. Mahr. Fundamentals of Algebraic Specification 1: Equations and Initial Semantics, volume 6 of EATCS Monographs on Theoretical Computer Science. Springer, 1985.

    Google Scholar 

  10. L. Fribourg. SLOG: A Logic Programming Language Interpreter Based on Clausal Superposition and Rewriting. In Proc. IEEE Internat. Symposium on Logic Programming, pp. 172–184, Boston, 1985.

    Google Scholar 

  11. J.A. Goguen and J. Meseguer. Completeness of Many-Sorted Equational Logic. Report No. CSLI-84-15, Stanford University, 1984.

    Google Scholar 

  12. J.A. 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, pp. 295–363. Prentice Hall, 1986.

    Google Scholar 

  13. W. Goldfarb. The Undecidability of the Second-Order Unification Problem. Theoretical Computer Science 13, pp. 225–230, 1981.

    Google Scholar 

  14. M. Hanus. Horn Clause Specifications with Polymorphic Types. Dissertation, FB Informatik, Univ. Dortmund, 1988.

    Google Scholar 

  15. M. Hanus. Horn Clause Programs with Polymorphic Types: Semantics and Resolution. In Proc. of the TAPSOFT '89, pp. 225–240. Springer LNCS 352, 1989. Extended version to appear in Theoretical Computer Science.

    Google Scholar 

  16. M. Hanus. Polymorphic Higher-Order Programming in Prolog. In Proc. Sixth International Conference on Logic Programming (Lisboa), pp. 382–397. MIT Press, 1989.

    Google Scholar 

  17. G. Huet and J.-M. Hullot. Proofs by Induction of Equational Theories with Constructors. Journal of Computer and System Sciences 25, pp. 239–266, 1982.

    Google Scholar 

  18. R. Harper, D.B. MacQueen, and R. Milner. Standard ML. LFCS Report Series ECS-LFCS-86-2, University of Edinburgh, 1986.

    Google Scholar 

  19. G. Huet and D.C. Oppen. Equations and Rewrite Rules: A Survey. In R.V. Book, editor, Formal Language Theory: Perspectives and Open Problems. Academic Press, 1980.

    Google Scholar 

  20. H. Hussmann. Unification in Conditional-Equational Theories. In Proc. EUROCAL '85, pp. 543–553. Springer LNCS 204, 1985.

    Google Scholar 

  21. M. Huber and I. Varsek. Extended Prolog with Order-Sorted Resolution. In Proc. 4th IEEE Internat. Symposium on Logic Programming, pp. 34–43, San Francisco, 1987.

    Google Scholar 

  22. F. Kluźniak. Type Synthesis for Ground Prolog. In Proc. Fourth International Conference on Logic Programming (Melbourne), pp. 788–816. MIT Press, 1987.

    Google Scholar 

  23. J.W. Lloyd. Foundations of Logic Programming. Springer, second, extended edition, 1987.

    Google Scholar 

  24. P. Mishra. Towards a theory of types in Prolog. In Proc. IEEE Internat. Symposium on Logic Programming, pp. 289–298, Atlantic City, 1984.

    Google Scholar 

  25. D.A. Miller and G. Nadathur. Higher-Order Logic Programming. In Proc. Third International Conference on Logic Programming (London), pp. 448–462. Springer LNCS 225, 1986.

    Google Scholar 

  26. A. Mycroft and R.A. O'Keefe. A Polymorphic Type System for Prolog. Artificial Intelligence, Vol. 23, pp. 295–307, 1984.

    Google Scholar 

  27. L. Naish. Specification = Program + Types. In Proc. Foundations of Software Technology and Theoretical Computer Science, pp. 326–339. Springer LNCS 287, 1987.

    Google Scholar 

  28. P. Padawitz. Computing in Horn Clause Theories, volume 16 of EATCS Monographs on Theoretical Computer Science. Springer, 1988.

    Google Scholar 

  29. A. Poigné. On Specifications, Theories, and Models with Higher Types. Information and Control, Vol. 68, No. 1–3, 1986.

    Google Scholar 

  30. J.C. Reynolds. Polymorphism is not set-theoretic. In Proc. of the Int. Symp. on the Semantics of Data Types, Sophia-Antipolis, pp. 145–156. Springer LNCS 173, 1984.

    Google Scholar 

  31. J.A. Robinson. A Machine-Oriented Logic Based on the Resolution Principle. Journal of the ACM, Vol. 12, No. 1, pp. 23–41, 1965.

    Google Scholar 

  32. G. Smolka. Fresh: A Higher-Order Language Based on Unification and Multiple Results. In D. DeGroot and G. Lindstrom, editors, Logic Programming, Functions, Relations, and Equations, pp. 469–524. Prentice Hall, 1986.

    Google Scholar 

  33. G. Smolka. Order-Sorted Horn Logic: Semantics and Deduction. SEKI Report SR-86-17, FB Informatik, Univ. Kaiserslautern, 1986.

    Google Scholar 

  34. G. Smolka. Logic Programming with Polymorphically Order-Sorted Types. In Proc. First International Workshop on Algebraic and Logic Programming (Gaussig, G.D.R.), pp. 53–70. Springer LNCS 343, 1988.

    Google Scholar 

  35. G. Smolka. TEL (Version 0.9) Report and User Manual. SEKI Report SR-87-11, FB Informatik, Univ. Kaiserslautern, 1988.

    Google Scholar 

  36. D. Turner. Miranda: A non-strict functional language with polymorphic types. In Conference on Functional Programming Languages and Computer Architecture, Nancy, France, pp. 1–16. Springer LNCS 201, 1985.

    Google Scholar 

  37. D.H.D. Warren. Higher-order extensions to PROLOG: are they needed? In Machine Intelligence 10, pp. 441–454, 1982.

    Google Scholar 

  38. J. Xu and D.S. Warren. A Type Inference System For Prolog. In Proc. 5th Conference on Logic Programming & 5th Symposium on Logic Programming (Seattle), pp. 604–619, 1988.

    Google Scholar 

  39. J. Zobel. Derivation of Polymorphic Types for Prolog Programs. In Proc. Fourth International Conference on Logic Programming (Melbourne), pp. 817–838. MIT Press, 1987.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Alfonso Miola

Rights and permissions

Reprints and permissions

Copyright information

© 1990 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Hanus, M. (1990). A functional and logic language with polymorphic types. In: Miola, A. (eds) Design and Implementation of Symbolic Computation Systems. DISCO 1990. Lecture Notes in Computer Science, vol 429. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-52531-9_142

Download citation

  • DOI: https://doi.org/10.1007/3-540-52531-9_142

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-52531-8

  • Online ISBN: 978-3-540-47014-4

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics