Want to learn and master Prolog?

Join Exercism’s Prolog Track for access to 19 exercises with automatic analysis of your code and personal mentoring, all 100% free.

Explore exercises

About Prolog

append([],    L,  L). 
append([H|T], L2, [H|L3]) :- append(T, L2, L3).

?- appendx([1,2],[3,4],X).
X = [1, 2, 3, 4].

?- appendx([1,2],X,[1,2,3,4]).
X = [3, 4].

?- appendx(X,[3,4],[1,2,3,4]).
X = [1, 2].

19 coding exercises for Prolog on Exercism. From Satellite to Complex Numbers.


Get better at programming through fun, rewarding coding exercises that test your understanding of concepts with Exercism.

See all Prolog exercises on Exercism

Key Features of Prolog


Prolog

Compatible

SWI-Prolog offers a comprehensive set of built-in predicates, covering many established standards.

Simplicity

A single language element, called a clause, is the basis of all prolog relations and programs.

Declarative

Prolog focuses on what holds true about solutions, rather than how it is implemented.

Logical

Prolog is based on the rules of logic, with execution being a form of logical resolution.

Homoiconic

Prolog programs are also valid prolog terms, programs can interact with other prolog programs.

Portable

Implementations exist for Unix/Linux, Windows, MacOS platforms with targets to WebAssembly (WASM).

Get mentored the Prolog way

Every language has its own way of doing things. Prolog is no different. Our mentors will help you learn to think like a Prolog developer and how to write idiomatic code in Prolog. Once you've solved an exercise, submit it to our volunteer team, and they'll give you hints, ideas, and feedback on how to make it feel more like what you'd normally see in Prolog - they'll help you discover the things you don't know that you don't know.

Learn more about mentoring

Community-sourced Prolog exercises

The Prolog track on Exercism has 19 exercises to help you write better code. Discover new exercises as you progress and get engrossed in learning new concepts and improving the way you currently write.

See all Prolog exercises
Prolog

Get started with the Prolog track

The best part, it’s 100% free for everyone.