Module 05 Study Guide
Learning Objectives (Prolog, CPL Ch.16)
We are learning elementary Prolog to get a taste of declarative and logical programming. As with functional programming, declarative programming is an entirely different way of thinking about programming from what you are used to. It is also quite different from functional programming. Specifically, by the end of the module you should be able to
- Run and exit the gprolog interpreter
- Create and load a Prolog program into the gprolog interpreter•Run queries in the gprolog interpreter and understand the results
- Write Prolog facts using predicates and atoms
- Write Prolog rules using variables and recursion
- Understand how the Prolog interpreter’s inference engine works
- Write rules using the cut (
!
), the not predicate (\+
), and the anonymous variable (_
) - Write test cases that can be run after a program is loaded
Resources
- CPL Chapter 16
- Learn Prolog Now! online book
- The Power of Prolog online book
- GNU Prolog Manual
- SWISH Interactive Online Prolog
Lab
Please complete the lab. You may begin it any time. You should try to finish it by Wednesday so you can start working on the programming assignment in class on Wednesday (please bring your computer).
Programming Assignment
Please complete the project and submit your code on Canvas by the due date.