The Prolog programming language

Maybe you still don’t know this programming language.

The Prolog programming language permit for example to use logic programming and constraint programming which are uncommon paradigms.

This language is mainly based on the backtracing and unification principles.

If you can read French, you should give a whirl at the following article : Présentation du langage Prolog.

If you can’t, you should give a whirl at this website : Learn Prolog Now !.

A sample code for calculating the size of a list (even if it already exists), in Prolog.

?View Code PROLOG
1
2
3
4
5
my_list_size([],0).
 
my_list_size ([H|L], S) :-
  my_list_size(L, S1),
  S is 1+S1.

My Prolog environment is SWI-Prolog and I use SWI-Prolog’s XPCE for User Interfaces.


Leave a Comment