From the hub, in category: "Development Practices"

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 ...


Testing multiple implementations of a protocol

This post is external to PrologHub

Testing multiple implementations of a protocol is a recurrent task. For example, we may have multiple datasets that we need to check for integrity. Or we may want to check multiple implementations of an abstract data type. In this blog post, we will use...