首页> 外文期刊>The Journal of Logic Programming >SLR inference: An inference system for fixed-mode logic programs, based on SLR parsing
【24h】

SLR inference: An inference system for fixed-mode logic programs, based on SLR parsing

机译:SLR推理:基于SLR解析的固定模式逻辑程序的推理系统

获取原文
获取原文并翻译 | 示例
       

摘要

Definite-clause grammars (DCGs) generalize context-free grammars in such a way that Prolog can be used as a parser in the presence of context-sensitive information. Prolog's proof procedure, however, is based on backtracking, which may be a source of inefficiency. Parsers for context-free grammars that use backtracking, for instance, were soon replaced by more efficient methods, such as LR parsers. This suggests incorporating the principles underlying LR parsing into a parser for grammars with context-sensitive information. We present a technique that applies a transformation to the program/grammar by adding leaves to the proof/parse trees and placing the contextual information in such leaves. An inference system is then easily obtained from an LR parser, since only the parts dealing with terminals (which appear at the leaves) must be modified. Although our method is restricted to programs with fixed modes, it may be preferable to DCGs under Prolog for some programs. (C) Elsevier Science Inc., 1998. [References: 34]
机译:定句语法(DCG)泛化了无上下文语法,使得Prolog可以在存在上下文敏感信息的情况下用作解析器。但是,Prolog的证明程序基于回溯,这可能会导致效率低下。例如,使用回溯的无上下文语法解析器很快就被更高效的方法(例如LR解析器)所取代。这建议将LR解析的基本原理合并到具有上下文相关信息的语法解析器中。我们提出了一种通过将叶子添加到证明/解析树并将上下文信息放置在这样的叶子中来对程序/语法进行转换的技术。然后,可以从LR解析器轻松获得推理系统,因为仅需要修改处理终端的部分(出现在叶子上)。尽管我们的方法仅限于固定模式的程序,但对于某些程序,它可能比Prolog下的DCG更可取。 (C)Elsevier Science Inc.,1998年。[参考:34]

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号