package elpi

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Internal.Discrimination_treeSource

Sourcetype cell
Sourcemodule Path : sig ... end
Sourceval mkConstant : safe:bool -> data:int -> arity:int -> cell
Sourceval mkPrimitive : Elpi_util.Util.CData.t -> cell
Sourceval mkVariable : cell
Sourceval mkLam : cell
Sourceval mkInputMode : cell
Sourceval mkOutputMode : cell
Sourceval mkListTailVariable : cell
Sourceval mkListHead : cell
Sourceval mkListEnd : cell
Sourceval mkPathEnd : cell
Sourcetype 'a t
Sourceval index : 'a t -> Path.t -> 'a -> 'a t

index dt path value ~time returns a new discrimination tree starting from dt where value is added wrt its path. ~time is used as a priority marker between two rules.

A rule with a given ~time has higher priority on other rules with lower ~time

@note: in the elpi runtime, there are no two rule having the same ~time

Sourceval max_path : 'a t -> int
Sourceval max_depths : 'a t -> int array
Sourceval empty_dt : 'b list -> 'a t
Sourceval retrieve : ('a -> 'a -> int) -> Path.t -> 'a t -> 'a Elpi__.Bl.scan

retrive 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 of values are sorted wrt to the order in which values are added in the tree: given two rules r_1 and r_2 with same path, if r_1 has been added at time t and r_2 been added at time t+1 then r_2 will appear before r_1 in the final result

Sourceval replace : ('a -> bool) -> 'a -> 'a t -> 'a t
Sourceval remove : ('a -> bool) -> 'a t -> 'a t
Sourceval pp_cell : Format.formatter -> cell -> unit
Sourceval show_cell : cell -> string
Sourceval pp : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit
Sourceval show : (Format.formatter -> 'a -> unit) -> 'a t -> string
Sourcemodule Internal : sig ... end
OCaml

Innovation. Community. Security.