Application module: Numeric expression | ISO/TS 10303-1526:2018-11(E) © ISO |
This clause specifies the information requirements for the Numeric expression application module. The information requirements are specified as the Application Reference Model (ARM) of this application module.
NOTE 1 A graphical representation of the information requirements is given in Annex C.
NOTE 2 The mapping specification is specified in 5.1. It shows how the information requirements are met by using common resources and constructs defined or imported in the MIM schema of this application module.
This clause defines the information requirements to which implementations shall conform using the EXPRESS language as defined in ISO 10303-11. The following begins the Numeric_expression_arm schema and identifies the necessary external references.
The Numeric_expression module represents a simple expression. It can represent a numeric or boolean expression. EXPRESS specification:
*)
SCHEMA Numeric_expression_arm;
(*
The following EXPRESS interface statements specify the elements imported from the ARMs of other application modules.
EXPRESS specification:
*)
USE FROM
Expression_arm;
--
ISO/TS 10303-1342
USE FROM
Generic_expression_arm;
--
ISO/TS 10303-1341
USE FROM
Numeric_function_arm;
--
ISO/TS 10303-1346
(*
NOTE 1 The schemas referenced above are specified in the following part of ISO 10303:
Expression_arm ISO/TS 10303-1342 Generic_expression_arm ISO/TS 10303-1341 Numeric_function_arm ISO/TS 10303-1346
NOTE 2 See Annex C, Figures C.1, C.2, C.3and C.4 for a graphical representation of this schema.
This subclause specifies the ARM entities for this module. Each ARM application entity is an atomic element that embodies a unique application concept and contains attributes specifying the data elements of the entity. The ARM entities and definitions are specified below.
NOTE The AND operator requires at least two Boolean expressions and evaluates to a Boolean value that is the conjunction of the two operands.
EXPRESS specification:
*)
ENTITY And_expression
SUBTYPE OF (Multiple_arity_boolean_expression);
END_ENTITY;
(*
EXPRESS specification:
*)
ENTITY Binary_boolean_expression
ABSTRACT SUPERTYPE
OF (ONEOF (Xor_expression,
Equals_expression))
SUBTYPE OF (Boolean_expression, Binary_generic_expression);
END_ENTITY;
(*
EXPRESS specification:
*)
ENTITY Binary_numeric_expression
ABSTRACT SUPERTYPE
OF (ONEOF (Minus_expression,
Div_expression,
Mod_expression,
Slash_expression,
Power_expression))
SUBTYPE OF (Numeric_expression, Binary_generic_expression);
SELF\Binary_generic_expression.operands : LIST[2:2] OF Numeric_expression;
END_ENTITY;
(*
Attribute definitions:
operands: a list containing the two parameters of the binary operator.
EXPRESS specification:
*)
ENTITY Boolean_defined_function
ABSTRACT SUPERTYPE
SUBTYPE OF (Defined_function, Boolean_expression);
END_ENTITY;
(*
EXPRESS specification:
*)
ENTITY Boolean_expression
ABSTRACT SUPERTYPE
OF (ONEOF (Simple_boolean_expression,
Unary_boolean_expression,
Binary_boolean_expression,
Multiple_arity_boolean_expression,
Comparison_expression,
Boolean_defined_function,
Interval_expression))
SUBTYPE OF (Expression);
END_ENTITY;
(*
NOTE 1 The EXPRESS Boolean data type has as its domain the set containing the two literals TRUE and FALSE.
EXPRESS specification:
*)
ENTITY Boolean_literal
SUBTYPE OF (Simple_boolean_expression, Generic_literal);
the_value : BOOLEAN;
END_ENTITY;
(*
Attribute definitions:
the_value: a BOOLEAN literal value.
NOTE 2 The EXPRESS Boolean data type has as its domain the set containing the two literals TRUE and FALSE.
EXPRESS specification:
*)
ENTITY Boolean_variable
SUBTYPE OF (Simple_boolean_expression, Variable);
END_ENTITY;
(*
NOTE The Comparison_equal evaluates to TRUE if the two operands evaluate to the same value.
EXPRESS specification:
*)
ENTITY Comparison_equal
SUBTYPE OF (Comparison_expression);
END_ENTITY;
(*
EXPRESS specification:
*)
ENTITY Comparison_expression
ABSTRACT SUPERTYPE
OF (ONEOF (Comparison_equal,
Comparison_greater,
Comparison_greater_equal,
Comparison_less,
Comparison_less_equal,
Comparison_not_equal))
SUBTYPE OF (Boolean_expression, Binary_generic_expression);
SELF\Binary_generic_expression.operands : LIST[2:2] OF Expression;
WHERE
WR1: (
('NUMERIC_EXPRESSION_ARM.NUMERIC_EXPRESSION'
IN TYPEOF(SELF\Binary_generic_expression.operands[1]))
AND
('NUMERIC_EXPRESSION_ARM.NUMERIC_EXPRESSION'
IN TYPEOF(SELF\Binary_generic_expression.operands[2])))
OR
(('NUMERIC_EXPRESSION_ARM.BOOLEAN_EXPRESSION'
IN TYPEOF(SELF\Binary_generic_expression.operands[1]))
AND
('NUMERIC_EXPRESSION_ARM.BOOLEAN_EXPRESSION'
IN TYPEOF(SELF\Binary_generic_expression.operands[2])))
OR
(('EXPRESSION_ARM.STRING_EXPRESSION'
IN TYPEOF(SELF\Binary_generic_expression.operands[1]))
AND
('EXPRESSION_ARM.STRING_EXPRESSION'
IN TYPEOF(SELF\Binary_generic_expression.operands[2])));
END_ENTITY;
(*
Attribute definitions:
operands: a list of Generic_expressions that contains the expressions to be compared.
Formal propositions:
WR1: the operands of the Comparison_expression shall be compatible in type.
NOTE The Comparison_greater evaluates to TRUE if the first operand evaluates to a value greater than the second operand. The relevant orders are:
EXPRESS specification:
*)
ENTITY Comparison_greater
SUBTYPE OF (Comparison_expression);
END_ENTITY;
(*
NOTE The Comparison_greater_equal evaluates to TRUE if the first operand evaluates to a value greater than or equal to the second operand. The relevant orders are:
EXPRESS specification:
*)
ENTITY Comparison_greater_equal
SUBTYPE OF (Comparison_expression);
END_ENTITY;
(*
NOTE The Comparison_less evaluates to TRUE if the first operand evaluates to a value less than the second operand. The relevant orders are:
EXPRESS specification:
*)
ENTITY Comparison_less
SUBTYPE OF (Comparison_expression);
END_ENTITY;
(*
NOTE The Comparison_less_equal evaluates to TRUE if the first operand evaluates to a value less than or equal to the second operand. The relevant orders are:
EXPRESS specification:
*)
ENTITY Comparison_less_equal
SUBTYPE OF (Comparison_expression);
END_ENTITY;
(*
NOTE The Comparison_not_equal evaluates to TRUE if the first operand evaluates to a value different from the second operand. The relevant orders are:
EXPRESS specification:
*)
ENTITY Comparison_not_equal
SUBTYPE OF (Comparison_expression);
END_ENTITY;
(*
EXPRESS specification:
*)
ENTITY Defined_function
ABSTRACT SUPERTYPE
;
END_ENTITY;
(*
NOTE The Div_expression is an expression which evaluates to the integer division of its operands. In the iso13584_expressions_schema, all these operands shall evaluate to a number in the number data type domain. The result is an integer number. If either operand is of data type REAL, it is truncated to an INTEGER before the operation, i.e. any fractional part is lost.
EXPRESS specification:
*)
ENTITY Div_expression
SUBTYPE OF (Binary_numeric_expression);
END_ENTITY;
(*
NOTE The entity instance equality operator accepts two compatible instance values that are Generic_expression and evaluates to a Boolean value. In the context of the iso13584_expressions_schema the two Generic_expressions instance values are compatible either if their data types are the same, or if one data type is a subtype of the other one.
EXPRESS specification:
*)
ENTITY Equals_expression
SUBTYPE OF (Binary_boolean_expression);
END_ENTITY;
(*
EXPRESS specification:
*)
ENTITY Expression
ABSTRACT SUPERTYPE
OF (ONEOF (Numeric_expression,
Boolean_expression))
SUBTYPE OF (Generic_expression);
END_ENTITY;
(*
NOTE An EXPRESS INTEGER literal represents an integer VALUE that is composed of one or more digits.
EXPRESS specification:
*)
ENTITY Int_literal
SUBTYPE OF (Literal_number);
SELF\Literal_number.the_value : INTEGER;
END_ENTITY;
(*
Attribute definitions:
the_value: an INTEGER literal value.
EXPRESS specification:
*)
ENTITY Int_numeric_variable
SUBTYPE OF (Numeric_variable);
END_ENTITY;
(*
NOTE An Interval_expression expression tests whether or not a value falls within a given interval. It evaluates to TRUE if interval_low < = interval_item < = interval_high. The relevant orders are:
EXPRESS specification:
*)
ENTITY Interval_expression
SUBTYPE OF (Boolean_expression, Multiple_arity_generic_expression);
DERIVE
interval_low : Generic_expression := SELF\Multiple_arity_generic_expression.operands[1];
interval_item : Generic_expression := SELF\Multiple_arity_generic_expression.operands[2];
interval_high : Generic_expression := SELF\Multiple_arity_generic_expression.operands[3];
WHERE
WR1: ('NUMERIC_EXPRESSION_ARM.EXPRESSION'
IN TYPEOF(interval_low))
AND ('NUMERIC_EXPRESSION_ARM.EXPRESSION'
IN TYPEOF(interval_item) )
AND ('NUMERIC_EXPRESSION_ARM.EXPRESSION'
IN TYPEOF(interval_high));
WR2: (('EXPRESSION_ARM.STRING_EXPRESSION'
IN TYPEOF (SELF.Interval_low))
AND ('EXPRESSION_ARM.STRING_EXPRESSION'
IN TYPEOF (SELF.Interval_high))
AND ('EXPRESSION_ARM.STRING_EXPRESSION'
IN TYPEOF (SELF.Interval_item)))
OR
(('NUMERIC_EXPRESSION_ARM.NUMERIC_EXPRESSION'
IN TYPEOF(SELF.Interval_low))
AND ('NUMERIC_EXPRESSION_ARM.NUMERIC_EXPRESSION'
IN TYPEOF(SELF.Interval_item))
AND ('NUMERIC_EXPRESSION_ARM.NUMERIC_EXPRESSION'
IN TYPEOF(SELF.Interval_high)));
END_ENTITY;
(*
Attribute definitions:
interval_low: the interval_low operand of the interval expression (see 12.2.4 of ISO 10303-11).
interval_item: the interval_item operand of the interval expression (see 12.2.4 of ISO 10303-11).
interval_high: the interval_high operand of the interval expression (see 12.2.4 of ISO 10303-11).
Formal propositions:
WR1: the data type of the operands shall be Expression.
WR2: the types of the Expression to be compared in the Interval_expression shall evaluate to comparable Expression.
NOTE The EXPRESS NUMBER data type has the numeric values as domain
EXPRESS specification:
*)
ENTITY Literal_number
ABSTRACT SUPERTYPE
OF (ONEOF (Int_literal,
Real_literal))
SUBTYPE OF (Simple_numeric_expression, Generic_literal);
the_value : NUMBER;
END_ENTITY;
(*
Attribute definitions:
the_value: a NUMBER literal value.
NOTE The Minus_expression is an expression which evaluates to the difference of its operands. In the iso13584_expressions_schema, all these operands shall evaluate to a number in the number data type domain.
EXPRESS specification:
*)
ENTITY Minus_expression
SUBTYPE OF (Binary_numeric_expression);
END_ENTITY;
(*
NOTE The Mod_expression is an expression which evaluates to the first argument value modulo operation of the second argument value. Its operands shall evaluate to a number in the number data type domain. The result is an integer number. If either operand is of data type REAL, it is truncated to an INTEGER before the operation, i.e. any fractional part is lost.
EXPRESS specification:
*)
ENTITY Mod_expression
SUBTYPE OF (Binary_numeric_expression);
END_ENTITY;
(*
NOTE The Mult_expression is an expression which evaluates to the difference of its operands. In the iso13584_expressions_schema, all these operands shall evaluate to a number in the number data type domain.
EXPRESS specification:
*)
ENTITY Mult_expression
SUBTYPE OF (Multiple_arity_numeric_expression);
END_ENTITY;
(*
EXPRESS specification:
*)
ENTITY Multiple_arity_boolean_expression
ABSTRACT SUPERTYPE
OF (ONEOF (And_expression,
Or_expression))
SUBTYPE OF (Boolean_expression, Multiple_arity_generic_expression);
SELF\Multiple_arity_generic_expression.operands : LIST[2:?] OF Boolean_expression;
END_ENTITY;
(*
Attribute definitions:
operands: the occurrences of Boolean_expression that represents the parameters of the m-arity operator.
EXPRESS specification:
*)
ENTITY Multiple_arity_function_call
ABSTRACT SUPERTYPE
SUBTYPE OF (Multiple_arity_numeric_expression);
END_ENTITY;
(*
EXPRESS specification:
*)
ENTITY Multiple_arity_numeric_expression
ABSTRACT SUPERTYPE
OF (ONEOF (Plus_expression,
Mult_expression,
Multiple_arity_function_call))
SUBTYPE OF (Numeric_expression, Multiple_arity_generic_expression);
SELF\Multiple_arity_generic_expression.operands : LIST[2:?] OF Numeric_expression;
END_ENTITY;
(*
Attribute definitions:
operands: a list containing the parameters of the multiple arity operator. The length of this list is equal to the arity of the operator.
NOTE The NOT operator requires one Boolean operand and evaluates to a Boolean value.
EXPRESS specification:
*)
ENTITY Not_expression
SUBTYPE OF (Unary_boolean_expression);
SELF\Unary_generic_expression.operand : Boolean_expression;
END_ENTITY;
(*
Attribute definitions:
operand: the Boolean_expression that represents the operand of the 'NOT' operator.
EXPRESS specification:
*)
ENTITY Numeric_expression
ABSTRACT SUPERTYPE
SUBTYPE OF (Expression);
DERIVE
is_int : BOOLEAN := Is_int_expr (SELF);
sql_mappable : BOOLEAN := Is_sql_mappable (SELF);
END_ENTITY;
(*
Attribute definitions:
is_int: a Boolean attribute that indicates if an expression evaluates to integer or not.
sql_mappable: a Boolean attribute that indicates if an expression is mappable to the SQL, defined in ISO/IEC 9075:1992, query language.
EXPRESS specification:
*)
ENTITY Numeric_variable
SUPERTYPE OF (ONEOF (Int_numeric_variable,
Real_numeric_variable))
SUBTYPE OF (Simple_numeric_expression, Variable);
WHERE
WR1: ('EXPRESSION_ARM.INT_NUMERIC_VARIABLE' IN TYPEOF(SELF) ) OR
('EXPRESSION_ARM.REAL_NUMERIC_VARIABLE' IN TYPEOF(SELF) );
END_ENTITY;
(*
Formal propositions:
WR1: A Numeric_variable can only be a real variable or an integer variable.
NOTE The OR operator requires at least two Boolean expressions and evaluates to a Boolean value that is the inclusive disjunction of the two operands.
EXPRESS specification:
*)
ENTITY Or_expression
SUBTYPE OF (Multiple_arity_boolean_expression);
END_ENTITY;
(*
NOTE The Plus_expression is an expression which evaluates to the sum of all its operands. In the iso13584_expressions_schema, all these operands shall evaluate to a number in the number data type domain.
EXPRESS specification:
*)
ENTITY Plus_expression
SUBTYPE OF (Multiple_arity_numeric_expression);
END_ENTITY;
(*
NOTE The Power_expression is an expression which evaluates to the first argument value modulo operation of the second argument value. Its operands shall evaluate to a number in the number data type domain. The result is an integer number. If either operand is of data type REAL, it is truncated to an INTEGER before the operation, i.e. any fractional part is lost.
EXPRESS specification:
*)
ENTITY Power_expression
SUBTYPE OF (Binary_numeric_expression);
END_ENTITY;
(*
NOTE An EXPRESS REAL literal represents a real VALUE that is composed of a mantissa and an optional exponent; the mantissa shall include a decimal point.
EXPRESS specification:
*)
ENTITY Real_literal
SUBTYPE OF (Literal_number);
SELF\Literal_number.the_value : REAL;
END_ENTITY;
(*
Attribute definitions:
the_value: a REAL literal value.
EXPRESS specification:
*)
ENTITY Real_numeric_variable
SUBTYPE OF (Numeric_variable);
END_ENTITY;
(*
EXPRESS specification:
*)
ENTITY Simple_boolean_expression
ABSTRACT SUPERTYPE
OF (ONEOF (Boolean_literal,
Boolean_variable))
SUBTYPE OF (Boolean_expression, Simple_generic_expression);
END_ENTITY;
(*
EXPRESS specification:
*)
ENTITY Simple_numeric_expression
ABSTRACT SUPERTYPE
OF (ONEOF (Literal_number,
Numeric_variable))
SUBTYPE OF (Numeric_expression, Simple_generic_expression);
END_ENTITY;
(*
NOTE The Slash_expression is an expression which evaluates to the first argument value modulo operation of the second argument value. Its operands shall evaluate to a number in the number data type domain. The result is an integer number. If either operand is of data type REAL, it is truncated to an INTEGER before the operation, i.e. any fractional part is lost.
EXPRESS specification:
*)
ENTITY Slash_expression
SUBTYPE OF (Binary_numeric_expression);
END_ENTITY;
(*
EXPRESS specification:
*)
ENTITY Unary_boolean_expression
ABSTRACT SUPERTYPE
SUBTYPE OF (Boolean_expression, Unary_generic_expression);
END_ENTITY;
(*
EXPRESS specification:
*)
ENTITY Unary_numeric_expression
ABSTRACT SUPERTYPE
SUBTYPE OF (Numeric_expression, Unary_generic_expression);
SELF\Unary_generic_expression.operand : Numeric_expression;
END_ENTITY;
(*
Attribute definitions:
operand: a Numeric_expression that represents the parameter of the unary operator.
NOTE The XOR operator requires two Boolean operands and evaluates to a Boolean value that is the exclusive disjunction of the two operands.
EXPRESS specification:
*)
ENTITY Xor_expression
SUBTYPE OF (Binary_boolean_expression);
SELF\Binary_generic_expression.operands : LIST[2:2] OF Boolean_expression;
END_ENTITY;
(*
Attribute definitions:
operands: the two Binary_boolean_expression operands of the XOR operator that shall be Binary_boolean_expression.
This subclause specifies the ARM functions for this module. The ARM functions and definitions are specified below.
EXPRESS specification:
*)
FUNCTION Is_int_expr (arg : Numeric_expression) : BOOLEAN;
LOCAL i: INTEGER; END_LOCAL; IF 'NUMERIC_EXPRESSION_ARM.INT_LITERAL' IN TYPEOF(arg) THEN RETURN (TRUE); END_IF; IF 'NUMERIC_EXPRESSION_ARM.REAL_LITERAL' IN TYPEOF(arg) THEN RETURN (FALSE); END_IF; IF 'NUMERIC_EXPRESSION_ARM.INT_NUMERIC_VARIABLE' IN TYPEOF(arg) THEN RETURN (TRUE); END_IF; IF 'NUMERIC_EXPRESSION_ARM.REAL_NUMERIC_VARIABLE' IN TYPEOF(arg) THEN RETURN (FALSE); END_IF; IF 'ELEMENTARY_FUNCTION_ARM.ABS_FUNCTION' IN TYPEOF(arg) THEN RETURN (Is_int_expr(arg\Unary_numeric_expression.operand)); END_IF; IF 'ELEMENTARY_FUNCTION_ARM.MINUS_FUNCTION' IN TYPEOF(arg) THEN RETURN (Is_int_expr(arg\Unary_numeric_expression.operand)); END_IF; IF ('ELEMENTARY_FUNCTION_ARM.SIN_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.COS_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.TAN_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.ASIN_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.ACOS_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.ATAN_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.EXP_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.LOG_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.LOG2_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.LOG10_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.SQUARE_ROOT_FUNCTION' IN TYPEOF(arg)) THEN RETURN (FALSE); END_IF; IF ('NUMERIC_EXPRESSION_ARM.PLUS_EXPRESSION' IN TYPEOF(arg)) OR ('NUMERIC_EXPRESSION_ARM.MULT_EXPRESSION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.MAXIMUM_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.MINIMUM_FUNCTION' IN TYPEOF(arg)) THEN REPEAT i :=1 TO SIZEOF ( arg\Multiple_arity_numeric_expression.operands); IF NOT Is_int_expr(arg\Multiple_arity_numeric_expression.operands[i]) THEN RETURN (FALSE); END_IF; END_REPEAT; RETURN (TRUE); END_IF; IF ('NUMERIC_EXPRESSION_ARM.MINUS_EXPRESSION' IN TYPEOF(arg)) OR ('NUMERIC_EXPRESSION_ARM.POWER_EXPRESSION' IN TYPEOF(arg)) THEN RETURN (Is_int_expr(arg\Binary_numeric_expression.operands[1]) AND Is_int_expr(arg\Binary_numeric_expression.operands[2])); END_IF; IF ('NUMERIC_EXPRESSION_ARM.DIV_EXPRESSION' IN TYPEOF(arg)) OR ('NUMERIC_EXPRESSION_ARM.MOD_EXPRESSION' IN TYPEOF(arg)) THEN RETURN(TRUE); END_IF; IF 'NUMERIC_EXPRESSION_ARM.SLASH_EXPRESSION' IN TYPEOF(arg) THEN RETURN (FALSE); END_IF; IF 'NUMERIC_FUNCTION_ARM.LENGTH_FUNCTION' IN TYPEOF(arg) THEN RETURN (TRUE); END_IF; IF 'NUMERIC_FUNCTION_ARM.FUNCTION_PARAMETER_VALUE' IN TYPEOF(arg) THEN IF 'NUMERIC_FUNCTION_ARM.INT_VALUE_FUNCTION' IN TYPEOF(arg) THEN RETURN (TRUE); ELSE RETURN (FALSE); END_IF; END_IF; IF 'ELEMENTARY_FUNCTION_ARM.INTEGER_DEFINED_FUNCTION' IN TYPEOF(arg) THEN RETURN(TRUE) ; END_IF; IF'ELEMENTARY_FUNCTION_ARM.REAL_DEFINED_FUNCTION' IN TYPEOF(arg) THEN RETURN(FALSE) ; END_IF ; IF 'NUMERIC_EXPRESSION_ARM.BOOLEAN_DEFINED_FUNCTION' IN TYPEOF(arg) THEN RETURN(FALSE) ; END_IF ; IF 'EXPRESSION_ARM.STRING_DEFINED_FUNCTION' IN TYPEOF(arg) THEN RETURN (FALSE) ; END_IF ; RETURN (FALSE);
END_FUNCTION;
(*
Argument definitions:
arg: it is a Numeric_expression.
EXPRESS specification:
*)
FUNCTION Is_sql_mappable (arg : Expression) : BOOLEAN;
LOCAL i: INTEGER; END_LOCAL; IF 'EXPRESSION_ARM.SIMPLE_NUMERIC_EXPRESSION' IN TYPEOF (arg) THEN RETURN (TRUE); END_IF; IF 'EXPRESSION_ARM.SQL_MAPPABLE_DEFINED_FUNCTION' IN TYPEOF (arg) THEN RETURN (TRUE); END_IF; IF 'EXPRESSION_ARM.MINUS_FUNCTION' IN TYPEOF(arg) THEN RETURN (Is_sql_mappable(arg\Unary_numeric_expression.operand)); END_IF; IF ('ELEMENTARY_FUNCTION_ARM.ABS_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.SIN_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.COS_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.TAN_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.ASIN_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.ACOS_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.ATAN_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.EXP_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.LOG_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.LOG2_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.LOG10_FUNCTION' IN TYPEOF(arg)) OR ('ELEMENTARY_FUNCTION_ARM.SQUARE_ROOT_FUNCTION' IN TYPEOF(arg)) OR ('NUMERIC_FUNCTION_ARM.FUNCTION_PARAMETER_VALUE' IN TYPEOF(arg)) OR ('NUMERIC_FUNCTION_ARM.LENGTH_FUNCTION' IN TYPEOF(arg)) THEN RETURN (FALSE); END_IF; IF ('NUMERIC_EXPRESSION_ARM.PLUS_EXPRESSION' IN TYPEOF(arg)) OR('NUMERIC_EXPRESSION_ARM.MULT_EXPRESSION' IN TYPEOF(arg)) OR('NUMERIC_EXPRESSION_ARM.MAXIMUM_FUNCTION' IN TYPEOF(arg)) OR('NUMERIC_EXPRESSION_ARM.MAXIMUM_FUNCTION' IN TYPEOF(arg)) THEN REPEAT i :=1 TO SIZEOF (arg\Multiple_arity_numeric_expression.operands); IF NOT Is_sql_mappable( arg\Multiple_arity_numeric_expression.operands[i]) THEN RETURN (FALSE); END_IF; END_REPEAT; RETURN (TRUE); END_IF; IF ('EXPRESSION_ARM.MINUS_EXPRESSION' IN TYPEOF(arg)) OR ('EXPRESSION_ARM.SLASH_EXPRESSION' IN TYPEOF(arg)) THEN RETURN (Is_sql_mappable(arg\Binary_numeric_expression.operands[1]) AND Is_sql_mappable(arg\Binary_numeric_expression.operands[2])); END_IF; IF ('NUMERIC_EXPRESSION_ARM.DIV_EXPRESSION' IN TYPEOF(arg)) OR ('NUMERIC_EXPRESSION_ARM.MOD_EXPRESSION' IN TYPEOF(arg)) OR('NUMERIC_EXPRESSION_ARM.POWER_EXPRESSION' IN TYPEOF(arg)) THEN RETURN (FALSE); END_IF; IF 'NUMERIC_EXPRESSION_ARM.SIMPLE_BOOLEAN_EXPRESSION' IN TYPEOF (arg) THEN RETURN (TRUE); END_IF; IF 'NUMERIC_EXPRESSION_ARM.NOT_EXPRESSION' IN TYPEOF (arg) THEN RETURN (Is_sql_mappable (arg\UNARY_GENERIC_EXPRESSION.OPERAND)); END_IF; IF ('NUMERIC_FUNCTION_ARM.ODD_FUNCTION'IN TYPEOF (arg)) OR ('NUMERIC_EXPRESSION_ARM.XOR_EXPRESSION' IN TYPEOF (arg)) THEN RETURN (FALSE); END_IF; IF ('NUMERIC_EXPRESSION_ARM.AND_EXPRESSION' IN TYPEOF (arg)) OR ('NUMERIC_EXPRESSION_ARM.OR_EXPRESSION' IN TYPEOF (arg)) THEN REPEAT i:=1 TO SIZEOF ( arg\MULTIPLE_ARITY_BOOLEAN_EXPRESSION.OPERANDS); IF NOT Is_sql_mappable ( arg\MULTIPLE_ARITY_BOOLEAN_EXPRESSION.OPERANDS[i]) THEN RETURN (FALSE); END_IF; END_REPEAT; RETURN (TRUE); END_IF; IF 'NUMERIC_EXPRESSION_ARM.EQUALS_EXPRESSION' IN TYPEOF (arg) THEN RETURN(Is_sql_mappable ( arg\Binary_generic_expression.OPERANDS [1]) AND Is_sql_mappable( arg\Binary_generic_expression.OPERANDS [2])); END_IF; IF ('NUMERIC_EXPRESSION_ARM.COMPARISON_EQUAL' IN TYPEOF (arg)) OR ('NUMERIC_EXPRESSION_ARM.COMPARISON_GREATER' IN TYPEOF (arg)) OR ('NUMERIC_EXPRESSION_ARM.COMPARISON_GREATER_EQUAL' IN TYPEOF (arg)) OR ('NUMERIC_EXPRESSION_ARM.COMPARISON_LESS' IN TYPEOF (arg)) OR ('NUMERIC_EXPRESSION_ARM.COMPARISON_LESS_EQUAL' IN TYPEOF (arg)) OR ('NUMERIC_EXPRESSION_ARM.COMPARISON_NOT_EQUAL' IN TYPEOF (arg)) OR ('EXPRESSION_ARM.LIKE_EXPRESSION' IN TYPEOF (arg)) THEN RETURN (Is_sql_mappable (arg\COMPARISON_EXPRESSION.OPERANDS[1]) AND Is_sql_mappable (arg\COMPARISON_EXPRESSION.OPERANDS[2])); END_IF; IF 'EXPRESSION_ARM.INTERVAL_EXPRESSION' IN TYPEOF(arg) THEN RETURN (Is_sql_mappable(arg\Interval_expression.interval_low) AND Is_sql_mappable(arg\Interval_expression.interval_high) AND Is_sql_mappable(arg\Interval_expression.interval_item)); END_IF; IF ('NUMERIC_FUNCTION_ARM.NUMERIC_DEFINED_FUNCTION' IN TYPEOF(arg)) OR ('NUMERIC_EXPRESSION_ARM.BOOLEAN_DEFINED_FUNCTION' IN TYPEOF(arg)) OR ('EXPRESSION_ARM.STRING_DEFINED_FUNCTION' IN TYPEOF(arg)) THEN RETURN (FALSE) ; END_IF; IF 'EXPRESSION_ARM.SIMPLE_STRING_EXPRESSION' IN TYPEOF(ARG) THEN RETURN (TRUE); END_IF; IF ('EXPRESSION_ARM.INDEX_EXPRESSION' IN TYPEOF(arg)) OR ('EXPRESSION_ARM.SUBSTRING_EXPRESSION' IN TYPEOF(arg)) OR ('EXPRESSION_ARM.CONCAT_EXPRESSION' IN TYPEOF(arg)) OR ('EXPRESSION_ARM.FORMAT_FUNCTION' IN TYPEOF(arg)) THEN RETURN (FALSE); END_IF; RETURN (FALSE);
END_FUNCTION;
(*
Argument definitions:
arg: an Expression.
*)
END_SCHEMA; -- Numeric_expression_arm
(*
© ISO 2018 — All rights reserved