From the hub

A dependable term-expansion mechanism

This post is external to PrologHub

Logtalk provides a dependable term-expansion mechanism that gives the user full and fine-grained control on if, when, and how expansions are applied. This is accomplished by introducing the concept of hook object and by allowing expansion rules to be defined and applied without relying on multifile predicates.

A hook object is simply an ...

Meta-messages for lazy coders

This post is external to PrologHub

One of the frequent excuses for coders to avoid using the message printing mechanism is that they require defining tokenization rules for the messages and that is too much work when they can just call write/1 instead. We can try to argue about laziness but the coders do have a point. To easy the pain of using the message printing mechanism ...

Localizing an application for multiple languages

This post is external to PrologHub

Applications often need to be localized in multiple natural languages. Textual elements of an application user interface such as banners, messages, and questions should use the native language of the user. The best practice in this case is to decouple the application core logic from the natural language used when interacting with the user. Customizing the application for additional natural languages should be ...

A category at the top

This post is external to PrologHub

Logtalk supports both prototypes and classes/instances. While classes and instances provide a clear distinction between abstractions and materializations of those abstractions, prototypes are usually used to represent concrete, one of a kind entities. But prototypes can also be derived...

Object and predicate aliases

This post is external to PrologHub

Naming is a non-trivial problem in programming. A good name conveys meaning, contributing to code readability. But there’s always a natural contention between descriptive names and concise names that help avoid excess verbosity. What’s a good name may also depend on its usage context. Moreover, if every library developer always use ...

Constraint-based School Timetabling with Prolog

This post is external to PrologHub

Prolog is an excellent choice for modeling combinatorial problems, and it is routinely used in practice to solve scheduling tasks such as school timetabling.

To show this, I have set up a page where you can interactively solve school timetabling instances with Prolog, and I invite you to try a few of the sample instances:

The Prolog source code of the timetabling engine is freely available from:

Complementing the showcase, I have uploaded a short video that explains how it works:


The cost of defaulty representations

This post is external to PrologHub

Logic programming applications that acquire and process external data are common. We don’t always have a choice on the format of the data during acquisition. But we can often decide how to represent the data internally. Our data representation choices can have a significant performance impact. To illustrate ...