Merge tables into rules.