Mlsem_types.WitnessExtraction of witnesses (sample inhabitants) from non-empty types.
type t = | DefaultAny value not explicitly mentioned in the type (negative types)
*)| Int of Z.tAn integer
*)| Enum of Sstt.Enum.tAn enum constant
*)| EnumDefaultAn enum constant not mentioned in the type
*)| Tuple of t listA tuple
*)| TupleDefaultA tuple whose arity is not mentioned in the type
*)| Record of (Sstt.Label.t * tf) list * tfA record: explicit fields and the field for all other labels
*)| Tag of Sstt.Tag.t * tA tagged value
*)| TagOpaque of Sstt.Tag.tA value with the given tag, whose content cannot be described (the tag does not preserve intersections)
*)| TagDefaultA tagged value whose tag is not mentioned in the type
*)| ArrowA function
*)A witness: a description of a value inhabiting a type.
The *Default witnesses stand for a value of a part of the type that is an infinite union of components (e.g. a negative type such as any or ~int). Such parts are not explored, as they may include components that do not correspond to values of the language (e.g. integers or tuples of some arity in a language without them). Choosing a representative for them is left to the printer.
A (possibly absent) record field.
val of_ty : Sstt.Ty.t -> t optionof_ty ty returns a witness of minimal depth for ty, or None if ty is empty. Type and row variables are ignored.
type printer = Stdlib.Format.formatter -> t -> unitA printer for tagged values, which is given the content of the tag (i.e. w for the witness Tag (tag, w)).
type printer_param = | Tagged of Sstt.Tag.t * printerTagged (tag, p): the witnesses Tag (tag, w) are printed by p.
| Opaque of Sstt.Tag.t * stringOpaque (tag, str): the witnesses TagOpaque tag are printed as str.
val add_printer_param : printer_param -> unitRegisters a printer, with priority over the printers registered before.
val set_printer_params : printer_param list -> unitReplaces the printers registered with add_printer_param. Built-in printers are always kept, but can be overridden.
val add_builtin_printer_param : printer_param -> unitRegisters a built-in printer: it is not removed by set_printer_params. Built-in printers are already registered for the extensions of Sstt (booleans, floats, characters, strings and lists), and for abstract types defined by Mlsem_types.Abstract.define.
The representatives printed for default witnesses. They are arbitrary, and should be chosen to be unlikely to be excluded by the types (they are only used for error reporting).
Representative for Default (default: _).
Representative for EnumDefault (default: Abc). Strings use their own representative, the literal abc.
Representative for TupleDefault (default: (_, _, _, _, _)).
Representative for TagDefault (default: Abd(_)).
val pp : Stdlib.Format.formatter -> t -> unitDefault printer for witnesses, using the registered printers. A tagged witness without a registered printer is printed as tag(w), or tag(_) for TagOpaque tag. Default witnesses are printed as the representatives set above. In records, absent fields are omitted, and the witness for all other labels is printed as _ = w.