Chapter 1 & 2 - Practice
Q1: Properties
- اعمل Facts للجمل الانجليزي دي:
- Gold is valuable.
- Saly is a female.
- Aly owns some gold.
- Gamal gives the book to Mona. (3 arguments)
Solution (Properties)
Q2: Facts Translation
- اعمل Facts لجمل الانجليزي دي:
- A car is fun.
- A rose is red.
- Bill likes Cindy.
- Cindy likes Bill.
- Bill likes dogs.
Solution (Facts Translation)
Q3: Age Database
- اعمل قاعدة بيانات للداتا دي:
- Aly is 42 years old.
- Hany is 15 years old.
- Saly is 20 years old.
- Aly is male.
- Hany is male.
- Saly is female.
- واكتب الاستعلامات دي:
- Is Aly 42 years old?
- What is Hany's age?
- Who is male? (اعرض كل الإجابات)
- List names with age < 40.
- List names with age < 40 and they are female.
Solution (Age Database)
Q4: Love Database 💕💕
- اعمل قاعدة بيانات بالـ Facts دي:
- Mia is a woman.
- Jana is a woman.
- Yara is a woman.
- Fady loves Mia.
- Magdy loves Mia.
- Magdy loves Badr.
- Aly loves Badr.
- Hany loves Aly.
- واكتب الاستعلامات:
- Who is a woman? (اعرض كل النتائج واحدة واحدة)
- Does Magdy love Mia?
- Does Magdy love Badr?
Solution (Loves Database)
Q5: Conjunctions
- من قاعدة البيانات:
likes(mary, food).
likes(mary, tea).
likes(john, tea).
likes(john, mary).
- اكتب الاستعلامات دي باستخدام الـ conjunctions ا ( and , or ):
- Does John like Mary and does Mary like John?
- Is there anything that John and Mary both like?
Solution (Conjunctions)
Q6: Jim's Family
- اعمل قاعدة بيانات لعيلة Jim:
- John is the father of Jim.
- Jack is father of John.
- Jane is the mother of Jim.
- واكتب الاستعلامات:
- Who is Jim's father?
- Is Jane the mother of Fred?
- Is Jane the mother of Jim?
- Does Jack have a grandchild?
Solution (Jim's Family)
Q7: Charles's Family
- اعمل قاعدة بيانات لعيلة Charles:
- Charles is male.
- Edward is male.
- Philip is male.
- Anne is female
- Philip is a parent of Anne
- Philip is a parent of Edward
- Philip is a parent of Charles
- واكتب الاستعلامات دي:
- The parents of Charles.
- The father of Charles.
- The grandfather of Charles.
- All the grandchildren of the grandparents of Charles. ( احفاد جد تشارلز )
- All males.
Solution (Charles's Family)
Q8: Pam & Bob Family Tree
- استخدم قاعدة بيانات لشجرة عيلة Pam و Bob :
parent(pam, bob).
parent(tom, bob).
parent(tom, liz).
parent(bob, ann).
parent(bob, pat).
parent(pat, jim).
- واكتب الاستعلامات:
- Who is Liz's parent?
- Who are Bob's children?
- Who is a parent of whom?
- Who is a grandparent of Jim?.
- Do Ann and Pat have a common parent?
Solution (Extended Pam & Bob)