Skip to content

Latest commit

 

History

History
91 lines (58 loc) · 6.67 KB

File metadata and controls

91 lines (58 loc) · 6.67 KB

Prolog & Logic Programming Information

SWI-Prolog Install Link

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.

Prolog Tutorials & References

Prolog Books

Representation of Lists of 2 elements in Scheme vs Prolog

  • Scheme: (X1, Y1) is equivalent to (X1 . (Y1 . ())
  • Prolog: [X1, Y1] is equivalent to [X1 | [Y1 | []]]

Calling C from Prolog

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 Links

Prolog Links

  • 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.

Other Logic Languages

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)

Prolog in the Real World

Where logic programming failed

5th Generation Project

Semantic Web

Logic programming was used with the Semantic Web

Why the semantic web failed:

Advanced Prolog Topics

Other links of interest