Você está na página 1de 17

Artificial Intelligence

SCSB3553
Knowledge Representation and Search
Propositional Logic

Outline
Formalize Knowledge using Logic
Syntax and Semantic for Propositional
Logic
Compounding Propositions using Truth
Tables

Formalize Knowledge using Logic


What is Logic?

A system of symbolic logic using symbols


to stand for whole propositions and logical connectives
Proposition: a statement or assertion that expresses a judgment or opinion

Formalize Knowledge using Logic


Solution

True

False

Problem
Proposition
Logic

Predicate
Logic

Formalize Knowledge using Logic


Logic

Semantics





Syntax







Logic - has a well defined syntax,


semantics and proof theory

Syntax

Syntax - a logic defines the


syntactically acceptable objects
of the logic (well-formed formulae)
Semantics - a logic associate each
formula with a meaning

Syntax

Problem

Proof Theory - concerned with


manipulating formulae according
to certain rules

Formalize Knowledge using Logic

Syntax

True
Proposition Logic

Logical Connectivity

False

Formalize Knowledge using Logic


What is a Proposition?

Statement 1

Statement 2

Let p be gene A is cancerous

Let q be gene A is healthy

Formalize Knowledge using Logic


What is a Connective?
combination of propositions to form
compound propositions

AND

Conjunction (&& or .)

OR
NOT

Disjunction (|| or +)
Negation (~)

IF THEN
IF AND ONLY IF

Implication ()
Equivalent (<=>)

Syntax for Propositional Logic


The proposition variable S1, and S2 are statements
If S is a sentence, S is not a sentence (negation)
If S1 and S2 are statements, S1 ^ S2 is a statement (conjunction)
If S1 and S2 are statements, S1 v S2 is a statement (disjunction)
If S1 and S2 are statements, S1 S2 is a statement (implication)
If S1 and S2 are statements, S1<=>S2 is a statement
(equivalence)

Semantic for Propositional Logic


Each model species true / false for each
proposition symbol
E.g.
P
Q
R
true/false true/false true/false
(With these symbols, 23=8 possible
models, can be enumerated automatically)
Rules for evaluating truth with respect to a
model are determined by truth tables

Truth Table for Compound


Propositions - AND
The conjunction p AND q, written p ^ q, of
two propositions is true when both p and q
are true, false otherwise.

Truth Table for Compound


Propositions - OR
The disjunction p OR q, written p v q, of two
propositions is true when p or q (or both) are
true, false otherwise.

Truth Table for Compound


Propositions - NOT
The negation NOT p of a proposition (or
p) is true when p is false and is false
otherwise. p may be read that it is false that
p.

Truth Table for Compound


Propositions IF THEN
The implication IF p THEN q, written p q,
of two propositions is true when either p is
false or q is true, and false otherwise.

Truth Table for Compound


Propositions IF AND ONLY IF
The equivalence IF AND ONLY IF p THEN
q, written p <=> q, of two propositions is true
when both p and q are true or when both p
and q are false, and false otherwise.

Exercise

Exercise

p.. (my breakfast is) eggs.
q.. (my breakfast is) cereal.
r.. (my breakfast is) toast.

The statement my breakfast is
either eggs or cereal, and toast
may be written in symbolic form
as ???
Thus, this logic tells us that
The compound proposition is true if
1. I eat cereal, eggs and toast; or
2. I eat cereal and toast; or
3. I eat eggs and toast.

Você também pode gostar