package acgtk

  1. Overview
  2. Docs
Module type
Class type



type address = (int * int) list

This type is the type of addresses of forests. It is a list of (position in the forest,position as a child).

type relative_path = int * address

This is the type of relative path from one forest to another one. The first argument is the number of steps to move up, then second argument is the address to reach from this point.

val diff : address -> address -> relative_path

diff add add' returns the relative path to go from the forest (subtree) wich occurs at address add to the forest (subtree) wich occurs at address add'.

val pp_path : Stdlib.Format.formatter -> relative_path -> unit

pp_path fmt p pretty prints the path p on the formatter fmt.

val pp_address : Stdlib.Format.formatter -> address -> unit

pp_path fmt add pretty prints the address add on the formatter fmt.

type weight = W.w

This type is the type for weights of trees. It is used to enumerate trees in the resumptions in the order specified by W

val pp_weight : Stdlib.Format.formatter -> weight -> unit

pp_path fmt w pretty prints the weight w on the formatter fmt.

type 'a forest = 'a forest_tree list
and 'a forest_tree =
  1. | Node of 'a * 'a child list
and 'a child =
  1. | Forest of 'a forest
type 'a childList_context = {
  1. siblings : 'a child ListContext.focused_list;
  2. parent_label : 'a;
  3. focus : 'a child;

The type of the context for child lists (cannot be straightforwadly list context because elements can be either forests or links to other places in the shared forest

type 'a forest_context_info = {
  1. label : 'a;
  2. children : 'a child ListContext.focused_list;
  3. alternatives : 'a forest_tree ListContext.focused_list;
  4. alt_num : int;
  5. context : 'a forest_context;
  6. suspended_computation : (('a forest_context * 'a forest_tree) * 'a childList_context) option;
  7. address : address;
and 'a forest_context =
  1. | Top of 'a forest_tree ListContext.focused_list * int * (('a forest_context * 'a forest_tree) * 'a childList_context) option
  2. | Zip of 'a forest_context_info

    The type for shared forest contexts. Using a record to better distinguish the different components


A resumption store module for the weighting scheme being used

val init : alt_max:int -> (Stdlib.Format.formatter -> 'a -> unit) -> 'a forest_tree list -> 'a Resumptions.resumptions

init ~alt_max ppf forest builds the resumptions with a focused forest focusing on each of the tree of forest. 10^alt_max is the max number of delayed computations before moving to non-regular sorting. ppf is a pretty printer for 'a type values.

resume resumptions returns a pair (Some (t,n),resumptions') where t of size n is extracted from resumptions, the latter being updated with possible alternatives met in building t to produce resumptions'. It returns (None,[]) if no tree can be extracted

val pp_trees : (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> 'a Resumptions.resumptions -> unit

pp_tree pp fmt r pretty prints all the trees by generated by the resumptions on the formatter fmt using the pretty printer for tree nodes pp

val pp_forest : (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> 'a forest -> unit

pp_tree pp fmt f pretty prints the forest f (with actual link-to node) on the formatter fmt using the pretty printer for tree nodes pp


Innovation. Community. Security.