Networking in Prolog - a survey



Hello, for my dissertation I developed a little Prolog interpreter
with didactical purposes (that was in late 2006). I coded it in Java
because it was the language I knew better. These days my professor
kindly asked if it was possible to extend the interpreter with various
facilities, among which basic networking support (thus allowing
different instances of the system to share knowledge). I think the
task is not difficult implementation-wise, since I can leverage Java's
libraries. However, before starting writing code, I wanted to check
the state of the art in Prolog networking libraries to see if I could
get any inspiration. Specifically, I'd like to make it possible to
write in Prolog a simple server capable of handling multiple
connections "simultaneously" or better asynchronously, but adding
multithreading to my interpreter is not going to be easy, so I'd avoid
that if possible; instead, I thought of using an event-based approach
(the programmer registers a goal with two free variables, Connection
and Message, as an "event handler" that will be automatically invoked
by the system each time a "message" arrives on an open connection.
What a message is concretely is rather vague at the moment, but I
digress. This way I will probably still have to manage threads, but
I'll be able to do it from the internals of the interpreter, without
exposing a threading API on the prolog side). I read about SWI
Prolog's clib networking support, which as far as I can tell is a
Prolog skin over the standard Unix socket library; it even mentions
fork! Besides that, I found no other convincing example of networking
libraries in Prolog. Has anyone on this group any insight into the
problem?

Thanks in advance to anyone who answers!
Kind regards,

Alessio Stalla
.



Relevant Pages

  • Re: Networking in Prolog - a survey
    ... main prolog interpreter loop from needing to be multi-threaded by ... interpreter loop to run, it will have to wait for the users query to ... allow to run the event handler code with a separate prolog stack, ... If I limit the handling of threads to be only on the Java side, ...
    (comp.lang.prolog)
  • Re: Networking in Prolog - a survey
    ... I coded it in Java ... kindly asked if it was possible to extend the interpreter with various ... the state of the art in Prolog networking libraries to see if I could ...
    (comp.lang.prolog)
  • Re: Changing the default search behavior?
    ... Prolog in Prolog, and then to adjust that interpreter to implement the ... and the following query with standard depth-first search: ... of remaining goals minus unprocessed time etc. ...
    (comp.lang.prolog)
  • Prolog interpreter (was Re: SMLs patterns)
    ... > Can you please provide me with some info regarding implementing prolog ... > interpreter in SML, please advise. ... fun lookup x = NONE ...
    (comp.lang.functional)
  • Re: Is Prolog good for AI? (was: Minsky still posting)
    ... but it was Prolog nor AI. ... I'm not talking about a different language. ... built-ins and libraries providing useful things such as better access ... but there are hardly any portable resources. ...
    (comp.lang.prolog)