package acgtk
Abstract Categorial Grammar development toolkit
Install
Dune Dependency
Authors
Maintainers
Sources
acg-2.1.0-20240219.tar.gz
sha512=5d380a947658fb1201895cb4cb449b1f60f54914c563e85181d628a89f045c1dd7b5b2226bb7865dd090f87caa9187e0ea6c7a4ee3dc3dda340d404c4e76c7c2
doc/src/acgtk.magicRewriting/adornment.ml.html
Source file adornment.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
module ASPred = DatalogLib.Datalog_AbstractSyntax.AbstractSyntax.Predicate type status = | Bound | Free type t = status list let adorn ~bound_variables = function | ASPred.Const _ -> Bound | var when ASPred.TermSet.mem var bound_variables -> Bound | _ -> Free let adornment ~bound_variables pred = let rev_bindings, bound_variables = List.fold_left (fun (l_rev_bindings, ctx) term -> (adorn ~bound_variables term)::l_rev_bindings, ASPred.TermSet.add term ctx) ([], bound_variables) pred.ASPred.arguments in List.rev rev_bindings, bound_variables let status_to_string = function | Bound -> "b" | Free -> "f" let compare_status b1 b2 = match b1, b2 with | Bound, Bound | Free, Free -> 0 | Bound, Free -> -1 | Free, Bound -> 1 let compare l1 l2 = List.compare compare_status l1 l2 let to_string l = UtilsLib.Utils.string_of_list "" status_to_string l let adorned_predicate_to_string ~pred_table (pred, bindings) = let pred_name = ASPred.(PredIdTable.find_sym_from_id pred.p_id pred_table) in let adornment = to_string bindings in Printf.sprintf "%s_%s" pred_name adornment
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>