@@ -72,6 +72,17 @@ evalRelationalExpr (Restrict predicateExpr relExpr) = do
7272 Right rel -> case predicateRestrictionFilter context predicateExpr of
7373 Left err -> return $ Left err
7474 Right filterfunc -> return $ restrict filterfunc rel
75+
76+evalRelationalExpr (Equals relExprA relExprB) = do
77+ evaldA <- evalRelationalExpr relExprA
78+ evaldB <- evalRelationalExpr relExprB
79+ case evaldA of
80+ Left err -> return $ Left err
81+ Right relA -> case evaldB of
82+ Left err -> return $ Left err
83+ Right relB -> return $ Right $ if relA == relB then relationTrue else relationFalse
84+
85+
7586
7687emptyDatabaseContext :: DatabaseContext
7788emptyDatabaseContext = DatabaseContext { inclusionDependencies = HS.empty,
@@ -130,7 +141,7 @@ supplierProductsRel = case mkRelation attributes tupleSet of
130141 where
131142 attributes = M.fromList [("S#", Attribute "S#" StringAtomType),
132143 ("P#", Attribute "P#" StringAtomType),
133− ("QTY", Attribute "QTY" StringAtomType)]
144+ ("QTY", Attribute "QTY" IntAtomType)]
134145 tupleSet = HS.fromList $ mkRelationTuples attributes [
135146 M.fromList [("S#", StringAtom "S1"), ("P#", StringAtom "P1"), ("QTY", IntAtom 300)],
136147 M.fromList [("S#", StringAtom "S1"), ("P#", StringAtom "P2"), ("QTY", IntAtom 200)],