package forester
A tool for tending mathematical forests
Install
dune-project
Dependency
Authors
Maintainers
Sources
5.0.tar.gz
md5=24f4aed96a8b8af33aba13fba66f1b37
sha512=d36b896aca11858bb4a00fc704c16cc27a1f197bdb3e479d6132fd70f70d67d7158096285cb0b6fb00db14417f0f822cc27fe65d82f0971e42378fd8271ce573
doc/src/forester.core/Datalog_engine.ml.html
Source file Datalog_engine.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
(* * SPDX-FileCopyrightText: 2024 The Forester Project Contributors * * SPDX-License-Identifier: GPL-3.0-or-later *) module V = struct include Vertex let to_string = show end module S = Datalog.BottomUp.Hashcons(V) open struct module T = Types module D = Datalog.BottomUp.Make(S) end type relation = string type vertex = Vertex.t type term = D.term type literal = D.literal type clause = D.clause type var = int let symbol_of_string str : D.symbol = let vtx = T.Content_vertex (T.Content [T.Text str]) in S.make vtx let pack_vertex vtx : D.symbol = S.make vtx let var_of_string = String.hash let mk_var = D.mk_var let mk_const vtx = D.mk_const (pack_vertex vtx) let mk_literal rel = D.mk_literal (symbol_of_string rel) let mk_clause = D.mk_clause let vertex_of_term = function | D.Const x -> (x : S.t :> Vertex.t) | _ -> failwith "const_of_term: unexpected variable" type db = D.db let db_create = D.db_create let db_add_fact db lit = D.db_add_fact db lit let db_add db clause = D.db_add db clause type answers = D.Query.set let list_of_answers answers = List.map (Array.map vertex_of_term) @@ D.Query.to_list answers let ask = D.Query.ask
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>