Developers SIG
September 7, 2004


At the September 7th meeting of the Developers SIG we will explore Prolog, the most prominent of the logical programming languages. Keith Alcock will introduce the language, cover syntax and semantics, walk through solutions to a few interesting textbook problems, and explain how it all fits together in the real-world application that is his current project. A sneak preview of the application is available.


Slides can be viewed in HTML format. There was a question during the presentation that couldn't be immediatedly answered: how can one do something repeatedly as in "for (int i=1;i<=MAX;i++) ulam(i);"? Although there is a potentially useful repeat/0 functor, the following allows queries like "?- for(1,5,ulam(_))." and could be more convenient:

for_loop(Index,Stop,Functor) :-
    Index =< Stop,
    Call =.. [Functor,Index],
    NewIndex is Index + 1, !,

for_loop(Index,Stop,_Functor) :- Index > Stop.

for(Start,Stop,Call) :-
    Call =.. [Functor| _],

These Prolog source code files were used in the presentation: