Skip to content
← Back to the portfolio

Kotlin app / Android

Prolog Studio.

A Prolog interpreter and visual debugger for students of logic programming and AI. Ask a question, then watch how Prolog finds the answer, one step at a time.

Coming soon to Google Play.

Prolog Studio app icon

Screenshots

Search tree for ancestor(A, jim) with the step panel explaining why a clause does not match A cut pruning two untried clauses from the search tree, shown with a dashed branch Query console showing the eight queens solution printed as a board Program editor with Prolog colouring and line numbers A lesson on recursion with a runnable factorial example Reference of built-in predicates, each with an example query

What you get

Watch the search

A live tree grows as Prolog works: green where it succeeds, red where it fails, and a dashed branch where a cut threw choices away.

Every step explained

Each clause tried, the bindings a match makes, and when a match fails, which argument did not fit. Step forward, step back, or play.

A real Prolog, offline

Standard syntax and operators, cut, negation, if-then-else, arithmetic, lists, strings, assert and retract, findall, bagof and setof, format, and grammar rules.

A console that answers like Prolog

Run a query, press Next for another solution or All to list them. A query that says false has a button that shows why.

Errors in plain words

A missing full stop, a variable used once, a misspelt predicate: each is marked on its line as you type, with what to do about it.

An editor made for a phone

Colouring, matching brackets, and extra keys for :- [H|T] \+ and the other symbols. Save any number of programs, import and export .pl files.

Seventeen lessons

From facts and rules to recursion, lists, cut, negation and grammars, with 23 exercises that check your answer and say what is wrong.

Classic problems

Family tree, N-queens, map colouring, the farmer and the wolf, and a parser, ready to run and to trace.

The steps are the real ones

The trace is not an animation drawn beside the engine. The engine records every step it takes: the goal it chose, the clause it tried, what unified and what did not, each choice point and each backtrack. The tree and the explanations are read from that record, so stepping back shows exactly what happened before.

It works offline and needs no account. Your programs are kept on your device, and you can export or share any of them as a .pl file. The app is free and shows a small banner advert under the console and the lessons, never over the editor or the search tree.

Not included: modules, constraint libraries and numbers larger than 64 bits.

If something you need is missing, write to [email protected] and tell me which.