Mathematical models for stable matching problems with ties and incomplete lists