[论文解读] Customisable handling of Java references in prolog programs
本文提出了一种可定制、可移植的方法,用于在 Prolog 程序中表示和管理 Java 对象引用,通过解决引用表示、透明性、身份保留和生命周期管理等关键维度来实现。该方法扩展了 JPC 库,以支持三种主要的 Prolog 引擎(SWI、YAP、XSB),实现了与 Prolog 引擎环境无关的无缝互操作,且对 Prolog 引擎环境的假设极少。
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
研究动机与目标
- 解决在 Prolog 程序中表示 Java 对象引用的问题,以保留对象身份和生命周期管理。
- 将现有的 Prolog 外部引用模式泛化,以支持多种跨语言交互维度。
- 最小化对 Prolog 引擎环境的假设,提升在不同执行模型(嵌入式或外部进程)下的可移植性。
- 提供一个灵活、可扩展的框架,用于管理跨语言引用转换策略。
- 通过将该方法集成到开源 JPC 库中进行验证,确保与多种 Prolog 引擎的兼容性。
提出的方法
- 设计一种支持透明性、身份保留和受控生命周期管理的引用表示模型,用于在 Prolog 中管理 Java 对象。
- 定义一种基于策略的转换机制,用于跨语言引用处理,允许对作用域和行为进行自定义。
- 在 JPC 库中实现基于驱动的架构,以抽象引擎特定的细节,确保在不同 Prolog 引擎间的兼容性。
- 借鉴其他领域已有的跨语言表示技术,以指导引用语义的设计。
- 扩展 JPC 以支持可定制的引用处理模式,将引用语义与引擎特定的实现解耦。
- 通过在三种开源 Prolog 引擎(SWI、YAP、XSB)上进行部署和测试,验证该方法。
实验结果
研究问题
- RQ1如何在 Prolog 中表示 Java 对象引用,以保留对象身份并支持受控的生命周期管理?
- RQ2哪些设计原则能够实现在不同执行模型下具有差异的 Prolog 引擎之间对外部引用的可移植处理?
- RQ3统一的引用管理模型在多样的跨语言集成模式中能多大程度上被泛化?
- RQ4如何控制引用表示的透明性和作用域,以支持安全且高效的互操作?
- RQ5采用基于策略的方法进行跨语言引用转换,其实际权衡与优势是什么?
主要发现
- 所提出的方法成功实现了在多个 Prolog 引擎之间对 Java 对象引用的一致表示与管理。
- JPC 库的扩展使得能够通过统一的抽象层,与 SWI-Prolog、YAP 和 XSB Prolog 引擎实现无缝集成。
- 该设计最小化了对 Prolog 引擎环境的假设,显著提升了可移植性和可重用性。
- 该方法通过整合多种引用处理维度,泛化并扩展了现有的 Prolog 外部引用模式。
- 通过使用驱动机制,可在保持统一引用管理接口的同时,实现对不同引擎的特定适配。
- 该解决方案支持可定制的引用转换策略,实现了对作用域、生命周期和可见性的细粒度控制。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。