1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 26: Introduction to Logic Programming with Prolog COMP 144 Programming Language.

Slides:



Advertisements
Similar presentations
Some Prolog Prolog is a logic programming language
Advertisements

ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Chapter 11 :: Logic Languages
1 Logic Programming School of Informatics, University of Edinburgh Transformations Specification-Program An introduction to moving between Prolog and First.
1 Logic Programming with Prolog: Resolution, Unification, Backtracking COMP 144 Programming Language Concepts Spring 2003 Stotts, Hernandez-Campos Modified.
1 Prolog’s Lists, Negation and Imperative Control Flow COMP 144 Programming Language Concepts Spring 2003 The University of North Carolina at Chapel Hill.
Logic Languages Source: Scott, Michael Programming Language Pragmatics 3rd Ed.
COP4020 Programming Languages Logic programming and Prolog Prof. Xin Yuan.
Introduction to Prolog What is Prolog? Application Areas of Prolog How does Prolog work? (Syntax of Prolog) Program Structure.
Computability and Complexity 9-1 Computability and Complexity Andrei Bulatov Logic Reminder (Cnt’d)
1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 27: Prolog’s Resolution and Programming Techniques COMP 144 Programming Language.
1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 12: Semantic Analysis COMP 144 Programming Language Concepts Spring 2002 Felix.
CPSC 322 Introduction to Artificial Intelligence September 20, 2004.
Logic Programming Languages. Objective To introduce the concepts of logic programming and logic programming languages To introduce a brief description.
TR1413: Discrete Mathematics For Computer Science Lecture 3: Formal approach to propositional logic.
1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 5: Syntax Analysis COMP 144 Programming Language Concepts Spring 2002 Felix Hernandez-Campos.
Formal Aspects of Computer Science – Week 12 RECAP Lee McCluskey, room 2/07
TR1413: Discrete Mathematics For Computer Science Lecture 4: System L.
1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 28: Prolog’s Lists, Negation and Imperative Control Flow COMP 144 Programming Language.
CS1502 Formal Methods in Computer Science Lecture Notes 10 Resolution and Horn Sentences.
ISBN Chapter 16 Logic Programming Languages.
Logic Programming Languages
DEDUCTIVE DATABASE.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
1 Lecture 15: Introduction to Logic Programming with Prolog (Section 11.3) A modification of slides developed by Felix Hernandez-Campos at UNC Chapel Hill.
Introduction to Logic Programming with Prolog (Section 11.3)
Chapter 16 Logic Programming Languages. Copyright © 2012 Addison-Wesley. All rights reserved.1-2 Chapter 16 Topics Introduction A Brief Introduction to.
F28PL1 Programming Languages Lecture 16: Prolog 1.
Lecture on Programming Languages
Introduction to Prolog Asst. Prof. Dr. Senem Kumova Metin Revised lecture notes of “Concepts of Programmig Languages, Robert W. Sebesta, Ch. 16”
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
CHAPTER 15 & 16 Functional & Logic Programming Languages.
CT214 – Logical Foundations of Computing Lecture 8 Introduction to Prolog.
1 Prolog and Logic Languages Aaron Bloomfield CS 415 Fall 2005.
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?
Dr. Muhammed Al-Mulhem ICS An Introduction to Logical Programming.
Kansas State University Department of Computing and Information Sciences CIS 730: Introduction to Artificial Intelligence Lecture 12 Friday, 17 September.
Logic Programming Languages Session 13 Course : T Programming Language Concept Year : February 2011.
CS6133 Software Specification and Verification
C. Varela1 Logic Programming (PLP 11) Predicate Calculus, Horn Clauses, Clocksin-Mellish Procedure Carlos Varela Rennselaer Polytechnic Institute November.
© Kenneth C. Louden, Chapter 12 - Logic Programming Programming Languages: Principles and Practice, 2nd Ed. Kenneth C. Louden.
Artificial Intelligence “Introduction to Formal Logic” Jennifer J. Burg Department of Mathematics and Computer Science.
Programming Languages Third Edition Chapter 4 Logic Programming.
Logic Programming (LP) expresses code using of a restricted form of symbolic logic. LP programs are declarative, rather than algorithmic. An LP program.
CSE 3302 Programming Languages Chengkai Li Spring 2008 Logic Programming: Prolog Lecture 21 – Prolog, Spring CSE3302 Programming Languages, UT-Arlington.
1 Knowledge Based Systems (CM0377) Lecture 6 (last modified 20th February 2002)
Logic Programming Tarik Booker. What will we cover?  Introduction  Definitions  Predicate Calculus  Prolog  Applications.
ISBN Chapter 16 Logic Programming Languages.
Knowledge Based Information System
1-1 An Introduction to Logical Programming Sept
Introduction to Prolog Asst. Prof. Dr. Senem Kumova Metin Revised lecture notes of “Concepts of Programmig Languages, Robert W. Sebesta, Ch. 16”
1 Announcements We are almost done grading HW1 HW2 due today Download SWI Prolog! HW3 (Prolog) will be posted today, due on February 29 th Spring 16 CSCI.
Copyright 1999Paul F. Reynolds, Jr. Foundations of Logic Programming.
Introduction to Artificial Intelligence Heshaam Faili University of Tehran.
By P. S. Suryateja Asst. Professor, CSE Vishnu Institute of Technology
Chapter 7. Propositional and Predicate Logic
CS 3304 Comparative Languages
Logic Programming with Prolog: Resolution, Unification, Backtracking
Prolog fundamentals Module 14.2 COP4020 – Programming Language Concepts Dr. Manuel E. Bermudez.
Logic Programming Languages
Logic Programming Languages
Chapter 11 :: Logic Languages
Carlos Varela Rensselaer Polytechnic Institute November 10, 2017
Logic Programming Language
Chapter 7. Propositional and Predicate Logic
CSNB234 ARTIFICIAL INTELLIGENCE
Chapter 2: Prolog (Introduction and Basic Concepts)
Representations & Reasoning Systems (RRS) (2.2)
PROLOG.
Presentation transcript:

1 COMP 144 Programming Language Concepts Felix Hernandez-Campos Lecture 26: Introduction to Logic Programming with Prolog COMP 144 Programming Language Concepts Spring 2002 Felix Hernandez-Campos March 25 The University of North Carolina at Chapel Hill

2 COMP 144 Programming Language Concepts Felix Hernandez-Campos Logic Programming A logic program is a collection of axiom from which theorems can be provenA logic program is a collection of axiom from which theorems can be proven A program is a theoremA program is a theorem –The language tries to find a collection of axioms and inference steps that imply the goal Axiom are written in a standard form known as Horn clausesAxiom are written in a standard form known as Horn clauses –A Horn clause consists of a consequent (head H) and a body (terms B i ) H  B 1, B 2,…, B n –Semantics: when all B i are true, we can deduce that H is true

3 COMP 144 Programming Language Concepts Felix Hernandez-Campos Resolution Horn clauses can capture most logical statementsHorn clauses can capture most logical statements –But not all The derivation of new statements is known as resolutionThe derivation of new statements is known as resolution –The logic programming system combines existing statements to find new statements –For instance, C  A, B D  C D  A, B A and B imply C If we know that A and B imply C, and that C implies D, then we can deduce that A and B imply D

4 COMP 144 Programming Language Concepts Felix Hernandez-Campos Example flowery(X)  rainy(X) rainy(Rochester)flowery(Rochester)Variable Predicate Applied to a Variable Predicate Applied to an Atom Free Variable X acquired value Rochester during the resolution This is known as Unification

5 COMP 144 Programming Language Concepts Felix Hernandez-Campos Prolog PROgramming in LOGicPROgramming in LOGic It is the most widely used logic programming languageIt is the most widely used logic programming language Its development started in 1970 and it was result of ta collaboration between researchers from Marseille, France, and Edinburgh, ScotlandIts development started in 1970 and it was result of ta collaboration between researchers from Marseille, France, and Edinburgh, Scotland Main applications:Main applications: –Artificial intelligence: expert systems, natural language processing, … –Databases: query languages, data mining,… –Mathematics: theorem proving, symbolic packages,…

6 COMP 144 Programming Language Concepts Felix Hernandez-Campos Reading Assignment ReadRead –Scott Ch. 11 intro –Scott Sect intro,