Elpi_runtime.Discrimination_treemodule Path : sig ... endval mkConstant : safe:bool -> data:int -> arity:int -> cellval mkPrimitive : Elpi_util.Util.CData.t -> cellval mkVariable : cellThis is for: unification variables, discard
val mkAny : cellThis is for:
val mkInputMode : cellval mkOutputMode : cellval mkListTailVariable : cellThis is for the last term of opened lists.
If the list ends is 1,2|X == Cons (CData'1',Cons(CData'2',Arg (_, _)))
The corresponding path will be: ListHead, Primitive, Primitive, ListTailVariable
ListTailVariable is considered as a variable, and if it appears in a goal in input position, it cannot be unified with non-flex terms
val mkUvarConstant : cellunique identifier for uvar constructor
val mkListTailVariableUnif : cellThis is used for capped lists.
If the length of the maximal list in the rules of a predicate is N, then any (sub-)list in the goal longer then N encodes the first N elements in the path and the last are replaced with ListTailVariableUnif.
The main difference with ListTailVariable is that DT will unify this symbol to both flex and non-flex terms in the path of rules
val mkListHead : cellval mkListNil : cellval mkListEnd : cellval mkPathEnd : cellThis is padding used to fill the array in paths and indicate the retrieve function to stop making unification.
Note that the array for the path has a length which is doubled each time the terms in it are larger then the forseen length. Each time the array is doubled, the new cells are filled with PathEnd.
index dt ~max_list_length path value returns a new discrimination tree starting from dt where value is added wrt its path.
max_list_length is provided and used to update (if needed) the length of the longest list in the received path.
val max_path : 'a t -> intval max_list_length : 'a t -> intval max_depths : 'a t -> int arrayval user_upper_bound_depth : 'a t -> int listval empty_dt : int list -> 'a tretrive cmp path dt Retrives all values in a discrimination tree dt from a given path p.
The retrival algorithm performs a light unification between p and the nodes in the discrimination tree. This light unification takes care of unification variables that can be either in the path or in the nodes of dt
The returned list is sorted wrt cmp so that rules are given in the expected order
val pp_cell : Format.formatter -> cell -> unitval show_cell : cell -> stringval pp : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unitval show : (Format.formatter -> 'a -> unit) -> 'a t -> stringmodule Internal : sig ... end