Basic Semantics of Prolog. CAS 706 Program m ing Language. Xinjun Wu mcmaster.ca

Size: px
Start display at page:

Download "Basic Semantics of Prolog. CAS 706 Program m ing Language. Xinjun Wu mcmaster.ca"

Transcription

1 Basic Semantics of Prolog CAS 706 Program m ing Language Xinjun Wu wux8@ mcmaster.ca Basic Sem antics ofprolog Logic Program m ing Language 1 Preface Logical programming or constraint programming is a program m ing paradigm in which a set ofattributes thata solution should have are specified rather than setof steps to obtain such a solution.a widely used logicalprogramming language is Prolog.Another is M ercury. Basic Sem antics ofprolog Logic Program m ing Language 2

2 Preface (Cont ) The nam e prolog is an acronym for PROgramming in LO Gic.It was created by Alain Colm eraueraround 1970s.It was an attem ptto make a programming language thatenables to express logic instead ofcarefu ly specifying instructions on the com puter. Basic Sem antics ofprolog Logic Program m ing Language 3 Form alsem antics form alsem antics is the field concerned with the rigorous m athem aticalstudy of the meaning ofprogramming languages and m odels ofcom putation. Basic Sem antics ofprolog Logic Program m ing Language 4

3 Form alsem antics (Cont ) Denotationalsem antics Operationalsem antics Axiom atic sem antics Basic Sem antics ofprolog Logic Program m ing Language 5 OperationalSem antics An operationalsem antics for a particular programming language describes how any particular valid program in the language is interpreted as sequences ofcom putationalsteps. These sequences then are the m eaning ofthe program. Basic Sem antics ofprolog Logic Program m ing Language 6

4 Tw o Prerequisites Concepts Horn clause "O n sentences which are true ofdirect unions ofalgebras",alfred Horn SLD -resolution,sld-tree SLD-resolution principle is the core ofprolog Basic Sem antics ofprolog Logic Program m ing Language 7 Horn Clauses Horn clause is a proposition ofthe general type (p and q and...and t) implies u, w here the num ber ofpropositions com bined by ands is as large as we like Horn Clause Predicate Six-step procedure translate a predicate p into a Horn Clause.(Pg 257 text) Basic Sem antics ofprolog Logic Program m ing Language 8

5 SLD-resolution principle Be summarized as the fo low ing inference rule ( A1... Ai 1 Ai Ai Am) (H B 1... B n) ( A... A B... B A... A ) θ 1 i 1 1 n i+ 1 m A1,..., A m and H, B 1,...,B n are atomic formulas 1 i m and n 0 θ is a most general unifier of A i and H Basic Sem antics ofprolog Logic Program m ing Language 9 SLD-tree?-customer_of(P, sinclair) :- owns(p, O), makes(sinclair, O) :-makes(sinclair, pavillion) :-makes(sinclair, zx81) :-makes(sinclair, spectrum) Basic Sem antics ofprolog Logic Program m ing Language 10

6 Constructive Item s Term s: Constants & Variables & Com pound Term Predicates: Relations Clauses: Statem ents ofprogram Fact: A Clause withoutbody Query: A Clause withouthead,and Others. Prolog = Fact+ Rule Basic Sem antics ofprolog Logic Program m ing Language 11 ControlConstraints None ofusualcontrolconstraints Such as: do,w hile,for loop,goto etc. Cut(!) may actlike Goto,butnot perm anent,w e wilstudy the case withoutcut Basic Sem antics ofprolog Logic Program m ing Language 12

7 Syntactic Categories Variable::= Var Functor::= Func Predicate::= Pred Term ::= Term Term ::= Variable+ Functor(Term 1, Termn) Basic Sem antics ofprolog Logic Program m ing Language 13 Syntactic Categories (Cont ) Atom ::= Predicate(Term 1, Termn) Literal::= Atom +! Goal::= Literal* Clause::= Atom :-G oal Basic Sem antics ofprolog Logic Program m ing Language 14

8 Interpreter of O perationalsem antics The operationalsem antics is given by an interpreter thatrepeatedly transform s a state encoding a leftm ost SLD-tree interp : State x Clause* FSubst FSubstis the setoffinite substitution Basic Sem antics ofprolog Logic Program m ing Language 15 Term inology Frame :: = Atom*, Var p A goalto be solved and a setofvariables FrameList :: = nil Frame :: FrameList Stack :: = nil FrameList, Subst, Clause* :: Stack Substis the currentfinite substitution State :: = Stack Basic Sem antics ofprolog Logic Program m ing Language 16

9 OperationalSem antics --1 interp : State x Clause* FSubst interp( nil, P) = nil Execution term inates when the runtime stack becom es em pty Basic Sem antics ofprolog Logic Program m ing Language 17 OperationalSem antics --2 in te rp ( n i l, φ, C :: S t, P ) = φ :: in te rp ( S t, P ) When the goalto be solved in the current fram e becom es em pty,a solution has been found,the current substitution is therefore returned,and execution backtracks to search for other solution Basic Sem antics ofprolog Logic Program m ing Language 18

10 OperationalSem antics --3 in terp ( F, φ, nil :: St, P ) 0 = in terp ( St, P) if F nil 0 If there are no more program clauses to match Againsta non-em pty goal,execution fails and Backtracking takes place Basic Sem antics ofprolog Logic Program m ing Language 19 OperationalSem antics --4 ( L GV F φ H B C St P) interp ::, ::,, ( : ) :: ::, o ' P = interp( F ::F ::F, θφ,p :: St,P), where H : B = rename(( H : B ), dom( φ)); θ = unify( φ( L), H ) ( fail) V = dom( φ); F = B, V ; F = G,V ; St ' 2 1 P 1 P 1 P = L::G,V :: F, φ, C :: St P 0 0 Unification Basic Sem antics ofprolog Logic Program m ing Language 20

11 O perationalsem antics 4 (Cont ) A non-em pty goaland sequence ofclauses,if the head ofthe first clause,after appropriate renam ing ofclause variables, unifies with the leftmostliteral,the fram e list is extended with a fram e describing the subgoalconsisting ofthe body ofthatclause, the originalgoal,together with the untried clauses,saved on the stack so that alternative solution may be found on backtracking Basic Sem antics ofprolog Logic Program m ing Language 21 OperationalSem antics --5 interp( L :: GV, :: F, φ,( H : - B) :: C :: St, P) P =interp( L:: G, V :: F, φ, C :: St, P), where P 0 0 H : B = rename(( H : B ), dom( φ)), and unify( φ( L), H ) = fail 1 Unification Basic Sem antics ofprolog Logic Program m ing Language 22

12 Supplem entary Definition φ: V T, andw V, Given a finite substitution The projection of φ on W,written Is the finite substitution with dom ain V1 = W ( vars( φ( v))) v w φ W Basic Sem antics ofprolog Logic Program m ing Language 23 OperationalSem antics --6 interp( nil, V :: F, φ, C :: St, P ) P 0 =interp( F, φ V, P :: St, P) 0 P Basic Sem antics ofprolog Logic Program m ing Language 24

13 Bibliography Saum ya K.Debray,Prateek M ishra Denotationaland O perationalsem antics for Prolog,The University of Arizona John Malpas, Prolog:A Relationallanguage and its Applications,1987.ISBN: UlfNilsson and Jan Maluszynski, Logic,Programming and Prolog,1990.ISBN: Basic Sem antics ofprolog Logic Program m ing Language 25 Thank you Basic Sem antics ofprolog Logic Program m ing Language 26

Brief Introduction to Prolog

Brief Introduction to Prolog Brief to Prolog Joana Côrte-Real jcr@dcc.fc.up.pt CRACS & INESC TEC Faculty of Sciences University of Porto University of Aizu 5th December 2014 1 / 27 Overview 1 to Prolog Prolog Syntax Tutorial 1 2 Lists

More information

Logic. Knowledge Representation & Reasoning Mechanisms. Logic. Propositional Logic Predicate Logic (predicate Calculus) Automated Reasoning

Logic. Knowledge Representation & Reasoning Mechanisms. Logic. Propositional Logic Predicate Logic (predicate Calculus) Automated Reasoning Logic Knowledge Representation & Reasoning Mechanisms Logic Logic as KR Propositional Logic Predicate Logic (predicate Calculus) Automated Reasoning Logical inferences Resolution and Theorem-proving Logic

More information

Strong AI vs. Weak AI Automated Reasoning

Strong AI vs. Weak AI Automated Reasoning Strong AI vs. Weak AI Automated Reasoning George F Luger ARTIFICIAL INTELLIGENCE 6th edition Structures and Strategies for Complex Problem Solving Artificial intelligence can be classified into two categories:

More information

Computational Logic Fundamentals (of Definite Programs): Syntax and Semantics

Computational Logic Fundamentals (of Definite Programs): Syntax and Semantics Computational Logic Fundamentals (of Definite Programs): Syntax and Semantics 1 Towards Logic Programming Conclusion: resolution is a complete and effective deduction mechanism using: Horn clauses (related

More information

Top-Down Execution CS240B Notes

Top-Down Execution CS240B Notes Top-Down Execution CS240B Notes Notes based on Section 9.4 of Advanced Database Systems Morgan Kaufmann, 1997 C. Zaniolo, March 2002 p.1/22 Top-Down Execution of Datalog A strict bottom-up execution strategy

More information

Unification and occur check. The programming language Prolog

Unification and occur check. The programming language Prolog Resolution and Logic Programming Ground resolution Unification and occur check General Resolution Logic Programming SLD-resolution The programming language Prolog Syntax Arithmetic Lists Slide 1 Motivation

More information

Propositional and Predicate Logic - V

Propositional and Predicate Logic - V Propositional and Predicate Logic - V Petr Gregor KTIML MFF UK WS 2016/2017 Petr Gregor (KTIML MFF UK) Propositional and Predicate Logic - V WS 2016/2017 1 / 21 Formal proof systems Hilbert s calculus

More information

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence Foundations of Artificial Intelligence 31. Propositional Logic: DPLL Algorithm Malte Helmert and Gabriele Röger University of Basel April 24, 2017 Propositional Logic: Overview Chapter overview: propositional

More information

Propositional Reasoning

Propositional Reasoning Propositional Reasoning CS 440 / ECE 448 Introduction to Artificial Intelligence Instructor: Eyal Amir Grad TAs: Wen Pu, Yonatan Bisk Undergrad TAs: Sam Johnson, Nikhil Johri Spring 2010 Intro to AI (CS

More information

Advanced Topics in LP and FP

Advanced Topics in LP and FP Lecture 3: Logic Programming in Prolog Outline 1 2 3 The control of execution Logic Programming Declarative programming style: Emphasis on What is the solution? instead of How to find the solution? Symbolic

More information

Prolog. Resolution (for beginners?) Resolution (cont.) Resolution (cont.) Unification. Resolution (still cont.) Resolution & Unification

Prolog. Resolution (for beginners?) Resolution (cont.) Resolution (cont.) Unification. Resolution (still cont.) Resolution & Unification Resolution & Unification Prolog Computer Science Resolution (for beginners?) Resolution is a theorem proving method developed by Robinson based on representing logical formulas as clauses Clauses are build

More information

Prolog and Logic Programming. CS152 Chris Pollett Dec. 3, 2008.

Prolog and Logic Programming. CS152 Chris Pollett Dec. 3, 2008. Prolog and Logic Programming CS152 Chris Pollett Dec. 3, 2008. Outline Logic and Logic Programs Horn Clauses Resolution and Unification Prolog Introduction So far this semester we have considered three

More information

Advanced Topics in LP and FP

Advanced Topics in LP and FP Lecture 1: Prolog and Summary of this lecture 1 Introduction to Prolog 2 3 Truth value evaluation 4 Prolog Logic programming language Introduction to Prolog Introduced in the 1970s Program = collection

More information

Inference in first-order logic

Inference in first-order logic CS 2710 Foundations of AI Lecture 15 Inference in first-order logic Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square Logical inference in FOL Logical inference problem: Given a knowledge base KB

More information

Logic & Computation. Autonomous Systems. Sistemi Autonomi. Andrea Omicini

Logic & Computation. Autonomous Systems. Sistemi Autonomi. Andrea Omicini Logic & Computation Autonomous Systems Sistemi Autonomi Andrea Omicini andrea.omicini@unibo.it Dipartimento di Informatica Scienza e Ingegneria (DISI) Alma Mater Studiorum Università di Bologna Academic

More information

Logic: Top-down proof procedure and Datalog

Logic: Top-down proof procedure and Datalog Logic: Top-down proof procedure and Datalog CPSC 322 Logic 4 Textbook 5.2 March 11, 2011 Lecture Overview Recap: Bottom-up proof procedure is sound and complete Top-down Proof Procedure Datalog 2 Logical

More information

Lecture 10: Even more on predicate logic" Prerequisites for lifted inference: Skolemization and Unification" Inference in predicate logic"

Lecture 10: Even more on predicate logic Prerequisites for lifted inference: Skolemization and Unification Inference in predicate logic CS440/ECE448: Intro to Artificial Intelligence Lecture 10: Even more on predicate logic Prof. Julia Hockenmaier juliahmr@illinois.edu http://cs.illinois.edu/fa11/cs440 Inference in predicate logic All

More information

COMP2411 Lecture 10: Propositional Logic Programming. Note: This material is not covered in the book. Resolution Applied to Horn Clauses

COMP2411 Lecture 10: Propositional Logic Programming. Note: This material is not covered in the book. Resolution Applied to Horn Clauses COMP2411 Lecture 10: Propositional Logic Programming Note: This material is not covered in the book Consider two Horn clauses Resolution Applied to Horn Clauses p p 1... p n and q q 1... q m Suppose these

More information

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning COMP219: Artificial Intelligence Lecture 20: Propositional Reasoning 1 Overview Last time Logic for KR in general; Propositional Logic; Natural Deduction Today Entailment, satisfiability and validity Normal

More information

Foundations of Logic Programming

Foundations of Logic Programming Foundations of Logic Programming Deductive Logic e.g. of use: Gypsy specifications and proofs About deductive logic (Gödel, 1931) Interesting systems (with a finite number of axioms) are necessarily either:

More information

Propositional Logic: Methods of Proof. Chapter 7, Part II

Propositional Logic: Methods of Proof. Chapter 7, Part II Propositional Logic: Methods of Proof Chapter 7, Part II Inference in Formal Symbol Systems: Ontology, Representation, ti Inference Formal Symbol Systems Symbols correspond to things/ideas in the world

More information

Logic (3A) Young W. Lim 12/5/13

Logic (3A) Young W. Lim 12/5/13 Copyright (c) 2013. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software

More information

Artificial Intelligence Chapter 7: Logical Agents

Artificial Intelligence Chapter 7: Logical Agents Artificial Intelligence Chapter 7: Logical Agents Michael Scherger Department of Computer Science Kent State University February 20, 2006 AI: Chapter 7: Logical Agents 1 Contents Knowledge Based Agents

More information

SLD-Resolution And Logic Programming (PROLOG)

SLD-Resolution And Logic Programming (PROLOG) Chapter 9 SLD-Resolution And Logic Programming (PROLOG) 9.1 Introduction We have seen in Chapter 8 that the resolution method is a complete procedure for showing unsatisfiability. However, finding refutations

More information

An Early (1971) Conversation. Logic Programming (PLP 11.3) Horn Clauses Introduction to Prolog: Resolution, Unification.

An Early (1971) Conversation. Logic Programming (PLP 11.3) Horn Clauses Introduction to Prolog: Resolution, Unification. Logic Programming (PLP 11.3) Horn Clauses Introduction to Prolog: Resolution, Unification Carlos Varela Rennselaer Polytechnic Institute November 9, 2006 C. Varela 1 An Early (1971) Conversation Cats kill

More information

Convert to clause form:

Convert to clause form: Convert to clause form: Convert the following statement to clause form: x[b(x) ( y [ Q(x,y) P(y) ] y [ Q(x,y) Q(y,x) ] y [ B(y) E(x,y)] ) ] 1- Eliminate the implication ( ) E1 E2 = E1 E2 x[ B(x) ( y [

More information

Logic (3A) Young W. Lim 11/2/13

Logic (3A) Young W. Lim 11/2/13 Copyright (c) 2013. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software

More information

Logic (3A) Young W. Lim 10/31/13

Logic (3A) Young W. Lim 10/31/13 Copyright (c) 2013. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software

More information

Logic (3A) Young W. Lim 10/29/13

Logic (3A) Young W. Lim 10/29/13 Copyright (c) 2013. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software

More information

Propositional Logic: Methods of Proof (Part II)

Propositional Logic: Methods of Proof (Part II) Propositional Logic: Methods of Proof (Part II) This lecture topic: Propositional Logic (two lectures) Chapter 7.1-7.4 (previous lecture, Part I) Chapter 7.5 (this lecture, Part II) (optional: 7.6-7.8)

More information

Propositional Logic: Methods of Proof (Part II)

Propositional Logic: Methods of Proof (Part II) Propositional Logic: Methods of Proof (Part II) You will be expected to know Basic definitions Inference, derive, sound, complete Conjunctive Normal Form (CNF) Convert a Boolean formula to CNF Do a short

More information

Bachelor/Master Exam Version V3B

Bachelor/Master Exam Version V3B Prof aadr Jürgen Giesl Carsten Fuhs, Carsten Otto, Thomas Ströder Bachelor/Master Exam Version V3B First Name: Last Name: Immatriculation Number: Course of Studies (please mark exactly one): Informatik

More information

LOGIC. Mathematics. Computer Science. Stanley N. Burris

LOGIC. Mathematics. Computer Science. Stanley N. Burris LOGIC for Mathematics and Computer Science Stanley N. Burris Department of Pure Mathematics University of Waterloo Prentice Hall Upper Saddle River, New Jersey 07458 Contents Preface The Flow of Topics

More information

SOCLP: A Set Oriented Calculus for Logic Programming

SOCLP: A Set Oriented Calculus for Logic Programming SOCLP: A Set Oriented Calculus for Logic Programming Rafael Caballero Y. García-Ruiz F. Sáenz-Pérez TECHNICAL REPORT SIP - 02/2006 Dep. Lenguajes, Sistemas Informáticos y Programación Univ. Complutense

More information

07 Equational Logic and Algebraic Reasoning

07 Equational Logic and Algebraic Reasoning CAS 701 Fall 2004 07 Equational Logic and Algebraic Reasoning Instructor: W. M. Farmer Revised: 17 November 2004 1 What is Equational Logic? Equational logic is first-order logic restricted to languages

More information

Definite Logic Programs: Derivation and Proof Trees. CSE 505 Computing with Logic Stony Brook University

Definite Logic Programs: Derivation and Proof Trees. CSE 505 Computing with Logic Stony Brook University Definite Logic Programs: Derivation and Proof Trees CSE 505 Computing with Logic Stony Brook University http://www.cs.stonybrook.edu/~cse505 1 Refutation in Predicate Logic parent(pam, bob). parent(tom,

More information

The non-logical symbols determine a specific F OL language and consists of the following sets. Σ = {Σ n } n<ω

The non-logical symbols determine a specific F OL language and consists of the following sets. Σ = {Σ n } n<ω 1 Preliminaries In this chapter we first give a summary of the basic notations, terminology and results which will be used in this thesis. The treatment here is reduced to a list of definitions. For the

More information

Inference in first-order logic. Production systems.

Inference in first-order logic. Production systems. CS 1571 Introduction to AI Lecture 17 Inference in first-order logic. Production systems. Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square Sentences in Horn normal form Horn normal form (HNF) in

More information

Lecture Notes on Logic Programming

Lecture Notes on Logic Programming Lecture Notes on Logic Programming 15-317: Constructive Logic Frank Pfenning Lecture 13 October 2, 2015 1 Computation vs Deduction The previous lectures explored a connection between logic and computation

More information

Description Logics. Foundations of Propositional Logic. franconi. Enrico Franconi

Description Logics. Foundations of Propositional Logic.   franconi. Enrico Franconi (1/27) Description Logics Foundations of Propositional Logic Enrico Franconi franconi@cs.man.ac.uk http://www.cs.man.ac.uk/ franconi Department of Computer Science, University of Manchester (2/27) Knowledge

More information

Logic: Propositional Logic (Part I)

Logic: Propositional Logic (Part I) Logic: Propositional Logic (Part I) Alessandro Artale Free University of Bozen-Bolzano Faculty of Computer Science http://www.inf.unibz.it/ artale Descrete Mathematics and Logic BSc course Thanks to Prof.

More information

Computational Logic Automated Deduction Fundamentals

Computational Logic Automated Deduction Fundamentals Computational Logic Automated Deduction Fundamentals 1 Elements of First-Order Predicate Logic First Order Language: An alphabet consists of the following classes of symbols: 1. variables denoted by X,

More information

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel Foundations of AI 7. Propositional Logic Rational Thinking, Logic, Resolution Wolfram Burgard and Bernhard Nebel Contents Agents that think rationally The wumpus world Propositional logic: syntax and semantics

More information

CS 771 Artificial Intelligence. Propositional Logic

CS 771 Artificial Intelligence. Propositional Logic CS 771 Artificial Intelligence Propositional Logic Why Do We Need Logic? Problem-solving agents were very inflexible hard code every possible state E.g., in the transition of 8-puzzle problem, knowledge

More information

Deliberative Agents Knowledge Representation I. Deliberative Agents

Deliberative Agents Knowledge Representation I. Deliberative Agents Deliberative Agents Knowledge Representation I Vasant Honavar Bioinformatics and Computational Biology Program Center for Computational Intelligence, Learning, & Discovery honavar@cs.iastate.edu www.cs.iastate.edu/~honavar/

More information

Conceptual Graphs and First Order Logic

Conceptual Graphs and First Order Logic Conceptual Graphs and First Order Logic GIANNI AMATI 1,2 AND IADH OUNIS 2 1 Fondazione Ugo Bordoni, v. B. Castiglione, 59, 00142 Rome, Italy 2 Department of Computing Science, University of Glasgow, Glasgow

More information

Resolution and Refutation

Resolution and Refutation Resolution and Refutation York University Department of Computer Science and Engineering York University- CSE 3401- V. Movahedi 04_Resolution 1 Propositional Logic Resolution Refutation Predicate Logic

More information

Methods of Partial Logic for Knowledge Representation and Deductive Reasoning in Incompletely Specified Domains

Methods of Partial Logic for Knowledge Representation and Deductive Reasoning in Incompletely Specified Domains Methods of Partial Logic for Knowledge Representation and Deductive Reasoning in Incompletely Specified Domains Anatoly Prihozhy and Liudmila Prihozhaya Information Technologies and Robotics Department,

More information

Lecture Notes on Logic Programming

Lecture Notes on Logic Programming Lecture Notes on Logic Programming 15-317: Constructive Logic Frank Pfenning Lecture 13 October 13, 2009 1 Computation vs Deduction Logic programming is a particular way to approach programming Other paradigms

More information

Propositional Calculus

Propositional Calculus Propositional Calculus Dr. Neil T. Dantam CSCI-498/598 RPM, Colorado School of Mines Spring 2018 Dantam (Mines CSCI, RPM) Propositional Calculus Spring 2018 1 / 64 Calculus? Definition: Calculus A well

More information

8 General first order representation

8 General first order representation Intro. to Artificial Intelligence: Dale Schuurmans, Relu Patrascu 1 8 General first order representation 8.1 First order language Propositional core constants A, B, C, D predicates on(, ) associated arity,

More information

CS 4700: Artificial Intelligence

CS 4700: Artificial Intelligence CS 4700: Foundations of Artificial Intelligence Fall 2017 Instructor: Prof. Haym Hirsh Lecture 14 Today Knowledge Representation and Reasoning (R&N Ch 7-9) Prelim, Statler Auditorium Tuesday, March 21

More information

Chapter 16. Logic Programming. Topics. Logic Programming. Logic Programming Paradigm

Chapter 16. Logic Programming. Topics. Logic Programming. Logic Programming Paradigm Topics Chapter 16 Logic Programming Introduction Predicate Propositions Clausal Form Horn 2 Logic Programming Paradigm AKA Declarative Paradigm The programmer Declares the goal of the computation (specification

More information

Resolution: Motivation

Resolution: Motivation Resolution: Motivation Steps in inferencing (e.g., forward-chaining) 1. Define a set of inference rules 2. Define a set of axioms 3. Repeatedly choose one inference rule & one or more axioms (or premices)

More information

Logical Agents. Santa Clara University

Logical Agents. Santa Clara University Logical Agents Santa Clara University Logical Agents Humans know things Humans use knowledge to make plans Humans do not act completely reflexive, but reason AI: Simple problem-solving agents have knowledge

More information

Logic and Prolog Midterm, CSC173With Answers and FFQOct. 26, 20

Logic and Prolog Midterm, CSC173With Answers and FFQOct. 26, 20 Logic and Prolog Midterm, CSC173With Answers and FFQOct. 26, 2 Please write your name on the bluebook. This is a closed-book exam. There are 75 points, one per minute. Stay cool and write neatly. 1. Propositional

More information

7.5.2 Proof by Resolution

7.5.2 Proof by Resolution 137 7.5.2 Proof by Resolution The inference rules covered so far are sound Combined with any complete search algorithm they also constitute a complete inference algorithm However, removing any one inference

More information

Resolution (14A) Young W. Lim 8/15/14

Resolution (14A) Young W. Lim 8/15/14 Resolution (14A) Young W. Lim Copyright (c) 2013-2014 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version

More information

Intelligent Agents. First Order Logic. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 19.

Intelligent Agents. First Order Logic. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 19. Intelligent Agents First Order Logic Ute Schmid Cognitive Systems, Applied Computer Science, Bamberg University last change: 19. Mai 2015 U. Schmid (CogSys) Intelligent Agents last change: 19. Mai 2015

More information

Intelligent Agents. Formal Characteristics of Planning. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University

Intelligent Agents. Formal Characteristics of Planning. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University Intelligent Agents Formal Characteristics of Planning Ute Schmid Cognitive Systems, Applied Computer Science, Bamberg University Extensions to the slides for chapter 3 of Dana Nau with contributions by

More information

C o r p o r a t e l i f e i n A n c i e n t I n d i a e x p r e s s e d i t s e l f

C o r p o r a t e l i f e i n A n c i e n t I n d i a e x p r e s s e d i t s e l f C H A P T E R I G E N E S I S A N D GROWTH OF G U IL D S C o r p o r a t e l i f e i n A n c i e n t I n d i a e x p r e s s e d i t s e l f i n a v a r i e t y o f f o r m s - s o c i a l, r e l i g i

More information

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system): Logic Knowledge-based agents Inference engine Knowledge base Domain-independent algorithms Domain-specific content Knowledge base (KB) = set of sentences in a formal language Declarative approach to building

More information

Logical Inference. Artificial Intelligence. Topic 12. Reading: Russell and Norvig, Chapter 7, Section 5

Logical Inference. Artificial Intelligence. Topic 12. Reading: Russell and Norvig, Chapter 7, Section 5 rtificial Intelligence Topic 12 Logical Inference Reading: Russell and Norvig, Chapter 7, Section 5 c Cara MacNish. Includes material c S. Russell & P. Norvig 1995,2003 with permission. CITS4211 Logical

More information

Predicate Logic. Xinyu Feng 09/26/2011. University of Science and Technology of China (USTC)

Predicate Logic. Xinyu Feng 09/26/2011. University of Science and Technology of China (USTC) University of Science and Technology of China (USTC) 09/26/2011 Overview Predicate logic over integer expressions: a language of logical assertions, for example x. x + 0 = x Why discuss predicate logic?

More information

Lecture overview. Knowledge-based systems in Bioinformatics, 1MB602. Reasoning. Reasoning cont. Inference in propositional logic.

Lecture overview. Knowledge-based systems in Bioinformatics, 1MB602. Reasoning. Reasoning cont. Inference in propositional logic. Lecture overview Knowledge-based systems in Bioinformatics, 1MB602 Logical reasoning Inference rules Example proofs Natural deduction SLD Resolution Lecture 7: Logical inference Reasoning The property

More information

Compositionality in SLD-derivations and their abstractions Marco Comini, Giorgio Levi and Maria Chiara Meo Dipartimento di Informatica, Universita di

Compositionality in SLD-derivations and their abstractions Marco Comini, Giorgio Levi and Maria Chiara Meo Dipartimento di Informatica, Universita di Compositionality in SLD-derivations and their abstractions Marco Comini Giorgio Levi and Maria Chiara Meo Dipartimento di Informatica Universita di Pisa Corso Italia 40 56125 Pisa Italy fcomini levi meog@di.unipi.it

More information

Self-assessment due: Monday 3/18/2019 at 11:59pm (submit via Gradescope)

Self-assessment due: Monday 3/18/2019 at 11:59pm (submit via Gradescope) CS 188 Spring 2019 Introduction to Artificial Intelligence Written HW 6 Sol. Self-assessment due: Monday 3/18/2019 at 11:59pm (submit via Gradescope) Instructions for self-assessment: Take your original

More information

From Operational Semantics to Abstract Machines

From Operational Semantics to Abstract Machines From Operational Semantics to Abstract Machines John Hannan Department of Computer Science, University of Copenhagen, Universitetsparken 1, DK-2100 Copenhagen East, Denmark. hannan@diku.dk Dale Miller

More information

Logical Agents. Chapter 7

Logical Agents. Chapter 7 Logical Agents Chapter 7 Outline Knowledge-based agents Wumpus world Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem

More information

CogSysI Lecture 8: Automated Theorem Proving

CogSysI Lecture 8: Automated Theorem Proving CogSysI Lecture 8: Automated Theorem Proving Intelligent Agents WS 2004/2005 Part II: Inference and Learning Automated Theorem Proving CogSysI Lecture 8: Automated Theorem Proving p. 200 Remember......

More information

[1] Describe with examples, the three inference rules involving quantifiers

[1] Describe with examples, the three inference rules involving quantifiers [1] Describe with examples, the three inference rules involving quantifiers The three new inference rules are as follows: 1- Universal Instantiation : For any sentence a, variable v, and ground term g

More information

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence Foundations of Artificial Intelligence 7. Propositional Logic Rational Thinking, Logic, Resolution Joschka Boedecker and Wolfram Burgard and Bernhard Nebel Albert-Ludwigs-Universität Freiburg May 17, 2016

More information

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence Foundations of Artificial Intelligence 7. Propositional Logic Rational Thinking, Logic, Resolution Wolfram Burgard, Maren Bennewitz, and Marco Ragni Albert-Ludwigs-Universität Freiburg Contents 1 Agents

More information

Resolution for Predicate Logic

Resolution for Predicate Logic Logic and Proof Hilary 2016 James Worrell Resolution for Predicate Logic A serious drawback of the ground resolution procedure is that it requires looking ahead to predict which ground instances of clauses

More information

UNIFORM PROOFS AS A FOUNDATION FOR LOGIC PROGRAMMING. Computer and Information Science Department University of Pennsylvania, Philadelphia, PA 19104

UNIFORM PROOFS AS A FOUNDATION FOR LOGIC PROGRAMMING. Computer and Information Science Department University of Pennsylvania, Philadelphia, PA 19104 UNIFORM PROOFS AS A FOUNDATION FOR LOGIC PROGRAMMING Dale Miller Gopalan Nadathur Frank Pfenning Andre Scedrov Computer and Information Science Department University of Pennsylvania, Philadelphia, PA 19104

More information

arxiv:cs/ v1 [cs.pl] 31 Jan 2002

arxiv:cs/ v1 [cs.pl] 31 Jan 2002 Under consideration for publication in Theory and Practice of Logic Programming 1 The Witness Properties and the Semantics of the Prolog Cut arxiv:cs/0201029v1 [cs.pl] 31 Jan 2002 JAMES H. ANDREWS Department

More information

Propositional Logic. Testing, Quality Assurance, and Maintenance Winter Prof. Arie Gurfinkel

Propositional Logic. Testing, Quality Assurance, and Maintenance Winter Prof. Arie Gurfinkel Propositional Logic Testing, Quality Assurance, and Maintenance Winter 2018 Prof. Arie Gurfinkel References Chpater 1 of Logic for Computer Scientists http://www.springerlink.com/content/978-0-8176-4762-9/

More information

Contents Chapters 2 & 3

Contents Chapters 2 & 3 Contents Chapters 2 & 3 Chapters 2 & 3: A Representation and Reasoning System Lecture 1 Representation and Reasoning Systems. Datalog. Lecture 2 Semantics. Lecture 3 Variables, queries and answers, limitations.

More information

Logical reasoning - Can we formalise our thought processes?

Logical reasoning - Can we formalise our thought processes? Logical reasoning - Can we formalise our thought processes? Why study (mathematical) logic? Logic: the science or method of reasoning Logical: able to reason correctly Human reasoning poorly understood,

More information

Propositional and Predicate Logic - XIII

Propositional and Predicate Logic - XIII Propositional and Predicate Logic - XIII Petr Gregor KTIML MFF UK WS 2016/2017 Petr Gregor (KTIML MFF UK) Propositional and Predicate Logic - XIII WS 2016/2017 1 / 22 Undecidability Introduction Recursive

More information

Inference in first-order logic

Inference in first-order logic CS 57 Introduction to AI Lecture 5 Inference in first-order logic Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square Logical inference in FOL Logical inference problem: Given a knowledge base KB (a

More information

MAI0203 Lecture 7: Inference and Predicate Calculus

MAI0203 Lecture 7: Inference and Predicate Calculus MAI0203 Lecture 7: Inference and Predicate Calculus Methods of Artificial Intelligence WS 2002/2003 Part II: Inference and Knowledge Representation II.7 Inference and Predicate Calculus MAI0203 Lecture

More information

Announcements. Project 1 underway... Second midterm Friday. discuss ideas with TAs check out wiki

Announcements. Project 1 underway... Second midterm Friday. discuss ideas with TAs check out wiki Announcements Project 1 underway... discuss ideas with TAs check out wiki Second midterm Friday You may bring on one letter-sized sheet of paper with anything written or drawn or... anywhere on it. It

More information

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask Set 6: Knowledge Representation: The Propositional Calculus Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask Outline Representing knowledge using logic Agent that reason logically A knowledge based agent Representing

More information

A Tableau Calculus for Minimal Modal Model Generation

A Tableau Calculus for Minimal Modal Model Generation M4M 2011 A Tableau Calculus for Minimal Modal Model Generation Fabio Papacchini 1 and Renate A. Schmidt 2 School of Computer Science, University of Manchester Abstract Model generation and minimal model

More information

Logic Programming in a Fragment of Intuitionistic Linear Logic

Logic Programming in a Fragment of Intuitionistic Linear Logic Logic Programming in a Fragment of Intuitionistic Linear Logic Joshua S. Hodas Computer Science Department Harvey Mudd College Claremont, CA 91711-5990 USA hodas@cs.hmc.edu Dale Miller Computer Science

More information

473 Topics. Knowledge Representation III First-Order Logic. Logic-Based KR. Propositional. Logic vs. First Order

473 Topics. Knowledge Representation III First-Order Logic. Logic-Based KR. Propositional. Logic vs. First Order 473 Topics Knowledge Representation III First-Order Logic CSE 473 Perception NLP Robotics Multi-agent Inference Logic Supervised Learning Knowledge Representation Search Problem Spaces Agency Reinforcement

More information

A new semantics for logic programs capturing the stable model semantics: the extension semantics

A new semantics for logic programs capturing the stable model semantics: the extension semantics A new semantics for logic programs capturing the stable model semantics: the extension semantics Belaïd Benhamou and Pierre Siegel Université Aix-Marseille, CMI Laboratoire des Sciences de L Information

More information

Introduction to Artificial Intelligence Propositional Logic & SAT Solving. UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010

Introduction to Artificial Intelligence Propositional Logic & SAT Solving. UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010 Introduction to Artificial Intelligence Propositional Logic & SAT Solving UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010 Today Representation in Propositional Logic Semantics & Deduction

More information

CS 380: ARTIFICIAL INTELLIGENCE

CS 380: ARTIFICIAL INTELLIGENCE CS 380: RTIFICIL INTELLIGENCE PREDICTE LOGICS 11/8/2013 Santiago Ontañón santi@cs.drexel.edu https://www.cs.drexel.edu/~santi/teaching/2013/cs380/intro.html Summary of last day: Logical gents: The can

More information

Artificial Intelligence Chapter 9: Inference in First-Order Logic

Artificial Intelligence Chapter 9: Inference in First-Order Logic Artificial Intelligence Chapter 9: Inference in First-Order Logic Andreas Zell After the Textbook: Artificial Intelligence, A Modern Approach by Stuart Russell and Peter Norvig (3 rd Edition) 9 Inference

More information

AI Programming CS S-09 Knowledge Representation

AI Programming CS S-09 Knowledge Representation AI Programming CS662-2013S-09 Knowledge Representation David Galles Department of Computer Science University of San Francisco 09-0: Overview So far, we ve talked about search, which is a means of considering

More information

CS 520: Introduction to Artificial Intelligence. Review

CS 520: Introduction to Artificial Intelligence. Review CS 520: Introduction to Artificial Intelligence Prof. Louis Steinberg : First-order Logic Proof Algorithms 1 Review Representing a Domain in FOL A domain is a portion of the world about which we wish to

More information

Using Meta-inference with Prolog to Preserve Accuracy in Numerical Equation Solving

Using Meta-inference with Prolog to Preserve Accuracy in Numerical Equation Solving Using Meta-inference with Prolog to Preserve Accuracy in Numerical Equation Solving Gabriel Renaldo Laureano Daniel Santana de Freitas 27 September 2004 Abstract In this paper, we explore the powerful

More information

The only sets are the empty set and those made by adjoining something to a set: s: Set(s) s = Ø x, s 2 : Set(s 2 ) s = { x s 2 }.

The only sets are the empty set and those made by adjoining something to a set: s: Set(s) s = Ø x, s 2 : Set(s 2 ) s = { x s 2 }. 171 Axioms for sets To define sets we use: Constant symbol Ø, which refers to the empty set Unary predicate Set, which is true of sets Binary predicates x s and s 1 s 2 Binary function are s 1 Us 2, s

More information

Validating QBF Invalidity in HOL4

Validating QBF Invalidity in HOL4 Interactive Theorem Proving (ITP) 14 July, 2010 Quantified Boolean Formulae Quantified Boolean Formulae Motivation System Overview Related Work QBF = propositional logic + quantifiers over Boolean variables

More information

Knowledge Compilation and Theory Approximation. Henry Kautz and Bart Selman Presented by Kelvin Ku

Knowledge Compilation and Theory Approximation. Henry Kautz and Bart Selman Presented by Kelvin Ku Knowledge Compilation and Theory Approximation Henry Kautz and Bart Selman Presented by Kelvin Ku kelvin@cs.toronto.edu 1 Overview Problem Approach Horn Theory and Approximation Computing Horn Approximations

More information

Modal logics: an introduction

Modal logics: an introduction Modal logics: an introduction Valentin Goranko DTU Informatics October 2010 Outline Non-classical logics in AI. Variety of modal logics. Brief historical remarks. Basic generic modal logic: syntax and

More information

CS:4420 Artificial Intelligence

CS:4420 Artificial Intelligence CS:4420 Artificial Intelligence Spring 2018 Propositional Logic Cesare Tinelli The University of Iowa Copyright 2004 18, Cesare Tinelli and Stuart Russell a a These notes were originally developed by Stuart

More information

Mary Southern and Gopalan Nadathur. This work was funded by NSF grant CCF

Mary Southern and Gopalan Nadathur. This work was funded by NSF grant CCF A Translation-Based Animation of Dependently-Typed Specifications From LF to hohh(and back again) Mary Southern and Gopalan Nadathur Department of Computer Science and Engineering University of Minnesota

More information