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 Zident.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 Zident.t * Deftypes.tsort
and loop_path = Zident.t list
type code = {
  1. mem : Obc.mentry Zmisc.State.t;
  2. init : Obc.inst;
  3. instances : Obc.ientry Zmisc.State.t;
  4. reset : Obc.inst;
  5. step : Obc.inst;
}
val fprint : Stdlib.Format.formatter -> entry Zident.Env.t -> unit
val empty_code : code
val seq : code -> code -> code
val empty_path : 'a list
val entry_of : Zident.Env.key -> 'a Zident.Env.t -> 'b

Look for an entry in the environment

Translation of immediate values

val constant : Deftypes.constant -> Obc.exp
val state : bool -> Zident.t -> Deftypes.mkind option -> Obc.left_state_value
val index : Obc.exp -> Zident.t list -> Obc.exp
val left_value_index : Obc.left_value -> Zident.t list -> Obc.left_value
val left_state_value_index : Obc.left_state_value -> Zident.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 -> Zident.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 : (Zident.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 -> Zident.t list -> Obc.exp -> Obc.exp list -> code -> Obc.exp * code

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

val exp : entry Zident.Env.t -> Zident.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 Zident.Env.t -> loop_path -> Zelus.eq -> code -> code

Equations

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

Translation of a declaration

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