Module Var.Prod

Variable products.

type ('o, 'p) var = ('o, 'p) t

The type for variables.

type ('o, 'p) t =
  1. | Unit : 'p -> ('o, 'p) t
  2. | Prod : ('o, 'a -> 'b) t * ('o, 'a) var -> ('o, 'b) t

The type for contructing a cartesian product with function 'p whose final result is represented by OCaml values of type 'o.

val unit : 'a -> ('o, 'a) t

unit f is a (virtual) unit variable with contructor f to be saturated by prod.

val prod : ('o, 'a -> 'b) t -> ('o, 'a) var -> ('o, 'b) t

prod p var is the product of variables p with var.

val (*) : ('o, 'a -> 'b) t -> ('o, 'a) var -> ('o, 'b) t

vs * var is prod vs var.

val absurd : unit -> ('o, 'a -> 'b) t

absurd () is an absurd unit to use to construct a product that cannot construct observations – trying raises Invalid_argument.

val vars : ('o, 'o) t -> 'o v list

vars p are the variables in product p.