Module Unifytest


module Unifytest: sig .. end
unifytest.ml

Link with ATSE Unification Module
Author(s): Yann GLOUCHE
Version: 1.0
Since 12/12/2005


val cn : int -> int
create an ATSE number
Returns int
n : is an integer
val x : int -> Types_unify.term
create an ATSE variable with identifier "n", with no type
Returns an ATSE variable (Types_unify.term)
n : is an identifier
val a : int -> Types_unify.term
create an ATSE value (atom) with identifier "n", with no type
Returns an ATSE atom (Types_unify.term)
n : is an identifier
val xt : int -> int -> Types_unify.term
create an ATSE variable with identifier "n", with the type "t"
Returns an ATSE variable (Types_unify.term)
n : is an identifier
t : is the type identifier
val at : int -> int -> Types_unify.term
create an ATSE value (atom) with identifier "n", with th type "t"
Returns an ATSE atom (Types_unify.term)
n : is an identifier
t : is the type identifier
val test_unif : (bool ->
Types_unify.term ->
Types_unify.term -> Types_unify.t_subst list -> Types_unify.t_subst list) ->
(int * string) list ->
string ->
Types_unify.term ->
Types_unify.term -> Types_unify.t_subst -> Types_unify.t_subst list
for test the unification
val test : (int * string) list ->
string ->
Types_unify.term ->
Types_unify.term -> Types_unify.t_subst -> Types_unify.t_subst list
for test the unification
val display : Types_unify.term -> string
Returns write the ATSE term s
s : is an ATSE term
val automtat_to_unify_format : (string * string, string * Types_unify.term) Hashtbl.t
contains the transcrption of an IF term to an ATSE term
val unify_format_to_automat : (string, string * string) Hashtbl.t
contains the transcrption of an ATSE term to an IF term
val automate_types_to_unify_types : (string, int) Hashtbl.t
contains the translation of an IF type to an ATSE type, the keys of the hash table is an IF type and the value is an ATSE type
val id_var_atom : int Pervasives.ref
used for generate an ATSE term with an IF value or an IF variable
val id_type : int Pervasives.ref
used for generate an ATSE term with an IF type (nat, text, nonce,...)
val to_unify_format_reciever : string -> string -> bool -> (string * string) * Types_unify.term
compute the pattern of the message of the receiver in th ATSE format
Returns an Term of the ATSE format (Types_unify.term)
name : is an agent
mess : is a message
untyped_variable : is a boolean, if untyped_variable=true then the type of the variables are not take into account, else the type of the variables is take into account
val to_unify_format_sender : string -> string -> bool -> (string * string) * Types_unify.term
compute the pattern of the message of the sender in th ATSE format
Returns an Term of the ATSE format (Types_unify.term)
name : is an agent
mess : is a message
untyped_variable : is a boolean, if untyped_variable=true then the type of the variables are not take into account, else the type of the variables is take into account
val unification : Types_unify.term ->
Types_unify.term ->
string ->
string ->
Types_unify.t_subst -> (string * string * string * string) list * bool
compute an unification of the ATSE term "u" of the agent "n1" with the ATSE term "v" of the agent "n2". "u" can be a message send by "n1" or a state of "n1", and "v" can be a message receive by "n2" or a state of "n2"
Returns an unification. An unification is a liste of 4-uplet (a0, v0, n, a) where the variable "v" of the agent "n" take the value of the variable "v0" of the agent "a0" or the value of the value "v0".
u : is an ATSE term (Types_unify.term)
n1 : is an agent
n2 : is an agent
val unify : string ->
string ->
string -> string -> bool -> (string * string * string * string) list
compute an unification of the message "mesage1" send by the agent "name1" with the message "message2" receive by the agent "name2". If the unification doesn't exist, the function return [].
Returns an unification. An unification is a liste of 4-uplet (a0, v0, n, a) where the variable "v" of the agent "n" take the value of the variable "v0" of the agent "a0" or the value of the value "v0".
name1 : is an agent
message1 : is a message send by "name1"
name2 : is an agent
message2 : is a message receive by "name2"

Match messages
val match_message_story : (string * string * string * string * string * string * bool,
(string * string * string * string) list)
Hashtbl.t Pervasives.ref
contains all the unifications computed in the current state of the protocol (or the current state the automate)
val latest_message_story : (string * string * string * string * string * string * bool,
(string * string * string * string) list)
Hashtbl.t Pervasives.ref
it is the previous value of !match_message_story. Thus, it is possible to come back to the previous value of !match_message_story
val clear_message_story : unit -> unit
save !match_message_story in !latest_message_story, and clear !match_message_story. Thus, it is possible to come back to the previous value of !match_message_story
Returns unit
val previous_message_story : unit -> unit
the hash table !match_messate_story came back at her previous value
Returns unit
val add_in_match_message_story : string ->
string ->
string ->
string ->
string -> string -> bool -> (string * string * string * string) list -> unit
save an unification in the hash table !match_message_story
Returns unit
name : is the name of an agent
state : is a state of the agent "name"
m1 : is a message of the agent "name"
name2 : is the name of an agent
state2 : is a state of the agent "name2"
m2 : is a message of the agent "name2"
val get_match_message_story : string ->
string ->
string ->
string ->
string -> string -> bool -> int * (string * string * string * string) list
return the result of an unification, if it is previously compute and save in the hash table !match_message_story
Returns a pair (int, unif). If int=-1 then the unification is not computed yet, else if int=0 the unification is impossible, else if int=1 the unification exist and unif it is this unification.
name : is the name of an agent
state : is a state of the agent "name"
m1 : is a message of the agent "name"
name2 : is the name of an agent
state2 : is a state of the agent "name2"
m2 : is a message of the agent "name2"
val match_message : string -> string -> string -> string -> string -> string -> bool
unify a message "m1" send by an agent "name" in a state "sender_state" with a message "m2" receive by an agent "name2" in a state "state2". If an unification exist, then an unification is save in match_message_story
Returns bool
name : of the sender
state : of the sender
m1 : is the message sent by the sender
name2 : is the name of the receiver
state2 : is the state of the receiver
m2 : is the message received by the receiver
val match_state : string -> string -> string -> string -> bool
unify a state "m1" of an agent "name" with a state "m2" of an agent "name2". If an unification exist, then an unification is save in match_message_story. In all case, this function is used with name=name2.
Returns bool
name : of the of the first agent
m1 : is the state of the first agant
name2 : is the name of the second agent
m2 : is the state of the second agent
val assign_sub : string -> (string * string * string * string) list -> unit
Assign values of variables in Message and in States
Returns unit
name_to_assign : is the name of the role which the value of variables are assigned
sub : is a substitution. Each element is a 4-uplet of string where (name1, value, name2, variable) "value" is a value or a variable of the role "name1", and this value is assigned to the variable "variable" of the role "name2"
val get_unification : string ->
string ->
string ->
string -> string -> string -> int * (string * string * string * string) list
Return an unification of the values of the variables in message "m2" of an agent "name2" in state "state2" from the variables and the value of a message "m1" of an agent "name" in state "state"
Returns unit
name : is the name of an agent
state : is a state of the agent "name"
m1 : is the message send by the agent "name"
name2 : is the name of an agent
state2 : is a state of the agent "name2"
m2 : is a message receive by the agent "name2"
val assign_var : string -> string -> string -> string -> string -> string -> unit
Assign the values of the variables in message "m2" of an agent "name2" in state "state2" from the variables and the value of a message "m1" of an agent "name" in state "state"
Returns unit
name : is the name of an agent
state : is a state of the agent "name"
m1 : is the message send by the agent "name"
name2 : is the name of an agent
state2 : is a state of the agent "name2"
m2 : is a message receive by the agent "name2"
val assign_var_of_state : string -> string -> string -> string -> unit
Assign the values of the variables of an agent "name2" in state "state2" from the state "state" of an agent "name". In all case, this function is used with name=name2.
Returns unit
name : is the name of an agent
name2 : is the name of an agent

treatment of sets and lists and other operations (not, equal, /=, cons, delete, in)
val find_operation_of_state : string -> string -> (string list * string list) * (string list * string list)
this function finds the operation associated with a state describe in a right member of a transition
Returns (op_left, op_right) where op_left is the operations of left member of transition, and op_right is the operations of the right member of the transition
name : if the name of an agent
state : is a state describe in a right member of a transition
val operations_test_treatment_left : string -> string -> bool
this function return a boolean value. If this value is true then the tests operations are satisfied, else if this value is false then the tests operations are not satisfied
Returns bool
name : if the name of an agent
state : is a state describe in a right member of a transition
val operations_test_treatment_right : string -> string -> bool
this function treats this affections operations like add an element in a list or in a set, and delete an element in a list or in a set
Returns bool
name : if the name of an agent
state : is a state describe in a right member of a transition
val operations_affectation_treatment : string -> string -> unit
this function return a boolean value. If this value is true then the tests operations are satisfied, else if this value is false then the tests operations are not satisfied
Returns unit
name : if the name of an agent
state : is a state describe in a right member of a transition