首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到18条相似文献,搜索用时 171 毫秒
1.
Visual Prolog截断机制对回溯的作用机理   总被引:4,自引:0,他引:4  
雷英杰  华继学  徐彤  狄博 《计算机工程》2005,31(18):183-185
回溯是一种获得目标所有可能解的良好方法.然而不恰当地使用回溯,可能导致系统效率降低,时空开销增大,因此必须设置相应机制,仔细控制回溯过程.Visual Prolog的控制谓词,即失败谓词fail和否定谓词not,与截断机制,包括静态截断机制和动态截断机制,构成了完整的目标搜索求解控制机制,可以实现对搜索过程的仔细控制,减少不必要的回溯.该文在考察Visual Prolog回溯机制和截断机制的基础上,通过实例,对其静态截断机制和动态截断机制进行了详细分析,从而揭示回溯机制和截断机制的本质特性和应用机理.  相似文献   

2.
徐彤  雷英杰  谢波  李松 《计算机工程》2005,31(22):192-193
阐明了Visual Prolog中确定性管理机制的目的和方法,归纳了编写确定性和非确定性谓词的基本原则,通过对代码示例中回溯和截断机制的详细分析,给出了结论。  相似文献   

3.
Visual Prolog语言是人工智能与专家系统领域最著名的逻辑程序设计语言,适合表达人的思维和推理规则,能够方便地实现模式匹配、回溯、事实数据库和谓词等功能;针对导弹测试设备结构复杂、故障隔离与定位困难等情况,充分利用Visual Prolog语言在专家系统知识表示及逻辑推理过程中的优点,建立了一个基于规则的导弹测试设备故障诊断专家系统;通过应用表明Visual Prolog语言十分适合构建此类专家系统,并具有良好的开发应用前景.  相似文献   

4.
陈东方  王诚 《福建电脑》2005,(8):117-118
货郎担问题是一个典型的易于描述却难以处理地NP完全问题。而Visual Prolog语言的匹配合一、递归和回溯等特点非常适合求解这类问题。本文利用Visual Prolog实现了简单的货郎担问题。  相似文献   

5.
Godel语言是在Prolog语亩基础上发展而来的一种新型逻辑程序设计语言,而控制机制是逻辑程序设计语言的核心内容.针对Prolog语言控制机制存在的问题,引出了Godel语言中新的控制机制,包括DELAY延迟机制和剪枝操作然后通过实例分析,表明了这些新机制能有效地避免递归谓词的低效或无限循环调用,并能够实现子目标的协同执行,从而提高系统的运行效率.针对这一有效改进,在对Godel语言控制机制比较深入研究的基础上,最后给出了Godel语言控制机制的实现算法.该算法已在研发的Godel语言编译系统中得以实现,通过实例测试,验证了算法具有较高的效率.  相似文献   

6.
遗传算法是一种在搜索过程中自动获取和积累有关搜索空间知识,并自适应地控制搜索过程,从而得到最优解或近似最优解的通用搜索算法,可广泛应用于求解一些非线性、多目标函数的最优化问题.设计了基于遗传算法求解最优路径问题的方法,并讨论了以Visual Studio 2005为开发环境的实现要点.  相似文献   

7.
1.前言prolog 这个名词是由 Program 和 logic 合成而来的。顾名思义,它是以一阶谓词逻辑为基础的语言。用 Prolog 编程序有的叫programming in logic,或 logic programm-ing,这两个术语比 Prolog 语言的适用范围略微广泛一些。不管怎么叫法,反正 Prolog的最大特点都是与 logic 密切相关的。Prolog 的其它特点,还有:(1)模式匹配功能(2)自动回溯功能(3)有灵活性,其参数对于过程的输  相似文献   

8.
PROLOG运行机制的辅助理解工具   总被引:1,自引:0,他引:1  
用表意图形的方法研究了人工智能语言PROLOG的各种语法成份,找出一套有效的辅助理解工具,它能准确清晰地图解PROLOG程序,如目标和子句,谓词FAIL和回溯,以及截断谓词等内容。文中特别用两个例子详述了在PROLOG语言中最难理解的递归过程。最后,简述了矩形表示法,该工具的图册和配套的图形动画软件。  相似文献   

9.
4.含CUT的PROLOG语义 4.1 语言成份“cut”前面所讨论的PROLOG解释程序简单控制策略的问题之一是在子树中进行大量的回溯搜索有可能没有解(在极端情况下,对无限树形结构进行的穷尽搜索会使逻辑上正确的程序永不终止)。语言成份cut为用户提供了控制这类回溯的手段。  相似文献   

10.
刘向娇  吴素萍  刘佳梅 《软件》2010,31(11):54-56
回溯法是一种按照深度优先的策略从根结点开始搜索解空间树的算法,该算法可以用来求出问题的全部解,也可以在求出问题的一个解之后停止对问题的求解,即只求该问题是否有解。哈密顿通路就是判断图中是否存在一条通过所有顶点一次且仅一次的路径。本文主要讲的就是用回溯法来求解一个任意的图中是否存在一条哈密顿通路的问题,并用具体的算法来实现它。  相似文献   

11.
We propose a visual computation model called theBox and Plane Model (BPM), which visually clarifies the semantics of backtracking, the cut operator, and side-effects, thus allowing the procedural features of Prolog to be grasped. On the bases of the BPM, we developed a visual debugger for Prolog, PROEDIT2, which has proved that this kind of pragmatic computation model for Prolog increases the efficiency of the debugging work.  相似文献   

12.
We present the implementation of a Prolog system composed of interpreter and compiler. The originality of our work consists in the adoption of a new framework to realize the main components of the system. The framework relies on new mechanisms, called sleepers. With their help we have developed a complete Prolog interpreter in which all the control activities, from backtracking up to last-call optimization, are performed by the sleeper mechanism. We have also produced a Prolog compiler by using a philosophy and tactics that are completely independent of hardware constraints; it exploits an incremental and abstract implementation technique, based on a delayed non-local execution protocol. Our approach to Prolog system implementation has been extremely useful both in terms of software design and overall performance.  相似文献   

13.
Prolog embodies an ordered input resolution inference mechanism, with a powerful unification procedure. However, Prolog is not a full theorem-prover, and does not contain an inexact reasoning mechanism. In this paper, it is shown how these capabilities can be combined in a Prolog environment. A Prolog meta-interpreter is used in an elegant and simple way for this purpose. The inexact reasoning mechanism is presented through the certainty factor model, but it is also discussed how other inexact reasoning models may be also implemented.  相似文献   

14.
In this paper, we investigate the feasibility of applying logic programming to structured design. We propose to use Prolog as a common machinery for the representation of various structured tools. We illustrate through examples how to produce structure charts from data flow diagrams, and evaluate them according to commonly recommended design guidelines. If the structure charts produced are not satisfactory, the inherent backtracking mechanism in Prolog will help to produce other versions for further evaluation.  相似文献   

15.
Prolog/Rex represents a powerful amalgamation of the latest techniques for knowledge representation and processing, rich in semantic features that ease the difficult task of encoding heterogeneous knowledge of real-world applications. The Prolog/Rex concept mechanism lets a user represent domain entities in terms of their structural and behavioral properties, including multiple inheritance, arbitrary user-defined relations among entities, annotated values (demons), incomplete knowledge, etc. A flexible rule language helps the knowledge engineer capture human expertise and provide flexible control of the reasoning process. Additional Prolog/Rex strength that cannot be found in any other hybrid language made on top of Prolog is language level support for keeping many potentially contradictory solutions to a problem, allowing possible solutions and their implications to be automatically generated and completely explored before they are committed. The same mechanism is used to model time-states, which are useful in planning and scheduling applications of Prolog/Rex  相似文献   

16.
本文提出一种支持PROLOG程序并行执行的智能回溯机制,它是基于数据相关性分析的动静结合的智能回溯策略,在静态编译时通过相关性分析产生各子目标带条件的智能回溯点集合,动态执行时通过对变量的简单测试及对当前运行结果的简单测试来确定当前失败目标的最佳回溯点。  相似文献   

17.
Functional logic languages are declarative programming languages that integrate the programming paradigms of functional and logic languages within a single framework. They are extensions of functional languages with principles derived from logic programmingNarrowing, the evaluation mechanism of functional logic languages, can be defined as a generalization ofreduction, the evaluation mechanism of purely functional languages. The unidirectional pattern matching, which is used for parameter passing in functional languages, is simply replaced by the bidirectionalunification known from logic programming languages. We show in this paper, how to extend a reduction machine, that has been designed for the evaluation of purely functional programs to a machine that performs narrowing. The necessary extensions concern the realization of unification and backtracking, for which we fall back upon the methods of Warren’s Prolog engine.21) The narrowing machine embodies an optimized treatment of deterministic computations. A complete specification of the reduction and the narrowing machine and of the translation of a sample language into abstract machine code is given. Comparative results of a C-implementation of the reduction and the narrowing machine show that the time overhead of the more complex narrowing evaluation is, in general, less than 10% of the reduction evaluation.  相似文献   

18.
本文提出了一种抽象机GOAM,是Prolog语言新的运行和实现方式,因为GOAM内存管理是一种堆式内存分配方法,所以具有潜在的并行性,另外GOAM控制算法是智能回溯方法,GOAM在没有引入冗余信息的情况下提高了系统的效率。  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号