Skip to content

ramsdell/datalog

Repository files navigation

			       Datalog

ABSTRACT

This package contains a lightweight deductive database system.
Queries and database updates are expressed using Datalog--a
declarative logic language in which each formula is a function-free
Horn clause, and every variable in the goal of a clause must appear in
the body of the clause.  The use of Datalog syntax and an
implementation based on tabling intermediate results, ensures that all
queries terminate.

The components in this package are designed to be small, and usable on
memory constrained devices.  The package includes an interactive
interpreter for Datalog, and a library that can be used to embed the
interpreter into C programs.

INSTALLATION FROM A DISTRIBUTION

Install using the usual "./configure; make; make install" sequence as
described in the file INSTALL.

If you have Lua 5.2 installed, configure with the --with-lua option.
On Debian-based systems, use:

    $ ./configure --with-lua-suffix=5.2 CPPFLAGS=-I/usr/include/lua5.2

Datalog can be built on top of Lua 5.1 too.

If your sources are coming from the repository, and not from a
distribution, you must use autotools to create the configure script.
In this case, it probably will be easer to use the installation
without autotools procedure described below.

INSTALLATION WITHOUT AUTOTOOLS

1. Install Lua.  On a mac try:

    $ brew install lua

2. Create dl_lua.h.

    $ cc -o bin2c bin2c.c
    $ cp datalog.lua.in datalog.lua
    $ ./bin2c -o dl_lua.h datalog.lua

3. Create datalog binary.

    $ cc -O -o datalog -I. -Ilua interp.c loader.c datalog.c -l lua

    Some systems place liblua in a place not known by the C compiler.
    In that case, add the -L switch to tell the C compiler its
    location.

DOCUMENTATION

This package is documented using Texinfo and a manual page.  The NEWS
file contains a history of user-visible changes.  The ChangeLog
records changes to the package.

TEST SUITE

The source distribution contains examples of Datalog programs used for
testing that are not installed.  Examples from the Texinfo manual are
also included.