Module Variables


module Variables: sig .. end
variables.ml
Author(s): Yann GLOUCHE
Version: 1.0
Since 12/12/2005


signatures of the the roles and types of the variables
val role_signature : (string, string list) Hashtbl.t
contains the signature of the roles, and the type of the variables
val untyped_variable : bool Pervasives.ref
for define if the unification respects the type of variables
val add_type : string -> string list -> unit
add a type of a variable or a signature of role in the hash table role_signture
Returns unit
role_name : is the name of a role, or a name of variable
signature : is the signature of a role or a type of a variable
val get_type : string -> string
return the type of a variable "r"
Returns a type of a variable
r : is a name of a variable
val get_role_signature : string -> string list
return the signature of a role "role_name"
Returns the signature of a role
role_name : is a name of a role
val print_type_in_role_session : (string * int * 'a * 'b) list -> unit
add the signature of the roles contains in the !automate variable, in the hash table role_signature
Returns unit
automate : is the value of the refernce automate

variables : allocation, valeurs
val var_value : (string * string, string) Hashtbl.t
contains the value of the variables of a role
val variable_story : (string * string) list list Pervasives.ref
contains the names of the variables for which the value change for each steps of the protocol execution
val variable_current_change : (string * string) list Pervasives.ref
contains the name of the variables for which the value change in the current step of the execution of the protocol
val is_a_var : string -> bool
test if value is a variable
Returns true if "var" is a variable, else false
var : is maybe a name of a variable
val is_a_value : string -> bool
test if value is a value
Returns true if "value" is a value, else false
value : is maybe a value
val is_a_set : string -> bool
test if "var" is a set
Returns true if "var" is a set, else false
var : is maybe a set
val is_a_list : string -> bool
test if "var" is a list
Returns true if "var" is a list, else false
var : is maybe a list
val is_an_aggregation : string -> bool
test if "var" is an aggregation type
Returns true if "var" is an aggregation type, else false
var : is maybe an aggregation type
val is_a_test_var : string -> bool
Returns true if the variable "var" is present in a message for test her value
var : is a variable
val get_name_of_test_var : string -> string
Returns the real name of the test variable "var"
var : is a variable
val is_a_refresh_var : string -> bool
Returns true if the variable "var" is present in a message with a new value refresh by the HLPSL function new').
var : is a variable
val get_name_of_refresh_var : string -> string
Returns the real name of the refresh variable "var"
var : is a variable
val get_name_of_var : string -> string
Returns the real name of the variable "var"
var : is a variable
val add_in_variable_change : string * string -> unit
Record the variables for which the value is changed during the current execution of the protocol. Each pair is (name_of_an_agent,name_of_a_variable)
Returns unit
val add_in_variable_story : unit -> unit
Record the variables for which the value is changed during the execution of the last step of the protocol. Each pair is (name_of_an_agent,name_of_a_variable)
Returns unit
val previous_variable_state : unit -> unit
the variables comme back to their previous values at the previous step of the execution of the protocol
Returns unit
val get_value_of_var : string -> string -> string
Give the value of the variable "var" of the agent "name"
Returns the value of the variable "var" of the agent "name"
name : is an agent
var : is a variable of the agent "name"
val local_variable_change : (string * string) list Pervasives.ref
Record the variables for which the value is changed during a period of the execution of the protocol. Each pair is (name_of_an_agent,name_of_a_variable). It is used for compute the incoming events, and come back at the current step of the protocol.
val add_var_value : string -> string -> string -> string -> unit
give the value or the value of the variable "value" of the agent "name0" to the variable "var" of the agent "name"
Returns unit
name0 : an agent
value : a value or a variable of the agent "name0"
name : an agent
var : a variable of the agent "name"
val compatible : string -> string -> bool
test if the type "t1" can be unified with the type "t2"
Returns true, if "t1" can be unified with "t2", else false
t1 : is a type
t2 : is a type
val get_type_of_var_in_state : string -> string -> string -> string

aggregation types : lists, sets
val add_in_set : string -> string -> string -> string -> unit
add the value or tha variable "value" of the role "name0" is contained in the set "var" of the role "name"
Returns unit
name0 : is an agent
value : is a value or a variable
name : is an agent
var : is a variable of type set
val in_set : string -> string -> string -> string -> bool
test if the value or tha variable "value" of the role "name0" is contained in the set "var" of the role "name"
Returns a boolean
name0 : is an agent
value : is a value or a variable
name : is an agent
var : is a variable of type set
val delete_in_set : string -> string -> string -> string -> unit
delete the value or tha variable "value" of the role "name0" is contained in the set "var" of the role "name"
Returns unit
name0 : is an agent
value : is a value or a variable
name : is an agent
var : is a variable of type set
val add_in_list : string -> string -> string -> string -> unit
add the value or the variable "value" of the role "name0" is contained in the list "var" of the role "name"
Returns unit
name0 : is an agent
value : is a value or a variable
name : is an agent
var : is a variable of type list
val in_list : string -> string -> string -> string -> bool
test if the value or the variable "value" of the role "name0" is contained in the list "var" of the role "name"
Returns a boolean
name0 : is an agent
value : is a value or a variable
name : is an agent
var : is a variable of type list
val delete_in_list : string -> string -> string -> string -> unit
delete the value or the variable "value" of the role "name0" is contained in the list "var" of the role "name"
Returns unit
name0 : is an agent
value : is a value or a variable
name : is an agent
var : is a variable of type list
val add_in_aggregation : string -> string -> string -> string -> unit
add the value or the variable "value" of the role "name0" is contained in "var" of the role "name"
Returns unit
name0 : is an agent
value : is a value or a variable
name : is an agent
var : is a variable of type list
val in_aggregation : string -> string -> string -> string -> bool
test if the value or the variable "value" of the role "name0" is contained in "var" of the role "name"
Returns a boolean
name0 : is an agent
value : is a value or a variable
name : is an agent
var : is a variable of type set or list
val delete_in_aggregation : string -> string -> string -> string -> unit
delete the value or the variable "value" of the role "name0" is contained in "var" of the role "name"
Returns unit
name0 : is an agent
value : is a value or a variable
name : is an agent
var : is a variable of type list
val remove_local_variable_change : unit -> unit
val get_value_of_var_at_step : string -> string -> int -> string
return the value of the variable "var" of the role "name" at the step "step" of the execution of the protocol
Returns tha value of "var"
name : is the name of the role
var : is the name of the variable
step : is the step of the execution
val id_refresh : int Pervasives.ref
id_refresh is used for refresh the value of the variables. It is the consequence of the HLPSL function new().
val id_refresh_story : int list Pervasives.ref
id_refresh_story is the historic of the variable id_refresh after each step of the protocol.
val next_id_refresh_story : unit -> unit
record the current value of id_refresh in id_refresh_story
val previous_id_refresh_story : unit -> unit
id_refresh and id_refresh_story back to their values in the previous step of the protocol
val refresh_var : string -> string -> int -> unit
refresh the value of a variable "var" of the agent "name". It is the consequence of the HLPSL function new().
name : is an agent
var : is a variable of the agent "name" return unit
val refresh_var_of_state : string -> string -> int -> unit
refresh the values of all the variables of a state "state" of the agent "name". It is the consequence of the HLPSL function new().
name : is an agent
state : is a state of the agent "name" return unit
val view_table_var : unit -> unit
For debugging : display the value of all the variables on the output error