Prolog

Difference Lists Explored

In Prolog, Difference Lists are a very powerful and useful tool. They're also difficult to understand and can result in difficult to read code. In this post we'll address both of these issues.

Functional Prolog: Map, Filter and Reduce

Prolog programs have both logical and procedural meanings. In this post we'll take a look at procedural ideas more commonly associated with functional programming than Prolog, namely: map, filter and reduce (foldl and foldr). We'll code them and then query them.

Reification By Example

Reification is a tool in the bag of tricks that can be quite tricky to understand. Rather than waffle on in the abstract, let's take a look at a few examples.

Framing Frames

If you've been doing some reading, you may have come across the notion of frames as a data structure, but little available information on what they are and how they work. Implementations of frames are even rarer. In this post we'll examine what they are and consider alternative representations and implementations.

The Golog Elevator

Golog is a logic programming language for dynamic domains based in Situation Calculus with an interpreter written in Prolog. The classic example from the book is that of an elevator. Here we present an interactive version of that program.

Reflexive, Symmetric and Transitive Relations in Prolog

When we start doing knowledge representation in Prolog, we start needing to describe the properties of relations so we can infer more than is in our recorded data. Symmetry, reflexivity and transitivity are the three main relationship properties you'll end up using. In this interactive post we take a look at how they can be encoded.