From the hub

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

Predicates vs Functions

People from other languages often get a little confused with these predicate things, especially as their syntax looks similar to functions in other languages. In this post we contrast predicates and functions and demonstrate the advantage of using predicates over functions.

User-defined test dialects

This post is external to PrologHub

Testing is a fundamental part of software development. Follows that writing tests should be as accessible as possible. Although automatic test generation is an established practice ...

Partial Predicates

Did you know you can call partial predicates with arguments added later on? This is how many of the higher order predicates like `maplist` work. But you can take advantage of this too! Let's take a look at `call`.

Modules are objects

This post is external to PrologHub

Prolog modules are objects. This statement may surprise you. From past experience, it will also annoy some Prolog practitioners. It is not the case that the creators of Prolog module systems intended to create an object-oriented extension to Prolog. But what modules are is a function of their characteristics, not a function of their design.

Predicate semantics

This post is external to PrologHub

Logtalk inherits but also extends and improves Prolog predicate semantics to provide clear and uniform closed world semantics, support protocols, provide consistent meta-predicate semantics, prevent misusing of multifile predicates, and prevent a number of hacks based on predicate directives that would break encapsulation. This post discusses...

Homoiconic Prolog: Explain yourself!

Prolog is rather popular for Expert Systems. Why? Well because it's homoiconic and because we have DCG's, we can reify a query to make it explain itself. That's a lot of jargon, in this post we'll break it down and make some explanations.