L4-First Order Logic
L4-First Order Logic
Lecture Notes
Lecture 4
First Order Logic
Propositional Logic
proposition - a statement which is true or false
Ex: 2+3=7 False (preposition)
Man is Mortal", it returns truth value TRUE (preposition)
"12 + 9 = 3 2", it returns truth value FALSE (preposition)
"A is less than 2". (not preposition) It is because unless we give a specific value of A,
we cannot say whether the statement is true or false
(ii) existential quantification, which tells us that there is one or more element under
consideration for which the predicate is true
x P(x) is read as for some values of x, P(x) is true
Ex: "Some students are good" can be transformed into the propositional form x
P(x) where P(x) is predicate which denotes x is good and is some students universe
of discourse
Generally for existential ( ) statements AND will come ( ^ )
Examples of First order logic
1) john likes cricket or football
likes(john, cricket) v likes(john, football)
2) john lives in a house and the colour of the house is green
lives(john,house) ^ colour(house,green)
3)if car belongs to john then it is green
belongs(car,john) colour(car,green)
4)john did not write JAVA
write(john,JAVA)
5)all elephants are grey
x [elephants(x) colour(x, grey)]
6)all computer students are brilliant
x [computer students(x) brilliant(x)]
7)john likes all kinds of foods
x [food(x) likes(john,x)]
8)everyone who is both strong and intelligent will succeed in his carrier
x [person(x) ^ strong(x) ^ intelligent(x) succeeds(x,carrier)]
9)there is person who wrote computer chess
X[person(x) ^ wrote(x, computer chess)]
Examples of First order logic (cont)
10) all courses in CEdepartment are easy
x [courses(x) CE department(x, easy)]
11)chicken is food -- food(chicken)
12)bill eats peanuts and is still alive
eats(bill,peanuts)^alive(bill)
13)sue eats everything that bill eat
x : eats(bill,x) eats(sue,x)
14)The last meeting of the club was at toms house
last meeting(club, toms house)
15)ali is not married married(ali)
16)Every country has exactly one ruler
x : y: country(x) ^ruler(y)
17)A grand parent is parent of ones parent
x : y : z parent(z,y)^parent(y,x) grand parent(z,x)
18)Every one is loyal to some one
x : y: loyal to(x,y)
19)All pompieans were romans
x : pompieans(x) romans(x)
Examples of Predicate logic (cont)
20) Bill takes either analysis or geometry
takes(bill, analysis) v takes(bill, geometry)
21) Bill takes analysis if and only if he does not take geometry
takes(bill, analysis) takes(bill, geometry)
22) Some students loves bill
x[student(x) ^ loves(x, bill)]
23) All students loves bill
x [student(x) loves(x, bill)]
24) All students are smart
x [student(x) smart(x)]
25) All graduating students are happy
x [GRstudent(x) happy(x)]
26) All happy people smile
x [happyPeople(x) smile(x)]
27) Someone is graduating
x[graduating (x)]
28) Someone is smiling
x[smiling (x)]