Did you know ... | Search Documentation: |
Packs (add-ons) for SWI-Prolog |
Title: | Simple interface to R |
---|---|
Rating: | Not rated. Create the first rating! |
Latest version: | 0.9.20 |
SHA1 sum: | d6dfa6539b01e9088306441c1af505f5f1422274 |
Author: | Matthias Gondan <Matthias.Gondan-Rochon@uibk.ac.at> |
No reviews. Create the first review!.
Version | SHA1 | #Downloads | URL |
---|---|---|---|
0.9.20 | a0b82fb2279d23fbd5b52fd8e6f09c2777a1ada6 | 9 | https://github.com/mgondan/rolog |
7c9092d9021bdc03f4f4f3f736a65e5e820dc611 | 4 | https://github.com/mgondan/rolog | |
244b91c10553dfc214d0db5ef87b7b0cd0b2975d | 1 | https://github.com/mgondan/rolog | |
d6dfa6539b01e9088306441c1af505f5f1422274 | 1 | https://github.com/mgondan/rolog | |
7cc34523f3f8a4615469bedd337f3ed778b50ba8 | 2 | https://github.com/mgondan/rolog | |
0f73395c26a32e0e56b01c1b43e6daff8be76af8 | 1 | https://github.com/mgondan/rolog | |
3db84840462cd6383e7369d20b6c11bc89ad1280 | 4 | https://github.com/mgondan/rolog | |
64927a9009a66d30e9350bd0350d4f2dd3cac9b3 | 7 | https://github.com/mgondan/rolog | |
7dc5e7897e7a7c06786ab117af78f4c6fd9c40c2 | 2 | https://github.com/mgondan/rolog | |
14a44f858390a8e067a63fdd994e3194eab56409 | 9 | https://github.com/mgondan/rolog | |
9e32274cd7991467273cc6cef9a56925480c2b53 | 4 | https://github.com/mgondan/rolog | |
0.9.19 | f436356c552d08193dbbef2e8cdf6434137e6738 | 3 | https://github.com/mgondan/rolog |
414e2384b68d6b470c5254c2abadf81f0debd376 | 4 | https://github.com/mgondan/rolog | |
b5b690f515f773948e94e06ffc8be2df42d1b372 | 2 | https://github.com/mgondan/rolog | |
2f7c1ae1422196b02a55c6fbe0f6559830e249c9 | 1 | https://github.com/mgondan/rolog | |
5fe42b23ec3576a14dbab5962a978c15e3104f52 | 1 | https://github.com/mgondan/rolog | |
46e79bc42c4aa41bdd2a2ac59f1e3877b3fb4920 | 8 | https://github.com/mgondan/rolog |
As the name says, rolog = Prolog for R. The logic programming language Prolog was invented in the 1970ies by Alain Colmerauer, mostly for the purpose of natural language processing. Since then, logic programming has become an important driving force in research on artificial intelligence, natural language processing, program analysis, knowledge representation and theorem proving.
This R package connects to an existing installation of SWI-Prolog. SWI-Prolog (https://www.swi-prolog.org/) is an open-source implementation of the logic programming language Prolog. SWI-Prolog targets developers of applications, with many users in academia, research and industry. SWI-Prolog includes a large number of libraries for "the real world", for example, a web server, encryption, interfaces to C/C++ and other programming languages, as well as a development environment and debugger.
rolog supports the following installations of SWI-Prolog, with decreasing priority:
This R package is distributed under a BSD-2 simplified license (see the file LICENSE).
R> install.packages("rolog")
R> library(rolog)
R> once(call("check_installation"))
Does this output appear?
................................................ not present Warning: See http://www.swi-prolog.org/build/issues/tcmalloc.html Warning: library(bdb) .......................... NOT FOUND Warning: See http://www.swi-prolog.org/build/issues/bdb.html Warning: library(jpl) .......................... NOT FOUND Warning: See http://www.swi-prolog.org/build/issues/jpl.html Warning: library(pce) .......................... NOT FOUND Warning: See http://www.swi-prolog.org/build/issues/xpce.html Warning: Found 4 issues. list() attr(,"query") [1] "check_installation"
This is a hello(world)
.
R> library(rolog)
Run a query such as member(X, [1, 2, 3])
with
R> `findall(call("member", expression(X)
, list(1L, 2L, 3L)))`
Sorry for the cumbersome syntax. At the moment, expression(X)
encapsulates variables. The query
returns bindings for X that satisfy member(X, [1, 2, 3])
.
The second example builds the vignette with nice use cases in Section 4.
`rmarkdown::render(system.file("vignettes", "rolog.Rmd", package="rolog"), output_file="rolog.html", output_dir=getwd())
`
You should find an HTML page in rolog.html
of the current folder. Note that it includes equations with MathML, which look
best in the Firefox browser.
As the name says, rolog = R for Prolog. The R system is a programming language for statistical computing and data visualization. It has been adopted in the fields of data mining, bioinformatics and data analysis.
This Prolog pack connects to an existing installation of R. rolog supports the following installations of R, with decreasing priority:
This Prolog pack is distributed under a BSD-2 simplified license (see the file LICENSE).
R> install.packages("RInside")
?- pack_install(rolog)
.
?- use_module(library(rolog))
.
?- r_eval(rnorm(3), X)
.
?- r_call(print(rnorm(3)))
.
Pack contains 71 files holding a total of 602K bytes.