Invitation to Computer Science, Java Version, Second Edition 1 Logic Programming Logic programming  Various facts are asserted to be true  On the basis.

Slides:



Advertisements
Similar presentations
Knowledge Representation using First-Order Logic
Advertisements

First-Order Logic Chapter 8.
Modelling with expert systems. Expert systems Modelling with expert systems Coaching modelling with expert systems Advantages and limitations of modelling.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Structures. Procedural (Imperative) Languages Procedural languages work on the basis of explicitly telling the computer ‘how to do something’; by using.
Prolog The language of logic. History Kowalski: late 60’s Logician who showed logical proof can support computation. Colmerauer: early 70’s Developed.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Prolog COMP 112 #
Formal Logic Mathematical Structures for Computer Science Chapter 1 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFormal Logic.
Comp 205: Comparative Programming Languages Declarative Programming Languages Logic Programming Horn-Clause Logic Prolog Lecture notes, exercises, etc.,
Introduction to Prolog What is Prolog? Application Areas of Prolog How does Prolog work? (Syntax of Prolog) Program Structure.
1 5.0 Expert Systems Outline 5.1 Introduction 5.2 Rules for Knowledge Representation 5.3 Types of rules 5.4 Rule-based systems 5.5 Reasoning approaches.
Rules and Expert Systems
Chapter 9: The Tower of Babel Invitation to Computer Science, C++ Version, Fourth Edition Additions by S. Steinfadt for SP08.
Chapter 9: The Tower of Babel Invitation to Computer Science, Java Version, Third Edition.
Chapter 9: The Tower of Babel Invitation to Computer Science, C++ Version, Fourth Edition Editied / additions by S. Steinfadt for SP09.
Chapter 9: The Tower of Babel
Represent the following sentences in first-order logic, using a consistent vocabulary
Alternative Programming Paradigms
ICT in Healthcare Expert Systems.
DEDUCTIVE DATABASE.
Chapter 9: The Tower of Babel Invitation to Computer Science, C++ Version, Third Edition.
PROLOG KAIST Gunwoo Park 1. What’s Prolog? 2  General purpose logic programming language  Declarative, which means that the program logic is.
Chapter 14: Artificial Intelligence Invitation to Computer Science, C++ Version, Third Edition.
Artificial Intelligence: Definition “... the branch of computer science that is concerned with the automation of intelligent behavior.” (Luger, 2009) “The.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
Programming languages1 Programming paradigms Families of programming languages.
Programming Paradigms
 Knowledge Acquisition  Machine Learning. The transfer and transformation of potential problem solving expertise from some knowledge source to a program.
School of Computer Science and Technology, Tianjin University
1 COSC3306: Programming Paradigms Lecture 8: Declarative Programming Specifications Haibin Zhu, Ph.D. Computer Science Nipissing University (C) 2003.
Lecture on Programming Languages
Artificial Intelligence LECTURE 2 ARTIFICIAL INTELLIGENCE LECTURES BY ENGR. QAZI ZIA 1.
603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 22 A First Course in Database Systems.
1 Prolog and Logic Languages Aaron Bloomfield CS 415 Fall 2005.
CS 152: Programming Language Paradigms February 26 Class Meeting Department of Computer Science San Jose State University Spring 2014 Instructor: Ron Mak.
Chapter 9: The Tower of Babel 國立雲林科技大學 資訊工程研究所 張傳育 (Chuan-Yu Chang ) 博士 Office: ES 709 TEL: ext 國立雲林科技大學.
Invitation to Computer Science 5th Edition
CS 345: Programming Language Paradigms Chris Brooks HR 510 MWF 11:00-12:05.
Ontology-Based Computing Kenneth Baclawski Northeastern University and Jarg.
CS4026 Formal Models of Computation Part II The Logic Model Lecture 2 – Prolog: History and Introduction.
Prolog Kyle Marcotte. Outline What is Prolog? Origins of Prolog (History) Basic Tutorial TEST!!! (sort of…actually not really at all) My example Why Prolog?
ES component and structure Dr. Ahmed Elfaig The production system or rule-based system has three main component and subcomponents shown in Figure 1. 1.Knowledge.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
Logical and Functional Programming
What is Science? Science – A way of learning about the natural world. Uses observation and logical reasoning. Scientific Inquiry – Refers to the various.
Introduction to Prolog. Outline What is Prolog? Prolog basics Prolog Demo Syntax: –Atoms and Variables –Complex Terms –Facts & Queries –Rules Examples.
Logic Programming (LP) expresses code using of a restricted form of symbolic logic. LP programs are declarative, rather than algorithmic. An LP program.
603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 21 A First Course in Database Systems.
CSE (c) S. Tanimoto, 2008 ISA Hierarchies 1 ISA Hierarchies: A Basis for Knowledge Representation with Semantic Networks Outline: Introduction The.
Chapter 9 ProgrammingLanguages.  Describe the evolution of programming languages from machine language to high-level languages.  Understand how a program.
What is Science? Science – A way of learning about the natural world through observation and logical reasoning. Scientific Inquiry – Refers to the various.
Logic Programming Dr. Yasser Nada Fall 2010/2011 Lecture 1 1 Logic Programming.
MB: 26 Feb 2001CS Lecture 11 Introduction Reading: Read Chapter 1 of Bratko Programming in Logic: Prolog.
Knowledge Based Information System
Invitation to Computer Science 6 th Edition Chapter 10 The Tower of Babel.
Done By :- -Nesreen Basem -Sara nabil -Rawan Prolog Program.
Software Design and Development Languages and Environments Computing Science.
Artificial Intelligence Knowledge Representation.
Review for Test 2 Chapters 5 (start at 5.4), 6.1, , 12, 13, 15.1, Python.
CPS120 Introduction to Computer Science High Level Language: Paradigms.
By P. S. Suryateja Asst. Professor, CSE Vishnu Institute of Technology
Introduction to Prolog
النظم الخبيرة Expert Systems (ES)
Probabilistic Horn abduction and Bayesian Networks
Rational Rose 2018/12/30.
TA : Mubarakah Otbi, Duaa al Ofi , Huda al Hakami
Ontology.
Topics discussed in this section:
Chapter 2: Prolog (Introduction and Basic Concepts)
Presentation transcript:

Invitation to Computer Science, Java Version, Second Edition 1 Logic Programming Logic programming  Various facts are asserted to be true  On the basis of these facts, a logic program can infer or deduce other facts  A query can be posed to the program The program applies logical deductions to answer the query Logic programming languages are sometimes called declarative languages

Invitation to Computer Science, Java Version, Second Edition 2 Logic Programming (continued) Logic programming has been used to write expert systems Prolog (PROgramming in LOGic)  Developed in France at the University of Marseilles in 1972 by a group headed by A. Colmerauer

Invitation to Computer Science, Java Version, Second Edition 3 Logic Programming (continued) Prolog programs  Consist of “facts” and “rules” A fact expresses a property about a single object or a relationship among several objects A rule is a declaration of an “if A then B” form  We interact with the program by posing queries

Invitation to Computer Science, Java Version, Second Edition 4 Figure 9.10 A Prolog Program

Invitation to Computer Science, Java Version, Second Edition 5 Some examples of Queries Q: ?-before (lincoln, fdr) A: Yes Q: ?-president (lincoln, civil_war). A: Yes Q: ?-president (lincoln, civil_war), before(fdr, lincoln). A: No

Invitation to Computer Science, Java Version, Second Edition 6 More Queries Q: ?-before (T, fdr). A: T = lincoln Q: ?-president (lincoln, X). A: X = gettysburg_address X = civil_war

Invitation to Computer Science, Java Version, Second Edition 7 More Queries Q: ?-precedes (jefferson, lincoln). A: YES Q: ?-precedes (lincoln, nixon). A: YES Q: ?-precedes (lincoln, nixon). A: NO (Why?) More Queries Q: ?-precedes (lincoln, X). A: X = fdr X = kennedy X = nixon Q: ?-precedes (lincoln, bush). A: NO (Why?)

Invitation to Computer Science, Java Version, Second Edition 8 Logic Programming (continued) Logic programming paradigm  The program is a knowledge base of facts and rules about a certain domain of interest  Interaction with the program: posing queries to an inference engine (also called a query interpreter)

Invitation to Computer Science, Java Version, Second Edition 9 Figure 9.11 The Logic Programming Paradigm