arXivDaily arXiv每日学术速递 周一至周五更新
北美退伍军人节(Veterans Day),12 日无更新
arXiv cs/9809016cs.PL
收藏

逻辑程序设计中的作用域构造:实现问题及其解决方案

Scoping Constructs in Logic Programming: Implementation Problems and their Solution

Gopalan Nadathur, Bharat Jayaraman, Keehang Kwon

摘要:

本文考虑了逻辑程序设计中目标的泛量化和蕴涵形式。这些新增内容为范围界定提供了逻辑基础,但也带来了新的实现问题。当全称量词和存在量词被允许以混合顺序出现在目标中时,必须修改用于解决存在目标的逻辑变量和统一的设备,以确保尊重量化顺序产生的约束。适当的修改,是基于附加数字标签的常数和变量,并在统一使用这些标签。由此产生的设备是服从一个有效的实施,并可以,事实上,很容易被同化到沃伦抽象机(WAM)的通常机械。在目标中提供含义导致了程序子句被添加到程序中以解决特定子目标的可能性。基于断言和撤回程序条款的天真方案不足以实现此类添加,原因有两个。首先,在回溯时,也有必要支持早期现有程序的复活。第二,隐含目标被量词包围的可能性需要考虑程序子句通过绑定其自由变量的参数化。用于支持这些附加要求的设备也被描述为将这些设备集成到WAM中。进一步扩展的机器概述了处理高阶添加到语言。这里提出的想法是相关的高阶逻辑程序设计语言lambda Prolog的实现。

英文摘要:

The inclusion of universal quantification and a form of implication in goals in logic programming is considered. These additions provide a logical basis for scoping but they also raise new implementation problems. When universal and existential quantifiers are permitted to appear in mixed order in goals, the devices of logic variables and unification that are employed in solving existential goals must be modified to ensure that constraints arising out of the order of quantification are respected. Suitable modifications that are based on attaching numerical tags to constants and variables and on using these tags in unification are described. The resulting devices are amenable to an efficient implementation and can, in fact, be assimilated easily into the usual machinery of the Warren Abstract Machine (WAM). The provision of implications in goals results in the possibility of program clauses being added to the program for the purpose of solving specific subgoals. A naive scheme based on asserting and retracting program clauses does not suffice for implementing such additions for two reasons. First, it is necessary to also support the resurrection of an earlier existing program in the face of backtracking. Second, the possibility for implication goals to be surrounded by quantifiers requires a consideration of the parameterization of program clauses by bindings for their free variables. Devices for supporting these additional requirements are described as also is the integration of these devices into the WAM. Further extensions to the machine are outlined for handling higher-order additions to the language. The ideas presented here are relevant to the implementation of the higher-order logic programming language lambda Prolog.

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

↑