Module Acml

module Acml: sig .. end
API for ACml objects creation.


An ACml object contains the description of a cellular automaton, a configuration or both (and many other things...).
type t 
Abstract type for ACml objects.
val valid : (t -> unit) -> unit
valid transfo sends the transformation function transfo to the main program and terminates. The main program then uses transfo to transform a given Acml object into the desired one. New calls to valid erase the preceeding calls. Thus, only one ACml transformation can be defined by file.

Core aspects



Lattice and Neighbourhoods


val set_dimension : t -> int -> unit
set_dimension a d sets the integer lattice of dimension d.
val set_moore_neighborhood : t -> int -> unit
Set a Moore neighbourhood of given radius (all cells having all their coordinates less than the given radius in absolute value).
val set_moore_neighbourhood : t -> int -> unit
British version of set_moore_neighborhood.
val set_vonneumann_neighborhood : t -> int -> unit
Set a von Neumann neighbourhood of given radius (all cells whose sum of absolute value of coordinates is less than the given radius).
val set_vonneumann_neighbourhood : t -> int -> unit
British version of set_vonneumann_neighborhood.
val set_cross_neighborhood : t -> int -> unit
Set a cross-shaped neighbourhood of given radius (all cells having exactly one non-zero coordinate, and less than the given radius in absolute value).
val set_cross_neighbourhood : t -> int -> unit
British version of set_cross_neighborhood.
val centercell : t -> int
When defining a local rule, the states of neighbours is given through an array of states. centercell a gives the array index corresponding to the current cell (see Acml.set_rule).
val relativecell : t -> int -> int -> int
relativecell a i j gives array index corresponding to the neighbour specified by relative Cartesian coordinates (i,j), (0,0) corresponding to the current cell. In dimension 1, second coordinate should be 0.
val neighbors : t -> (int * int) list
neighbors a gives the list of neighbors as coordinate pairs. It may (actually it does) contain the cell itself.

Setting integer states and rule


val set_cardinality : t -> int -> unit
set_cardinality a n specifies that the alphabet is the set set of integers from 0 to n-1.
val set_rule : t ->
?cache:((int array -> int) -> int array -> int) ->
?no_table:bool -> (int array -> int) -> unit
Set the transition rule. Must be called after other charracteristics of the CA (e.g. dimension, neighbourhood) are set to their definitive value. The transition rule is a function taking as single argument an array giving the state of each neighbouring cell in some order (use Acml.centercell or Acml.relativecell to get the index of a given neighbour in that array) and returning a new state. By default and if memory allows it, this function will be called only once for each possible content of the array and all results memorized. For large number of states and/or radius this is not possible and the function is called directly at each cell update. The optional argument cache gives the opportunity to add some user-given cache mechanism to improve efficiency: if the full memorization of the local function f as a transition table is impossible then f is replaced by cache f. Finally if no_table is set to true (it's false by default) then no full memorization is done and f (or cache f) is used at each cell update.
val set_rule_fun : t -> ((int -> int -> int) -> int) -> unit
Similar to Acml.set_rule but the transition rule in this case has acces to the value of neighbours through a reading function. set_rule_fun a f sets transition rule f in object a where f read give the new state of a cell assuming read x y gives the value of (relative) neighbour (x,y) of that cell.
val set_multiset_rule : t ->
?cache:((int -> int array -> int) -> int -> int array -> int) ->
?no_table:bool -> (int -> int array -> int) -> unit
Similar to Acml.set_rule but assuming that the rule is invariant by any permutation of neighbours. The local rule is given as a function of two arguments. The first is the value of the cell. The second argument is an array giving the number of occurrences of each state in its neighbourhood (including the cell itself). The remarks concerning Acml.set_rule apply.
val set_multiset_rule_fun : t -> (int -> (int -> int) -> int) -> unit
Acml.set_multiset_rule_fun is similar to Acml.set_multiset_rule but with a functional description of the neighbourhood. More precisly, the local rule is given as a function of two arguments: the first is the value of the cell, and the second argument is a function which on input i returns the number of occurrences of state i in the neighbourhood (including the cell itself). The remarks concerning Acml.set_rule apply.
val active_only : t -> (int -> bool) -> unit
Reduce updating to the following list of states. Must be called after Acml.set_rule. At each step, the updating is done for each cell that has at least one neighbour in an active state.

Polymorphic setting of states and rule


type 'a alphabet = 
| AlphaArray of 'a array
| AlphaFun of (int * (int -> 'a))
Type to describe an alphabet of arbitrary type. For functional description AlphaFun (n,enum), the first argument n is the cardinal of the alphabet and the second argument enum is an enumeration function which must be well defined over all integers from 0 to n-1.
val poly_set_rule : t ->
?active:('a -> bool) ->
?printer:('a -> string) ->
alphabet:'a alphabet -> ('a array -> 'a) -> unit
Equivalent to Acml.set_rule but for states of arbitrary type, the alphabet being given as argument. The optional argument active, if given, will restrict the application of the local rule to states x such that active x is true (it is similar to what set_rule does with Acml.active_only). printer is a function giving a string representation for each state and it is used for debugging purpose only.
val poly_set_rule_fun : t ->
?active:('a -> bool) ->
?printer:('a -> string) ->
alphabet:'a alphabet -> ((int -> int -> 'a) -> 'a) -> unit
This function is to Acml.poly_set_rule what Acml.set_rule_fun is to Acml.set_rule.
val poly_set_multiset_rule : t ->
?active:('a -> bool) ->
?printer:('a -> string) ->
alphabet:'a alphabet -> ('a -> ('a -> int) -> 'a) -> unit
This function is to Acml.poly_set_rule what Acml.set_multiset_rule is to Acml.set_rule. Note that the local rule is a function taking two arguments: the state of the cell and a function giving for each state its number of occurrences in the neighbourhood.

Determinism and (pseudo-)randomness


val declare_stochastic : t -> unit
Disable all cache mechanism to allow successive calls of the local function with identical neighbourhood to possibly give different results. It has an effect only if it is called before the function setting the local rule (e.g. Acml.set_rule or Acml.set_multiset_rule).
val declare_deterministic : t -> unit
Deprecated: rules are now considered deterministic by default. Declare that the local function is already deterministic and that a cache mechanism is not necessary to ensure determinism. The decision of whether some cache mechanism is added therefore becomes uniquely a question of efficiency. It has an effect only if it is called before the function setting the local rule (e.g. Acml.set_rule or Acml.set_multiset_rule).
val ensure_determinism : t -> unit
Add a cache mechanism in order to ensure determinism: two successive calls of the local function with the same neighborhood will produce the same result. It has an effect only if it is called before the function setting the local rule (e.g. Acml.set_rule or Acml.set_multiset_rule). This function has no effect when using *_rule_fun functions for setting the local rule.
val ca_random : int -> int
Pseudo-random generator reserved to cellular automata generation. ca_random bound returns an integer between 0 and bound - 1. If bound is 0 it returns 0. The user must ensure that the transformation function transmitted through Acml.valid is such that two consecutive calls with the same values of parameters and the same random sequence given by ca_random produces the same cellular automaton. If it is not the case, saving a CA might not give the desired results.
val ca_random_float : float -> float
Same as Acml.ca_random but for floats.
val conf_random : int -> int
Pseudo-random generator reserved to configuration generation. conf_random bound returns an integer between 0 and bound - 1. If bound is 0 it returns 0. The user must ensure that the transformation function transmitted through Acml.valid is such that two consecutive calls with the same values of parameters including universe size (see Acml.set_universe_size and Acml.get_universe_size) and the same random sequence given by conf_random produces the same initial configuration.
val conf_random_float : float -> float
Same as Acml.conf_random but for floats.

Initial configuration


val set_universe_size : t -> int -> int -> unit
Set the dimensions of the universe (for dimension 1, second argument is the time anticipation). This overrides the user choice.
val get_universe_size : t -> int * int
Return the dimensions of the universe chosen by the user.
type 'a initconf = 
| General of (int -> int -> 'a)
| GenArray of (unit -> 'a array array)
| Bernoulli of ('a -> float)
| RandomBernoulli of 'a array
| RandomUniform
| Uniform of 'a
| Mask of (int -> int -> bool) * 'a initconf
| FixedSize of int * int * 'a initconf
| MultiLayer of 'a initconf list
Type to describe initial configurations. General f produces a configuration obtained by evaluating f for each coordinate (second argument ignored in dimension 1) . GenArray f produces a configuration described by the matrix generated by calling f () and extended periodically or shortened to fit the current size of the universe. Bernoulli p describes a random configuration according to the Bernouilli measure where the probability of any state q is given by f q. RandomBernouilli tab also describes a random configuration according to a Bernoulli measure where the probability of a state is given by its number of occurrences in tab divided by the length of tab. For instance a tab containing 0;1;0 correspond to proba 1/3 for 1, 2/3 for 0 and 0 for any other state. Uniform x describes a configuration everywhere equal to x. RandomUniform describes a random configuration with the uniform measure giving the same weight to every states. Mask (f,c) describes a configuration equal to c but only at positions where f evaluates to true (second coordinate ignored in dimension 1). FixedSize (w,h,conf) specifies configuration conf but with a fixed size (w,h). MultiLayer l describes the configuration obtained by building each configuration in the list l in the order specified.
val add_init_conf : t -> ?set:bool -> string -> int initconf -> unit
Set the initial configuration.
val poly_add_init_conf : t ->
?set:bool -> string -> alphabet:'a alphabet -> 'a initconf -> unit
Set the initial configuration for polymorphic functions.

Reading functions


val radius : t -> int
Return the current radius of the CA.
val arity : t -> int
Return the current arity (number of neighbours) of the CA.
val cardinality : t -> int
Return the current number of states of the CA.
val dimension : t -> int
Return the current dimension of the CA.
val initial : t -> bool
initial ac returns true if and only if ac is a first generation ACml object.

Decorations and interaction with User Interface


val set_name : t -> string -> unit
Give a name to the family.
val get_name : t -> string
Get the name of the family.
val set_object_name : t -> string -> unit
Give a name to the object being constructed.
val get_object_name : t -> string
Get the name of the object being constructed.
val set_state_name : t -> int -> string -> unit
Give a name to some state. It is better to give names to states only after cardinality is set via Acml.set_cardinality
val get_state_name : t -> int -> string
Get the name of a given state. Raises Not_found if the given state has no name.
val poly_set_state_name : t -> alphabet:'a alphabet -> 'a -> string -> unit
Same as Acml.set_state_name but in polymorphic version
val poly_get_state_name : t -> alphabet:'a alphabet -> 'a -> string
Same as Acml.get_state_name but in polymorphic version
val add_description : t -> string -> string -> unit
Add some info about the object or the family. The first string is used as a title, the second as descriptive text.
val get_stop_time : unit -> int
Get the stop time (if negative, no stop will be applied).
val set_stop_time : int -> unit
Set the stop time (if negative, no stop will be applied).

Parameters


val param : t -> string -> int -> int -> int -> int
Creates a parameter in the user interface. param ca name min max init create the parameter name in ca. The returned value is init if this is the initial generation (see Acml.initial) or a value between min and max chosen through the user interface.
val bool_param : t -> string -> bool -> bool
Same as Acml.param but with a boolean type.
val float_param : t -> string -> float -> float -> float -> float
Same as Acml.param but with type float.
val string_param : t -> string -> string -> string
Same as Acml.param but with a string type.
val text_param : t -> string -> string -> string
Same as Acml.string_param but, in the user interface, multiline string values are easier to manipulate.
val file_param : t -> string -> string -> string
Same as Acml.string_param but, in the user interface, the value given can be changed via a file selection dialog.
val choice_param : t -> string -> string list -> string
Same as Acml.param but with a list of string to choose from. The default value is the head of the list or the empty string if the list is empty.
val choice_array_param : t -> string -> string array -> int
Same as Acml.param but with a array of string to choose from. The choice is returne as the index of the element in the array. The default value is the first element.
val doc_param : t -> string -> string -> unit
doc_param a name explanations associates explanations to parameter name.
val group_param : t -> string -> string list -> unit
group_param a name list creates a group called name containing all parameters in list.
val std_params : ?dimension:int ->
?dimension_fixed:bool ->
?states:int ->
?states_fixed:bool ->
?radius:int ->
?radius_fixed:bool ->
?neighborhood:string ->
?neighborhood_fixed:bool -> t -> int * int * int * string
Creates standard parameters dimension, states, radius and neighborhood using default values given (if any). Then set the properties of the given ACML object to the corresponding parameters values. When one of the boolean fixed_X is set to true, the corresponding parameter is not created but the corresponding property of the given ACML object is still fixed. It returns the 4-uple (dimension, states, radius, neighborhood).

Views, modifs, snapshots and measurements


type representation = 
| Unicolor of int * int * int
| Transparent
| NorthArrow
| SouthArrow
| EastArrow
| WestArrow
| Bordercolor of int * int * int
| Multiple of representation list
Type to describe graphical representation of states (should be self-explicit).
val color_gradient : t -> (int * int * int) array -> int -> representation
Utility function to handle color gradients. color_gradient a color_tab state gives a representation of type Unicolor for state obtained by linear interpolation from RVB colors in color_tab (using the number of states of a).
val add_colormap : t -> ?set:bool -> string -> (int -> representation) -> unit
add_colormap a name f adds a new view which is just a colormap giving a representation for each state (function f). If optional argument set is set to true, then the view is immediatly selected.
val add_view : t ->
?set:bool ->
string -> (int -> int -> (int -> int -> int) -> representation) -> unit
Add a new view which is defined by a function which given current position and a reading function (x, y, read_universe) returns a representation.
val poly_add_colormap : t ->
?set:bool ->
string -> alphabet:'a alphabet -> ('a -> representation) -> unit
Same as Acml.add_colormap but using polymorphic alphabet.
val poly_add_view : t ->
?set:bool ->
string ->
alphabet:'a alphabet ->
(int -> int -> (int -> int -> 'a) -> representation) -> unit
Same as Acml.add_view but using polymorphic alphabet.
val get_representation : t -> (int -> int -> int) -> int -> int -> representation
Give the current representation of a cell. Since add_view allows arbitrary computation to produce the representation, giving the coordinate of the cell is not enough in the general case. Therefore the call is of the form get_representation a reader x y where reader is a reading function and x, y give the position.
val poly_get_representation : t ->
alphabet:'a alphabet ->
(int -> int -> 'a) -> int -> int -> representation
Same as Acml.get_representation but using polymorphic alphabet.
type 'a modifier = 
| Forced of 'a
| Map of ('a -> 'a)
| GeneralZone of ('a -> int * int * int * int -> int -> int -> 'a)
| SimpleZone of ('a -> int -> int -> 'a)
| FreeZone of (int * int * int * int ->
(int -> int -> 'a) -> (int -> int -> 'a -> unit) -> unit)
type to describe modification methods.

Forced n changes all states in the selected zone to n.

GeneralZone f describes a modification method such that the state f state.(x).(y) (ax,ay,bx,by) x y is affected to cell (x,y) which was previousely in state state.(x).(y), this for all cells of the modification zone which is given by (ax,ay,bx,by). The convention for zone coordinates are fixed when calling Acml.add_modif.

SimpleZone f is the same as GeneralZone f except that f doesn't take the coordinates of the modification zone as argument.

Finally, in FreeZone f, the function f takes 3 arguments: the zone coordinates a reading function and a writing function. The reading and writing functions should be called with arguments belonging to the zone. Moreover, in dimension 1, the second arguments of the reading and writing functions have the following interpretation: 0 represents the earliest configuration in memory (= current time - height of universe); the second argument is always interpreted as 0 in the writing function; non-zero values in the reading function allows to read configurations between the earliest and the current one.

val add_modif : t ->
?key:string ->
?set:bool ->
?left:bool -> ?oriented:bool -> string -> int modifier -> unit
Add a modif method referenced in the user interface by its name. Optional parameter oriented indicates whether the zone coordinates should be unoriented (lower-left corner, then upper-right corner, this is the default) or oriented (mouse click point, then mouse release point). Optional parameter key affects the modif to a key (to be pressed while clicking). Optional parameter set tells whether the method should be selected immediately as operative on click, in which case left tells whether it should be affected to left button (true means left, false means right and not setting the option means both).
val poly_add_modif : t ->
?key:string ->
?set:bool ->
?left:bool ->
?oriented:bool ->
string -> alphabet:'a alphabet -> 'a modifier -> unit
Same as Acml.add_modif but in polymorphic version.
val add_snapshot : t ->
?set:bool -> string -> (int -> int -> (int -> int -> int) -> unit) -> unit
Add a snapshot method referenced in the user interface by its name. A snapshot is a function taking 3 parameters: width, length and a read function such that read i j gives the value of the universe at position (i,j).
val poly_add_snapshot : t ->
?set:bool ->
string ->
alphabet:'a alphabet ->
(int -> int -> (int -> int -> 'a) -> unit) -> unit
Same as Acml.add_snapshot but in polymorphic version.
val add_measurement : t ->
?trigger:bool ->
?set:bool ->
string ->
(int ->
int -> int -> (int -> int -> int) -> (int -> int -> int -> unit) -> unit) ->
unit
Add a measurement. A measurement is a function applied at each step and taking 5 arguments: the current time, the size of the universe (2 args), a function to read the current configuration and a function to modify the current configuration. The optional parameter trigger (default false) tells whether the measurement must be triggered on user demand only (trigger=true) or automatically at each step (trigger=false). In the latter case (trigger=false), the optional argument set (default false) tells whether the triggering is on or off at the beginning (this can be later changed via the user interface).
val poly_add_measurement : t ->
?trigger:bool ->
?set:bool ->
string ->
alphabet:'a alphabet ->
(int ->
int -> int -> (int -> int -> 'a) -> (int -> int -> 'a -> unit) -> unit) ->
unit
Same as Acml.add_measurement but in polymorphic version.
val doc_action : t -> string -> string -> unit
doc_action a name explanations associates explanations to the action name.

Scenarios


type action = 
| Save
| Shoot
| New
| Stop
Sceanrios are simple list of actions.
val clear_scenario : unit -> unit
Clear the current scenario.
val addto_scenario : action -> unit
Add an action to the end of the scenario.

GUI buillding functions


type gui_t 
Abstract type of GUI elements
val gui_window : ?height:int -> ?width:int -> string -> gui_t -> unit -> unit
Display a window containing a GUI element. The first parameter is the title of the window. It returns a function to kill the window.
val gui_vbox : gui_t list -> gui_t
Produce a GUI element consisting of a list of vertically aligned GUI elements
val gui_hbox : gui_t list -> gui_t
Produce a GUI element consisting of a list of horizontally aligned GUI elements
val gui_label : string -> gui_t
Produce a label containing text to display.
val gui_full_label : string -> gui_t * (string -> unit)
Produce a label containing text to display together with a function to update label content.
val gui_textbox : string -> gui_t
Produce a scrollable text box GUI element. The parameter is the text to display.
val gui_textbuffer : string -> gui_t * (string -> unit)
Produce a scrollable text box GUI element and a function to later add more text in it. The parameter is the first text to display.
val gui_button : string -> (unit -> unit) -> gui_t
Produce a clickable button with a label and an associated action.
type draw_context 
Abstract type to handle drawings
val size : draw_context -> int * int
Return the size of a drawing context.
val point : draw_context -> ?color:int * int * int -> int -> int -> unit
Draw a point in the given draw_context. The meaning of the optional argument should be clear and the two regular arguments are coordinates (horizontal then vertical).
val rectangle : draw_context ->
?color:int * int * int -> int -> int -> int -> int -> unit
Draw a rectangle in the given draw_context. The meaning of the optional argument should be clear and the two first regular arguments are coordinates (horizontal then vertical) and the two last argument are width and height.
val gui_drawing_area : ?height:int ->
?width:int ->
?background:int * int * int -> unit -> gui_t * draw_context
Produce a GUI element (to place inside other GUI elements) together with a drawing context (to do actual drawings later).
val clear : draw_context -> unit
Clear the content of the given draw_context.

Misc


val add_mem_info : int -> unit
add_mem_info n is invoked to declare that n additional bytes are used in the computation of the current rule. It has a purely informative purpose and can be omitted without problem.
val infomsg : string -> unit
Send a message to be printed by the user interface.
val add_shortcut : string -> (string -> (string * string) list) -> unit
Add a shortcut to quickly load an ACml object generated by the current file with a particular combination of parameters. This function must be invoked before the call to Acml.valid. More precisely, add_shortcut regexp list_gen_fun will add a shortcut to the user interface such that if the string given by the user matches the regular expression regexp (conventions of module Str from Ocaml standard distribution) then the transformation function of the current file is called with preset parameters given by the association list produced by calling list_gen_fun on the user string.
val declare_object : ?family:string -> string -> unit
declare_object name simply tell the GUI that name is a valid shorcut to try that will produce an interesting object. In a plugin file, a family name must be provided using the optional argument.
val declare_file_type : ?transform:(string -> string) -> string -> string list -> unit
declare_file_type name extension_list simply tell the GUI that file having extension in extension_list are interesting and give a name to that set of files. The optional argument transform is a transformation applied to the selected filename.
val neednewac : t -> bool
Return whether user requested a new AC.
val neednewconf : t -> bool
Return whether user requested a new configuration.

Plugins


type execution = 
| EachStep
| EachNewObject_after
| EachNewObject_before
| ProgramStartup
| UserDemand
val valid_plugin : ?name:string ->
?description:string ->
?activate:bool ->
?executed_at:execution ->
?start:(unit -> unit) -> ?finish:(unit -> unit) -> (t -> unit) -> unit
valid_plugin transfo sends the transformation function transfo to the main program and terminates. The main program then uses transfo as a plugin. The optional argument activate tells whether the plugin should be immediately activated (don't by default). The optional argument executed_at tells when the transformation function is executed. Optional arguments start and finish are functions called when plugin is activated or desactivated (respectively). The other optional arguments are self-explanatory. Name of plugins are case-insensitive ('Ab' and 'ab' refer to the same plugin) but the name is displayed as you specify.
type regenerate = 
| Automaton
| Configuration
| Both
| Nothing
| Skip
val valid_hook_plugin : ?activate:bool ->
?name:string ->
pattern:string ->
?description:string ->
?start:(unit -> unit) ->
?finish:(unit -> unit) ->
(string ->
t ->
int * int ->
(int -> int -> int) ->
(int -> int -> int -> unit) -> regenerate * string list) ->
unit
Register a hook which is triggered when the user gives a 'shortcut string' matching regular expression pattern. The 'action' registered is a function recieving 5 arguments: the 'shortcut string', the acml object to transform, the size of the universe, a reading function and a writing function. This function must return a pair (regen, list). regen is an indication about what needs to be regenerated after the application of the hook. Returning Skip means to go on as if the 'shortcut string' was not recognized by pattern (e.g. it can be used to design hooks that triggers on a set of string that is not a regular alnguage). list is list of strings, each of which will be considered as a new 'shortcut string' and will be considered for further processing by this hook or other ones. Keep in mind that other hooks can ask regeneration of automaton and/or configuration even if this one doesn't. The optional argument activate has the same meaning as in Acml.valid_plugin and is set to false by default.

Advanced usage



Use with care: things can be non-intuitive with these functions.
val initialize : t -> unit
Make the given ACml object a first generation object. Almost everything in the object is reset to a default value. After the initialization, a call to initial on the object returns true.
val apply : string -> t -> unit
apply_builtin name a applies the transformation called name on object a.
val get_builtin_names : unit -> string list
This function gives the list of available buitin transformations.
val get_external_names : unit -> string list
This function gives the list of currently available external transformations (loaded from a file since the program started).
val clean_decorations : t -> unit
Remove all parameters / documentation / user colormaps and user modif methods.
val remove_param : t -> string -> unit
Remove a given parameter.
val filter_params : t -> (string -> bool) -> unit
filter_params a filter removes all parameters that do not satisfy the filter filter.
val set_param : t -> string -> int -> unit
Force the value of a parameter. Overrides the user choice. Raise an error if parameter doesn't exist or has a different type.
val set_bool_param : t -> string -> bool -> unit
Same as Acml.set_param but for a boolean param.
val set_float_param : t -> string -> float -> unit
Same as Acml.set_param but for a float param.
val set_string_param : t -> string -> string -> unit
Same as Acml.set_param but for a string param. A file param can be set via set_string_param.
val set_choice_param : t -> string -> string -> unit
Same as Acml.set_param but for a choice param.
val get_param : t -> string -> int
Return current value of the parameter. Raise an error if parameter doesn't exist or has a different type.
val get_bool_param : t -> string -> bool
Same as Acml.set_param but for a boolean param.
val get_float_param : t -> string -> float
Same as Acml.set_param but for a float param.
val get_string_param : t -> string -> string
Same as Acml.set_param but for a string param. A file param can also be read via set_string_param.
val get_choice_param : t -> string -> string
Same as Acml.set_param but for a choice param.
val kernel_cast : t -> Kernel.actype
Cast an object to the internal type used in the kernel.
val get_views : t -> string list
Give the list of names of currently available views.
val set_view : t -> string -> unit
Set the view given by its name.