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

  • Authors:
  • Satyam Tyagi;Paul Tarau

  • Affiliations:
  • -;-

  • Venue:
  • PADL '01 Proceedings of the Third International Symposium on Practical Aspects of Declarative Languages
  • Year:
  • 2001

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.