FUNCTION space_dimension
(tspace : tuple_space) : nonnegative_integer;
LOCAL types : SET OF STRING := TYPEOF (tspace); END_LOCAL; IF (schema_prefix + 'UNIFORM_PRODUCT_SPACE') IN types THEN RETURN (tspace\uniform_product_space.exponent); END_IF; IF (schema_prefix + 'LISTED_PRODUCT_SPACE') IN types THEN RETURN (SIZEOF (tspace\listed_product_space.factors)); END_IF; IF (schema_prefix + 'EXTENDED_TUPLE_SPACE') IN types THEN -- IN the CASE OF an extended_tuple_space, the minimum dimension is returned. RETURN (space_dimension (tspace\extended_tuple_space.base)); END_IF; -- Should be unreachable RETURN (?); END_FUNCTION; -- space_dimension
|