0

In the introduction to The Art of Prolog, Sterling and Shapiro defer a discussion of parallelism, concurrency, and logic programming to another book. My question is whether there is such a resource:

[the] promise of parallel computers, combined with the parallelism that seems to be available in the logic programming model, have lead to numerous attempts, which are still ongoing, to execute Prolog in parallel, and to devise novel concurrent programming languages based on the logic programming computation model. This, however, is a subject for another book (The Art of Prolog, p. xx).

Searching on Google, I found a parallel implementation of Prolog and concurrency libraries for Mercury, in addition to hundreds of research papers and dissertations. But it's harder to locate resources on the second part of the paragraph, about concurrent programming and programming languages based on the execution models of logic programming languages. Is there a good resource on these topics? I'm particularly interested in references on compiling and writing parallel and concurrent logic programs.

emi
  • 5,380
  • 1
  • 27
  • 45
  • I think the verdict of history is that Prolog turns out to be an ill-suited language for parallel or concurrent programming. I recall looking into this a few years ago, and finding some decent essays on the topic. Let me try and reconstruct my steps. – hardmath Mar 08 '14 at 18:19
  • hardmath: If you find the time, I would appreciate it. Your comment makes it sound like I should refine my search to histories of implementations of parallel and concurrent logic programming, if the verdict of history is that logic programming languages aren't well-suited for the task. – emi Mar 09 '14 at 14:26
  • I don't want to press the historical angle too hard, as the Question deserves an analysis on the merits of the language. However I recommend the [2010 blog article](http://vanemden.wordpress.com/2010/08/21/who-killed-prolog/) "Who Killed Prolog?" by Maarten van Emden, which has a postscript from last month (Feb. 2014). It largely concerns the Japanese "Fifth-Generation Computer System" Project (1982-1992), but that's an important historical data point. – hardmath Mar 09 '14 at 17:11
  • See also this [2011 SO Question](http://stackoverflow.com/questions/6874762/how-concurrent-is-prolog), How Concurrent is Prolog? I upvoted three of the Answers on that! – hardmath Mar 09 '14 at 17:18
  • massively concurrent Prolog-like language? Could that be........ Erlang? – Will Ness Jul 03 '16 at 20:47

1 Answers1

1

In Prolog you can have both non-determinism and concurrency. Non-determinsim is what is usually described as unification and backtracking. You can imagine that a Prolog clause is full of implicit amb statements. It is less known that concurrency is also supported by logic-programming.

But today we might just go with treads inside logic programming. Here is an example to implement a findall via threads. This can also be modded to perform all kinds of tasks on the collection, or maybe even produce agent networks towards distributed artificial intelligence.

There is a even a proposal for a set of ISO standard predicates that support threading inside Prolog. These predicates also cover synchronization and queueing primitives. But more important, light weighted Prolog based web servers wouldn't work, there werent multi-threaded Prolog systems around:

ISO/IEC DTR 13211–5:2007 Prolog multi-threading support
http://logtalk.org/plstd/threads.pdf

Community
  • 1
  • 1