Explaining Prolog in simple terms so that we can save the Web

Simon Polovina, SCISM, South Bank University, London, UK

Let me get to the point: we need to explicate the benefits of Prolog to the world at large if not only Logic Programming but indeed the Web itself is truly to survive. The following, I hope, does so in sufficiently simple terms:

Despite its many espoused benefits, we cannot escape from the fact that using Java directly to develop models of meaningful real world problem-solving content for the Web environment remains questionable. We need to get across to the software development community that Java still exposes its 1960s third generation computer programming pedigree, particularly the imperative programming style. This style demands that the developer has to focus on the prevalent von Neumann architecture of the computer itself and how it processes data, rather than model the logical interrelationships of the subject domain itself. The dominance of von Neumann computers, named after the person who designed the architecture on which they are based, should not be underestimated; we must remind ourselves that this design includes all the popular computers in use today such as the IBM Compatible PC, Apple Macintosh and UNIX machines.

Of course, as imperative programs are closely tied to the design of these computers, they can be executed efficiently. It does not follow, however, that the imperative paradigm is the most appropriate logical computational model. With the dynamic subject domains that are a feature of the real world, and more so with the Web, there is a danger that this shortcoming would prove to be fundamental. A subject's content modelled with an imperative mentality runs the risk of turning into an economically and socially expensive disaster. An associated consequence of the imperative paradigm's close alignment to the computer is that a sound computing knowledge is required as well as expertise of the problem domain. Thus claims about Java, or Perl, being easy to learn can also be questioned.

Many argue that these issues can be simply resolved by dividing the duties between, say, the subject domain expert and the computer software engineer. Thus the latter's expertise can be called upon, including not falling into the imperative trap. We have to consider, though, that such a strategy has a significant cost, namely real time interactivity due to the domain expert being delayed, perhaps by many months, as the software engineer amends the materials to reflect developments in the subject being telematically explored. This is not new. Nonetheless we must remind ourselves that with the dynamic and rapidly interactive subject domains that are to become a feature of the Web, 'keeping up' with the problem domain's dynamics will be impossible as a result thus stifling the Web's true potential. Clearly there is a need for major advances to be made in this area.

Recognising the limitations arising from the von Neumann architecture of computer hardware, computer scientists have sought to find a logical paradigm that does indeed model the domain problem at hand rather than pacify the computer. As we know this effort has lead to the development of logic programming languages, of which 'Prolog', short for Programming in Logic, as its major culmination. An added feature of the Prolog computer programming language is that it can run on von Neumann computers. Prolog interpreters or compilers convert the modelled domain knowledge into the imperative form, but do so in a principled way that avoids the dangers outlined earlier.

Given that Prolog has been around for some time, we must wonder why it is not as popular as it should be. Essentially the reasons are historical, but have managed to persist nonetheless. Early versions of Prolog were inefficient and therefore very slow, essentially because of the inherent difficulty of converting the Prolog code into von Neumann executable form, thus illustrating the order of magnitude between logic and imperative programming. Since then, however, much work has been conducted resulting in the efficient implementation of Prolog, even on prevailing computers, through the use of 'optimising' compilers.

Also, because of the large established base of imperative programs and expertise, an instinctive reluctance to change has prevailed due to the fear of 'trying something that is unknown'. Indeed this a pattern that is reflected throughout computing's history. Examples include the predominant QWERTY keyboard layout, despite the fact that it had been deliberately designed to be inefficient thus preventing early mechanical typewriters from becoming jammed due to too-rapid key pressing. The efficiency argument itself does seem to matter little, since certain modern popular computer languages such as Visual Basic, though imperative in nature, are renowned to be very slow.

Given the need for expressive models of Web-based subject domains, it therefore could be that Prolog's 'time has come'. Certainly Prolog, because of its problem-based logic focus, allows the more rapid development and deployment of real world applications. The software (or knowledge) engineer could produce revised material more quickly for their end users, as the engineer would not have to go through the careful process of matching it to the imperative paradigm. This could be mitigated further if a proper Computer-Aided Software Engineering (CASE) tool was developed that could be effectively embedded into the Prolog programming environment.

In addition, the latest Prolog compilers do not enjoy the distributed client-server advantages of Java as explained earlier. One desirable outcome therefore would be a compiler that automatically converts Prolog code into Java bytecode, thus immediately benefiting from Java's advantages without its limitations.

We need to get all these benefits across to the Web community and end-users at large. It is a challenge in which we must succeed if we are not to repeat the computing mistakes of the past by shackling the Web's potential.


*Dr. Simon Polovina, S'wark Telecommunity Research Ints. Group (STRInG)
*School of Computing, IS & Maths, South Bank University, London SE1 0AA
*Web: http://www.sbu.ac.uk/~polovina
*Tel: 0171 815 7405 (Direct) / 7443 (School Office), Fax: 0171 815 7499