Skip to content

Commit 0480969

Browse files
committed
prepare for 0.7; generate opam files from dune-project; format dune files
1 parent 08cfaf5 commit 0480969

File tree

11 files changed

+100
-72
lines changed

11 files changed

+100
-72
lines changed

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
# 0.7
3+
4+
- compat with OCaml 5.2
5+
- fix location reporting in parse errors

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ You need **OCaml >= 4.02** with [dune](https://github.com/ocaml/dune). Just type
137137

138138
```sh non-deterministic
139139
$ make
140+
$ cp src/bottom_up_cli/datalog_cli.exe ./datalog_cli
140141
```
141142

142143
## How to use it
@@ -147,7 +148,7 @@ There are two ways to use `datalog`:
147148
installed it on your system; just type in
148149

149150
```sh non-deterministic
150-
$ datalog_cli <problem_file>
151+
$ ./src/datalog_cli <problem_file>
151152
```
152153

153154
- The libraries `datalog`, `datalog.top_down`, `datalog.unix`, `datalog.caml_interface`.
@@ -179,7 +180,7 @@ edge(7, 8).
179180
edge(8, 9).
180181
edge(9, 10).
181182
edge(10, 7).
182-
$ datalog_cli tests/clique10.pl --pattern 'same_clique(1,X)'
183+
$ ./datalog_cli tests/clique10.pl --pattern 'same_clique(1,X)'
183184
% start datalog
184185
% parse file tests/clique10.pl
185186
% process 15 clauses
@@ -198,7 +199,7 @@ $ datalog_cli tests/clique10.pl --pattern 'same_clique(1,X)'
198199
Or
199200

200201
```sh
201-
$ datalog_cli tests/graph200.pl --size --sum reachable
202+
$ ./datalog_cli tests/graph200.pl --size --sum reachable
202203
% start datalog
203204
% parse file tests/graph200.pl
204205
% process 205 clauses
@@ -212,7 +213,7 @@ $ datalog_cli tests/graph200.pl --size --sum reachable
212213
Or
213214

214215
```sh
215-
$ datalog_cli tests/graph10.pl --goal 'increasing(3,7)' --pattern 'increasing(3,X)'
216+
$ ./datalog_cli tests/graph10.pl --goal 'increasing(3,7)' --pattern 'increasing(3,X)'
216217
% start datalog
217218
% parse file tests/graph10.pl
218219
% process 15 clauses
@@ -232,7 +233,7 @@ $ datalog_cli tests/graph10.pl --goal 'increasing(3,7)' --pattern 'increasing(3,
232233
Or
233234

234235
```sh
235-
$ datalog_cli tests/small.pl --query '(X,Y) :- ancestor(X,john), father(X,Y), not mother(Y,Z)'
236+
$ ./datalog_cli tests/small.pl --query '(X,Y) :- ancestor(X,john), father(X,Y), not mother(Y,Z)'
236237
% start datalog
237238
% parse file tests/small.pl
238239
% process 12 clauses

datalog.opam

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,31 @@
1+
# This file is generated by dune, edit dune-project instead
12
opam-version: "2.0"
2-
name: "datalog"
3-
version: "0.6"
3+
version: "0.7"
44
synopsis: "An in-memory datalog implementation for OCaml"
5-
maintainer: "simon.cruanes.2007@m4x.org"
5+
maintainer: ["simon.cruanes.2007@m4x.org"]
66
authors: ["Simon Cruanes"]
7-
homepage: "https://github.com/c-cube/datalog"
87
license: "BSD-2-Clause"
9-
doc: ["https://c-cube.github.io/datalog"]
10-
tags: [
11-
"datalog"
12-
"relational"
13-
"query"
14-
"prolog"
15-
]
16-
build: [
17-
["dune" "build" "@install" "-p" name "-j" jobs]
18-
["dune" "build" "@doc" "-p" name] {with-doc}
19-
["dune" "runtest" "-p" name] {with-test}
20-
]
8+
tags: ["datalog" "relational" "query" "prolog"]
9+
homepage: "https://github.com/c-cube/datalog"
10+
bug-reports: "https://github.com/c-cube/datalog/issues"
2111
depends: [
22-
"dune"
23-
"ocaml" { >= "4.08" }
12+
"dune" {>= "2.0"}
13+
"ocaml" {>= "4.08"}
2414
"odoc" {with-doc}
25-
"mdx" { >= "1.3" & with-test}
15+
"mdx" {>= "1.3" & with-test}
2616
]
27-
dev-repo: "git://github.com/c-cube/datalog"
28-
bug-reports: "https://github.com/c-cube/datalog/issues"
17+
build: [
18+
["dune" "subst"] {pinned}
19+
[
20+
"dune"
21+
"build"
22+
"-p"
23+
name
24+
"-j"
25+
jobs
26+
"@install"
27+
"@runtest" {with-test}
28+
"@doc" {with-doc}
29+
]
30+
]
31+
dev-repo: "git+https://github.com/c-cube/datalog.git"

dune

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
2-
(alias
3-
(name runtest)
4-
(deps (:readme README.md)
5-
(source_tree tests))
6-
(action (progn
7-
(run ocaml-mdx test %{readme})
8-
(diff? %{readme} %{readme}.corrected))))
9-
1+
(rule
2+
(alias runtest)
3+
(deps
4+
(:readme README.md)
5+
./src/bottom_up_cli/datalog_cli.exe
6+
(source_tree tests))
7+
(action
8+
(progn
9+
(run ocaml-mdx test %{readme})
10+
(diff? %{readme} %{readme}.corrected))))

dune-project

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
(lang dune 1.0)
1+
(lang dune 2.0)
2+
(generate_opam_files true)
3+
4+
(name datalog)
5+
(version 0.7)
6+
(source (github c-cube/datalog))
7+
(maintainers "simon.cruanes.2007@m4x.org")
8+
(authors "Simon Cruanes")
9+
(license "BSD-2-Clause")
10+
11+
(package
12+
(name datalog)
13+
(synopsis "An in-memory datalog implementation for OCaml")
14+
(tags (datalog relational query prolog))
15+
(depends
16+
(dune ( >= "2.0" ))
17+
(ocaml ( >= "4.08" ))
18+
(odoc :with-doc)
19+
(mdx (and ( >= "1.3" ) :with-test))))

src/bottom_up/dune

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
21
(rule
3-
(targets version.ml)
4-
(action
5-
(with-stdout-to %{targets}
6-
(echo "let version = \"%{version:datalog}\""))))
2+
(targets version.ml)
3+
(action
4+
(with-stdout-to
5+
%{targets}
6+
(echo "let version = \"%{version:datalog}\""))))
77

88
(library
9-
(name datalog)
10-
(public_name datalog)
11-
(synopsis "An in-memory datalog implementation for OCaml")
12-
(libraries)
13-
(flags :standard -color always -safe-string -warn-error -a+8 -w -50))
9+
(name datalog)
10+
(public_name datalog)
11+
(synopsis "An in-memory datalog implementation for OCaml")
12+
(libraries)
13+
(flags :standard -color always -safe-string -warn-error -a+8 -w -50))
14+
15+
(ocamlyacc
16+
(modules Parser))
1417

15-
(ocamlyacc (modules Parser))
16-
(ocamllex (modules Lexer))
18+
(ocamllex
19+
(modules Lexer))

src/bottom_up_cli/dune

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
21
(executable
3-
(name datalog_cli)
4-
(public_name datalog_cli)
5-
(libraries datalog))
2+
(name datalog_cli)
3+
(public_name datalog_cli)
4+
(libraries datalog))

src/caml_interface/dune

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
21
(library
3-
(name datalog_caml_interface)
4-
(public_name datalog.caml_interface)
5-
(libraries datalog.top_down unix))
2+
(name datalog_caml_interface)
3+
(public_name datalog.caml_interface)
4+
(libraries datalog.top_down unix))

src/top_down/dune

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
21
(library
3-
(name datalog_top_down)
4-
(public_name datalog.top_down)
5-
(libraries datalog)
6-
(flags :standard -color always -safe-string -warn-error -a+8))
2+
(name datalog_top_down)
3+
(public_name datalog.top_down)
4+
(libraries datalog)
5+
(flags :standard -color always -safe-string -warn-error -a+8))
6+
7+
(ocamllex
8+
(modules Lexer))
79

8-
(ocamllex (modules Lexer))
9-
(ocamlyacc (modules Parser))
10+
(ocamlyacc
11+
(modules Parser))

src/top_down_cli/dune

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
21
(executable
3-
(name topDownCli)
4-
(libraries datalog datalog.top_down datalog.unix))
5-
2+
(name topDownCli)
3+
(libraries datalog datalog.top_down datalog.unix))

0 commit comments

Comments
 (0)