First-order logic is another way of knowledge representation in artificial intelligence. It is an extension to propositional logic.
link: https://www.slideshare.net/HabibaSaeed5/first-order-predicate-logic-examples-different-examples
4. • There is at least one thief.
∃x: thief(x)
• Some cats are black.
∃x: cats(x) ^ black(x)
• Every apple is delicious.
∀x: apple(x) → delicious(x)
First order predicate logic
5. • All students taking Al are genius.
∀x: students(x) ^ taking AI(x) → genius(x)
• Some students are taking AL are genius and hardworking.
∃x: students(x) ^ taking AI(x) →genius(x) ^hardworking(x)
• Hiba takes DM and AI.
∃x: hiba(x) ^ takes(x, DM) ^ takes(x, AI)
6. • All romans were either loyal to Caesar or hated him.
• Anyone who is married and has more than one spouse is a bigamist.
• Bigamist: someone who marries a person while already legally married to
someone else
7. solution
• All romans were either loyal to Caesar or hated him.
∀x: Roman(x) → Loyal(x, Caesar) ∨ Hated (x, Caesar)
• Anyone who is married and has more than one spouse is a bigamist.
∀x: married(x) ^ (no.of.Spouse(x) > 1) → bigamist(x)
8. • Ancestors of my ancestors are ancestors of mine.
∀x ∀y ∀z: ancestor(x, y) ^ ancestors(y, z) → ancestor(x, z)
x= dada dadi y= Ami Abu z=me
• NO purple mushroom is poisonous.
∀x: mushroom(x) ^ purple(x) → ~poisonous(x)
• Saleh takes either AI or DM( but not both).
∃x: saleha(x) ^ takes(x, AI) ↔ ~takes (x, DM)
9. • If any bananas are yellow , they are ripe.
∀x : Banana(x) ^ yellow(x) → Ripe(x)
• If anyone cheats, everyone suffers.
∀x ∀y: cheat(x) → suffers(y)
• No whale is a fish.
∀x : whale(x) → ~fish(x)
10. • Brothers are siblings.
∀x ∀y: brother(x) → Siblings(x, y)
• Nida has no sister.
~∃x: Sister.Of(x, Nida)
• Every student smiles.
∀x : student(x) → smile(x)
11. • Every student except Ayesha smiles.
∀x : student(x) → (x ≠ Ayesha ↔ smile(x))
• Every student who loves Mary is happy.
∀x : student(x) ^ loves(x, Mary) → happy(x)
• Everyone loves himself.
∀x : Love(x, x)
12. • Every boy who loves Mary hates every boy who Mary loves.
∀x ∀y: (boy(x) ^ love(x, Mary)) → (boy(y) ^ love(Mary, y)) → hate(x, y)
• Every boy who loves Mary hates every other boy who Mary loves.
∀x ∀y: (boy(x) ^ love(x, Mary)) → (boy(y) ^ love(Mary, y) ^ y ≠ x )→
hate(x, y)