Solving stable matching problems using answer set programming