[net.lang.prolog] Modules, and Algorithms

Moss.UPenn%Rand-Relay@sri-unix.UUCP (11/09/83)

From:  Chris Moss <Moss.UPenn@Rand-Relay>

As a response to Wayne Christopher, there are several Prolog systems 
that include modules. I'll briefly describe one: microProlog,
available for CP/M and IBM PC machines. A module appears as 3
entities: a module name, names of relations that are defined in the
module, and names of symbols referenced in the outside world. (I.e.
export and import). Thus each module maintains its own dictionary and
modules can of course be nested, saved and edited (using unwrap and
wrap commands) and one can change contexts easily. There are a few
hacks (module names must be distinct from other names) but the system
generally works well.  It does stop familiar problems like acquiring 2
copies of append from different files!

   On Russ Abbott's question about Prolog for algorithms, I would
refer him to Bob Kowalski's series of papers on the subject, though
they are not completed. Processing a command involves a parameter
representing the database and a new database created by it. He
characterises an algorithm as logic+control, and several papers by
Clark and Tarnlund expand this in developing efficient programs from
inefficient specifications. Improvements in Prolog implementation
techniques, such as tail recursion, make iterative programs
reasonable. So the work is being done although it is far from
completion.  The danger is that like Lisp, the available tools become
a de facto standard and prevent the 'right' solutions being used.

Refs: K.A.Bowen, R.A. Kowalski: Amalgamating Language and
      Metalanguage in Logic Programming. in Logic Programming
      (Clark, Tarnlund Eds). Academic Press, 1982.

      R.A.Kowalski: Algorithm=Logic+Control. CACM 22, 424-431. 1979.
      K.L.Clark, J. Darlington: Algorithm Classification through
      Synthesis. Computer Journal 23/1. 1980.

      A.Hansson, S.Haridi, S-A.Tarnlund: Properties of a Logic
      Programming Language. in Logic Programming. 1982.