# The Power of Prolog: Local Setup, Examples, and Constraints

> The Power of Prolog is a self-hosted HTML book that teaches Prolog through local examples and an included HTTP server. It suits programmers and students who want a path from logic fundamentals to constraints and alternative execution strategies.

**triska/the-power-of-prolog** — The Power of Prolog: Introduction to modern Prolog

- Repository: https://github.com/triska/the-power-of-prolog
- Website: https://www.metalevel.at/prolog
- Stars: 1,410 · Forks: 90
- Language: HTML
- License: not declared
- Published: 2026-10-16 · Updated: 2026-10-16 · Language: en
- Canonical page: https://hysenlabs.com/projects/triska-the-power-of-prolog

## Why The Power of Prolog Targets Logic-Centered Learners

The Power of Prolog addresses a specific gap between older Prolog textbooks and the language as used with modern implementations. Its goal is not to provide a small Prolog library. It is a teaching project that connects formal logic with search, unification, constraints, integer arithmetic, and execution strategies. That distinction matters because learning syntax alone does not explain why Prolog programs behave as they do.

The book is intended for two reading groups. Readers who are new to Prolog can follow the chapters in order for a self-contained introduction to important language features. Readers who already know Prolog can start with the chapter on integer arithmetic and then follow its links into newer topics. This is particularly useful for programmers who learned classical Prolog but have not encountered capabilities such as `dif/2`, declarative integer arithmetic, or SLG resolution.

The repository also includes subject-specific directories such as `clpb/`, `conn4/`, `knight/`, `queens/`, `sudoku/`, and `zurg/`. Based on the repository layout, the teaching content is backed by multiple examples rather than being confined to prose chapters. The repository topics identify constraints, logic programming, Prolog, books, and teaching materials.

This is a reading and experimentation resource, not an application framework. It does not document deployment tooling, a package registry, or a general-purpose interface for building Prolog-powered services. Its main value is the organized instruction path and the ability to browse the book through the server included with the source.

## Search, Unification, and the Self-Hosting Architecture

Prolog is presented as a language rooted in formal logic, with search and unification built into its programming model. Search allows a program to pursue goals through clauses, while unification relates terms by assigning variables where they can be made compatible. The book uses this declarative core to teach compact, general programs, but it does not stop at the traditional core.

The README also discusses impure features. The author's position is that programmers must choose how much of the impure language to use. A pure, monotonic core supports systematic reasoning about programs, while stateful constructs introduce different responsibilities. This framing gives learners a concrete design decision instead of treating every predicate as interchangeable.

The book itself is self-hosting. Its repository contains `server.pl`, which runs an HTTP server for browsing most content locally. When a requested file is not available locally, the server redirects to its online version. This means the reading interface can run from a source checkout without converting the book into a separate desktop application.

The code examples require more than a minimal ISO-only interpreter in some cases. The README specifies extensions for constraints such as `dif/2`, declarative integer arithmetic, and alternative execution strategies such as SLG resolution. It describes a conforming extension as a feature that does not change the meaning of standard Prolog text. The examples also assume the `double_quotes` flag is set to `chars`, causing strings written with double quotes to be interpreted as lists of characters.

## Starting the Scryer Prolog HTTP Server Locally

The documented local setup requires Scryer Prolog. From the repository directory, the following command starts the included server on port `6012`:

```bash
$ scryer-prolog -g "server(6012)" server.pl
```

Run that command from the repository so that `server.pl` is available to the interpreter. The README does not provide Scryer Prolog installation commands, so installation must be handled through the separate Scryer Prolog project. The README also does not define a dependency bootstrap command for this book.

After the process starts, open the following address in a browser:

```bash
http://localhost:6012/prolog
```

The reader should see the book's local browsing interface. The command explicitly selects port `6012`, while the URL includes the `/prolog` path. The README does not document an authentication mechanism, so this command should not be treated as a documented production deployment setup.

For a first reading session, follow the chapters in order if Prolog is unfamiliar. Readers with prior Prolog experience can start with the chapter on integer arithmetic and continue through its linked chapters. When browsing locally, expect missing local files to redirect to their online versions, which means the self-hosting arrangement does not guarantee complete offline access.

## Choosing a Prolog Implementation for the Extensions

The README says code examples can run on any Prolog implementation that conforms to Prolog ISO and provides the stated extensions. Compatibility therefore depends on implementation capability, not merely support for standard clauses. The explicit requirements include `dif/2`, declarative integer arithmetic, and an alternative execution strategy such as SLG resolution.

The book names several recommended systems, but each has a different documented emphasis. Scryer Prolog is described as a modern implementation written mostly in Rust. GNU Prolog is presented as a free Prolog compiler with constraint solving over finite domains. SICStus Prolog is described as an ISO-compliant Prolog system. These descriptions point to different reasons for selection, including implementation technology, standards coverage, and constraint support. The README does not include a compatibility matrix, so readers should not assume that every example behaves identically across implementations.

The `double_quotes` setting is another practical compatibility point. Examples assume it is `chars`, so strings in double quotes are lists of characters. The README identifies Scryer Prolog, Tau Prolog, Trealla Prolog, and ichiban/prolog as newer implementations for which this was already the default. Other systems may require a setting change or a modified snippet. The README also notes that code may need small changes to accommodate different libraries and implementation variations.

For an existing Prolog user, the relevant choice is the implementation that covers the extensions needed by the selected chapters. For a newcomer, Scryer Prolog has the clearest role in the documented server setup because the command invokes `scryer-prolog` directly.

## Where The Power of Prolog Falls Short

The first limitation is the distinction between a self-hosted book and a packaged learning application. The README provides one server command and one browser URL, but it does not document automated setup for Scryer Prolog, operating-system-specific installation, process supervision, or deployment behind another HTTP server. Serving `server.pl` on `localhost` is a local reading workflow, not a documented production configuration.

Second, the target example environment is broader than plain ISO Prolog. A system may conform to ISO/IEC 13211 and still lack `dif/2`, declarative integer arithmetic, or SLG resolution. In that case, a chapter may not run as written even though the implementation is standards-compliant. The README acknowledges that some snippets need changes for implementation differences and libraries, but it does not enumerate chapter-specific modifications.

Third, the online fallback limits full offline use. Locally available files can be browsed through the included server, while unavailable files redirect to their online versions. A reader who needs a complete offline copy should first verify that the checkout contains every required chapter, image, and linked resource. The README makes no guarantee that all external assets are stored locally.

There is also no formal release track in the repository. GitHub reports no releases, and the README describes periodic synchronization rather than versioned publication. The repository may contain revisions suitable for pinning, but the README does not document how instructors should map course material to a particular commit. That is an operational gap for classroom adoption.

## Hosted and Implementation-Based Alternatives

The direct alternative is to use the online book at `https://www.metalevel.at/prolog` without running its HTTP server. The difference is direct: the hosted edition removes the Scryer Prolog and `server.pl` setup, while the repository route adds a local browsing server and redirects unavailable files to their online versions. The Prolog instruction itself remains the book.

Another alternative is to use one of the recommended Prolog implementations directly and consult its own documentation when running examples. SICStus Prolog, Scryer Prolog, and GNU Prolog differ in their documented focus. The README describes GNU Prolog's finite-domain constraints, identifies Scryer Prolog as mostly written in Rust, and characterizes SICStus Prolog as ISO-compliant. This can be the better approach when a course already prescribes an implementation, although The Power of Prolog does not map every chapter to every system.

Traditional Prolog textbooks are a broader alternative, but this is the historical gap the project explicitly addresses. The author wants to connect older textbooks with constructs that have become important in modern Prolog. Selecting an older book may mean learning the pure core without comparable treatment of current constraints, integer arithmetic techniques, and execution strategies.

The practical choice is access and compatibility. Use the hosted edition for the lowest setup cost, the included server for repository-based browsing, and an existing implementation when compatibility with a course takes priority.

## Maintenance, Upgrades, and Unresolved License Terms

The repository is not archived, and its last push was on 2026-10-12. That date records recent repository activity, while the README says the author will periodically synchronize the repository as new material becomes available. It does not promise a fixed publication schedule. GitHub reports no releases, so there is no release archive, packaged artifact, or release-specific changelog.

Upgrading primarily means comparing repository revisions and checking whether the examples still match the chosen Prolog implementation. The README warns about differing libraries and small implementation variations. It does not document a dependency lockfile, an automated migration command, or a method for mapping a course to a known revision. Instructors can therefore inspect repository history, but the README does not define a supported upgrade procedure.

The repository information lists the license as unknown, and the README does not state license terms. It would be incorrect to conclude that the HTML text, diagrams, or example code has a particular open source license. Redistribution and modification should not be assumed to be permitted until an authoritative license declaration is added to the repository. This is a concrete adoption blocker for organizations that require a known license before incorporating teaching content into internal programs.

The maintenance picture is therefore mixed. Repository activity is recent, but release discipline, compatibility promises, and licensing are not documented in the README.

## Conclusion

Adopt this book if you want a course-like, locally readable introduction to Prolog and can work with Scryer Prolog plus its supported extensions. Do not treat it as a standalone toolchain if you need automated dependency installation, packaged exercises, or documented license terms. Before committing, first confirm that Scryer Prolog can start `server.pl` on your chosen port and that the selected implementation supplies the extensions required by your intended examples.

## FAQ

### What do I need to run The Power of Prolog locally?

The README says Scryer Prolog is required. From the repository, start `server.pl` with the documented `-g "server(6012)"` command, then browse to `http://localhost:6012/prolog`.

### Does The Power of Prolog provide complete offline access?

No such guarantee is documented. The included server can browse locally available files, but files that are not available locally redirect to their online versions.

### Can I use another Prolog implementation for the code examples?

The README says examples can run on any ISO-conforming implementation that provides the required extensions, including `dif/2`, declarative integer arithmetic, and an alternative execution strategy such as SLG resolution. Some snippets may still require small implementation-specific changes.

## Sources

- [Issues](https://github.com/triska/the-power-of-prolog/issues)
- [Project website](https://www.metalevel.at/prolog)
- [README](https://github.com/triska/the-power-of-prolog/blob/master/README.md)
- [triska/the-power-of-prolog on GitHub](https://github.com/triska/the-power-of-prolog)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/triska-the-power-of-prolog
