as1sol.pdf - CPSC 312 Functional and Logic Programming Fall 2017 Assignment One Queries Solution Question One(a The query is assignment(A september D

# as1sol.pdf - CPSC 312 Functional and Logic Programming Fall...

This preview shows page 1 - 2 out of 2 pages.

CPSC 312 Functional and Logic Programming Fall 2017 Assignment One: Queries Solution Question One (a) The query is ?- assignment(A, september, D). Here are the results from the query: \$ swipl Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 7.2.3) Copyright (c) 1990-2015 University of Amsterdam, VU Amsterdam SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Please visit for details. For help, use ?- help(Topic). or ?- apropos(Word). ?- [cs312_2017]. true. ?- assignment(A, september, D). A = as1, D = 12 ; A = as2, D = 17 ; A = as3, D = 24. (b) Query is ?- ta(cs312,2017,P), email(P,E). Just ask of the KB to get the answer. Note that this provides extra information, namely P . (c) office_hour(P1,Day,S1,F1), office_hour(P2,Day,S2,F2), different(P1, P2). Then you need to define different. The answer may depend on when you loaded the knowledge base (but that is what you should expect as office hours change).

• Fall '09

### 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