package zelus

  1. Overview
  2. Docs
val app : Obc.exp -> Obc.exp list -> Obc.exp
val sequence : Obc.inst -> Obc.inst -> Obc.inst
val kind : Zelus.kind -> Obc.kind

Translation of the kind

Translating type expressions.

val constr_decl : Zelus.constr_decl -> Obc.constr_decl
val is_mutable : Deftypes.typ -> bool
val type_expression_of_typ : Deftypes.typ -> Obc.type_expression
type env = entry Ident.Env.t
and entry = {
  1. e_typ : Deftypes.typ;
  2. e_sort : sort;
  3. e_size : loop_path;
}
and sort =
  1. | In of Obc.exp
  2. | Out of Ident.t * Deftypes.tsort
and loop_path = Ident.t list
type code = {
  1. mem : Obc.mentry Misc.State.t;
  2. init : Obc.inst;
  3. instances : Obc.ientry Misc.State.t;
  4. reset : Obc.inst;
  5. step : Obc.inst;
}
val fprint : Stdlib.Format.formatter -> entry Ident.Env.t -> unit
val empty_code : code
val seq : code -> code -> code
val empty_path : 'a list
val entry_of : Ident.Env.key -> 'a Ident.Env.t -> 'a

Look for an entry in the environment

Translation of immediate values

val constant : Deftypes.constant -> Obc.exp
val state : bool -> Ident.t -> Deftypes.mkind option -> Obc.left_state_value
val index : Obc.exp -> Ident.t list -> Obc.exp
val left_value_index : Obc.left_value -> Ident.t list -> Obc.left_value
val left_state_value_index : Obc.left_state_value -> Ident.t list -> Obc.left_state_value
val var : entry -> Obc.exp
val assign : entry -> Obc.exp -> Obc.inst

Make an assignment according to the sort of a variable n

val def : entry -> Obc.exp -> code -> code

Generate the code for a definition

val der : entry -> Obc.exp -> code -> code

Generate the code for der x = e

val ifthen : Obc.exp -> Obc.inst -> Obc.inst -> Obc.inst

Generate an if/then

val for_loop : bool -> Ident.t -> Obc.exp -> Obc.exp -> Obc.inst -> Obc.inst

Generate a for loop

val letpat : Obc.pattern -> Obc.exp -> code -> code

Generate the code for the definition of a value

val letvar : (Ident.t * Obc.is_mutable * Deftypes.typ * Obc.exp option) list -> Obc.inst -> Obc.inst

Generate the code for initializing shared variables

val pluseq : entry -> Obc.exp -> code -> code

Compile an equation n += e

val size_of_type : Deftypes.size -> Obc.size

Translate size expressions

val size : Zelus.size -> Obc.size

Translate size expressions

val choose : 'a -> Deftypes.typ -> Obc.exp option
val default : 'a -> Deftypes.typ -> Deftypes.constant option -> Obc.exp option

Computes a default value

Extension of an environment

val apply : Deftypes.kind -> 'a -> Ident.t list -> Obc.exp -> Obc.exp list -> code -> Obc.exp * code

Translation of a stateful function application f se1 ... sen e

val exp : entry Ident.Env.t -> Ident.t list -> code -> Zelus.exp -> Obc.exp * code

Translation of expressions under an environment env

val pattern : Zelus.pattern -> Obc.pattern

Patterns

val equation : entry Ident.Env.t -> loop_path -> Zelus.eq -> code -> code

Equations

val equation_list : entry Ident.Env.t -> loop_path -> Zelus.eq list -> code -> code
val add_mem_vars_to_code : code -> Obc.mentry Misc.State.t -> (Ident.Env.key * Obc.is_mutable * Deftypes.typ * Obc.exp option) list -> code
val expression : entry Ident.Env.t -> Zelus.exp -> code

Translation of a declaration

val implementation_list : Zelus.implementation_desc Zelus.localized list -> Obc.implementation list
OCaml

Innovation. Community. Security.