FUNCTION compatible_intervals
(sp1 : maths_space, sp2 : maths_space) : BOOLEAN;
LOCAL amin, amax : REAL; END_LOCAL; IF min_exists(sp1) AND max_exists(sp2) THEN amin := real_min(sp1); amax := real_max(sp2); IF amin > amax THEN RETURN (FALSE); END_IF; IF amin = amax THEN RETURN (min_included(sp1) AND max_included(sp2)); END_IF; END_IF; IF min_exists(sp2) AND max_exists(sp1) THEN amin := real_min(sp2); amax := real_max(sp1); IF amin > amax THEN RETURN (FALSE); END_IF; IF amin = amax THEN RETURN (min_included(sp2) AND max_included(sp1)); END_IF; END_IF; RETURN (TRUE); END_FUNCTION; -- compatible_intervals
|