Datalog: Bag Semantics via Set Semantics