If you have not already done so, please install SWI-Prolog. Once you install SWI Prolog it will associate files with a .pl extension. If you double click on the file it will open SWI & consult the file. At that point you should be able to do queries.
SWI-Prolog has an online Prolog environment. It is still in the experimental phase, but all the CSC240 assignment solutions work. For the project you should still test with the stand alone project since that is how assignments will be graded.
If you want something a bit more high-end, Sicstus is a commercial-quality Prolog implementation with a ton of additional features. You can get a free 30-day license which will get you through the end of class if you wait until we finish Scheme.
- An Introduction to Logic Programming
- 12 Days to Prolog with some nice advanced examples
- The Art of Prolog is an excellent book on Prolog and logic programming. It is available for free online - look under the "Open Access" tab.
- The Power of Prolog is a more thorough, advanced tutorial.
- The Art of Prolog: Advanced Programming Techniques by Leon S. Sterling and Ehud Y. Shapiro This text is available Open Access
- Clause and Effect: Prolog Programming for the Working Programmer by W. F. Clocksin
- Programming in Prolog: Using the ISO Standard by W. F. Clocksin and C. S. Mellish
- Prolog Programming for Artificial Intelligence by Ivan Bratko
- Scheme:
(X1, Y1)is equivalent to(X1 . (Y1 . ()) - Prolog:
[X1, Y1]is equivalent to[X1 | [Y1 | []]]
We will not be doing this in class, but for those of you interested here is an example of calling Prolog code from C. The functions starting with SP_ are part of the Sicstus Prolog library. SWI has a similar feature, but I have never used it.
- Prolog as a Database Query Langauge shows you you can use Porlog as a database query langauge.
- A comparison of SQL and Prolog
- SWI-Prolog offers an online Prolog course, including constraint programming
- The author of Logic Programming Is Overrated talks about how a certain problem was easier to solve in Clojure without using logic programming extensions. While not directly related to what we cover in this class, there are some interesting examples of Clojure & logic programming in the article.
I have not looked in depth at most of these, but here are a few newer logic languages that I've heard about.
- Mercury, a functional-logic language
- Datomic, a query language based on Datalog (if you are interested, there is a tutorial)
- VIDEO: Production Prolog by Michael Hendricks
- An interesting experiment in using Prolog for bots in Counter-Strike. Two interesting conclusions: C++ bot code can be rewritten to Prolog, & Prolog bots can be used efficiently.
- cozo is a relational database that uses Datalog as its query language
- GRAKN.AI is a distributed graph database that is compatible with logic programs.
- Windows NT had an embedded Prolog interpreter to help with network configuration
- Web Prolog and the Programmable Prolog Web (book).
- SICStus Prolog is used in the airline & rail industries.
- Prolog was used in the Java specification.
- IBM Watson uses Prolog.
- In 2016, the AppLP workshop was held where different applications of logic programming were discussed. The talks are summarized in this document.
- New York Times article about Japan's Fifth Generation project
Logic programming was used with the Semantic Web
Why the semantic web failed:
- The Semantic Web and why it failed
- Whatever Happened to the Semantic Web?
- Three reasons why the Semantic Web has failed
- The Warren Abstract Machine
- The Micro-Prolog manual from Spectrum
- VIDEO: A solution to the four-color problem which we will be solving using Prolog in the project - Four color theorem: coloring algorithm