603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 25 A First Course in Database Systems.

Slides:



Advertisements
Similar presentations
CS4026 Formal Models of Computation Part II The Logic Model Lecture 1 – Programming in Logic.
Advertisements

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
Resolution Proof System for First Order Logic
Inference Rules Universal Instantiation Existential Generalization
1 A formula in predicate logic An atom is a formula. If F is a formula then (~F) is a formula. If F and G are Formulae then (F /\ G), (F \/ G), (F → G),
Knowledge & Reasoning Logical Reasoning: to have a computer automatically perform deduction or prove theorems Knowledge Representations: modern ways of.
Standard Logical Equivalences
ITCS 3153 Artificial Intelligence Lecture 15 First-Order Logic Chapter 9 Lecture 15 First-Order Logic Chapter 9.
Inference in first-order logic Chapter 9. Outline Reducing first-order inference to propositional inference Unification Generalized Modus Ponens Forward.
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Automated Reasoning Systems For first order Predicate Logic.
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.
First Order Logic Resolution
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
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.
Logic Use mathematical deduction to derive new knowledge.
Resolution
13 Automated Reasoning 13.0 Introduction to Weak Methods in Theorem Proving 13.1 The General Problem Solver and Difference Tables 13.2 Resolution.
Logic Concepts Lecture Module 11.
Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus Artificial Intelligence Chapter 14. Resolution in the Propositional Calculus.
Propositional Calculus A propositional calculus formula is composed of atomic propositions, which area simply statements that are either true or false.
Prolog IV Logic, condensed. 2 Propositional logic Propositional logic consists of: The logical values true and false ( T and F ) Propositions: “Sentences,”
1 Applied Computer Science II Resolution in FOL Luc De Raedt.
Outline Recap Knowledge Representation I Textbook: Chapters 6, 7, 9 and 10.
Logic Programming Languages. Objective To introduce the concepts of logic programming and logic programming languages To introduce a brief description.
Inference in FOL Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 9 Spring 2004.
1 Automated Reasoning Introduction to Weak Methods in Theorem Proving 13.1The General Problem Solver and Difference Tables 13.2Resolution Theorem.
Logic in Computer Science Transparency No Chapter 3 Propositional Logic 3.6. Propositional Resolution.
Chapter 3 Propositional Logic
Introduction to Logic for Artificial Intelligence Lecture 1 Erik Sandewall 2010.
Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus Artificial Intelligence Chapter 14 Resolution in the Propositional Calculus.
The Semantic Web – WEEK 8: An automatic Proof technique.. The “Layer Cake” Model – [From Rector & Horrocks Semantic Web cuurse] You are here!
CS1502 Formal Methods in Computer Science Lecture Notes 10 Resolution and Horn Sentences.
CS2013 Maths for Computing Science Proof (part b) Adam Wyner University of Aberdeen Computing Science.
Propositional Logic Reasoning correctly computationally Chapter 7 or 8.
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
Propositional Resolution Computational LogicLecture 4 Michael Genesereth Spring 2005.
Conjunctive normal form: any formula of the predicate calculus can be transformed into a conjunctive normal form. Def. A formula is said to be in conjunctive.
1 Lecture 6 Logic Programming introduction to Prolog, facts, rules Ras Bodik Shaon Barman Thibaud Hottelier Hack Your Language! CS164: Introduction to.
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
Tasks Task 41 Solve Exercise 12, Chapter 2.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
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.
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,
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
The AI War LISP and Prolog Basic Concepts of Logic Programming
Dr. Muhammed Al-Mulhem ICS An Introduction to Logical Programming.
Logic Programming Languages Session 13 Course : T Programming Language Concept Year : February 2011.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 24 A First Course in Database Systems.
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
Automated Reasoning Systems For first order Predicate Logic.
CS6133 Software Specification and Verification
© Kenneth C. Louden, Chapter 12 - Logic Programming Programming Languages: Principles and Practice, 2nd Ed. Kenneth C. Louden.
Propositional Logic Predicate Logic
1 Knowledge Based Systems (CM0377) Lecture 6 (last modified 20th February 2002)
1-1 An Introduction to Logical Programming Sept
Resolution Theorem Proving in Predicate Calculus Lecture No 10 By Zahid Anwar.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 26 A First Course in Database Systems.
Resolution in the Propositional Calculus
Propositional Logic Resolution
Logic Programming Languages
Logic Use mathematical deduction to derive new knowledge.
Prolog IV Logic, condensed.
RESOLUTION.
Resolution Proof System for First Order Logic
Chapter 2: Prolog (Introduction and Basic Concepts)
Presentation transcript:

603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 25 A First Course in Database Systems

Deductive Databases RULES: Although formally all variables in a clause are universally quantified, we will sometimes refer to variables that occur in the body of the clause, but not in its head, as if they are existentially quantified inside the body.

Deductive Databases Example: grandfather rule can be read: “For all X and Y, X is the grandfather of Y if there exists a Z such that X is the father of Z and Z is the father of Y.”  (X,Y){(grandfather(X, Y))  (  (Z) | father (X, Z), father (Z, Y))}.

Deductive Databases Incorporate rules into our framework of logical deduction: To incorporate rules into our framework of logical deduction, we need the law of modus ponens. Modus ponens states that from B and A  B we can deduce A.

Deductive Databases The Law of Universal Modus Ponens: RULE: R = ( A  B 1, B 2, ……….B n ) FACTS: B’ 1. B’ 2.. B’ n. A’ can be deduced, if A’  B’ 1, B’ 2, ……….B’ n is an instance of R. Universal Modus Ponens include identity and instantiation as a special cases.

Deductive Databases Complete definition of the concept of a logic program and its associated concept of logical consequence: Definition: A logic program is a finite set of rules. Definition: An existentially quantified goal G is a logical consequence of a program P if there is a clause in P with a ground instance A  B 1, B 2, ……….B n, n  0, such that are logical consequences of P and A is an instance of G.

Deductive Databases Universal Modus Ponens: Consider the query son(S, haran)? Rule: son(X,Y)  father (Y,X), male(X). The substitution {X=lot, Y=haran} applied to the rule gives the instance son(lot, haran)  father (haran,lot), male(lot). Both goals in the body of this rule are facts in the database.

Deductive Databases Universal Modus Ponens: In the previous query the modus ponens implies the query with answer S=lot. The rule for son is correct, but is an incomplete specification of the relationship. A new rule expressing this relationship can be added, namely son(X,Y)  mother(Y,X), male(X).

Deductive Databases Grandparent rules: grandparent(X,Y)  father(X,Y), father(Y,Z). grandparent(X,Y)  father(X,Y), mother(Y,Z). grandparent(X,Y)  mother(X,Y), father(Y,Z). grandparent(X,Y)  mother(X,Y), mother(Y,Z). More precise way of expressing these rules.

The Deductive Databases Rules for son and grandparent: son(X,Y)  parent(Y,X), male(X). grandparent(X,Y)  parent(X,Z), parent(X,Y).

Deductive Databases parent(X,Y)  father(X,Y). parent(X,Y)  mother(X,Y). A collection of rules with the same predicate in the head, such as the pair of parent rules, is called a procedure.

Deductive Databases An abstract interpreter for logic programs: Input:A ground query Q and a program P Output:yes if a proof of Q form P was found, no otherwise Algorithm: Initialize the resolvent to Q while the resolvent A 1, A 2, ……….A n is not empty begin choose a goal A i, 1  i  n, and a ground instance of a clause A  B 1, B 2, ……….B n, n  0, in P, such that A = A i (If no such clause exists, exit the while loop); determine the new resolvent A 1,... A i-1, ………., B 1, B 2, ……….B k, A i+1,... A n end If the resolvent is empty, output yes, otherwise output no.

Deductive Databases Simple Problem : If Fido goes wherever John goes and if John is at School, where is Fido? Rule: (  X ) [At (John, X) At(Fido, X)] Fact: At(John, School) Query: (  X ) At (Fido, X)? Where is Fido? Rule Facts Query Resultant fact(answers) Deductive Database

Deductive Databases Resolution Process(rule of inference): Applied to a pair of parent clauses Produce a derived clause (inferred clause)

Deductive Databases Conversion of Predicate Calculus Formula into clausal form includes the following steps: Step 1.Remove Implications  X [X, man(X)  human(X)] becomes  X [X, ~ man(X) # human(X)] Step 2.Moving negations inward ~ (human (caesar) & living (caesar)) becomes ~ human(caesar) # ~ living (caesar)

Deductive Databases Conversion of Predicate Calculus Formula into clausal form includes the following steps(continued): Step 3.Skolemising - removing existential quantifiers  X (X, female(X) & mother of (X, eve)) etc.

Deductive Databases Once we have the PC formula in clausal form we can then apply the resolution process to prove the goal!! In resolution refutation, we first negate the goal and then add the negation to the set. The set is then converted to a set of clauses and resolution is used to derive a contradiction, represented by an empty clause, NIL

Deductive Databases When we get NIL, The answer is provided.

Deductive Databases Fact 1: (  X ) [At (John, X)  At(Fido, X)] =>Axiom 1 Fact 2: At(John, School)=> Axiom 2 Query: (  X ) At (Fido, X)? => conjecture Where is Fido?

Deductive Databases Resolution Refutation: Conjecture: (  X ) At (Fido, X)? Negation of conjecture: (  X ) ~At (Fido, X)? (  X ) ~At (Fido, X) in clausal form is ~At (Fido, X)

Deductive Databases Refutation TREE(negate the goal): ~At (Fido, X) ~At (John, X) # At(Fido, X) (negation of conjecture)(Axiom 1) ~At (John, X) At(John, School) (Axiom 2) NIL (  X ) [At (John, X)  At(Fido, X)] in clausal form becomes ~At (John, X) # At(Fido, X) and ~At (Fido, X) + ~At (John, X) # At(Fido, X) becomes ~At (John, X) ~At (John, X) + At(John, School) becomes NIL

Deductive Databases Extracting the Answer: ~At (Fido, X) # At(Fido, X) ~At (John, X) # At(Fido, X) At (John, School) At (Fido, School) X get bound to School

Deductive Databases Company Database: Facts:supervise(franklin, john). supervise(franklin, ramesh). supervise(franklin, joyce). supervise(jennifer, alicia). supervise(jennifer, ahmad). supervise(james, franklin). supervise(james, jennifer)....

Deductive Databases Rules: superior(X,Y):- supervise(X,Y). superior(X,Y):- supervise(X,Z), superior(Z,Y). subordinate(X,Y):-superior(Y,X). Queries: superior(james, Y)? superior(james,joyce)?

Deductive Databases The supervisory TREE: james franklinjennifer john ramesh joyce alicia ahmad

Deductive Databases Fact: supervise predicate Rules: superior predicate superior predicate subordinate predicate head :- body conclusion premise

Deductive Database Queries: superior (james, Y)? superior (james, joyce)? NOTE: predicate with constant as argument => ground or instantiated predicate!!

Deductive Databases Next Lecture MORE Deductive Databases