Application module: Expression | ISO/TS 10303-1342:2014-02(E) © ISO |
This clause specifies the information requirements for the 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 Expression_arm schema and identifies the necessary external references.
The Expression module represents expression itself. It can represent a numeric, boolean and a string expression. EXPRESS specification:
*)
SCHEMA Expression_arm;
(*
The following EXPRESS interface statements specify the elements imported from the ARMs of other application modules.
EXPRESS specification:
*)
USE FROM
Generic_expression_arm;
--
ISO/TS 10303-1341
USE FROM
Numeric_expression_arm;
--
ISO/TS 10303-1526
REFERENCE FROM
Numeric_expression_arm
--
ISO/TS 10303-1526
(Is_int_expr);
(*
NOTE 1 The schemas referenced above are specified in the following part of ISO 10303:
Generic_expression_arm ISO/TS 10303-1341 Numeric_expression_arm ISO/TS 10303-1526 Numeric_expression_arm ISO/TS 10303-1526
NOTE 2 See Annex C, Figures C.1and C.2 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 Concat_expression operator accepts at least two String_expression as operands and evaluates to a string value resulting from the concatenation of all the elements of the operands list. These elements are concatenated in the list order.
EXPRESS specification:
*)
ENTITY Concat_expression
SUBTYPE OF (String_expression, Multiple_arity_generic_expression);
SELF\Multiple_arity_generic_expression.operands : LIST[2:?] OF String_expression;
END_ENTITY;
(*
Attribute definitions:
operands: the String_expression to be concatenated.
EXPRESS specification:
*)
ENTITY Format_function
SUBTYPE OF (String_expression, Binary_generic_expression);
DERIVE
value_to_format : Generic_expression := SELF\Binary_generic_expression.operands[1];
format_string : Generic_expression := SELF\Binary_generic_expression.operands[2];
WHERE
WR1: (('EXPRESSION_ARM.NUMERIC_EXPRESSION')
IN TYPEOF(value_to_format))
AND (('EXPRESSION_ARM.STRING_EXPRESSION')
IN TYPEOF(format_string));
END_ENTITY;
(*
Attribute definitions:
value_to_format: the Numeric_expression to be formatted.
format_string: the formatting commands that defines the appearance of the result.
Formal propositions:
WR1: the value_to_format shall be a Numeric_expression and the format_string shall be a String_expression.
NOTE The Index_expression string operator takes two operands, the string value (represented by the operand attribute) being indexed by the index specification (represented by the index attribute). The resulting string value is the character at position the value of the index operator.
EXPRESS specification:
*)
ENTITY Index_expression
SUBTYPE OF (String_expression, Binary_generic_expression);
DERIVE
operand : Generic_expression := SELF\Binary_generic_expression.operands[1];
index : Generic_expression := SELF\Binary_generic_expression.operands[2];
WHERE
WR1: ('EXPRESSION_ARM.STRING_EXPRESSION' IN TYPEOF(operand))
AND ('NUMERIC_EXPRESSION_ARM.NUMERIC_EXPRESSION' IN TYPEOF(index));
WR2: Is_int_expr (index);
END_ENTITY;
(*
Attribute definitions:
operand: the String_expression that represents the STRING.
index: the integer Numeric_expression that indicates the index value.
Formal propositions:
WR1: the first operand shall be a String_expression and the second operand shall be a Numeric_expression.
WR2: the position described by the index operand shall be an integer value.
EXPRESS specification:
*)
ENTITY Like_expression
SUBTYPE OF (Comparison_expression);
WHERE
WR1: ('EXPRESSION_ARM.STRING_EXPRESSION'
IN TYPEOF(SELF\Comparison_expression.operands[1])) AND
('EXPRESSION_ARM.STRING_EXPRESSION'
IN TYPEOF(SELF\Comparison_expression.operands[2]));
END_ENTITY;
(*
Formal propositions:
WR1: the operand list shall contain two Generic_expressions instances that are String_expression.
EXPRESS specification:
*)
ENTITY Simple_string_expression
ABSTRACT SUPERTYPE
OF (ONEOF (String_literal,
String_variable))
SUBTYPE OF (String_expression, Simple_generic_expression);
END_ENTITY;
(*
EXPRESS specification:
*)
ENTITY Sql_mappable_defined_function
ABSTRACT SUPERTYPE
SUBTYPE OF (Defined_function);
END_ENTITY;
(*
EXPRESS specification:
*)
ENTITY String_defined_function
ABSTRACT SUPERTYPE
SUBTYPE OF (Defined_function, String_expression);
END_ENTITY;
(*
EXPRESS specification:
*)
ENTITY String_expression
ABSTRACT SUPERTYPE
OF (ONEOF (Simple_string_expression,
Index_expression,
Substring_expression,
Concat_expression,
Format_function,
String_defined_function))
SUBTYPE OF (Expression);
END_ENTITY;
(*
NOTE The EXPRESS STRING data type has as its domain sequences of characters.
EXPRESS specification:
*)
ENTITY String_literal
SUBTYPE OF (Simple_string_expression, Generic_literal);
the_value : STRING;
END_ENTITY;
(*
Attribute definitions:
the_value: a STRING literal value.
EXPRESS specification:
*)
ENTITY String_variable
SUBTYPE OF (Simple_string_expression, Variable);
END_ENTITY;
(*
NOTE The Substring_expression string operator takes three operands, the string value (represented by the operand attribute) being indexed by the index specification (represented by the index1 and index2 attributes). The Substring_expression evaluates to a string value of length (index2 - index1 + 1). The resulting string value is equivalent to the sequence of characters at position index1through index2.
EXPRESS specification:
*)
ENTITY Substring_expression
SUBTYPE OF (String_expression, Multiple_arity_generic_expression);
DERIVE
operand : Generic_expression := SELF\Multiple_arity_generic_expression.operands[1];
index1 : Generic_expression := SELF\Multiple_arity_generic_expression.operands[2];
index2 : Generic_expression := SELF\Multiple_arity_generic_expression.operands[3];
WHERE
WR1: ('EXPRESSION_ARM.STRING_EXPRESSION'
IN TYPEOF(operand))
AND ('EXPRESSION_ARM.NUMERIC_EXPRESSION'
IN TYPEOF(index1))
AND ('EXPRESSION_ARM.NUMERIC_EXPRESSION'
IN TYPEOF(index2));
WR2: SIZEOF(SELF\Multiple_arity_generic_expression.operands)=3;
WR3: Is_int_expr (index1);
WR4: Is_int_expr (index2);
END_ENTITY;
(*
Attribute definitions:
operand: the String_expression from which a substring is extracted.
index1: the Numeric_expression that indicates the low bound of the substring in operand.
index2: the Numeric_expression that indicates the high bound of the substring in operand.
Formal propositions:
WR1: operand shall be a String_expression, index1 and index2 shall be a Numeric_expression.
WR2: the Substring_expression operands LIST shall contain three elements.
WR3: the index1 shall evaluate to an INTEGER value.
WR4: the index2 shall evaluate to an INTEGER value.
*)
END_SCHEMA; -- Expression_arm
(*
© ISO 2014 — All rights reserved