 
Summary: G52PAS 20112012 Answer to the exercise on FOL
Express the following sentences in firstorder logic:
1. A friend of a friend is a friend. (Use a binary predicate Friend.)
2. An enemy's enemy is a friend. (Use binary predicates Friend and Enemy.)
3. If two people are friends, then they are not enemies. (Use binary predicates
Friend and Enemy.)
4. Any two people are either enemies or friends. (Use binary predicates
Friend and Enemy.)
5. John has a friend. (Use a binary predicate Friend and constant J for
John.)
6. John has at least two friends. (Use a binary predicate Friend, constant
J for John, and equality=.)
7. John has exactly two friends, and everyone else is an enemy. (Use binary
predicates Friend and Enemy, constant J for John, and equality=.)
Answer
I used Friend(x, y) for `y is a friend of x' and also for `x and y are friends'. May
be the latter is better expressed as Friend(x, y) Friend(y, x)', but I wanted
to keep the formulas shorter. (Same for enemies.)
1. A friend of a friend is a friend.
xyz(Friend(x, y) Friend(y, z) Friend(x, z))
