On Wed, Jul 16, 2014 at 2:12 PM, Matt Rice <[email protected]> wrote:
> I think the best argument for it I have come up with is something like
> the following scenerio:
>
> we have a structure Triangle {pt1; pt2; pt3;}
> we have a structure much like a subtyping relationship with restricted
> values
> structure RightTriangle {pt1; pt2; pt3} where one of the angles must
> be 90 degrees, and for whatever reason we wish not to make
> RightTriangle opaque, to avoid the indirection of accessor functions
> for the values,
>
OK. This is an interesting example. The example itself is clearly
contrived, but it illustrates a problem that actually *does* arise in
practice, which is data structure *instances* that meet some interesting
constraint. In this case the right-angle constraint.
This can be viewed as type, or it can be viewed as a known constraint on a
value of some type. How do we want to think about this case?
Incidentally, this is the kind of think that preconditions, postconditions,
and assertions deal with quite well.
shap
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev