There are many initiatives in presents-days for interaction between Java and Prolog programming languages. These initiatives allow combine two programming paradigms, Object Oriented Programming and Logic Programming. Every proposed interface has specifics features depending of the final use. The present paper introduces a new Java Prolog Interface (JPI) to be used for Prolog persistence interacting from Java side and functional programming from Prolog side. JPI define a layered architecture where each component represents a library to connect the final user application with some specific Prolog Engine. The project equals to existing solutions have an implementation for the most popular open source Prolog Engines like SWI, YAP, TuProlog, JLog and JTrolog. To support Java and Prolog interaction an inter-languages data type mappings between Java objects and Prolog terms is implemented. This API have a logic development workflow to create Terms, Engines, Query and some builder classes to help Clauses and Query creation. JPI implement the javax.script interface include in Java from version 1.6. Using a Java Prolog Benchmark test and evaluate different Prolog Engines implementations to determine the performance over JPI. The best performance is obtained using pure Java Prolog Engines respect to Native Engines. JPI is a modern solution that take the best features from existing solutions and combine all in one. It’s more flexible, adaptive and have an Application Provider Interface (API) easy to use. Provides clear and concise access to Prolog and simplifies the integration of predicates in Prolog and provides an automated object-to-term mapping mechanism.
Published in | Mathematics and Computer Science (Volume 7, Issue 5) |
DOI | 10.11648/j.mcs.20220705.11 |
Page(s) | 81-101 |
Creative Commons |
This is an Open Access article, distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution and reproduction in any medium or format, provided the original work is properly cited. |
Copyright |
Copyright © The Author(s), 2022. Published by Science Publishing Group |
Java, Prolog, Connector, Terms, Prolog Engine, Java Virtual Machine
[1] | Calejo, M. (2004). InterProlog: Towards a Declarative Embedding of Logic Programming in Java. Logics in Artificial Intelligence, 9th European Conference, JELIA 2004 (pp. 714-717). Lisbon, Portugal: Springer. |
[2] | Cimadamore, M., & Viroli, M. (2007). A Prolog-oriented etension of Java programming based on generics annotations. Proceedings PPPJ, 197-202. |
[3] | Cimadamore, M., & Viroli, M. (2008). Integrating Java and Prolog throug generic methods and type inference. Proceedings SAC, 198-205. |
[4] | Denti, E. O. (2001). tuProlog: A light-weight Prolog for Internet. Practical Aspects of Declarative Languages, 1990, 184-198. |
[5] | Grogan, M. (2006). JSR-223, Scripting for the Java Platform Specification. Santa Clara, California: Sun Microsystems, Inc. |
[6] | Hermenegildo, M. V., Bueno, F., Carro, M., Lopez-Garcia, P., Mera, E., Morales, J. F., & Puebla, G. (2012). An overview of Ciao and its design philosophy. Theory and Practice of Logic Programming, 12, 219-252. |
[7] | Kashan, K. (2014). Beginning Java 8 APIs, Extension and Libraries. New York: Apress. |
[8] | L. Ostermayer, F. F. (2014). CAPJA - A Connector Architecture for Prolog and Java. 10th Workshop on Knowledge Engineering and Software Engineering (KESE). |
[9] | Oracle. (2017). Java Platform, Standard Edition Java Scripting Programmer's Guide. Oracle. |
[10] | Rho, T. D. (2004). The Prolog Development Tool – A Prolog IDE for Eclipse. Retrieved from http://sewiki.iai.uni-bonn.de/research/pdt/ |
[11] | Schimps, J., & Shen, K. (2012). ECLiPSe – From LP to CLP. Theory and Practice of Logic Programming, 12, 127-156. |
[12] | Sergio Castro, K. M. (2013). JPC: A Library for Modularising Inter-Language Conversion Concerns between Java and Prolog. International Workshop on Advanced Software Development Tools and Tecniques. |
[13] | Sergio Castro, K. M. (2014). JPC: A Library for Categorising and Applying Inter-Language. International Workshop on Advanced Software Development Tools and Tecniques. |
[14] | Tarau, P. (2004). Agent Oriented Logic Programming Constructs in Jinni 2004. International Conference of Logic Programming. 3132, pp. 477-478. Springer,. |
[15] | Victor Santos Costa, R. R. (2012). The YAP Prolog System. Theory and Practice of Logic Programming, 12, 5-34. |
[16] | Warren, T. S. (2012). XSB: Extending Prolog with Tabled Logic Programming. Theory and Practice of Logic Programming (TPLP), 12, 157-187. |
[17] | Wielemaker, J., & Angelopoulos, N. (2012). Syntactic integration of external languages in Prolog. 22nd Workshop on Logic-based Programming Environments (WLPE 2012), 40-50. |
[18] | Wielemaker, J., Schrijvers, T., & Triska, M. &. (2012). SWI-Prolog. Theory and Practice of Logic Programming, 12, 67-96. |
[19] | XLOG, T. (2010). Language Reference. Jekejeke Prolog 0.8.1. |
[20] | Zalacain Llanes, J. E. (2017). Mapping Objects to Persistent Predicates. arXiv:1705.00556v1. |
APA Style
Jose Eduardo Zalacain Llanes. (2022). Application Provider Interface for Interaction Between Java and Prolog Programming Languages. Mathematics and Computer Science, 7(5), 81-101. https://doi.org/10.11648/j.mcs.20220705.11
ACS Style
Jose Eduardo Zalacain Llanes. Application Provider Interface for Interaction Between Java and Prolog Programming Languages. Math. Comput. Sci. 2022, 7(5), 81-101. doi: 10.11648/j.mcs.20220705.11
@article{10.11648/j.mcs.20220705.11, author = {Jose Eduardo Zalacain Llanes}, title = {Application Provider Interface for Interaction Between Java and Prolog Programming Languages}, journal = {Mathematics and Computer Science}, volume = {7}, number = {5}, pages = {81-101}, doi = {10.11648/j.mcs.20220705.11}, url = {https://doi.org/10.11648/j.mcs.20220705.11}, eprint = {https://article.sciencepublishinggroup.com/pdf/10.11648.j.mcs.20220705.11}, abstract = {There are many initiatives in presents-days for interaction between Java and Prolog programming languages. These initiatives allow combine two programming paradigms, Object Oriented Programming and Logic Programming. Every proposed interface has specifics features depending of the final use. The present paper introduces a new Java Prolog Interface (JPI) to be used for Prolog persistence interacting from Java side and functional programming from Prolog side. JPI define a layered architecture where each component represents a library to connect the final user application with some specific Prolog Engine. The project equals to existing solutions have an implementation for the most popular open source Prolog Engines like SWI, YAP, TuProlog, JLog and JTrolog. To support Java and Prolog interaction an inter-languages data type mappings between Java objects and Prolog terms is implemented. This API have a logic development workflow to create Terms, Engines, Query and some builder classes to help Clauses and Query creation. JPI implement the javax.script interface include in Java from version 1.6. Using a Java Prolog Benchmark test and evaluate different Prolog Engines implementations to determine the performance over JPI. The best performance is obtained using pure Java Prolog Engines respect to Native Engines. JPI is a modern solution that take the best features from existing solutions and combine all in one. It’s more flexible, adaptive and have an Application Provider Interface (API) easy to use. Provides clear and concise access to Prolog and simplifies the integration of predicates in Prolog and provides an automated object-to-term mapping mechanism.}, year = {2022} }
TY - JOUR T1 - Application Provider Interface for Interaction Between Java and Prolog Programming Languages AU - Jose Eduardo Zalacain Llanes Y1 - 2022/09/28 PY - 2022 N1 - https://doi.org/10.11648/j.mcs.20220705.11 DO - 10.11648/j.mcs.20220705.11 T2 - Mathematics and Computer Science JF - Mathematics and Computer Science JO - Mathematics and Computer Science SP - 81 EP - 101 PB - Science Publishing Group SN - 2575-6028 UR - https://doi.org/10.11648/j.mcs.20220705.11 AB - There are many initiatives in presents-days for interaction between Java and Prolog programming languages. These initiatives allow combine two programming paradigms, Object Oriented Programming and Logic Programming. Every proposed interface has specifics features depending of the final use. The present paper introduces a new Java Prolog Interface (JPI) to be used for Prolog persistence interacting from Java side and functional programming from Prolog side. JPI define a layered architecture where each component represents a library to connect the final user application with some specific Prolog Engine. The project equals to existing solutions have an implementation for the most popular open source Prolog Engines like SWI, YAP, TuProlog, JLog and JTrolog. To support Java and Prolog interaction an inter-languages data type mappings between Java objects and Prolog terms is implemented. This API have a logic development workflow to create Terms, Engines, Query and some builder classes to help Clauses and Query creation. JPI implement the javax.script interface include in Java from version 1.6. Using a Java Prolog Benchmark test and evaluate different Prolog Engines implementations to determine the performance over JPI. The best performance is obtained using pure Java Prolog Engines respect to Native Engines. JPI is a modern solution that take the best features from existing solutions and combine all in one. It’s more flexible, adaptive and have an Application Provider Interface (API) easy to use. Provides clear and concise access to Prolog and simplifies the integration of predicates in Prolog and provides an automated object-to-term mapping mechanism. VL - 7 IS - 5 ER -