on master help sign in
remove some unused stale crust
01c7abeAgentM
ProjectM36/Relation.hs−21
@@ -50,27 +50,6 @@ relationTrue = Relation A.emptyAttributes singletonTupleSet
50relationFalse :: Relation
50relationFalse :: Relation
51relationFalse = Relation A.emptyAttributes emptyTupleSet
51relationFalse = Relation A.emptyAttributes emptyTupleSet
52
52
53−madeTrue :: Either RelationalError Relation
54−madeTrue = mkRelation A.emptyAttributes (HS.fromList [])
55−
56−madeFalse :: Either RelationalError Relation
57−madeFalse = mkRelation A.emptyAttributes emptyTupleSet
58−
59−{-
60−--used for predicate filtering- instead of allowing for tuple types to be floating around in Tutorial D, just created a "singleton value" relation with cardinality and arity 1 for tuple atom comparison purposes
61−singletonValueFromRelation :: Relation -> Either RelationalError Atom
62−singletonValueFromRelation rel@(Relation _ tupSet) = if cardinality rel /= Countable 1 then
63− Left (PredicateExpressionError "Relational expression must have cardinality 1")
64− else if arity rel /= 1 then
65− Left (PredicateExpressionError "Relation expression must have arity 1")
66− else
67− Right value
68− where
69− value = snd $ head $ M.toList tupMap
70− tupMap = tup2Map $ head (HS.toList tupSet)
71− tup2Map (RelationTuple tupmap) = tupmap
72−-}
73−
74union :: Relation -> Relation -> Either RelationalError Relation
53union :: Relation -> Relation -> Either RelationalError Relation
75union (Relation attrs1 tupSet1) (Relation attrs2 tupSet2) =
54union (Relation attrs1 tupSet1) (Relation attrs2 tupSet2) =
76 if not (A.attributesEqual attrs1 attrs2)
55 if not (A.attributesEqual attrs1 attrs2)