package lutin

  1. Overview
  2. Docs

COMPILATION/EXPANSION : expressions algébriques

------------------------------------------------------------

Représentation des expressions algébriques.

----------------------------------------------------------

C'est la structure utilisée pour toutes les expressions non "trace" (grosso/modo du Lustre !).

La structure est très simple~: on distingue plusieurs cas de feuilles, et un seul cas de noeud (opérateur).

Elle contient, dès la construction, les infos sémantiques associées : type de valeur et "controlabilité".

Rappel~: une alg_exp est contrôlable si et seulement si elle contient au moins une référence à une variable support contrôlable (output ou local).

type node =
  1. | AE_true
  2. | AE_false
  3. | AE_const of string
  4. | AE_iconst of string
  5. | AE_rconst of string
  6. | AE_ival of int
  7. | AE_rval of float
  8. | AE_support of CoIdent.t
  9. | AE_pre of CoIdent.t
  10. | AE_alias of CoIdent.t
  11. | AE_call of CoIdent.t * t list
  12. | AE_external_call of CoIdent.t * CkIdentInfo.extern_info * CkTypeEff.profile * t list
and t = {
  1. ae_type : CkTypeEff.t;
  2. ae_ctrl : bool;
  3. ae_val : node;
}
val sizeof : t -> int

Batterie de "constructeurs"

val of_true : t
val of_false : t
val of_huge_weight : t
val of_const : string -> CkTypeEff.t -> t
val of_iconst : string -> t
val of_rconst : string -> t
val of_bval : bool -> t
val of_ival : int -> t
val of_rval : float -> t
val of_support : CoIdent.t -> CkTypeEff.t -> bool -> t

Réference à une variable du support

val of_pre : CoIdent.t -> CkTypeEff.t -> t

Réference au pre d'une variable du support

val of_alias : CoIdent.t -> CkTypeEff.t -> bool -> t

Référence à un alias

val of_call : CoIdent.t -> CkTypeEff.t -> t list -> t

Tout calcul est un appel, prédéfini ou non

val of_external_call : CoIdent.t -> CkIdentInfo.extern_info -> CkTypeEff.profile -> CkTypeEff.t -> t list -> t
val of_and : t -> t -> t

On donne quand même le and ...

val of_big_and : t list -> t
val of_eq : t -> t -> t
val of_not : t -> t
val of_ite : CkTypeEff.t -> t -> t -> t -> t

... et le ite i(il faut donner le type)

val is_controlable : t -> bool

Infos

val get_type : t -> CkTypeEff.t
val dump : t -> unit

Affichage prefixé sur stdout

val dumpf : Stdlib.out_channel -> t -> unit

Affichage prefixé sur os

val lus_dumpf : Stdlib.out_channel -> t -> unit

Affichage infixé (autant que possible) sur os n.b. compatible Lustre/Lucky

val lus_dumps : t -> string

Affichage infixé (autant que possible) dans une string n.b. compatible Lustre/Lucky