Prolog is not a general-purpose theorem prover, and its powers of inference are limited. For example, it cannot answer these questions:

X > 1, X =< 2, integer(X). 25 is X^2 + Y^2, integer(X), integer(Y).

Prolog works by *backward-chaining*, using Modus Ponens:

If I am asked to prove Q and I have the rule (P implies Q) then if I can prove P, I can prove Q otherwise I shall assume Q is false.Note that if Prolog can't prove a goal, it assumes it to be false. This is called the

I shall illustrate execution using the following set of rules.

/*10*/ suits(Skier, st_sartre) :- is_a(Skier, beginner), wants(Skier, fun). /*20*/ suits(Skier, schloss_heidegger) :- is_a(Skier, beginner), wants(Skier, serious). /*30*/ suits(Skier, chateau_derrida) :- is_a(Skier, advanced), wants(Skier, serious). /*40*/ suits(Skier, wittgenstein_gladbach) :- is_a(Skier, advanced), wants(Skier, fun). /*50*/ is_a(Skier, beginner) :- had_lessons(Skier, L), L < 30. /*60*/ is_a(Skier, beginner) :- had_lessons(Skier, L), L >= 30, has_fitness(Skier, poor). /*70*/ is_a(Skier, advanced) :- had_lessons(Skier, L), L >= 30, has_fitness(Skier, good). /*80*/ has_fitness(Skier, poor) :- max_pressups(Skier, P), P < 10. /*90*/ has_fitness(Skier, good) :- max_pressups(Skier, P), P >= 10. wants(eddie,fun). max_pressups(eddie,170). had_lessons(eddie,78).

Mon Jul 17 22:27:41 BST 1995