Modern SWI-Prolog (2026 Edition) Second Edition
Index
Outline
THE MASTER SYLLABUS: Sovereign Infrastructure & Industrial Logic VOLUME I: The Foundations of Log...
Preface
Gemini Prompt
MASTER SYSTEM DIRECTIVE: Sovereign Infrastructure Project (v4) Role: You are the Master Architect...
possible coninueing chapters
Volume VII: Asymmetric Infrastructure & Distributed Intelligence Chapter 32: The Logic of Asymmet...
VOLUME I: The Foundations of Logic
Strategic Briefing: Volume I (The Foundations of Logic)
Foundations of Sovereign Logic & The Logic Programmer’s Mindset Infrastructure is often mistaken ...
Chapter 1: The Sovereign Paradigm
Before a single line of Prolog is written, the engineer must understand why this technology is be...
Chapter 2: The Anatomy of Unification
The word "unification" is borrowed from mathematical logic, where it names the process of finding...
Chapter 3: The Static Knowledge Base
Every inference engine requires a foundation of facts it treats as unconditionally true. In Prolo...
Chapter 4: Search and Backtracking
Prolog's execution model is not a function call graph. It is a search. Every query the engine rec...
Chapter 5: The Command Oracle (ZFS & Proxmox)
Every administrative command issued against production infrastructure carries an implicit precond...
Chapter 6: Control Flow and The Cut (!)
Backtracking is Prolog's correctness mechanism: it exhausts all proof paths, guaranteeing that ev...
Chapter 7: List Processing and Recursion
An imperative loop is a mutable index advancing through a mutable array under a termination condi...
Chapter 8: Advanced Data Structures (Dicts)
Every infrastructure record is a named collection of typed fields: a host has a name, a MAC addre...
Chapter 9: Meta-Programming & State Management
Prolog has one data type: the term. Rules, facts, queries, and data values are all terms. A claus...
VOLUME II: Parsing & The Offline Library
Strategic Briefing: VOLUME II: Parsing & The Offline Library
Knowledge Acquisition & The Parsing Trust Boundary In Volume I, we built the "Prefrontal Cortex" ...
Chapter 10: Definite Clause Grammars (DCGs)
A regular expression is a finite automaton description encoded as a write-only string. The engine...
Chapter 11: Parsing System Logs
/var/log/auth.log on a busy SSH-exposed host grows at several megabytes per day. A year's worth o...
Chapter 12: Declarative Configuration
Every configuration management tool in production infrastructure does the same thing: it takes a ...
Chapter 13: Ingesting the Offline Archive
Every cloud-dependent knowledge pipeline has a single failure mode: the API goes away. OpenAI rat...
VOLUME III: The Hybrid Engine & Web UI
Strategic Briefing: Volume III Introduction: Scaling, Concurrency, and the Sovereign Bridge
Volume III of Modern SWI-Prolog (2026 Edition): Sovereign Infrastructure & Industrial Logic repre...
Chapter 14: Concurrent Logic & Message Passing
The single-threaded REPL is the correct environment for reasoning about static facts. It is the w...
Chapter 15: The CGO Bridge
An HTTP/REST boundary between a Go microservice and a Prolog inference engine introduces three co...
Chapter 16: The Go-Log Concurrency Model
Chapter 15 established a single working CGO bridge: one goroutine, pinned to one OS thread, attac...
Chapter 17: Tabling (SLG Resolution)
A Proxmox cluster with redundant network bridges is not a tree. It is a graph — specifically, a g...
Chapter 18: Prolog at the Edge (WASM)
Every firewall policy check executed in Chapter 15 and scaled in Chapter 16 required a round trip...
Chapter 19: Building the Orchestrator UI
The Sovereign Orchestrator UI is a Single Page Application that operates across three simultaneou...
VOLUME IV: Observability & Telemetry
VOLUME IV: Strategic Briefing
Introduction: Closing the Loop – Telemetry, Inference, and Autonomous Remediation Volumes I and I...
Chapter 20: Bare-Metal Telemetry
The logic engine built across Chapters 15–19 reasons with perfect fidelity over the rules it has ...
Chapter 21: The PromQL Oracle
The Chapter 20 VictoriaMetrics stack is an instrumented system: 14 hypervisors emit 1,200 metrics...
Chapter 22: Time-Series Logic
The Chapter 21 Oracle can produce injection-immune PromQL strings for any metric in its closed vo...
Chapter 23: Distributed Prolog (Pengines)
The Chapter 22 Ingestor centralises both the computation and the network traffic on a single WAM,...
Chapter 24: Closed-Loop Remediation and Active Eviction
The Volumes III and IV stack can observe a dying hypervisor with sub-second latency, classify its...
VOLUME V: Constraint Logic & Optimization
Chapter 25: The Physics of CLP(FD)
Classical Prolog solves constraint problems by generating candidate values and testing them — a s...
Chapter 26: The Proxmox Bin Packer
Assigning fifty virtual machines to fourteen hypervisors subject to RAM and CPU capacity constrai...
Chapter 27: High Availability Constraints
The Chapter 26 bin-packer produces the densest valid assignment of VMs to hypervisors — and in do...
VOLUME VI: Neuro-Symbolic AI & Local LLMs
Chapter 28: Local LLMs (16GB GPU VRAM Math)
The deterministic sovereign stack built across Volumes III through V can prove that pve3 is criti...
Chapter 29: Proxmox PCIe Passthrough and AI Inference
Running the LLM inference engine directly on the Proxmox host OS — as Chapter 27's llm-inference....
Chapter 30: Fine-Tuning for Infrastructure
The sovereign-analyst model from Chapter 29 knows how to format incident runbooks and reason abou...
Chapter 31: RAG via Prolog (The Deterministic Context)
Standard Retrieval-Augmented Generation embeds past incident documents into a vector database and...
Chapter 32: Tool Calling & Autonomy
The fine-tuned, RAG-grounded analyst from Chapters 30 and 31 can diagnose a degraded cluster and ...
Chapter 33: The Sovereign Codebase
The journey from a working prototype to a hardened production system is not a matter of adding fe...