Page 1 Nov 09, 2004CAS 701, McMaster Logic Programming and Prolog Presenter: John Xu Date: Nov 09, 2004.

Slides:



Advertisements
Similar presentations
Artificial Intelligence: Natural Language and Prolog
Advertisements

CS4026 Formal Models of Computation Part II The Logic Model Lecture 1 – Programming in Logic.
First Order Logic Logic is a mathematical attempt to formalize the way we think. First-order predicate calculus was created in an attempt to mechanize.
Some Prolog Prolog is a logic programming language
Getting started with Prolog
Logic Programming Lecture 1: Getting started. Getting started We’ll use SICStus Prolog Free for UofE students Available on all DICE machines
Inference Rules Universal Instantiation Existential Generalization
SLD-resolution Introduction Most general unifiers SLD-resolution
Prolog for Dummies Ulf Nilsson Dept of Computer and Information Science Linköping University.
Prolog The language of logic. History Kowalski: late 60’s Logician who showed logical proof can support computation. Colmerauer: early 70’s Developed.
Logic Programming – Part 2 Lists Backtracking Optimization (via the cut operator) Meta-Circular Interpreters.
Introduction to Prolog, cont’d Lecturer: Xinming (Simon) Ou CIS 505: Programming Languages Fall 2010 Kansas State University 1.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
Standard Logical Equivalences
Prolog The language of logic. History Kowalski: late 60’s Logician who showed logical proof can support computation. Colmerauer: early 70’s Developed.
1 Introduction to Prolog References: – – Bratko, I., Prolog Programming.
1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
1 Logic Programming. 2 A little bit of Prolog Objects and relations between objects Facts and rules. Upper case are variables. parent(pam, bob).parent(tom,bob).
We have seen that we can use Generalized Modus Ponens (GMP) combined with search to see if a fact is entailed from a Knowledge Base. Unfortunately, there.
For Friday No reading Homework: –Chapter 9, exercise 4 (This is VERY short – do it while you’re running your tests) Make sure you keep variables and constants.
1 Knowledge Based Systems (CM0377) Lecture 8 (Last modified 5th March 2001)
Formal Logic Mathematical Structures for Computer Science Chapter 1 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFormal Logic.
CS 330 Programming Languages 12 / 02 / 2008 Instructor: Michael Eckmann.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
Logic programming. Introduction To express program in symbolic logic Also called declarative language Only the specification of desired results are stated.
Chapter 8: The Logical Paradigm Lecturer: Xinming (Simon) Ou CIS 505: Programming Languages Fall 2010 Kansas State University 1.
1 Applied Computer Science II Resolution in FOL Luc De Raedt.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering A Hole in Goal Trees Notes for: D.W. Loveland and M. Stickel. “A Hole in Goal.
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
Symbolic AI weeks of even numbers Lecture Monday 13:00-14:00 (2Q50) Lab Sessions (five groups, all in 2Q52) Monday.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 15 Logic Programming Q: How many legs does.
CS1502 Formal Methods in Computer Science Lecture Notes 10 Resolution and Horn Sentences.
Formal Models of Computation Part II The Logic Model
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
Slide 1 Logic: Domain Modeling /Proofs + Top-Down Proofs Jim Little UBC CS 322 – CSP October 22, 2014.
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
Logical Agents Logic Propositional Logic Summary
1 COMP 205 Introduction to Prolog Dr. Chunbo Chu Week 14.
Unification Algorithm Input: a finite set Σ of simple expressions Output: a mgu for Σ (if Σ is unifiable) 1. Set k = 0 and  0 = . 2. If Σ  k is a singleton,
1 Prolog and Logic Languages Aaron Bloomfield CS 415 Fall 2005.
Programming Languages. A Logic Programming Language: Prolog This lesson describes the basic structures and functions of the logic programming language:
CS4026 Formal Models of Computation Part II The Logic Model Lecture 2 – Prolog: History and Introduction.
The AI War LISP and Prolog Basic Concepts of Logic Programming
Computing & Information Sciences Kansas State University Lecture 14 of 42 CIS 530 / 730 Artificial Intelligence Lecture 14 of 42 William H. Hsu Department.
Logic Programming and Prolog Goal: use formalism of first-order logic Output described by logical formula (theorem) Input described by set of formulae.
Computing & Information Sciences Kansas State University Monday, 25 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 14 of 42 Monday, 25 September.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 23 Friday, 17 October.
Web Science & Technologies University of Koblenz ▪ Landau, Germany Procedural Semantics Soundness of SLD-Resolution.
Computing & Information Sciences Kansas State University Lecture 15 of 42 CIS 530 / 730 Artificial Intelligence Lecture 15 of 42 William H. Hsu Department.
© Kenneth C. Louden, Chapter 12 - Logic Programming Programming Languages: Principles and Practice, 2nd Ed. Kenneth C. Louden.
1 Knowledge Based Systems (CM0377) Lecture 6 (last modified 20th February 2002)
MB: 26 Feb 2001CS Lecture 11 Introduction Reading: Read Chapter 1 of Bratko Programming in Logic: Prolog.
In The Name Of Allah Lab 03 1Tahani Aldweesh. objectives Searching for the solution’s. Declaration. Query. Comments. Prolog Concepts. Unification. Disjunction.
Answer Extraction To use resolution to answer questions, for example a query of the form  X C(X), we must keep track of the substitutions made during.
6/11/2016 Linear Resolution and Introduction to First Order Logic Michael Leuschel Softwaretechnik und Programmiersprachen Lecture 5.
Review for Test 2 Chapters 5 (start at 5.4), 6.1, , 12, 13, 15.1, Python.
CSE 341, S. Tanimoto Logic Programming -
Resolution in the Propositional Calculus
Prolog programming Introduction to Prolog
First Order Logic: Logical Inference
Logic: Top-down proof procedure and Datalog
Biointelligence Lab School of Computer Sci. & Eng.
Soundness of SLD-Resolution
Biointelligence Lab School of Computer Sci. & Eng.
CSE 3302 Programming Languages
Soundness of SLD-Resolution
Representations & Reasoning Systems (RRS) (2.2)
Logical Inference 4 wrap up
Presentation transcript:

Page 1 Nov 09, 2004CAS 701, McMaster Logic Programming and Prolog Presenter: John Xu Date: Nov 09, 2004

Page 2 Nov 09, 2004CAS 701, McMaster Logic Programming – Example Suppose we have the following sentences 1) A graduate student of CAS must take the core course CAS 701 2) A student can not obtain a degree without passing the required core course I am a graduate student of CAS and want to obtain a degree, should I pass CAS 701?

Page 3 Nov 09, 2004CAS 701, McMaster Logic Programming – Example Structured solution: S: Being a graduate student of CAS T: Taking core course CAS 701 O: Obtaining a degree P: Passing required core course Σ: S => T, ¬P => ¬O, S Λ O Logic consequence: T Λ P

Page 4 Nov 09, 2004CAS 701, McMaster Logic Programming – Definition Logic programming is a declarative approach of writing computer programs based on Logic Prolog, which stands for PROgramming in LOGic, is the most widely available logic programming language

Page 5 Nov 09, 2004CAS 701, McMaster /* Filename: ancestor.pro This program creates a small set of facts and rules on who is the ancestor of whom. The user types the desired goal interactively when the program is run.*/ /* ancestor(A, B) means A is an ancestor of B */ ancestor(bob, susan). ancestor(A, X) :- parent(A, X). ancestor(A, X) :- parent(A, C), ancestor(C, X). /* parent(P, C) means P is a parent of C */ parent(fred, sally). parent(tina, sally). parent(sally, diane). parent(sam, bill).

Page 6 Nov 09, 2004CAS 701, McMaster Logic Programming – Prolog Query Queries: ancestor(fred, sally). Yes ancestor(fred, diane). Yes ancestor(fred, bill). No

Page 7 Nov 09, 2004CAS 701, McMaster Logic Programming – Implementation SLD-Resolution (inference mechanism) Unification: a procedure that takes two atomic formulas as input, and either shows how they can be instantiated to identical atoms or, reports a failure An SLD-derivation of G0 (using P and g1->g2…->gn … SLD-refutation: a finite derivation of the goal g0 Failed derivation: a derivation of the goal g0 with the last element that is not empty and cannot be resolved by any clause of the program

Page 8 Nov 09, 2004CAS 701, McMaster Logic Programming – Implementation Soundness of SLD-resolution Completeness of SLD-resolution Cut: Pruning the SLD-tree

Page 9 Nov 09, 2004CAS 701, McMaster Logic Programming – Reference Book: Ralph P. Grimaldi, DISCRETE AND COMBINATORIAL MATHEMATICS, 5TH ED, Pearson Education, 2004 Ulf Nilsson and Jan Ma luszy_nski, LOGIC, PROGRAMMING AND PROLOG, 2ND ED, Ulf Nilsson and Jan Ma luszy_nski, 2000 Web: