From the hub

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:

https://www.metalevel.at/prolog/timetabling/

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

https://www.metalevel.at/simsttab/

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

https://www.metalevel.at/prolog/videos/timetabling

Enjoy!


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


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