Boundary conditions

Making this into a pull request to allow commenting, etc. Still premature to actually pull, but I think everyone involved knows that.
If this part could be phrased as flip-abs-flip as below, the bounds inference is going to have a better time.