Module Rel.Rel_private

Low-level private representations.

For the language extender and backend writer. Subject to change even between minor versions of the library.

Rows

type ('r, 'a) prod =
| Unit : 'a -> ( 'r, 'a ) prod
| Prod : ( 'r, 'a -> 'b ) prod * ( 'r, 'a ) Col.t -> ( 'r, 'b ) prod
| Cat : ( 'r, 'a -> 'b ) prod * ( 'r -> 'a ) * ( 'a, 'a ) prod -> ( 'r, 'b ) prod

The type for products. See Row.prod.

val prod_of_prod : ( 'r, 'a ) Row.prod -> ( 'r, 'a ) prod

prod_of_prod p is the representation of p.

val prod_to_prod : ( 'r, 'a ) prod -> ( 'r, 'a ) Row.prod

prod_to_prod p is the representee of p.

Operators

type ('a, 'b) unop = ..

The type for unary operations on base values of type 'a returning values of type 'b.

type unop +=
| Neg : 'a Type.t -> ( 'a, 'a ) unop(*

Negation.

*)

Predefined unary operations.

type ('a, 'b) binop = ..

The type for binary operations on base values of type 'a returning values of type 'b.

type arith =
| Add
| Sub
| Div
| Mul(*

The type for arithmetic operators.

*)
type cmp =
| Eq
| Neq
| Lt
| Leq
| Gt
| Geq(*

The type for comparison operators.

*)
type binop +=
| Arith : arith * 'a Type.t -> ( 'a, 'a ) binop
| Cmp : cmp * 'a Type.t -> ( 'a, bool ) binop
| And : ( bool, bool ) binop
| Or : ( bool, bool ) binop

Predefined binary operations.

Values and bags

type 'a value' = 'a value

See Relt.value.

type 'a value =
| Var : string -> 'a value
| Const : 'a Type.t * 'a -> 'a value
| Unop : ( 'a, 'b ) unop * 'a value -> 'b value
| Binop : ( 'a, 'b ) binop * 'a value * 'a value -> 'b value
| Proj : 'b value * ( 'b, 'a ) Col.t -> 'a value
| Row : 'a -> 'a value
| Tuple : ( 'a -> 'b ) value * 'a value -> 'b value
| Exists : ( 'b, 'e ) bag -> bool value

The type for values of type 'a. This represents an expression computing a value of type 'a.

and ('a, 'e) bag =
| Table : 'a Table.t -> ( 'a, 'e ) bag
| Empty : ( 'a, 'e ) bag
| Yield : 'a value -> ( 'a, 'e ) bag
| Union : ( 'a, 'e ) bag * ( 'a, 'e ) bag -> ( 'a, 'e ) bag
| Foreach : ( 'a, _ ) bag * ( 'a value -> ( 'b, 'e ) bag ) -> ( 'b, 'e ) bag
| Where : bool value * ( 'a, 'e ) bag -> ( 'a, 'e ) bag

The type for bags. See Bag.t.

val value_to_value : 'a value' -> 'a value

value_to_value v is the repressentation of v.

val bag_to_bag : ( 'a, 'e ) Bag.t -> ( 'a, 'e ) bag

bag_to_bag b is the representation of b.

Formatters

val pp_value : Stdlib.Format.formatter -> 'a value -> unit

pp_value formats values.

val pp_bag : Stdlib.Format.formatter -> ( 'a, 'e ) bag -> unit

pp_bag formats bags.