FUNCTION domain_from
(ref : maths_space_or_function) : tuple_space;
LOCAL typenames : SET OF STRING := stripped_typeof(ref); func : maths_function; END_LOCAL; IF NOT EXISTS (ref) THEN RETURN (?); END_IF; IF 'TUPLE_SPACE' IN typenames THEN RETURN (ref); END_IF; IF 'MATHS_SPACE' IN typenames THEN RETURN (one_tuples_of (ref)); END_IF; func := ref; IF 'CONSTANT_FUNCTION' IN typenames THEN RETURN (domain_from (func\constant_function.source_of_domain)); END_IF; IF 'SELECTOR_FUNCTION' IN typenames THEN RETURN (domain_from (func\selector_function.source_of_domain)); END_IF; IF 'PARALLEL_COMPOSED_FUNCTION' IN typenames THEN RETURN (domain_from (func\parallel_composed_function.source_of_domain)); END_IF; RETURN (func.domain); END_FUNCTION; -- domain_from
|