Feed on
Posts
Comments

Archive for the ‘Prolog’ Category

Wandering around the Prolog world, it’s fun (the “shooting rats” or “burning ants” sort of fun, that to some people, including myself, does not mean fun at all) to see not only how implementations differ in basic mechanisms, but also how they differ in little, unfrequently used, details.
What is the result of mod(7, -2) in [...]

Read Full Post »

Pick your favorite Prolog book. If you don’t have a favorite Prolog book, just pick a Prolog book you happen to have handy. In the house where I’m living, there are three of them. Then, find the page where the book talks about Prolog goal disjunction. You may skip books where neither the authors nor [...]

Read Full Post »

My first comment, over at Simon Willison’s blog, posted by using this WordPress.com blog as my OpenID. And it is about the ISO Prolog standard! Am I becoming too damn boooring?

Read Full Post »

When do Prolog engines create choice points in a demonstration?
SICStus Prolog 3.12.2:

| ?- assertz((b :- write(b1))).
yes
| ?- assertz((b :- write(b2))).
yes
| ?- b.
b1
yes
| ?-

SWI-Prolog 5.6.33:

?- assertz((b :- write(b1))).
Yes
?- assertz((b :- write(b2))).
Yes
?- b.
b1
Yes
?-

GNU Prolog 1.3.0:

| ?- assertz((b :- write(b1))).
yes
| ?- assertz((b :- write(b2))).
yes
| ?- b.
b1
true ? ;
b2
yes
| ?-

tuProlog 2.1:

?- assertz((b :- write(b1))).
yes.
?- assertz((b :- write(b2))).
yes.
?- b.
b1 ? [...]

Read Full Post »

In the latest days, I’ve been diving into the perils of parsing Prolog programs, again. In particular, I’ve been re-reading parts of Kjell Post’s PhD dissertation, entitled “Analysis and Transformation of Logic Programs”. That document contains a most interesting argument explaining the difficulties of Prolog parsing: it starts from considering how an operator is allowed [...]

Read Full Post »