{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# hw-assign1 - What are the heads of the rules and what are...

This preview shows page 1. Sign up to view the full content.

King AbdulAziz University CPCS-331 Faculty of Computing & Information Technology Prolog-Lab Fall Semester 2011 Lecturer: I. Aasma Memon Homework Assignment # 1 Due Date: 12 th Nov’ 2011 Q1. Which of the following sequences of characters are atoms, which are variables, and which are neither?[2 marks] 1. vINCENT 2. Footmassage 3. variable23 4. Variable2000 5. big_burger 6. big burger 7. 'Jules' 8. '_Jules' Q2. Which of the following sequences of characters are atoms, which are variables, which are complex terms, and which are not terms at all? Give the functor and arity of each complex term.[3 marks] 1. loves(Vincent,mia). 2. 'loves(Vincent,mia)'. 3. Butch(boxer). 4. boxer(Butch). 5. (Butch kills Vincent). 6. kills(Butch,Vincent. Q3. How many facts, rules, clauses, and predicates are there in the following knowledge base?
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: What are the heads of the rules, and what are the goals they contain?.[3 marks] woman(vincent). woman(mia). man(jules). person(X) :- man(X); woman(X). loves(X,Y) :- knows(Y,X). father(Y,Z) :- man(Y), son(Z,Y). father(Y,Z) :- man(Y), daughter(Z,Y). Q4. Translate the following statements in to prolog rules: [1 mark] Everybody who has a child is happy (introduce a one-argument relation ishappy . Q5. Define the relation grandchild using the parent relation.[1 mark] Hint: It wilt be Similar to the grandparent relation Q6. Define the relation aunt( X, Y) in terms of the relations parent and sister.[3 marks] Q7.For all X, if X has a child who has a sister, then X has Two Children .[2 marks] (introduce a new relation hasTwoCHildren)...
View Full Document

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern