Any Function Added to the Rel Standard Library

Posted October 5, 2021 by George Kastrinis ‐ 1 min read

The Rel stdlib has been updated to include the Any function.

The Standard Library now offers the Any function. This is a unary relation that is true for any value used. It is used as a generic type assertion that always succeeds.

In the following example, we define a relation R that contains tuples of various lengths (arities). In the second line we output the second argument of all the tuples in R that have arity 3. By using Any in the first and third position, we declare that we are not interested in the values of these arguments:

def R = {(1, 2, 3); ("a", 3, 0.5); (11, 22, 33, 44)}

def output = x : R(Any, x, Any)

Relation: output