FUNCTION simplify_maths_value
(val : maths_value) : maths_value;
LOCAL vtypes : SET OF STRING := stripped_typeof(val); vlist : LIST OF maths_value; nlist : LIST OF maths_value := []; END_LOCAL; IF 'GENERIC_EXPRESSION' IN vtypes THEN RETURN (simplify_generic_expression(val)); END_IF; IF 'LIST' IN vtypes THEN vlist := val; REPEAT i := 1 TO SIZEOF (vlist); INSERT (nlist, simplify_maths_value(vlist[i]), i-1); END_REPEAT; RETURN (convert_to_maths_value(nlist)); END_IF; RETURN (val); END_FUNCTION; -- simplify_maths_value
|