@@ -72,6 +72,17 @@ evalRelationalExpr (Restrict predicateExpr relExpr) = do
72 Right rel -> case predicateRestrictionFilter context predicateExpr of
72 Right rel -> case predicateRestrictionFilter context predicateExpr of
73 Left err -> return $ Left err
73 Left err -> return $ Left err
74 Right filterfunc -> return $ restrict filterfunc rel
74 Right filterfunc -> return $ restrict filterfunc rel
76+evalRelationalExpr (Equals relExprA relExprB) = do
77+ evaldA <- evalRelationalExpr relExprA
78+ evaldB <- evalRelationalExpr relExprB
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
76emptyDatabaseContext :: DatabaseContext
87emptyDatabaseContext :: DatabaseContext
77emptyDatabaseContext = DatabaseContext { inclusionDependencies = HS.empty,
88emptyDatabaseContext = DatabaseContext { inclusionDependencies = HS.empty,
@@ -130,7 +141,7 @@ supplierProductsRel = case mkRelation attributes tupleSet of
131 attributes = M.fromList [("S#", Attribute "S#" StringAtomType),
142 attributes = M.fromList [("S#", Attribute "S#" StringAtomType),
132 ("P#", Attribute "P#" StringAtomType),
143 ("P#", Attribute "P#" StringAtomType),
133− ("QTY", Attribute "QTY" StringAtomType)]
144+ ("QTY", Attribute "QTY" IntAtomType)]
134 tupleSet = HS.fromList $ mkRelationTuples attributes [
145 tupleSet = HS.fromList $ mkRelationTuples attributes [
135 M.fromList [("S#", StringAtom "S1"), ("P#", StringAtom "P1"), ("QTY", IntAtom 300)],
146 M.fromList [("S#", StringAtom "S1"), ("P#", StringAtom "P1"), ("QTY", IntAtom 300)],
136 M.fromList [("S#", StringAtom "S1"), ("P#", StringAtom "P2"), ("QTY", IntAtom 200)],
147 M.fromList [("S#", StringAtom "S1"), ("P#", StringAtom "P2"), ("QTY", IntAtom 200)],