Skip to content
REL
REFERENCE
Union and Disjunction

Union and Disjunction

Expr := Expr ";" Expr

The semicolon is a generalized union operator.

For example:

// read query
 
def P = (1, 2); (3, 4); (5, 6)
def Q = ("a", 41, "A", 61 ); ("b", 42, "B", 62)
def output = P; Q

Examples:

  • For any relation p, {}; p is equivalent to p.
  • 1; 3 is equivalent to x: x = 1 or x = 3.
  • If p and q are unary relations, then:
    • p(x); q(x) is equivalent to p(x) or q(x).
    • p; q is equivalent to x: p(x) or q(x).

The semicolon operator is equivalent to or when its arguments are restricted to relations of arity 0. To illustrate this, here is the table of all possible combinations of two relations with arity 0:

LeftRightLeft ; Right
{}{} {}
{()}{}{()}
{}{()}{()}
{()}{()}{()}

Next: Precedence

Was this doc helpful?