From the hub, written by: "Paulo Moura"

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


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


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


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