This shows you the differences between two versions of the page.
sc330_f2016:prolog1 [2016/10/19 20:00] jhansen |
sc330_f2016:prolog1 [2021/06/30 23:42] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====Objective:==== | ||
- | * Gain experience with logic programming. | ||
- | * Become familiar with Prolog. | ||
- | * Gain understanding of the declarative nature of prolog. | ||
- | ---- | ||
- | You will use the Prolog container for this Assignment. | ||
- | |||
- | (The Prolog container isn't ready, ensure that you are using SWI-Prolog) | ||
- | |||
- | ====Deliverables:==== | ||
- | You will turn in two prolog programs(in separate files) that solve the following logic puzzles:\\ | ||
- | *{{sc330_f2016:schoolsout.png?linkonly|School's Out!}} | ||
- | *{{sc330_f2016:rosiesroses.png?linkonly|Rosie's Roses}}\\ | ||
- | |||
- | Your "main" function will be the predicate solve.\\ | ||
- | |||
- | To help you we've provided a [[smapleSolution.pl|sample solution]] to {{sc330_f2016:tie.png?linkonly|It's a tie}}, Use this as a model for your own solutions. | ||
- | |||
- | ====Notes:==== | ||
- | *Just copy and paste the all_different function. It simply checks to make sure each item in the list is unique. | ||
- | *Check spelling errors. There is not such thing as misspelled atoms. So speigel and spiegel are both valid but different. | ||
- | *Once you have a solution just check whether it satisfies each of the numbered rules in the problem. | ||
- | *These problems make extensive use of the "not operator, \+. | ||
- | * \+ works as you expect when all variables are completely bound. | ||
- | * If E contains unbound variables, \+E will try to find bindings to that will make E true. If Successful \+ will fail. | ||
- | * This lab is taken from http://www.cis.upenn.edu/~matuszek/cis554-2015/Assignments/prolog-1-logic-puzzles.html there may be additional resources there. |