You are on page 1of 21

PROPOSITIONAL LOGIC &

PREDICATE LOGIC
Nidheesh Chittil

1. Propositional Logic
A proposition a sentence that can be either true or false.
Propositional logic consists of:

The logical values true and false (T and F)

Propositions: Sentences, which

Are atomic (that is, they must be treated as indivisible units,


with no internal structure), and
Have a single logical value, either true or false

Operators, both unary and binary; when applied to logical values,


yield logical values

The usual operators are and, or, not, and implies

Well formed formula

Propositional Calculus (PC) is a language of propositions basically refers

to set of rules used to combine the propositions to form compound


propositions using logical operators often called connectives such
as , V, ~, ,

Well-formed formula is defined as:

An atom is a well-formed formula.

If is a well-formed formula, then ~ is a well-formed formula.

If and are well formed formulae, then ( ), ( V ),


), ( ) are also well-formed formulae.

A propositional expression is a well-formed formula if and only if it


can be obtained by using above conditions.

Equivalence laws
Commutation
1.

PQ

Q P

2.

P V Q

Q V P

(P Q) R

Association
1.

P (Q R)

2.

P V (Q V R)

(P V Q) V R

Double Negation
~ (~ P)

Distributive Laws
1.

P ( Q V R)

(P Q) V (P R)

2.

P V ( Q R)

(P V Q) (P V R)

De Morgans Laws
1.

~ (P Q)

~P V~Q

2.

~ (P V Q)

~P ~Q

Law of Excluded Middle


P V ~P

T (true)

Law of Contradiction
P ~P

F (false)

Truth table
Truth table gives us operational definitions of important logical
operators.

By using truth table, the truth values of well-formed formulae are


calculated.

Truth table elaborates all possible truth values of a formula.


The meanings of the logical operators are given by the following truth
table.
P

~P

PQ PVQ

P Q

P Q

Syntax
1. symbols

logical constants True, False

propositional symbols P, Q,

logical connectives

conjunction , disjunction ,

negation ,

implication , equivalence

parentheses ,

2. sentences

constructed from simple sentences

conjunction, disjunction, implication, equivalence, negation

Propositional logic : Syntax

Cont.

The symbols of the language:

Propositional symbols (Prop): A, B, C,

Connectives:

and

or

not

implies

xor (different than)

, >

equivalent to
False, True

Parenthesis:(, ).

Semantics
1. interpretation of the propositional symbols and constants

symbols can stand for any arbitrary fact

sentences consisting of only a propositional symbols are


satisfiable, but not valid

the value of the symbol can be True or False

must be explicitly stated in the model

the constants True and False have a fixed interpretation

True indicates that the world is as stated

False indicates that the world is not as stated

2. specification of the logical connectives

frequently explicitly via truth tables

Semantics

2.

Predicate Logic

Predicate calculus is also known as First Order Logic (FOL)

Predicate calculus includes:

All of propositional logic

Logical values true, false

Variables

Connectives

x, y, a, b,...
, , , ,

Constants KingJohn, 2, Villanova,...

Predicates Brother, >,...

Functions Sqrt, MotherOf,...

Quantifiers

Constants, functions and predicates


A constant represents a thing--it has no truth value, and it does
not occur bare in a logical expression
Examples: DavidMatuszek, 5, Earth, goodIdea
Given zero or more arguments, a function produces a constant as
its value:
Examples: motherOf(DavidMatuszek), add(2, 2), thisPlanet()
A predicate is like a function, but produces a truth value
Examples: greatInstructor(DavidMatuszek), isPlanet(Earth), greater(3,
add(2, 2))

Universal quantifier

The universal quantifier, , is read as for each


or for every

Example: x, x2 0 (for all x, x2 is greater than or equal to zero)

Typically, is the main connective with :

x, at(x,Villanova) smart(x)
means Everyone at Villanova is smart

Common mistake: using as the main connective with :

x, at(x,Villanova) smart(x)
means Everyone is at Villanova and everyone is smart

If there are no values satisfying the condition, the result is true

Example: x, isPersonFromMars(x) smart(x) is true

Existential quantifier

The existential quantifier, , is read for some or there exists

Example: x, x2 < 0 (there exists an x such that x2 is less than zero)

Typically, is the main connective with :

x, at(x,Villanova) smart(x)
means There is someone who is at Villanova and is smart

Common mistake: using as the main connective with :

x, at(x,Villanova) smart(x)
This is true if there is someone at Villanova who is smart...
...but it is also true if there is someone who is not at Villanova
By the rules of material implication, the result of F T is T

Properties of quantifiers

x y is the same as y x

x y is the same as y x

x y is not the same as y x

x y Loves(x,y)

There is a person who loves everyone in the world

More exactly: x y (person(x) person(y) Loves(x,y))

y x Loves(x,y)

Everyone in the world is loved by at least one person

Quantifier duality: each can be expressed using the other

x Likes(x,IceCream)

x Likes(x,IceCream)

x Likes(x,Broccoli)

x Likes(x,Broccoli)

Parentheses
Parentheses are often used with quantifiers
Examples:

(x) person(x) likes(x,iceCream)

(x) (person(x) likes(x,iceCream))

(x) [ person(x) likes(x,iceCream) ]

x, person(x) likes(x,iceCream)

x (person(x) likes(x,iceCream))

Parentheses are preferred that show the scope of the


quantifier

x (x > 0) x (x < 0)

Syntax
based on sentences

more complex than propositional logic


constants, predicates, terms, quantifiers
1.constant symbols
A, B, C, Franz, Square1,3,

stand for unique objects ( in a specific context)


2.

predicate symbols
Adjacent-To, Younger-Than, ...

describes relations between objects


3. function symbols
Father-Of, Square-Position,

the given object is related to exactly one other object

Semantics
relates sentences to models

in order to determine their truth values

provided by interpretations for the basic constructs

usually suggested by meaningful names (intended interpretations)

constants

the interpretation identifies the object in the real world

predicate symbols

the interpretation specifies the particular relation in a model

may be explicitly defined through the set of tuples of objects that


satisfy the relation

function symbols

identifies the object referred to by a tuple of objects

may be defined implicitly through other functions, or explicitly


through tables

Syntax and Semantic


Predicate Symbol
It is a particular relation in the model between pair of
objects Predicate(Term,,,,,)
< (1,2)

> (3,4)

Brother(mohamed,Mostefa)

Function Symbol
A given object it is related to exactly one other
object by the relation Function(Term,,,,,)
FatherOf(Ahmad)

Equal(Plus(1,2))

Syntax and Semantic


Terms
It is an expression that refers to an object
Function(Term,,,) | variable | constant
FatherOf( Khalid) x y
2
Riyadh
Ahmad
Atomic Sentence
Is formed from a predicate symbol
followed by a parenthesized list of terms.
Predicate(Term,,,) or term =term
Older(Youssef, 30)

1=1

Syntax and Semantic


Complex sentences
We can use logical connective to
construct more complex sentences
S1

S1 S2
S1 S2

> (1,2) (1,2)


> (1,2) >(1,2)

S1 S2

S1 => S2

You might also like