A Most Specific Method Finding Algorithm for Reflection Based Dynamic Prolog-to-Java Interfaces

  • Satyam Tyagi
  • Paul Tarau
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1990)


In the context of direct and reflection based extension mechanisms for the Jinni 2000 Java based Prolog system, we discuss the design and the implementation of a reflection based Prolog to Java interface. While the presence of dynamic type information on both the Prolog and the Java sides allows us to automate data conversion between method parameters, the presence of subtyping and method overloading makes finding the most specific method corresponding to a Prolog call pattern fairly difficult. We describe a run-time algorithm which closely mimics Java’s own compile-time method dispatching mechanism and provides accurate handling of overloaded methods beyond the reflection package’s limitations. As an application of our interfacing technique, a complete GUI library is built in Prolog using only 10 lines of application specific Java code.


Java based Language Implementation Prolog to Java Interface Method Signatures Dynamic Types Method Overloading Most Specific Method Reflection 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [1]
    P. Bothner. Kawa, the Java based Scheme system. Technical report, 1999. Available from toc.html.
  2. [2]
    J. Gosling, B. Joy, and G. Steele. The Java Language Specification, Second Edition. Java Series. Addison-Wesley, 1999. ISBN:0-201-31008-2.Google Scholar
  3. [3]
    N. Kino. Plc. java: JIPL class source. Technical report, KLS Research Labs, 1997. Available from e.html.
  4. [5]
    P. Tarau. A Logic Programming Based Software Architecture for Reactive Intelligent Mobile Agents. In P. Van Roy and P. Tarau, editors, Proceedings of DIPLCL’99, Las Cruces, NM, Nov. 1999.
  5. [6]
    P. Tarau. Inference and Computation Mobility with Jinni. In K. Apt, V. Marek, and M. Truszczynski, editors, The Logic Programming Paradigm: a 25 Year Perspective, pages 33–48. Springer, 1999. ISBN 3-540-65463-1.Google Scholar
  6. [7]
    P. Tarau. Intelligent Mobile Agent Programming at the Intersection of Java and Prolog. In Proceedings of The Fourth International Conference on The Practical Application of Intelligent Agents and Multi-Agents, pages 109–123, London, U.K., 1999.Google Scholar
  7. [8]
    P. Tarau. Fluents: A Refactoring of Prolog for Uniform Reflection and Interoperation with External Objects. In J. Lloyd, editor, Proceedings of CL’2000, London, July 2000. to appear at Springer-Verlag.Google Scholar
  8. [9]
    P. Tarau, K. De Bosschere, and B. Demoen. Partial Translation: Towards a Portable and Efficient Prolog Implementation Technology. Journal of Logic Programming, 29(1–3):65–83, Nov. 1996.zbMATHCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2001

Authors and Affiliations

  • Satyam Tyagi
    • 1
  • Paul Tarau
    • 1
  1. 1.Department of Computer ScienceUniversity of North TexasDenton, Texas

Personalised recommendations