module Scm_syn: sig
.. end
Variables
type
var = string
Variable
type
typ =
| |
Real |
| |
Int |
| |
Single |
| |
Double |
| |
Extended |
| |
Quad |
Types of variables
Expressions
type
unop =
Unary operators
type
binop =
| |
Add |
| |
Sub |
| |
Mul |
| |
Div |
| |
Mod |
Binary operators
type
round =
| |
Near |
| |
Zero |
| |
Up |
| |
Down |
| |
Rnd |
Rounding direction
type
scalar =
| |
Float of float |
| |
Mpqf of unit |
type
interval = {
}
type
coeff =
type
iexpr =
User type for numerical expressions
type
constyp =
| |
EQ |
| |
NEQ |
| |
GT |
| |
GEQ |
| |
LEQ |
| |
LT |
Numerical constraint type
type
cons = iexpr * constyp * iexpr
Numerical constraint
type
bexpr =
Boolean expression
type
point = {
|
line : int ; |
|
col : int ; |
|
char : int ; |
}
Control point in the program
type
taction =
Transitions and states
type
transition = {
}
Transition
type
trans = {
}
Labelled transition
type
state = {
}
Automata
type
declaration = var * typ * iexpr option
Variable declaration
type
automaton = {
|
id_auto : string ; |
|
ldec : declaration list ; |
|
init_states : string list ; |
|
lstate : state list ; |
}
SCMs
type
scm = {
|
id_scm : string ; |
|
nb_channels : int ; |
|
lossy_list : int list ; |
|
params : declaration list ; |
|
lauto : automaton list ; |
|
threshold : cons list ; |
|
bad_states : (string * (string * bexpr) list) list list ; |
}
type
global_scm = {
|
gb_id_scm : string ; |
|
gb_nb_channels : int ; |
|
gb_lossy_list : int list ; |
|
gb_vars : declaration list ; |
|
gb_params : declaration list ; |
|
gb_init_states : string list ; |
|
gb_lstates : state list ; |
|
gb_threshold : cons list ; |
|
gb_bad_states : (string * bexpr) list ; |
}
Self-checking
exception Wrong_scm of string
val check_global_scm : global_scm -> unit
raise Wrong_scm if the automaton contains one of these errors:
- some lossy channels does not exist
- a variables appearing in a guard or an affectation is undeclared
- a transition leads to an undeclared state
- an initial state does not exist
- a message is not decleared
- a message is sent to a channel that does not exist
- a bad states does not correspond to an actual location
Exceptions
val start_of_comment : Lexing.position Pervasives.ref
exception Error
exception Unterminated_comment of Lexing.position