Propositional & Propositional & Predicate Calculus _ Predicate Calculus _ I I
Jan 29, 2016
Propositional & Propositional & Predicate Calculus _Predicate Calculus _II
Propositional Logic vs. Predicate Calculus•Propositional Logic
▫The world consists of propositions (sentences) which can be true or false.
•Predicate Calculus (First Order Logic)▫The world consists of objects, functions
and relations between the objects.
•Propositional calculus: The proposition calculus and the predicate calculus are first of all
language using their word , phrase and sentences which we can represent and reason about
properties and relation ship in the world.
Proposition calculus symbol: the symbol about the proposition calculus
are :
Proposition symbol P,Q,R….. Truth Symbol :True , falseand Connective =, , , , …..
example The wumpus world• Hunt the Wumpus is an early
computer game, based on a simple hide and seek format .
We might use W1,2 stand for proposition that the wumpus is in [1,2]. Symbole such W1,2
is atomic as shown in the next slide.
Syntax of FOL: Basic elements
•ConstantsKingJohn, 2, NUS,... •Predicates Brother, >,...•FunctionsSqrt, LeftLegOf,...•Variables x, y, a, b,...•Connectives , , , , •Equality = •Quantifiers ,
with examples Syntax
•Term: ▫constant|variable|function(term, …, term)
War-and-Peace author-of(War-and-Peace) father-of(author-of(War-and-Peace))
•Atomic Sentence▫predicate(term, …, term)
•Complex Sentence
•Every propositional symbol and truth symbol is a sentence.
• Examples: true, P, Q, R.•The negation of a sentence is a sentence.• Examples: P, false.•The conjunction, or and, of two sentences
is a sentence.• Example: P P
•The disjunction, or or, of two sentences is a sentence.
• Example: P P•The implication of one sentence from
another is a sentence.• Example: P Q•The equivalence of two sentences is a
sentence.• Example: P Q R•Legal sentences are also called well-
formed formulas or WFFs.
•P means “It is hot.”•Q means “It is humid.”•R means “It is raining.”•(P Q) R
“If it is hot and humid, then it is raining”
•Q P “If it is humid, then it is hot”
example
Truth tables for connectives
Universal Quantifier
•Brothers are siblings
•Mother: a female parent of a plant or animal
Existential Quantifier•A red object is on top of a green one
•An author is a person who writes documents
•A grandparent is the parent of one’s parent
Quantifier
•allow statements about many objects▫apply to sentence containing variable
•universal : true for all substitutions for the variable
•existential : true for at least one substitution for the variable.
Properties of Quantifiers
•The cost of an omelette at the Red Lion is £5”
•Normally:▫cost_of(omelette,red_lion,five_pounds)
Examples on predicate calculus
• Examples of representing English sentence
▫If it doesn’t rain tomorrow, Tom will go to the mountains weather(rain, tomorrow) go(tom,
mountains)▫Bisang is a Jindogae and a good dog
gooddog(bisang) isa(bisang, jindogae)▫All basketball players are tall
X (basketball_player(X) tall(X))▫If wishes were horses, beggars would ride.
equal(wishes, horses) ride(beggars).▫Nobody likes taxes
X likes(X, taxes)
• Given statements converted to formulae in predicate logic:
1. Marcus was a man.man(Marcus).
2. Marcus was a Pompein.Pompein(Marcus).
3. All Pompeins were Romans. x Pompein(x) → Roman(x).
4. Caesaer was a ruler. ruler(Caeser). 5. All Romans were either loyal to Caeser or
(EOR) hated him x Roman(x) → loyalto(x, Caeser) \/ hate(x,Caeser). OR
x Roman(x) → ((loyalto(x, Caeser) \/ hate(x,Caeser) /\
~(loyalto(x, Caeser) /\ hate(x,Caeser))) . EOR