Semantics
Semantics of Eval( , DB) is given by appeal to range restricted relational calculus with multiset semantics
Answers(
is a table with arity Cnum( ) and extension Eval( , DB)
For
- Relation name: Eval(
, DB) = Answers where Cnum( ) = - Constant: Eval(
) = Answers( , DB) where Cnum( ) = 1 - Selection: Eval(
, DB) = Answers( , DB) where Cnum( ) = Cnum( ) - Projection: Eval(
) = Answers( , DB) where Cnum( ) = m - Duplicate elimination: Eval(elim
, DB) = Answers( |elim , DB) where Cnum(elim ) = Cnum( ) - Cross product: Eval(
, DB) = Answers( ) where Cnum( ) = Cnum( ) + Cnum( ) - Multiset Union: Eval(
, DB) = Answers( , DB) where Cnum( ) = Cnum( ) - Multiset Difference: (Except all) Eval (
, DB) = Answers( , DB) where Cnum(E_1 - E_2) = Cnum( ) - Multiset Difference: (Alternative not exists) Eval (
, DB) = Answers( , DB) where Cnum(E_1 - E_2) = Cnum( )
Multiset difference with alternative semantics can be used when translating subqueries in SQL conditions