【精品】关于2010年度高级工程师任职资格评审  .67_第1页
【精品】关于2010年度高级工程师任职资格评审  .67_第2页
【精品】关于2010年度高级工程师任职资格评审  .67_第3页
【精品】关于2010年度高级工程师任职资格评审  .67_第4页
【精品】关于2010年度高级工程师任职资格评审  .67_第5页
已阅读5页,还剩3页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

CSE 341 - S. Tanimoto Introduction to Prolog,1,Introduction to Prolog,MotivationSample problemExample program: grandmother.plSample sessionA question about logic and programmingWhat is a program?,CSE 341 - S. Tanimoto Introduction to Prolog,2,Motivation,1. Reduce the programming burden.2. System should simply accept the necessary information and the objective (goal), and then figure out its own solution.3. Have a program that looks more like its own specification.4. Take advantage of logical inference to automatically get many of the consequences of the given information.,CSE 341 - S. Tanimoto Introduction to Prolog,3,Sample Problem,For someone (call him or her X) to be the grandmother of someone else (call him or her Y), X must be the mother of someone (call him or her Z) who is a parent of Y.Someone is a parent of another person, if that someone is either the mother or the father of the other person.Mary is the mother of Stan.Gwen is the mother of Alice.Valery is the mother of Gwen.Stan is the father of Alice.The question: Who is a grandmother of Alice?,CSE 341 - S. Tanimoto Introduction to Prolog,4,Sample Prolog Program: grandmother.pl,grandmother(X, Y) :- mother(X, Z), parent(Z, Y).parent(X, Y) :- mother(X, Y).parent(X, Y) :- father(X, Y).mother(mary, stan).mother(gwen, alice).mother(valery, gwen).father(stan, alice).,CSE 341 - S. Tanimoto Introduction to Prolog,5,Sample Session,Welcome to SWI-Prolog (Version 3.3.2)Copyright (c) 1990-2000 University of Amsterdam. All rights reserved.For help, use ?- help(Topic). or ?- apropos(Word).?- grandmother.% grandmother compiled 0.00 sec, 1,312 bytesYes?- grandmother(X, alice).X = mary ;X = valery ;No?-,CSE 341 - S. Tanimoto Introduction to Prolog,6,A Question about Logic & Programming,Q: Is a logical description of a problem actually a program?,CSE 341 - S. Tanimoto Introduction to Prolog,7,What is a program?,A specification for a computation. The specification must be effective - interp

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论