Prolog and Web Development

March 14th, 2007

I recently set about completing something I have wanted to create for some time, a logic theorem prover in Prolog. At the moment it just deals with classical propositional logic, but it is ready to be easily extended to deal with some basic many-valued non-classical logics. Accompanying this endeavour was an aim to give the Prolog backend a friendly web frontend. These tasks directly contributed to the development of my skills with regard to logic programming for the web, something I am currently interested in working on. So I set about doing this. Although no where near as covered as traditional web programming paradigms such as PHP and ASP, I did find a disparate collection of literature pertaining to methods to and approaches for Prolog programming for the Internet. Much of this was quite impressive. I use SWI Prolog, and it has nice support for HTTP, RDF and the Semantic Web in general. At this link you will find a good summary of the options available with regard to using Prolog for web development. The guy who wrote this page has developed something he calls Prolog Server Pages (PSP), a cool little web based scripting language using Prolog. If you already haven’t and are interested in this idea, I encourage you to visit the page. I made a small attempt to get it working but to no avail, though I will continue to try and get it working. However, since my project is to be hosted on a server on which I can not use Prolog Server Pages, I opted to use CGI. Although there is a very small amount of literature (pretty much very old forum posts with links to pages that no longer exist) over the internet on the topic of using Prolog programs with CGI, I was unable to find a decent, basic tutorial on how to get a web page to call a Prolog program using CGI. So I have written one: Writing CGI Applications with Prolog.

Leave a Reply