Module Symbolic.Expr

Manipulation of symbolic expressions.

type t =
  1. | Bop of Qasm.binaryop * t * t
  2. | Uop of Qasm.unaryop * t
  3. | Cst of int
  4. | Pi
  5. | I
  6. | Var of Symbol.t
  7. | CustomSymbol of Stdlib.String.t

Type of symbolic expressions.

val (*!) : t -> t -> t

Symbolic product.

val (+!) : t -> t -> t

Symbolic sum.

val neg : t -> t

Symbolic negation.

val cstring_of_binary : Qasm.binaryop -> string

Returns a C template-compatible string of a binary operation.

val cstring_of_unary : Qasm.unaryop -> string

Returns a C template-compatible string of a unary operation.

val repr : t -> Stdlib.String.t

Returns a string representation of the expression.

val reduce : t -> t

Reduces an expression by matching against reduction rules.