diff --git a/datalog.opam b/datalog.opam new file mode 100644 index 0000000..d9cd7db --- /dev/null +++ b/datalog.opam @@ -0,0 +1,8 @@ +opam-version: "1.2" +name: "datalog" +version: "0.3" +maintainer: "Robert Atkey " +authors: "Robert Atkey " +license: "MIT" +build: [["jbuilder" "build" "-p" name "-j" jobs "@install"]] +available: [ ocaml-version >= "4.04.0" ] diff --git a/datalog/jbuild b/datalog/jbuild index 94b5a62..a257bd6 100644 --- a/datalog/jbuild +++ b/datalog/jbuild @@ -2,4 +2,5 @@ (library ((name datalog) + (public_name datalog) (libraries (ocamlgraph fmt)))) \ No newline at end of file diff --git a/datalog/ruleset.ml b/datalog/ruleset.ml index a2afca6..f014380 100644 --- a/datalog/ruleset.ml +++ b/datalog/ruleset.ml @@ -142,15 +142,11 @@ module Builder = struct | [] -> Ok () | Atom {pred;args} :: atoms -> -(* match PredicateNameMap.find pred pred_info with - | exception Not_found -> - Error (Undeclared_predicate pred) - | {arity} ->*) - let used_arity = List.length args in - if pred.arity <> used_arity then - Error (Arity_mismatch { pred; used_arity }) - else - check_atoms pred_info atoms + let used_arity = List.length args in + if pred.arity <> used_arity then + Error (Arity_mismatch { pred; used_arity }) + else + check_atoms pred_info atoms let add_rule ({pred;args;rhs} as rule) t = match check_atoms t.predicates_so_far rhs with diff --git a/datalog/ruleset.mli b/datalog/ruleset.mli index 808d28c..9183d9f 100644 --- a/datalog/ruleset.mli +++ b/datalog/ruleset.mli @@ -1,3 +1,5 @@ +(** Datalog programs as sets of rulesets. *) + type predicate_name = { ident : string ; arity : int