From the hub, in category: "Development Practices"

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

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

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