caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] [ANN] Datalog-0.1
@ 2013-01-28 11:11 Simon Cruanes
  2013-01-28 18:06 ` yoann padioleau
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Cruanes @ 2013-01-28 11:11 UTC (permalink / raw)
  To: OCaml List

Hello,

I'm pleased to announce the first (alpha) release of Datalog, a small
fixpoint engine for the Datalog fragment of logic
(http://en.wikipedia.org/wiki/Datalog) written in OCaml. The library is
designed to be used to compute fixpoints of rules, incrementally. It is
available under the BSD license at https://github.com/c-cube/datalog .

Both a command-line fixpoint computation tool and a functorial library
are provided. Input files have a prolog-like syntax, but without
function symbols. The command line tool works like this (the example
computes the transitive closure of a graph, and then cliques within this
transitive closure):

$ cat tests/clique10.pl
reachable(X,Y) :- edge(X,Y).
reachable(X,Y) :- edge(X,Z), reachable(Z,Y).
same_clique(X,Y) :- reachable(X,Y), reachable(Y,X).
edge(0, 1).  % edge from 0 to 1
edge(1, 2).
edge(2, 3).
edge(3, 4).
edge(4, 5).
edge(5, 0).
edge(5, 6).
edge(6, 7).
edge(7, 8).
edge(8, 9).
edge(9, 10).
edge(10, 7).

$ ./datalog_cli.native tests/clique10.pl -pattern 'same_clique(1,X)'
% start datalog
% parse file tests/clique10.pl
% process 15 rules
% computing fixpoint...
% done.
% facts matching pattern same_clique(1, X1):
same_clique(1, 0).
same_clique(1, 1).
same_clique(1, 3).
same_clique(1, 2).
same_clique(1, 5).
same_clique(1, 4).
% max_heap_size: 126976; minor_collections: 0; major collections: 0

The library provides a functor that allows one to create rules (Datalog
clauses), and add them to a structure that computes their fixpoint
incrementally (i.e., the fixpoint is updated after each rule is
inserted). Callbacks can be associated to symbols, to be called whenever
a fact is derived.

Feedback, comments, or bug reports are very welcome!

Cheers,

-- 
Simon Cruanes


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-29  9:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-28 11:11 [Caml-list] [ANN] Datalog-0.1 Simon Cruanes
2013-01-28 18:06 ` yoann padioleau
2013-01-28 18:19   ` Simon Cruanes
2013-01-29  9:23   ` Simon Cruanes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).