You are on page 1of 31

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

(1/27

Knowledge bases
Inference engine Knowledge base

domain-independent algorithms domain-specic content

Knowledge base = set of sentences in a formal language = logical theory Declarative approach to building an agent (or other system): T ELL it what it needs to know

Then it can A SK itself what to doanswers should follow from the KB Agents can be viewed at the knowledge level i.e., what they know, regardless of how implemented

Or at the implementation level i.e., data structures in KB and algorithms that manipulate them

(2/27

Logic in general

Logics are formal languages for representing information such that conclusions can be drawn

Syntax denes the sentences in the language Semantics dene the meaning of sentences; i.e., dene truth of a sentence in a world

E.g., the language of arithmetic

x + 2 y is a sentence; x2 + y > is not a sentence x + 2 y is true iff the number x + 2 is no less than the number y x + 2 y is true in a world where x = 7, y = 1 x + 2 y is false in a world where x = 0, y = 6 x + 2 x + 1 is true in every world

(3/27

The one and only Logic?


Logics of higher order Modal logics

epistemic temporal and spatial ...


Description logic Non-monotonic logic Intuitionistic logic ...

But: There are standard approaches

; propositional and predicate logic

(4/27

Types of logic

Logics are characterized by what they commit to as primitives Ontological commitment: what existsfacts? objects? time? beliefs? Epistemological commitment: what states of knowledge?
Ontological Commitment (What exists in the world) facts facts, objects, relations facts, objects, relations, times facts degree of truth Epistemological Commitment (What an agent believes about facts) true/false/unknown true/false/unknown true/false/unknown degree of belief 01 degree of belief 01

Language Propositional logic First-order logic Temporal logic Probability theory Fuzzy logic

Classical logics are based on the notion of TRUTH

(5/27

Entailment Logical Implication


KB |=

Knowledge base KB entails sentence if and only if

is true in all worlds where KB is true

E.g., the KB containing Manchester United won and Manchester City won entails Either Manchester United won or Manchester City won

(6/27

Models

Logicians typically think in terms of models, which are formally structured worlds with respect to which truth can be evaluated

We say m is a model of a sentence if is true in m

M () is the set of all models of


Then KB E.g. or

|= if and only if M (KB) M ()

KB = United won and City won = City won = Manchester won

or

= either City or Manchester won

(7/27

Inference Deduction Reasoning


KB
i

KB

= sentence can be derived from KB by procedure i

Soundness:

i is sound if whenever KB i , it is also true that KB |=

Completeness:

i is complete if whenever KB |= , it is also true that KB

We will dene a logic (rst-order logic) which is expressive enough to say almost anything of interest, and for which there exists a sound and complete inference procedure.

(8/27

Propositional Logics: Basic Ideas


Statements: The elementary building blocks of propositional logic are atomic statements that cannot be decomposed any further: propositions. E.g.,

The block is red The proof of the pudding is in the eating It is raining

and logical connectives and, or, not, by which we can build propositional formulas.

(9/27

Propositional Logics: Reasoning


We are interested in the questions:

when is a statement logically implied by a set of statements, in symbols:

|=

can we dene deduction in such a way that deduction and entailment coincide?

(10/27

Syntax of Propositional Logic


Countable alphabet of atomic propositions:

a, b, c, . . ..
atomic formula false true

, a | |
Propositional formulas:

| | | | |

negation conjunction disjunction

implication equivalence

Atom: atomic formula Literal: (negated) atomic formula

Clause: disjunction of literals

(11/27

Semantics: Intuition

Atomic statements can be true T or false F. The truth value of formulas is determined by the truth values of the atoms (truth value assignment or interpretation).

Example:

(a b) c

If a and b are wrong and c is true, then the formula is not true. Then logical entailment could be dened as follows:

is implied by , if is true in all states of the world, in which is true.

(12/27

Semantics: Formally
A truth value assignment (or interpretation) of the atoms in is a function I :

I: {T, F}.
Instead of I(a) we also write aI . A formula is satised by an interpretation I (I

|= ) or is true under I :

I |= I |= I |= a I |= I |= I |=
iff iff iff iff

I |= iff if I |= , then I |= aI = T I |= I |= and I |= I |= or I |=

I |= iff I |= , if and only if I |=

(13/27

Example
a T b F c F d T . . .

I:

((a b) (c d)) ((a b) (c d)).

(14/27

Exercise

Find an interpretation and a formula such that the formula is true in that interpretation (or: the interpretation satises the formula).

Find an interpretation and a formula such that the formula is not true in that interpretation (or: the interpretation does not satisfy the formula).

Find a formula which cant be true in any interpretation (or: no interpretation can satisfy the formula).

(15/27

Satisability and Validity


An interpretation I is a model of :

I |=
A formula is

satisable, if there is some I that satises , unsatisable, if is not satisable, falsiable, if there is some I that does not satisfy , valid (i.e., a tautology), if every I is a model of .

Two formulas are logically equivalent (

), if for all I :

I |= iff I |=

(16/27

Exercise
Satisable, tautology?

(((a b) a) b) (( ) ( )) (a b c) (a b d) (a b d)

Equivalent?

( ( )) (( ) ( )) ( )

(17/27

Consequences
Proposition:

is a tautology iff is unsatisable is unsatisable iff is a tautology. iff is a tautology.

Proposition:

Theorem: If and are equivalent, and results from replacing in by , then and are equivalent.

(18/27

Entailment
Extension of the entailment relationship to sets of formulas :

I |= iff I |= for all


Remember: we want the formula to be implied by a set , if is true in all models of (symbolically,

|= ):

|= iff I |= for all models I of

(19/27

Propositional inference: Enumeration method


Let

= A B and KB = (A C) (B C) |= ?

Is it the case that KB

Check all possible models must be true wherever KB is true

A F alse F alse F alse F alse T rue T rue T rue T rue

B F alse F alse T rue T rue F alse F alse T rue T rue

C F alse T rue F alse T rue F alse T rue F alse T rue

AC

B C

KB

(20/27

Propositional inference: Enumeration method


Let

= A B and KB = (A C) (B C) |= ?

Is it the case that KB

Check all possible models must be true wherever KB is true

A F alse F alse F alse F alse T rue T rue T rue T rue

B F alse F alse T rue T rue F alse F alse T rue T rue

C F alse T rue F alse T rue F alse T rue F alse T rue

AC F alse T rue F alse T rue T rue T rue T rue T rue

B C

KB

(20/27

Propositional inference: Enumeration method


Let

= A B and KB = (A C) (B C) |= ?

Is it the case that KB

Check all possible models must be true wherever KB is true

A F alse F alse F alse F alse T rue T rue T rue T rue

B F alse F alse T rue T rue F alse F alse T rue T rue

C F alse T rue F alse T rue F alse T rue F alse T rue

AC F alse T rue F alse T rue T rue T rue T rue T rue

B C T rue F alse T rue T rue T rue F alse T rue T rue

KB

(20/27

Propositional inference: Enumeration method


Let

= A B and KB = (A C) (B C) |= ?

Is it the case that KB

Check all possible models must be true wherever KB is true

A F alse F alse F alse F alse T rue T rue T rue T rue

B F alse F alse T rue T rue F alse F alse T rue T rue

C F alse T rue F alse T rue F alse T rue F alse T rue

AC F alse T rue F alse T rue T rue T rue T rue T rue

B C T rue F alse T rue T rue T rue F alse T rue T rue

KB F alse F alse F alse T rue T rue F alse T rue T rue

(20/27

Propositional inference: Enumeration method


Let

= A B and KB = (A C) (B C) |= ?

Is it the case that KB

Check all possible models must be true wherever KB is true

A F alse F alse F alse F alse T rue T rue T rue T rue

B F alse F alse T rue T rue F alse F alse T rue T rue

C F alse T rue F alse T rue F alse T rue F alse T rue

AC F alse T rue F alse T rue T rue T rue T rue T rue

B C T rue F alse T rue T rue T rue F alse T rue T rue

KB F alse F alse F alse T rue T rue F alse T rue T rue

F alse F alse T rue T rue T rue T rue T rue T rue

(20/27

Properties of Entailment

{} |= iff |=
(Deduction Theorem)

{} |= iff {} |=
(Contraposition Theorem)

{} is unsatisable iff |=
(Contradiction Theorem)

(21/27

Equivalences (I)
Commutativity

Associativity

( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( )

Idempotence

Absorption

Distributivity

(22/27

Equivalences (II)
Tautology Unsatisability Negation

Neutrality


Double Negation De Morgan

( ) ( )

Implication

(23/27

Normal Forms
Other approaches to inference use syntactic operations on sentences, often expressed in standardized forms Conjunctive Normal Form (CNF) conjunction of disjunctions of literals: clauses E.g., (A B) (B
n i=1 ( m j=1 li,j )

C D)
n i=1 ( m j=1 li,j )

Disjunctive Normal Form (DNF) disjunction of conjunctions of literals: terms E.g., (A B) (A C) (A D) (B

C) (B D)

(24/27

Normal Forms, cont.


Horn Form (restricted) conjunction of Horn clauses (clauses with E.g., (A B) (B

1 positive literal)

C D)

Often written as set of implications:

B A and (C D) B
Theorem For every formula, there exists an equivalent formula in CNF and one in DNF.

(25/27

Why Normal Forms?

We can transform propositional formulas, in particular, we can construct their CNF and DNF.

DNF tells us something as to whether a formula is satisable. If all disjuncts contain or complementary literals, then no model exists. Otherwise, the formula is satisable.

CNF tells us something as to whether a formula is a tautology. If all clauses (= conjuncts) contain or complementary literals, then the formula is a tautology. Otherwise, the formula is falsiable.

But:

the transformation into DNF or CNF is expensive (in time/space) it is only possible for nite sets of formulas

(26/27

Summary: important notions


Syntax: formula, atomic formula, literal, clause Semantics: truth value, assignment, interpretation Formula satised by an interpretation Logical implication, entailment Satisability, validity, tautology, logical equivalence Deduction theorem, Contraposition Theorem Conjunctive normal form, Disjunctive Normal form, Horn form

(27/27

You might also like