create canonical constraints to improve comparisons

fixes #1296