John joined the CS Department at UVM in 2000 and graduated in 2003. Mary joined the CS Department at UVM in 1994 and graduated in 2001. Peter joined the Business Department at UVM in 1999 and graduated in 2002.If any two students were present at the same university in the same department for any period of time, they are considered classmates.
For example, your program should answer "yes" to the following query:
?- class_mates(john, mary). YesAnd no to the following query:
?- class_mates(john, peter). NoYou should also be able to provide a rule called attended_during(S,Year), which indicates that a student S attended UVM during a particular Year. For example:
?- attended_during(S,2002). Yes S=john S=peter
?- double([[1,3],[9,5],[7],[6,8,4]], X). Yes X=[2,6,18,10,14,12,16,8]