ГОСТ Р ИСО 10303-46-2002
5.6.3 Ф у н к ц и я f i e l d_i n j a b l e
Функция field_in_table проверяет примитив table_record_field_representation объекта annotation,.
table_occerrence: она возвращает значение TRUE, если поле, заданное в них, входит в таблицу, и
значение FALSE — в противном случае.
Изначально функция находит примитив table_representation. отображающий объект annotation_
table_occerrcnce. Затем все примитивы table_record_representation, связанные с объектом table_
representation_entity посредством примитива symbol_representation_relationship. или включенные в
примитив table_representation через объект niapped_item. Функция возвращает значение FALSE при
отсутствии примитивов tabie_record_representation. связанных с заданным полем посредством при
митива symbol_representat»on_relationship или входящих в ото поле через объект niappedjtem. и
значение TRUE - в противном случае.
EXPRESS-спешкЬикаиия
•>
FUNCTION field_in_table (field : table_record,field_representation;
table : annotation table occurrence) : BOOLEAN;
LOCAL
table„rep
: tablejreptesentation;
symboI_rep_rel_set
mapped Jtemjset
: SET OF symbol_representation_relationship;
: SET OF mapped ,item;
iable_record_rep_set: SET OF table_record_representation := ||;
END_LOCAL;
table_rep: table\styled_item.item\mapped_iteni.mapping_sourse.
mapped representation;
mappedJteni_set: = QUERY (item <* table_rep.items |
(’REPRESENTATION SCHEMA.MAPPED ITEM’ IN
TYPEOF (item))
AND
(’RESENTATION,.DEFINITION SCHEMA.’+
TABLE_RECORD_REPRESENTATION’ IN
TYPEOF (ite m\mapped_item.mappi ng_source.
mapped_represe ntation))
);
REPEAT i: = 1 TO HI INDEX (mapped_item_set);
table_record_rep_set: = table_record _rcp_set +
mappedJtem set|i|.mapping_source.mapped representation;
END_REPEAT;
symbol rep_rel set: = bag_to_set (USEDIN(table rep,
■REPRESENTATION_SCHEMA.’+’
•REPRESENTATION RELATIONSHIP.REP 1*));
REPEAT i :=1 TO HIINDEX (symbol_rep_rel_set);
table., record.. rep_set ; = table.,record_rep_set +
symbol rcp,rel_set|i|\representation_relationship.rcp_2;
ENDUREPEAT;
IF SIZEOF(QUERY(table,record_rcp <• table_record_rep set |
(SIZEOF(QUERY(rep_rel <♦ USEDIN(table_record,rep,
’REPRESENTATION SCHEMA/+
’REPRESENTATION RELATIONSHIP.REP_l’) |
’(PRESENTATION DEFINITION SCHEMA.+
’SYMBOL_REPRESENTATION_ RELATIONSHIP" IN
TYPEOF (rep_rel))
AND
(rep_rel.rep 2 ;=: field)
)) > 0)
OR
52