From the hub

Transitive relations, a deeper dive.

Transitive relations show up a lot in AI code, in this post we look at a couple of ways to code them that depend on what you can assume about your domain and what Prolog you're using.


"Hello, <name>!", the second program improved.

After "Hello, world!" it's typical to write a program that asks the user's name and greets them. In this post we learn how to do this in SWI-Prolog without requiring a full-stop.


Reification By Example

Reify: (v) To represent something abstract as a concrete thing.

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.


Easily QuickCheck your predicates

This post is external to PrologHub

Logtalk lgtunit testing tool includes a QuickCheck implementation supporting property-based testing of plain Prolog, Prolog module, and Logtalk code. The tool is portable and can be used with all Logtalk supported Prolog compilers. The QuickCheck implementation provides ...


Hello, Tau Prolog!

Imagine an internet where you didn't need to write JavaScript...

Imagine an internet where you could write Prolog...

Imagine no more, write Tau Prolog!


Introduction to CLP(FD) for Resource Management

This post is external to PrologHub

Introduction to using CLP(FD). A guide from scenario description, to mathematical representation, to code, for the kind of problems that are typical in the Operational Research/Management Science domain. We're maximizing profit or minimizing spending given some constraints on resources.


Failure-driven loops: when and how

This post is external to PrologHub

Failure is a big part of logic programming success! (always wanted to write this :-)

Predicates are often required to perform repetitive operations. For example, assume a table of...