Pick a chapter.
Let's get curious!
Start with a new way of thinking, then run your first program. Feeling adventurous? Jump into Sudoku and watch constraints do the heavy lifting.
Think Differently!
Driving a car? Easy. Surfing with a steering wheel? Not so much. Discover why Prolog is a different kind of adventure.
Facts & Rules
Build a tiny world with things that are true. Then teach Prolog how those facts fit together.
Questions & Variables
Stop telling the computer every step. Ask questions and discover the answers that make them true!
Natural Numbers
Two tiny clauses. Infinite possibilities! Write your first Prolog program and run it right here in your browser.
Sudoku, the Logic Way!
Wait... where's the algorithm?! Explore Markus Triska's elegant Sudoku solver and experiment with Scryer Prolog.
The Sudoku browser lab is experimental; the chapter and its explanations are available even if the Scryer engine cannot start.
No spectators.
You're the programmer!
We don't want you to read fifty pages before writing a line of code. Here, learning means trying things.
Read a little
A story, a question, or a surprisingly simple idea.
Try it yourself
Edit a real Prolog program. Run a query. Ask for another answer.
Make it yours
Break something. Fix it. Discover why it works.
Stop looking for
the steering wheel!
Prolog isn't Python with strange punctuation. It's a different way to think about programming: describe facts, relationships and constraints — then ask what follows.
This is an open, growing book in English. Every chapter is free to read, and the interactive exercises run in your browser. No signup. No fuss. Just curiosity.
Find out why Prolog is different ↗