rolog: Querying Prolog from R
Prolog is a classical logic programming language with many applications in expert systems, computer linguistics and traditional, that is, symbolic artificial intelligence. The main strength of Prolog is its concise representation of facts and rules for the representation of knowledge and grammar, as well as its very efficient built in search engine for closed world domains. R is a statistical programming language for data analysis and statistical modeling which is widely used in academia and industry. Besides the core library, a lot of packages have been developed for all kinds of statistical problems, including new-style artificial intelligence tools such as neural networks for machine learning and deep learning. Whereas Prolog is weak in statistical computation, but strong in symbolic manipulation, the converse may be said for the R language. The R package Rolog embeds the SWI-Prolog system into an R package, thus enabling deterministic and non-deterministic queries to the Prolog interpreter. Usage of the Rolog library is illustrated by a few examples, including grammars for mathematical typesetting, linguistics, knowledge structures, and interval arithmetic.