Certamen 1 de Representación del Conocimiento



Similar documents
CHAPTER 7 GENERAL PROOF SYSTEMS

Lecture 8: Resolution theorem-proving

CS510 Software Engineering

Resolution. Informatics 1 School of Informatics, University of Edinburgh

(LMCS, p. 317) V.1. First Order Logic. This is the most powerful, most expressive logic that we will examine.

Logic in general. Inference rules and theorem proving

Likewise, we have contradictions: formulas that can only be false, e.g. (p p).

Lecture 13 of 41. More Propositional and Predicate Logic

Fixed-Point Logics and Computation

2. The Language of First-order Logic

Summary Last Lecture. Automated Reasoning. Outline of the Lecture. Definition sequent calculus. Theorem (Normalisation and Strong Normalisation)

Computational Logic and Cognitive Science: An Overview

Handout #1: Mathematical Reasoning

Predicate Logic. Example: All men are mortal. Socrates is a man. Socrates is mortal.

Foundational Proof Certificates

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

THREE DIMENSIONAL GEOMETRY

Rigorous Software Development CSCI-GA

Computational Methods for Database Repair by Signed Formulae

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi

ON FUNCTIONAL SYMBOL-FREE LOGIC PROGRAMS

Basic Proof Techniques

it is easy to see that α = a

Predicate logic. Logic in computer science. Logic in Computer Science (lecture) PART II. first order logic

First-Order Logics and Truth Degrees

Predicate logic Proofs Artificial intelligence. Predicate logic. SET07106 Mathematics for Software Engineering

University of Ostrava. Reasoning in Description Logic with Semantic Tableau Binary Trees

How To Write A Program Verification And Programming Book

Propositional Logic. A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not both.

Schema Mappings and Data Exchange

Predicate Logic Review

Artificial Intelligence

The Modal Logic Programming System MProlog

First-Order Stable Model Semantics and First-Order Loop Formulas

Bounded Treewidth in Knowledge Representation and Reasoning 1

DEFINABLE TYPES IN PRESBURGER ARITHMETIC

The last three chapters introduced three major proof techniques: direct,

Logical Agents. Explorations in Artificial Intelligence. Knowledge-based Agents. Knowledge-base Agents. Outline. Knowledge bases

MATHEMATICAL INDUCTION. Mathematical Induction. This is a powerful method to prove properties of positive integers.

a 1 x + a 0 =0. (3) ax 2 + bx + c =0. (4)

Mathematical Induction

Schedule. Logic (master program) Literature & Online Material. gic. Time and Place. Literature. Exercises & Exam. Online Material

On the Decidability and Complexity of Query Answering over Inconsistent and Incomplete Databases

MATH 304 Linear Algebra Lecture 9: Subspaces of vector spaces (continued). Span. Spanning set.

Mathematical Induction. Lecture 10-11

Beyond Propositional Logic Lukasiewicz s System

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Chapter 1. Use the following to answer questions 1-5: In the questions below determine whether the proposition is TRUE or FALSE

Algebra I. In this technological age, mathematics is more important than ever. When students

Extending Semantic Resolution via Automated Model Building: applications

A Note on Context Logic

Bounded-width QBF is PSPACE-complete

Winter Camp 2011 Polynomials Alexander Remorov. Polynomials. Alexander Remorov

Boolean Algebra Part 1

k, then n = p2α 1 1 pα k

Aikaterini Marazopoulou

SOLVING POLYNOMIAL EQUATIONS

Formalization of the CRM: Initial Thoughts

Theory of Automated Reasoning An Introduction. Antti-Juhani Kaijanaho

6.2 Permutations continued

The Division Algorithm for Polynomials Handout Monday March 5, 2012

Sound and Complete Inference Rules in FOL

CODING TRUE ARITHMETIC IN THE MEDVEDEV AND MUCHNIK DEGREES

x < y iff x < y, or x and y are incomparable and x χ(x,y) < y χ(x,y).

Student Learning Outcome - The 15 Best Based Performance Criteria

Exponential time algorithms for graph coloring

Unique Factorization

Introduction. Appendix D Mathematical Induction D1

DIFFICULTIES AND SOME PROBLEMS IN TRANSLATING LEGAL DOCUMENTS

Algorithmic Software Verification

Type Theory & Functional Programming

Introducing Formal Methods. Software Engineering and Formal Methods

Chapter 4, Arithmetic in F [x] Polynomial arithmetic and the division algorithm.

µz An Efficient Engine for Fixed points with Constraints

Introduction to Logic in Computer Science: Autumn 2006

Clue Deduction: an introduction to satisfiability reasoning

Lecture Notes in Discrete Mathematics. Marcel B. Finan Arkansas Tech University c All Rights Reserved

Introduction to formal semantics -

Predicate Logic. For example, consider the following argument:

def: An axiom is a statement that is assumed to be true, or in the case of a mathematical system, is used to specify the system.

Example: Backward Chaining. Inference Strategy: Backward Chaining. First-Order Logic. Knowledge Engineering. Example: Proof

Automated Theorem Proving - summary of lecture 1

KLMLean 2.0: A Theorem Prover for KLM Logics of Nonmonotonic Reasoning

Rules of Inference Friday, January 18, 2013 Chittu Tripathy Lecture 05

Applied Logic in Engineering

o-minimality and Uniformity in n 1 Graphs

Transcription:

Certamen 1 de Representación del Conocimiento Segundo Semestre 2012 Question: 1 2 3 4 5 6 7 8 9 Total Points: 2 2 1 1 / 2 1 / 2 3 1 1 / 2 1 1 / 2 12 Here we show one way to solve each question, but there might be other ways to solve them. Propositional Logic 1. [2 ptos] Use structural induction to prove that a propositional formula has the same number of left parenthesis as right parenthesis. TIP: The syntax of propositional formulas is given in the appendix of this test. Solution: Let LP (ϕ) and RP (ϕ) denote the number of left and right parenthesis of ϕ Base case: for proposition p we have LP (p) = RP (p) = 0. Inductive cases: assume we have formulas φ 1 and φ 2 such that LP (φ 1 ) = RP (φ 1 ) = c 1 and LP (φ 2 ) = RP (φ 2 ) = c 2 : 1. Given a formula φ such that LP (φ) = RP (φ), prove that for ϕ = φ, it holds LP (ϕ) = RP (ϕ). Proof: LP (ϕ) = LP ( φ) = LP (φ) = RP (φ) = RP ( ϕ) = RP (ϕ) 2. Given formulas φ 1 and φ 2 such that LP (φ 1 ) = RP (φ 1 ) and LP (φ 2 ) = RP (φ 2 ), prove that for ϕ = (φ 1 φ 2 ) where {,,, }, it holds LP (ϕ) = RP (ϕ). Proof: LP (ϕ) = LP ((φ 1 φ 2 )) = 1+LP (φ 1 )+LP (φ 2 ) = 1+RP (φ 1 )+RP (φ 2 ) = RP ((φ 1 φ 2 )) = rp (ϕ) 2. Consider Σ = { (( p q) (r p)), q}. (a) [1 pto] Prove in precise semantic 1 terms that Σ = r. Solution: The following table shows that Σ is inconsistent and therefore r is a logical consequence. 1 Using truth tables 1

p q r t 1 = ( p q) t 2 = (r p) t 1 t 2 (t 1 t 2 ) Σ 1 1 1 0 1 1 0 0 0 1 1 0 0 0 1 0 1 1 0 0 1 1 0 0 1 0 1 0 1 1 0 0 1 0 0 0 1 1 0 0 0 1 0 0 1 1 0 0 0 0 1 1 0 1 0 0 0 0 0 1 1 1 0 0 (b) [1 pto] Prove by resolution that Σ = (r s). Solution: We will prove that Σ { (r s)} is inconsistent. To apply resolution we need to put the formulas in CNF: (( p q) (r p)) q ( r s) = ( ( p q) ( r p)) q r s = ((p q) (r p)) q r s = (p q) r p q r s Though, we need to apply resolution with the following clauses {p q, r, p, q, r, s}. By resolution between the first and third clause we get q. By applying resolution with the fourth clause we get an inconsistency. 3. Prove using the set of natural deduction rules that: (a) [ 1 / 2 pto] {(p q) r, q p, q} = r Solution: 1. (p q) r 2. q p 3. q 4. p (result of applying rule (F) to 2 and 3) 5. p q (result of applying rule (A) to 3 and 4) 6. r (result of applying rule (F) to 1 and 5) (b) [ 1 / 2 pto] {p} = (q p) Solution: 1. p 2. Assume q a) p (true from 1) Página 2 de 7 Pase a la siguiente página...

3. q p (result of applying rule (M) to 2) In your proofs you should say which deductive rules you are using. TIP: use the natural deduction rules in the appendix with the given names. 4. [ 1 / 2 pto] Prove that {(p (q r)) (s u), r} = u Solution: For an assignment that makes s true and the rest of the variables false (in particular r), makes {(p (q r)) (s u), r} true but u is false. Thus, u is not a logical consequence. 5. [ 1 / 2 pto] Provide a short proof showing that for an inconsistent knowledge base Σ in propositional logic, every formula ϕ is a logical consequence of Σ. Solution: A formula ϕ is a logical consequence of a knowledge base Σ if every model that satisfies Σ it holds also that ϕ is true. In the case in which Σ is inconsistent, it has no model and therefore the requirement is trivially true for any formula ϕ. First Order Logic 6. Tony, Shi-Kuo and Ellen belong to the Hoofers Club. Every member of the Hoofers Club is either a skier or a mountain climber or both. No mountain climber likes rain, and all skiers like snow. Ellen dislikes whatever Tony likes and likes whatever Tony dislikes. Tony likes rain and snow. Prove via the resolution method and unification (where needed) that Ellen is a mountain climber but not a skier. More precisely: (a) [1 pto] Translate the sentences above into FOL Sentences. Solution: We can transform the knowledge base into the following rules (it is not the only solution): Tony, Shi-Kuo and Ellen belong to the Hoofers Club. HClub(T ony) HClub(ShiKuo) HClub(Ellen) Every member of the Hoofers Club is either a skier or a mountain climber or both. x(hclub(x) (Skier(x) Climber(x))) Página 3 de 7 Pase a la siguiente página...

No mountain climber likes rain, and all skiers like snow. x(climber(x) Like(x, Rain)) x(skier(x) Like(x, Snow)) Ellen dislikes whatever Tony likes and likes whatever Tony dislikes. xy(likes(t ony, y) Like(Ellen, y)) Tony likes rain and snow. Likes(T ony, Rain) Likes(T ony, Snow) Ellen is a mountain climber but not a skier (our goal) Climber(Ellen) Skier(Ellen) (b) [1 pto] Convert to Clause Forms. Solution: The sentences are already in prenex normal form and there is no need to skolemize so they can be translate into the following clauses: 1. HClub(T ony) 2. HClub(ShiKuo) 3. HClub(Ellen) 4. HClub(x) Skier(x) Climber(x) 5. Skier(x) Like(x, Snow) 6. Climber(x) Like(x, Rain) 7. Likes(T ony, y) Like(Ellen, y) 8. Likes(T ony, Rain) 9. Likes(T ony, Snow) (c) [1 pto] Prove, using resolution, the goal sentence: Ellen is a mountain climber but not a skier. Solution: To prove it we will find a contradiction between the knowledge base and the negation of our goal. 10. Climber(Ellen) Skier(Ellen) The inconsistency can be achieved by doing the following: 11. HClub(Ellen) Skier(Ellen) (resolution between 4 + 10) 12. Skier(Ellen) (resolution between 11 + 3) 13. Like(Ellen, Snow) (resolution between 12 + 5) 14. Like(T ony, Snow) (resolution between 13 + 7) 15. (resolution between 14 + 9) 7. Given a knowledge base Σ = { x(p (A, x) yr(x, y)), P (A, B)} 2 2 Note that A and B are constants Página 4 de 7 Pase a la siguiente página...

(a) [ 1 / 2 pto] Define a FOL signature S = {Ω, Π} for which formulas in Σ are well-formed. Solution: Ω = {A/0, B/0} and Π = {R/2, P/2} (b) [ 1 / 2 pto] Show that Σ is valid (provide an interpretation for S). Solution: Consider the interpretation I = (U, A I, B I, R I, P I ) where U = {A, B}, A I = A, B I = B, R I = {(B, B)} and P I = {(A, B)}. This interpretation is a model of Σ and therefore it is valid. (c) [ 1 / 2 pto] Is R(A, B) a logical consequence of Σ? Prove your answer. Solution: It is not. To prove it, it suffices to show a model of Σ for which R(A, B) is false. The model given in the previous question is such a model. First-Order Logic Programming 8. [1 pto] Consider the logic program P (x) R(x), not Q(x). Q(x) S(x). P (x) S(x). Q(a). S(a). R(b). Find all the answers to query P (x)? Show the resolution tree with the unifiers that are used. Solution: To simplify the presentation we will present the different branches of the tree. 1. Branch 1: P (x) R(x), not Q(x) not Q(b) (unifier b/x) We try to prove Q(b): S(b) Q(b) is false, therefore not Q(b) is true. Thus b is an answer to the query. 2. Branch 2: P (x) S(x) (unified for a/x) Thus a is an answer to the query. Página 5 de 7 Pase a la siguiente página...

9. [ 1 / 2 pto] Show by means of an example that first-order logic programming with negation as failure is non-monotonic. Solution: A logic is non-monotonic if an answer that was obtained from a knowledge base continues to be true after adding more knowledge. In the case of FOLprogramming this is not the case as the following example shows. Consider a logic program with a single fact: P (a). The answer to the query P (x), notq(x) is x = a. But now, if we add Q(a) to the knowledge base we get that the query has no answers. Página 6 de 7 Pase a la siguiente página...

Appendix Syntaxis of Propositional Formulas ϕ ::= p ϕ (ϕ ϕ) (ϕ ϕ) (ϕ ϕ) (ϕ ϕ) Natural Deduction Rules Non-hypothetical rules (with no assumptions) (A) (B) (C) ϕ, ψ ϕ ψ ϕ ψ ϕ ϕ ψ ψ (D) (E) (F) ϕ ϕ ψ ψ ϕ ψ ϕ, ϕ ψ ψ (G) (H) (I) ϕ, ϕ φ ϕ ϕ ϕ ψ ϕ φ (J) (K) ϕ ψ φ ϕ ϕ φ, φ ϕ ϕ φ Hypothetical rules (that require assumption) (L) ϕ ψ, ϕ φ, ψ φ φ (M) ψ ϕ ψ ϕ (N) ψ F alse ψ Página 7 de 7 Fin del certamen.