add constraint comparsion function