From the hub

Generating code coverage reports

This post is external to PrologHub

You wrote a set of tests for your project and all pass. Time to celebrate? Well, depends. How good is your tests code coverage? Are all predicates being called? Are all predicate clauses being tried? How do you know? If you answer is akin to “by visual inspection”, you may be in trouble. Will you be able to ...

Handling optional data

This post is external to PrologHub

We often need to represent structured data where some of the data is optional. As an example, consider books that may be sold with extras ...

Basic Idea of Recursion

Want to do something a bunch of times in Prolog? Recursion is how we do it. In this post we'll look at the most basic ideas of recursion and talk through a couple of examples.

Handling missing data

This post is external to PrologHub

Real world data is often faulty. Noisy data and missing data are common problems that applications must deal with sensibly. In this blog post, we focus on how to handle missing data. The solution we described can also be used to handle noisy data.

As an example, assume our raw data is the set of facts that ...

Abstracting user interaction

This post is external to PrologHub

Logtalk and some Prolog systems provide a message printing mechanism that allows abstracting the message text, where the message is effectively printed, and how. Another key aspect of this mechanism is that a call to print a message can be intercepted by defining a hook predicate. Logtalk complements the message printing mechanism by providing also ...

The "many worlds" design pattern

This post is external to PrologHub

The many worlds design pattern is one of the most common patterns in Logtalk and Prolog applications. It allows reasoning about different worlds, where a world can be e.g. a dataset, a knowledge base, a set of examples. While this design pattern can be ...

Facts and Fluents vs Constants and Variables

In Prolog we have facts rather than constants, fluents rather than variables. This post is another terminology breakdown with examples and comparison to features common in other programing languages.