Assignment: (15 points)For this assignment you will be asked to write some Prolog clauses.
1) Write the clauses for a relation called longerThan which is a relation between two lists of integers. The relation holds for two lists if the first is longer than the second. For instance, after loading the clauses you write, the following queries should produce the results listed.
a) Write clauses for longerThan using a len predicate (like we did in class).
b) Write clauses for longerThan without calculating the length of each.
2) Write the clauses for a relation called subset which is a relation between two lists. The relation holds for two lists if every item in the first list is contained in the second list. Some sample queries:
X = [1,2]
X =  note that X = , or X=, or X =  would be valid as well.
3) Consider representing dates as a compound data object, with the month, date, and year, being the arguments. For instance, this year’s commencement would be represented as:
date(october, 28, 1999)
Now consider the relation bday, which takes a person's name (in single quotes) and a date as arguments and is true if the date is that person’s birthdate. eg:
bday('Ed Jones', date(april, 19, 1988)).
bday('Christine Warner', date(may, 26, 1985)).
bday('Terri Veenstra', date(march, 7, 1989)).
bday('Anne Glackin', date(november, 28, 1989)).
bday('Mike Vitale', date(august, 28, 1985)).
bday('Ed Smith', date(may, 19, 1990)).
The following should work on any database, not just the one given.
a) Give a query (goal) which will give me the name of someone in the database with a birthday in May (or "no" if no such person exists).
b) Create a predicate inmonth with two arguments: the first argument is a month, and the second one is a list. It is satisfied if everyone in the list was born in the month given. Samples:
inmonth(november, ['Anne Glackin', 'Terri Veenstra']).
inmonth(may, ['Mike Vitale', 'Christine Warner']).
inmonth(X, ['Mike Vitale', 'Christine Warner']).
X = may.
inmonth(X, ['Anne Glackin', 'Terri Veenstra']).
????? - this may give an empty list, or a list of people in that month, depending on how you write the database.
c) Write clauses for a predicate over30, which is a property of a person. The predicate is true if the person is over 30 right now. (The date you are doing the assignment.) Examples with the above database:
X = 'Christine Warner'
Handin method: TBA