Online Prolog Interpreter

Write facts and rules, type queries in the Input tab and see all answers. It runs in your browser.

Ln 1, Col 1

Run Prolog online

Write your facts and rules in the editor. Open the Input tab and type queries, one per line, for example grandparent(tom, X). Each answer is listed, and false. is shown when nothing matches. If the Input tab is empty, the goal main is run.

The engine is Tau Prolog, which follows the ISO standard closely. A card explains common errors such as an undefined predicate or a missing full stop.

Frequently asked questions

Which Prolog is it?

Tau Prolog, an ISO Prolog written in JavaScript. It is not SWI-Prolog, so SWI-only libraries are missing.

How do I print?

Use write/1 and nl/0 inside a rule such as main.

Why does it stop on my query?

A query that loops forever is stopped after a step limit.

Looking for another language? Open the full code editor with 100+ languages.