@@ -25,6 +25,7 @@ data RelationalExpr where
2525 Join :: RelationalExpr -> RelationalExpr -> RelationalExpr
2626 Assign :: String -> RelationalExpr -> RelationalExpr
2727 MultipleExpr :: [RelationalExpr] -> RelationalExpr
28+ Rename :: AttributeName -> AttributeName -> RelationalExpr -> RelationalExpr
2829 --Restrict :: RExpr.RestrictionExpr -> RelationalExpr -> RelationalExpr
2930{- maybe break this into multiple steps:
30311. check relational types for match (attribute counts) (typechecking step
@@ -82,7 +83,13 @@ eval (MakeStaticRelation attributes tupleSet) = do
8283 case mkRelation attributes tupleSet of
8384 Right rel -> return $ Right rel
8485 Left err -> return $ Left err
85−
86+
87+eval (Rename oldAttrName newAttrName relExpr) = do
88+ evald <- eval relExpr
89+ case evald of
90+ Right rel -> return $ rename oldAttrName newAttrName rel
91+ Left err -> return $ Left err
92+
8693emptyRelVarContext :: RelVarContext
8794emptyRelVarContext = M.empty
8895