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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
P. Bothner. Kawa, the Java based Scheme system. Technical report, 1999. Available from http://www.delorie.com/gnu/docs/kawa/kawa toc.html.
J. Gosling, B. Joy, and G. Steele. The Java Language Specification, Second Edition. Java Series. Addison-Wesley, 1999. ISBN:0-201-31008-2.
N. Kino. Plc. java: JIPL class source. Technical report, KLS Research Labs, 1997. Available from http://www.kprolog.com/jipl/index e.html.
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. http://www.binnetcorp.com/wshops/ICLP99DistInetWshop.html.
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.
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.
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.
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.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2001 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Tyagi, S., Tarau, P. (2001). A Most Specific Method Finding Algorithm for Reflection Based Dynamic Prolog-to-Java Interfaces. In: Ramakrishnan, I.V. (eds) Practical Aspects of Declarative Languages. PADL 2001. Lecture Notes in Computer Science, vol 1990. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45241-9_22
Download citation
DOI: https://doi.org/10.1007/3-540-45241-9_22
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-41768-2
Online ISBN: 978-3-540-45241-6
eBook Packages: Springer Book Archive