jon.recoil.org

Module Flambda2_term_basics.Simple

A value that is known to fit into a register (of the appropriate kind) on the target machine. We do not require such values to be Let-bound.

include module type of struct include Flambda2_identifiers.Int_ids.Simple end
include Flambda2_algorithms.Container_types.S_plus_iterator with type t := t
include Flambda2_algorithms.Container_types_intf.Thing with type t := T.t
include Hashtbl.HashedType with type t := T.t
val equal : T.t -> T.t -> bool

The equality predicate used to compare keys.

val hash : T.t -> int

A hashing function on keys. It must be such that if two keys are equal according to equal, then they have identical hash values as computed by hash. Examples: suitable (equal, hash) pairs for arbitrary key types include

  • ((=), hash) for comparing objects by structure (provided objects do not contain floats)
  • ((fun x y -> compare x y = 0), hash) for comparing objects by structure and handling Stdlib.nan correctly
  • ((==), hash) for comparing objects by physical equality (e.g. for mutable or cyclic objects).
include Map.OrderedType with type t := T.t
val compare : T.t -> T.t -> int

A total ordering function over the keys. This is a two-argument function f such that f e1 e2 is zero if the keys e1 and e2 are equal, f e1 e2 is strictly negative if e1 is smaller than e2, and f e1 e2 is strictly positive if e1 is greater than e2. Example: a suitable ordering function is the generic structural comparison function Stdlib.compare.

val print : Format.formatter -> T.t -> unit
val with_coercion : t -> Flambda2_identifiers.Int_ids.Coercion.t -> t
val pattern_match : t -> name: (Flambda2_identifiers.Int_ids.Name.t -> coercion:Flambda2_identifiers.Int_ids.Coercion.t -> 'a) -> const:(Flambda2_identifiers.Int_ids.Const.t -> 'a) -> 'a
val same : t -> t -> bool
val export : t -> exported
val import : exported -> t
include Flambda2_nominal.Contains_names.S with type t := t

Compute the free names of a term. Such computation covers all kinds of bindable names (variables, continuations, ...)

val apply_renaming : t -> Flambda2_nominal.Renaming.t -> t

Apply a renaming throughout a term.

val has_coercion : t -> bool
val apply_coercion : t -> Coercion.t -> t option
val apply_coercion_exn : t -> Coercion.t -> t
val without_coercion : t -> t
val must_be_var : t -> (Flambda2_identifiers.Variable.t * Coercion.t) option
val must_be_symbol : t -> (Flambda2_identifiers.Symbol.t * Coercion.t) option
val must_be_name : t -> (Flambda2_identifiers.Name.t * Coercion.t) option
val must_be_const : t -> Flambda2_identifiers.Reg_width_const.t option

The constant representating the given number of type "int".

val const_bool : Target_system.Machine_width.t -> bool -> t

The constant representating the given boolean value.

val untagged_const_bool : Target_system.Machine_width.t -> bool -> t

The naked immediate constant representating the given boolean value.

val const_true : Target_system.Machine_width.t -> t

The constant representating boolean true.

val untagged_const_true : Target_system.Machine_width.t -> t
val const_false : Target_system.Machine_width.t -> t

The constant representating boolean false.

val untagged_const_false : Target_system.Machine_width.t -> t
val const_zero : Target_system.Machine_width.t -> t

The constant representating the number zero of type "int".

val untagged_const_zero : Target_system.Machine_width.t -> t
val untagged_const_int : Flambda2_numbers.Target_ocaml_int.t -> t
val const_one : Target_system.Machine_width.t -> t
val const_unit : Target_system.Machine_width.t -> t

The constant representing the unit value.

val const_int_of_kind : machine_width:Target_system.Machine_width.t -> Flambda2_kinds.Flambda_kind.t -> int -> t
val is_const : t -> bool
val is_symbol : t -> bool
val is_var : t -> bool
val is_imported_or_constant : t -> bool
val free_names_in_types : t -> Flambda2_nominal.Name_occurrences.t
val pattern_match' : t -> var:(Flambda2_identifiers.Variable.t -> coercion:Coercion.t -> 'a) -> symbol:(Flambda2_identifiers.Symbol.t -> coercion:Coercion.t -> 'a) -> const:(Flambda2_identifiers.Reg_width_const.t -> 'a) -> 'a
module List : sig ... end
module With_kind : sig ... end
module With_debuginfo : sig ... end