Safety of Expressions

Next: Expressive Power of Up: The Tuple Relational Previous: Formal Definitions

## Safety of Expressions

1. A tuple relational calculus expression may generate an infinite expression, e.g.

2. There are an infinite number of tuples that are not in borrow! Most of these tuples contain values that do not appear in the database.

3. Safe Tuple Expressions

We need to restrict the relational calculus a bit.

• The domain of a formula , denoted dom(), is the set of all values referenced in .
• These include values mentioned in as well as values that appear in a tuple of a relation mentioned in .

• So, the domain of is the set of all values explicitly appearing in or that appear in relations mentioned in .

• is the set of all values appearing in borrow.

• is the set of all values appearing in borrow.

We may say an expression is safe if all values that appear in the result are values from dom().

4. A safe expression yields a finite number of tuples as its result. Otherwise, it is called unsafe.

Page created and maintained by Osmar R. Zaï ane
Last Update: Wed Sep 20 15:45:57 PDT 1995