use sets of constraints instead of lists
optimization: discard equivalent constraints