(****************************************************************************** ** SIDE.sml ** sml ** ** Franklin Chen and Guy Blelloch ** The SIDE signature ******************************************************************************) (* This signature defines a three valued logic to deal with regions of space. The values of Side.t are in (inside), on (on the boundary) and out (outside). Many of the functions in other signatures return one of these values (e.g. Halfspace.pointIn). *) signature SIDE = sig datatype t = In | On | Out val == : t * t -> bool val != : t * t -> bool val toString : t -> string (* Converts LESS to In, EQUAL to On, and GREATER to Out *) val fromOrder : order -> t val toOrder : t -> order (* In if both inputs are In, On if one input is On and the the other is On or In, and Out otherwise *) val intersection : t * t -> t (* In if either input is In, On if one input is On and the the other is On or Out, and Out otherwise *) val union : t * t -> t (* In to Out, Out to In, and On to On *) val complement : t -> t (* True if both inputs are In, both inputs are Out, or either input is On *) val sameSide : t * t -> bool end