Re ning Logic Programs using Types andInvariantsRobert