Implementation of Generic Inference in Haskell

by Alexander Knight

Inference is the process of taking separate pieces of information, and combining them together to answer a question. For example, each table in a database may be thought of as a separate piece of information, and to answer a query about the database, we may be required to combine initially separate tables together. In this manner, querying a database is an example of a problem of inference.

Many seemingly unrelated problems can be modelled as problems of inference. However, in the absence of a generic algorithm to solve inference problems, each problem still requires its own solution. We build off mathematical equations and pseudocode from prior work to present a Haskell library that implements generic inference, allowing any inference problem to be solved using a single algorithm.

Some examples of problems that could be solved using the algorithms of the library include:

- query answering in relational databases

- shortest path distance problems

- regression by least squares

- Kalman filtering

- satisfiability of constraint or logical systems

- sparse matrix computation

- computation of the fast Fourier transform

- the evaluation of Bayesian networks

- ... and more!

The library can be found here: https://github.com/alexknight0/generic-inference

Implementation of Generic Inference in Haskell