package acgtk

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

Parameters

Signature

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
val pp_address : Stdlib.Format.formatter -> address -> unit
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
type 'a stack = 'a list

The type of a stack.

type 'a list_context = 'a stack

A list context is a stack

type 'a focused_list = 'a list_context * 'a list

a focused list is a pair of a list context and of a list

type 'a forest = 'a tree focused_list

Recursive definition of a shared forest.

and 'a tree =
  1. | Node of 'a * 'a child list
and 'a child =
  1. | Forest of 'a forest
type 'a simple_tree

Type definition for standard trees

val pp_tree : (Stdlib.Format.formatter -> 'a -> unit) -> Stdlib.Format.formatter -> 'a simple_tree -> unit

pp_tree pp fmt t pretty prints the tree t on the formatter fmt using the pretty printer for tree nodes pp

type 'a resumptions

An abstract type to give access to resumptions when trees are built from a forest

val empty : 'a resumptions

empty is the empty resumptions

val fold_depth_first : (('a -> 'b) * ('b -> 'b -> 'b)) -> 'a simple_tree -> 'b

fold_depth_first (f,g) t recursively computes (g a) b_1 .... b_n where a=f t_0 and b_i= f t_i and t is a tree of node t_0 and of children t_1...t_n

val init : 'a tree list -> 'a resumptions

init forest builds the resumptions with all the focused forest focusing on each of the tree of forest

val resume : 'a resumptions -> ('a simple_tree * W.w) option * 'a resumptions

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 is_empty : 'a resumptions -> bool

is_empty resumptions returns true if resumptions does not propose any other value on which to resume, false otherwise

OCaml

Innovation. Community. Security.