Q1
I was just wondering if its ok to work on the assignments with other people ?
A1
You can work on the assignments with any students registered in cps721,
but the number of people in your team must be less than or equal to 3.
Q2
I was wondering where I can find the handouts you were using in class.
A2
Take notes in class: write down the most important definitions and ideas.
Also, visit cps721 folder on D2L to download copies of slides.
Q3
I was wondering if you want us to buy both textbooks, and if so, do
you have some sort of recommended readings/chapters for each book that
relates to this course, or do you expect us to read both the entire books?
A3
As I mentioned in class, you have to buy only one textbook:
Hector Levesque's "Thinking as Computation". The bookstore has many copies.
All other books are supplementary reading. Some of their sections
assume that the reader has a certain level of mathematical maturity.
Q4
Can we use the symbol ";" in the bodies of our rules?
A4
No, you are not allowed to use ";" and you also are not
allowed to use symbols "->" and "!" when you work on your assignments.
Note that any rule with disjunction (i.e., with ";") in its body
can be written as a couple of rules with the same predicate
in the head, but with different bodies.
Q5
Suppose we have the following clauses (taken from KB5 in the online
Prolog tutorial):
loves(vincent,mia). loves(marcellus,mia). loves(pumpkin,honey_bunny). loves(honey_bunny,pumpkin). jealous(X,Y) :- loves(X,Z),loves(Y,Z).So, if I do this:
jealous(X,Y) :- loves(X,Z), loves(Y,Z), not X=Y.This means that the values of variables X and Y must NOT be equal (this is assumed implicitly when we think about "jealous"). Using different names of variables in any rule does not guarantee that their values must be different: we have to say this explicitly in the rule. If you will use this corrected conditional statement, then no matter in which order you will write atomic statements, the answer to both queries
Q6
Can we use loops or lists to formulate queries in Part 1 of the assignment?
A6
No, you can use only Prolog constructs that we already studied in class:
conjunction, negation, predicates given to you (they may have variables
and constants as their arguments), equality and inequality (<) between
arithmetical expressions. In Q10, you can use also the addition operator (+)
because you have to compare the sum of the list price and shipping cost
from one bookstore with the sum of the list price and shipping cost
from another bookstore.
Q7
In Part1, Query 11, to find the last album, do we only need to make it
so that it finds the last album in our own set of atomic statments,
or goes it have to work in a general case (ie the query should work with any other
set of atomic statments whether there are 5 Drake's albums or 50 Drake's albums or more)
A7
Your query should find the latest Drake's album in a general case, i.e.,
for an arbitrary set of atomic statements.
Q8
Can we use anonymous variables in our queries?
A8
No, to avoid confusion, please try using named variables only
to formulate queries as it was discussed in class.
Q9
In Part 1 of the assignment, queries 11 and 10 are difficult to write
in Prolog. Can I write them using rules with recursion? If not, please
give me a hint on how can I write these queries.
A9
In Part 1, you can write queries only. So, you are not allowed
to write any rules (recursive, or otherwise). If you cannot formulate
quires 11 and 10 in Prolog directly, think how you can reformulate them
in English so that the reformulated query is easy to express in Prolog.
Make sure that you do logically equivalent transformation when you
transform one logical statement in English into another statement in English.
Q10
is there a way to stop repetitive results from occuring?
(i.e. X=a,Y=b followed by Y=b,X=a). I'm finding that some of
the later questions produce far more results then they really need to.
A10
In Part 1 of the assignment, the most important is to make sure that
your queries are rendered in Prolog correctly. Repetitions in answers are fine.
We discussed in class when and why this happens when I was talking about queries in
Prolog with equality in "Prolog basics". The issue of
how to prevent repetitive answers to a given query is beyond the
scopes of this assignment. You are only responsible to make sure
that all the answers are correct with respect to your KB.
Q11
A11
Q12
A12
Q13
A13
Q14
A14
Q15
A15
Q16
A16
Q17
A17
Q18
A18
Q19
A19
Q20
A20
Q21
A21
Q25
A25