fsml

A library for describing and describing synchronous finite state machines
IN THIS PACKAGE
Module Fsml . Types
type t =
| TyInt of sign attr * size attr * range attr
| TyBool
| TyArrow of t * t(*

Internal use only

*)
| TyProduct of t list(*

Internal use only

*)
| TyVar of t var(*

Internal use only

*)
and 'a attr =
| Const of 'a
| Var of 'a attr var
and 'a var = {
stamp : string;
mutable value : 'a value;
}
and 'a value =
| Unknown
| Known of 'a
and sign =
| Signed
| Unsigned
and size = int
and range = {
lo : int;
hi : int;
}
val to_yojson : t -> Yojson.Safe.t
val attr_to_yojson : ( 'a -> Yojson.Safe.t ) -> 'a attr -> Yojson.Safe.t
val var_to_yojson : ( 'a -> Yojson.Safe.t ) -> 'a var -> Yojson.Safe.t
val value_to_yojson : ( 'a -> Yojson.Safe.t ) -> 'a value -> Yojson.Safe.t
val sign_to_yojson : sign -> Yojson.Safe.t
val size_to_yojson : size -> Yojson.Safe.t
val range_to_yojson : range -> Yojson.Safe.t
type typ_scheme = {
ts_params : ts_params;
ts_body : t;
}
and ts_params = {
tp_typ : t var list;
tp_sign : sign attr var list;
tp_size : size attr var list;
tp_range : range attr var list;
}
val show_typ_scheme : typ_scheme -> Ppx_deriving_runtime.string
val show_ts_params : ts_params -> Ppx_deriving_runtime.string
val typ_scheme_to_yojson : typ_scheme -> Yojson.Safe.t
val ts_params_to_yojson : ts_params -> Yojson.Safe.t

Builders

val new_type_var : unit -> t var

new_type_var () returns a fresh type variable

val new_attr_var : unit -> 'a attr var

new_attr_var () returns a fresh type attribute variable

val type_int : unit -> t
val trivial_scheme : t -> typ_scheme

Unification

exception TypeConflict of t * t
exception TypeCircularity of t * t
val unify : t -> t -> unit
val type_instance : typ_scheme -> t
val real_type : t -> t
val real_attr : 'a attr -> 'a attr
exception Polymorphic of t
val mono_type : t -> t

Remove all type variables from type representation t. Raises !Polymorphic if t contains unresolved type variables.

Printing

val to_string : t -> string