Ch 14. An Introduction to Prolog.ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Ch 14. An Introduction to Prolog.ppt

Artificial Intelligence Ch 14. An Introduction to Prolog an Implementation of logic as a programming language(PROgramming in LOGig) many interesting contributions to AI problem solving declarative semantics built-in unification high-powered techniques for pattern matching and search 14.1 Syntax for Predicate Calculus Programming 14.1.1 Representing Facts and Rules 14.1.2 Creating, Changing, and Monitoring the PROLOG Environment 14.1.3 Lists and Recursion in PROLOG 14.1.4 Recursive Search in PROLOG 14.1.5 The Use of Cut 14.1.1 Representing Facts and Rules(1) English Predicate Calculus PROLOG and ù , or ú ; only if ? :- not ? not “Everyone likes Susie.” likes(X, susie). or likes(Everyone, susie). The set of people that are liked by George AND Susie likes(george, Y), likes(susie, Y). “George likes Kate OR George likes Susie.” likes(george, kate); likes(george, susie). 14.1.1 Representing Facts and Rules(2) “George likes Susie if George likes Kate.” likes(george, susie) :- likes(george, kate). “Kate does not like Susie.” not(likes(kate, susie)). A Model for the database Database - a set of specifications describing the objects and relations in a problem domain Queries to the database are patterns in the same logical syntax as the database entries. Prolog interpreter uses pattern-directed search to find whether these queries logically follow from the contents of the database. 14.1.1 Representing Facts and Rules(3) Prolog exmaple 14.1.1 Representing Facts and Rules(4) Prolog interpertations The prompts with (;) forces a backtrack on the most recent result. Continued prompts force Prolog to find all possible solutions to the query Closed world assumption or Negations as failure assumes that “anything is false if it is not known to be true.” Horn clause logic the left hand side(conclusion) of an implication must be a single positive literal. An example of a rule friends(X, Y) :- likes(X, Z), likes(Y, Z). ?- friends(george, susie). yes Prolog d

文档评论(0)

gshshxx + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档