## [Prolog] Missionaries and Cannibals – M Missionaries & C Cannibals & Boat carries N passengers version

In the missionaries and cannibals problem, three missionaries and three cannibals must cross a river using a boat which can carry at most two people, under the constraint that, for both banks, if there are missionaries present on the bank, they cannot be outnumbered by cannibals (if they were, the cannibals would eat the missionaries). [...]

## [Prolog] Tower of Hanoi – M discs & N poles version

The Tower of Hanoi (also called the Tower of Brahma or Lucas’ Tower, and sometimes pluralized) is a mathematical game or puzzle. It consists of three rods, and a number of disks of different sizes which can slide onto any rod. The puzzle starts with the disks in a neat stack in ascending order of [...]

## [Prolog] State space search method

This is not an introductory article into state space search method in general. Rather, it will show you how to implement state space search method in Prolog. Backtracking is in the nature of Prolog’s interpreter so the idea here is: We will utilize its backtracking nature to implement depth-first search. If you are not sure [...]

## [Prolog] The Three Jealous Men and Their Wives

Three men, travelling with their wives, came to a river which they wanted to cross. The one available boat would accomodate only two people. Since the husbands were very jealous, no woman could be with a man unless her own husband was present. Under these severe handicaps, how can they get across the river using [...]

## Prefix expression evaluation in Prolog

A friend of mine this morning asked me to program Prolog to evaluate [+, +, /, 1, 2, *, 5, 6, 7] and return X as the output with X’s value equals 1 / 2 + 5 * 6 + 7. I do not know her motivation behind this question still I find it interesting so I have [...]