Formalizing and Reasoning about Constraints in Federated Databases