ITCS440Assignment-I
a) Write a prolog program to show the summation of even numbers, odd
numbers and the total numbers in a given list.
Example
?- sum([2,5,7,3,9.6],M).
M=[8,24,32]
b) Given the following English text, convert it to prolog facts and rules
FACTS
// charlie studies csc135
// olivia studies csc135
// jack studies csc131
// arthur studies csc134
// kirke teaches csc135
// collins teaches csc131
// collins teaches csc171
// juniper teaches csc134
RULE
// X is a professor of Y if X
teaches C and Y studies C.
Run the program to answer the
following Queries
// charlie studies what? OR
What does charlie study?
// Who are the students of
professor kirke.
Note: In addition to the pl files, give also your program in .doc. You should include
comments for every instruction in your program. You have also submit a document
file with run screenshots.