arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1405.2693cs.PL
收藏

Prolog程序中Java引用的可定制处理

Customisable Handling of Java References in Prolog Programs

Sergio Castro, Kim Mens, Paulo Moura

摘要:

用于组合以不同语言范式编写的程序的集成技术有助于以最适合其任务的语言实现专用模块。在Java-Prolog集成的情况下,一个已知的问题是Prolog端对Java对象的引用的正确表示。要解决这一问题,需要从多个方面进行考虑,包括引用表示、表示的不透明性、身份保持、引用寿命和跨语言转换策略的范围。本文提出了一种方法,解决所有这些方面,概括和建立在Prolog中的外国参考文献的现有表示模式,并从其他领域中发现的类似的中间语言表示技术中汲取灵感。我们的方法通过对Prolog引擎与Java的交互做一些假设(例如,嵌入或作为外部进程执行)。我们验证我们的工作扩展JPC,一个开源的集成库,支持我们的方法的功能。我们的JPC库目前通过驱动程序与三种不同的开源Prolog引擎(SWI,YAP和XSB)兼容。出现在逻辑编程理论与实践(TPLP)中。

英文摘要:

Integration techniques for combining programs written in distinct language paradigms facilitate the implementation of specialised modules in the best language for their task. In the case of Java-Prolog integration, a known problem is the proper representation of references to Java objects on the Prolog side. To solve it adequately, multiple dimensions should be considered, including reference representation, opacity of the representation, identity preservation, reference life span, and scope of the inter-language conversion policies. This paper presents an approach that addresses all these dimensions, generalising and building on existing representation patterns of foreign references in Prolog, and taking inspiration from similar inter-language representation techniques found in other domains. Our approach maximises portability by making few assumptions about the Prolog engine interacting with Java (e.g., embedded or executed as an external process). We validate our work by extending JPC, an open-source integration library, with features supporting our approach. Our JPC library is currently compatible with three different open source Prolog engines (SWI, YAP} and XSB) by means of drivers. To appear in Theory and Practice of Logic Programming (TPLP).

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑