acgtk
Library
Module
Module type
Parameter
Class
Class type
This exception can be raised when a signature or an entry is not found in the environmnent
module Signature1 :
Interface.Signature_sig
with type term = Logic.Lambda.Lambda.term
with type t = Acg_lexicon.Data_Lexicon.Signature.t
with type term = Acg_lexicon.Data_Lexicon.Signature.term
with type stype = Acg_lexicon.Data_Lexicon.Signature.stype
The modules implementing the signatures and the lexicons managed by the environment
module Lexicon :
Interface.Lexicon_sig
with type Signature.t = Signature1.t
and type Signature.term = Signature1.term
and type Signature.stype = Signature1.stype
with type t = Acg_lexicon.Data_Lexicon.t
Exceptions raised when interpretations of types or constants are duplicated
The type of what an environment can contain
val empty : t
empty
is the empty environmnent
insert c d e
adds the content c
into the environment e
and returns the resulting environmnent. If d
is set to true, then c
is dumped in e
by the Environment
.Environment_sig.write function. The default value for the overwrite
optional parameter is false
.
val get_signature : string -> t -> Signature1.t
get_signature name e
returns the signature of name name
in the environment e
. Raise Environment
.Environment_sig.Signature_not_found if such a signature does not exist
get_lexicon name e
returns the signature of name name
in the environment e
. Raise Environment
.Environment_sig.Lexicon_not_found if such a signature does not exist
get name e
returns the entry of name name
in the environment e
. Raise Environment
.Environment_sig.Lexicon_not_found if such an entry does not exist.
append e1 e2
merges the two environment e1
and e2
. If an entry appears in both environment then the one of e2
is kept if the overwrite
parameter is set to true
(default is false
). If set to false
, if an entry appears in both environment, an error is emitted.
iter f e
applies f to every data contained in the environment
fold f a e
returns f a_n (f a_n-1 (... (f a1 (f a0 a))
... ))
where the a_0 ... a_n
are the n+1
elements of the environmnent
val sig_number : t -> int
sig_number e
returns the number of signatures an environment contains
val lex_number : t -> int
sig_number e
returns the number of lexicons an environment contains
val choose_signature : t -> Signature1.t option
choose_signature e
returns a randomly chosen signature in the environment e
val compatible_version : t -> bool
compatible_version e
returns true
if the environment e
was created with the current versions of the compilers and/or interpreter
val read : string -> string list -> t option
read filename dirs
returns Some e
if the file filename
contains the output value of an enviromnent compatible with the current version of the software. It returns None
otherwise. The file filename
is looked up in the list of directories dirs
.
val write : string -> t -> unit
write filename e
write the output value of the enviromnent e
into the file filename