From 8ec8e778a6d050118f442319bd99efba507a316b Mon Sep 17 00:00:00 2001 From: Mark Pictor Date: Fri, 22 Nov 2013 17:37:17 -0500 Subject: [PATCH] test files not committed --- src/exppp/test/1.exp | 47 + ...ly_structure_non_pretty_printed_mim_lf.exp | 1898 +++++++++++++++++ src/express/test/libexpress_prob_func.exp | 15 + src/test/list_attributes/list_attributes.cc | 42 + .../si_energy_unit_snippet.exp | 274 +++ .../uninitialized_edge_list.exp | 41 + 6 files changed, 2317 insertions(+) create mode 100644 src/exppp/test/1.exp create mode 100644 src/exppp/test/assembly_structure_non_pretty_printed_mim_lf.exp create mode 100644 src/express/test/libexpress_prob_func.exp create mode 100644 src/test/list_attributes/list_attributes.cc create mode 100644 test/unitary_schemas/si_energy_unit_snippet.exp create mode 100644 test/unitary_schemas/uninitialized_edge_list.exp diff --git a/src/exppp/test/1.exp b/src/exppp/test/1.exp new file mode 100644 index 00000000..7252693c --- /dev/null +++ b/src/exppp/test/1.exp @@ -0,0 +1,47 @@ +(* [ ... , ... ] and [ ... : ... ] in this schema are not changed by exppp *) +SCHEMA exppp_comma_colon_unchanged; + + ENTITY A; + name : STRING; -- should remain colon + END_ENTITY; + + ENTITY B + SUBTYPE OF (A); + WHERE + WR1: SELF.name IN ['prefix', 'suffix']; -- should remain comma + END_ENTITY; + + ENTITY C; + arr_real : ARRAY[1:3] OF REAL; -- should remain colon + DERIVE + id : REAL := 1.2345678901234567890E20; -- check precision after pretty print + END_ENTITY; + + FUNCTION exppp_colon_and_comma( + lis: LIST [0:?] OF GENERIC:t -- should remain colon + ): ARRAY [1:5] OF GENERIC:t; -- should remain colon + + LOCAL + re : ARRAY [1:5] OF GENERIC:t; -- should remain colon + res : ARRAY [1:5] OF GENERIC:t; -- should remain colon + END_LOCAL; + re := [lis[1],5]; --should remain a comma + res := [lis[1]:5]; --should remain a colon + RETURN(res); + + END_FUNCTION; -- exppp_colon_and_comma + + ENTITY long_lines; + name : STRING; + WHERE + WR1: SIZEOF (USEDIN (SELF, 'AP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAGING_DESIGN_MIM_LF.' + + 'ID_ATTRIBUTE.IDENTIFIED_ITEM')) + <= 1; + WR2: SIZEOF (USEDIN (SELF, 'AP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAGING_DESIGN_MIM_LF.DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1; + WR3: SIZEOF ([ USEDIN (SELF, 'AP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAGING_DESIGN_MIM_LF.MANIFOLD_SOLID_BREP'), USEDIN (SELF, 'AP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAGING_DESIGN_MIM_LF.MAPPED_ITEM') ] ) = 1; + WR4: SIZEOF (USEDIN (SELF, 'AP210_ELECTRONIC_ASSEMBLY_INTERCONNECT_AND_PACKAGING_DESIGN_MIM_LF.' + + 'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1; + END_ENTITY; + + +END_SCHEMA; diff --git a/src/exppp/test/assembly_structure_non_pretty_printed_mim_lf.exp b/src/exppp/test/assembly_structure_non_pretty_printed_mim_lf.exp new file mode 100644 index 00000000..5f9fd5bf --- /dev/null +++ b/src/exppp/test/assembly_structure_non_pretty_printed_mim_lf.exp @@ -0,0 +1,1898 @@ + +(* ===================================================================================== *) +(* Long form schema generated by The EXPRESS Data Manager compiler version 9.8.3B 20121030*) +(* Fri Sep 20 15:27:35 2013 *) +(* The schema is converted from ISO10303 P11-2003 to ISO10303 P11-1994 *) +(* ===================================================================================== *) + +SCHEMA Assembly_structure_mim_LF; + + +(* +USE FROM Product_view_definition_mim; + +USE FROM Product_view_definition_reference_mim; + +USE FROM Value_with_unit_mim; + +USE FROM product_structure_schema + (assembly_component_usage, + next_assembly_usage_occurrence, + promissory_usage_occurrence, + quantified_assembly_component_usage, + specified_higher_usage_occurrence, + multi_level_reference_designator); +*) +(* USED FROM (measure_schema); *) + TYPE non_negative_length_measure = length_measure; + WHERE + WR1: SELF >= 0.0; + END_TYPE; +(* USED FROM (basic_attribute_schema); *) +(* This SELECT set has been been expanded or truncated for EXPRESS E1 layout. *) +TYPE name_attribute_select = SELECT ( + derived_unit, + product_definition); +END_TYPE; + +(* USED FROM (External_item_identification_assignment_mim); *) +(* This SELECT set has been been expanded or truncated for EXPRESS E1 layout. *) +TYPE external_identification_item = SELECT ( + generic_product_definition_reference); +END_TYPE; + +(* USED FROM (support_resource_schema); *) + TYPE identifier = STRING; + END_TYPE; + +(* Pruned unused type: s_name_attribute_select *) + +(* USED FROM (measure_schema); *) + TYPE absorbed_dose_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) +TYPE acceleration_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE radioactivity_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) +TYPE amount_of_substance_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE area_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE celsius_temperature_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE context_dependent_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE count_measure = NUMBER; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE descriptive_measure = STRING; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE capacitance_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE dose_equivalent_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE electric_charge_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE electric_current_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE conductance_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE electric_potential_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE energy_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE force_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE frequency_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE magnetic_flux_density_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE illuminance_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE inductance_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE length_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE luminous_intensity_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE luminous_flux_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE mass_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE measure_value = SELECT + (absorbed_dose_measure, + dose_equivalent_measure, + radioactivity_measure, + acceleration_measure, + amount_of_substance_measure, + area_measure, + celsius_temperature_measure, + context_dependent_measure, + count_measure, + descriptive_measure, + capacitance_measure, + electric_charge_measure, + conductance_measure, + electric_current_measure, + electric_potential_measure, + energy_measure, + magnetic_flux_density_measure, + force_measure, + frequency_measure, + illuminance_measure, + inductance_measure, + length_measure, + luminous_flux_measure, + luminous_intensity_measure, + magnetic_flux_measure, + mass_measure, + numeric_measure, + non_negative_length_measure, + parameter_value, + plane_angle_measure, + positive_length_measure, + positive_plane_angle_measure, + positive_ratio_measure, + power_measure, + pressure_measure, + ratio_measure, + resistance_measure, + solid_angle_measure, + thermodynamic_temperature_measure, + time_measure, + velocity_measure, + volume_measure); + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE magnetic_flux_measure = REAL; + END_TYPE; + +(* Pruned unused type: pie_external_identification_item *) + +(* USED FROM (measure_schema); *) + TYPE numeric_measure = NUMBER; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE parameter_value = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE plane_angle_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE positive_length_measure = non_negative_length_measure; + WHERE + WR1: SELF > 0.0; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE positive_plane_angle_measure = plane_angle_measure; + WHERE + WR1: SELF > 0.0; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE positive_ratio_measure = ratio_measure; + WHERE + WR1: SELF > 0.0; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE power_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE pressure_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE ratio_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE resistance_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE si_prefix = ENUMERATION OF (exa, peta, tera, giga, mega, kilo, hecto, deca, deci, centi, milli, micro, nano, pico, femto, atto); + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE si_unit_name = ENUMERATION OF (metre, gram, second, ampere, kelvin, mole, candela, radian, steradian, hertz, newton, pascal, joule, watt, coulomb, volt, farad, ohm, siemens, weber, tesla, henry, degree_Celsius, lumen, lux, becquerel, gray, sievert); + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE solid_angle_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE thermodynamic_temperature_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE time_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE unit = SELECT (derived_unit, named_unit); + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE velocity_measure = REAL; + END_TYPE; +(* USED FROM (measure_schema); *) + TYPE volume_measure = REAL; + END_TYPE; +(* USED FROM (support_resource_schema); *) + TYPE label = STRING; + END_TYPE; +(* USED FROM (support_resource_schema); *) + TYPE text = STRING; + END_TYPE; + +(* Implicit interfaced from: product_definition_schema *) + TYPE product_definition_or_reference = SELECT ( + product_definition, + generic_product_definition_reference); + END_TYPE; + +(* Implicit interfaced from: basic_attribute_schema *) +(* This SELECT set has been been expanded or truncated for EXPRESS E1 layout. *) +TYPE description_attribute_select = SELECT ( + application_context, + external_source, + representation); +END_TYPE; + + +(* Implicit interfaced from: basic_attribute_schema *) +(* This SELECT set has been been expanded or truncated for EXPRESS E1 layout. *) +TYPE id_attribute_select = SELECT ( + application_context, + representation); +END_TYPE; + + +(* Implicit interfaced from: external_reference_schema *) +(* This SELECT set has been pruned. *) +TYPE source_item = SELECT ( + identifier); +END_TYPE; + + +(* Implicit interfaced from: representation_schema *) +(* This SELECT set has been pruned. *) +TYPE founded_item_select = SELECT ( + representation_item); +END_TYPE; + + +(* Pruned unused type: pds_name_attribute_select *) + + +(* Pruned unused type: ers_description_attribute_select *) + + +(* Pruned unused type: acs_description_attribute_select *) + + +(* Pruned unused type: acs_id_attribute_select *) + + +(* Pruned unused type: rs_description_attribute_select *) + + +(* Pruned unused type: rs_id_attribute_select *) + +(* USED FROM (measure_schema); *) + ENTITY si_force_unit + SUBTYPE OF (force_unit,si_unit); + WHERE + WR1: SELF\si_unit.name = si_unit_name.newton; + WR2: NOT EXISTS(SELF\derived_unit.name); + END_ENTITY; +(* USED FROM (product_structure_schema); *) +ENTITY next_assembly_usage_occurrence + SUBTYPE OF (assembly_component_usage); +UNIQUE + UR1 : SELF\assembly_component_usage.reference_designator, SELF\product_definition_relationship.relating_product_definition; +END_ENTITY; +(* USED FROM (product_structure_schema); *) +ENTITY promissory_usage_occurrence + SUBTYPE OF (assembly_component_usage); +END_ENTITY; +(* USED FROM (product_structure_schema); *) +ENTITY quantified_assembly_component_usage + SUBTYPE OF (assembly_component_usage); + quantity : measure_with_unit; +WHERE + WR1: (NOT ('NUMBER' IN TYPEOF(quantity.value_component))) + OR (quantity.value_component > 0); +END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY frequency_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.FREQUENCY_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY frequency_unit + SUBTYPE OF(derived_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.hertz); + END_ENTITY; +(* USED FROM (application_context_schema); *) + ENTITY product_definition_context + SUBTYPE OF (application_context_element); + life_cycle_stage : label; + END_ENTITY; +(* USED FROM (basic_attribute_schema); *) + ENTITY name_attribute; + attribute_value : label; + named_item : name_attribute_select; + END_ENTITY; +(* USED FROM (product_definition_schema); *) + ENTITY product_definition; + id : identifier; + description : OPTIONAL text; + formation : product_definition_formation; + frame_of_reference : product_definition_context; + DERIVE + name : label := get_name_value(SELF); + WHERE + WR1: SIZEOF(USEDIN(SELF, 'ASSEMBLY_STRUCTURE_MIM_LF.' + 'NAME_ATTRIBUTE.NAMED_ITEM')) <= 1; + END_ENTITY; +(* USED FROM (product_definition_schema); *) + ENTITY product_definition_context_association; + definition : product_definition; + frame_of_reference : product_definition_context; + role : product_definition_context_role; + END_ENTITY; +(* USED FROM (product_definition_schema); *) + ENTITY product; + id : identifier; + name : label; + description : OPTIONAL text; + frame_of_reference : SET [1:?] OF product_context; + END_ENTITY; +(* USED FROM (product_definition_schema); *) + ENTITY product_definition_formation; + id : identifier; + description : OPTIONAL text; + of_product : product; + UNIQUE + UR1: id, of_product; + END_ENTITY; +(* USED FROM (External_item_identification_assignment_mim); *) +ENTITY applied_external_identification_assignment +SUBTYPE OF (external_identification_assignment); + items : SET [1 : ?] OF external_identification_item; +END_ENTITY; +(* USED FROM (management_resources_schema); *) + ENTITY external_identification_assignment + ABSTRACT SUPERTYPE + SUBTYPE OF (identification_assignment); + source : external_source; + END_ENTITY; +(* USED FROM (external_reference_schema); *) + ENTITY externally_defined_item; + item_id : source_item; + source : external_source; + END_ENTITY; +(* USED FROM (external_reference_schema); *) + ENTITY external_source; + source_id : source_item; + DERIVE + description : text := get_description_value(SELF); + WHERE + WR1: SIZEOF(USEDIN(SELF, 'ASSEMBLY_STRUCTURE_MIM_LF.' + 'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1; + END_ENTITY; +(* USED FROM (product_definition_schema); *) + ENTITY generic_product_definition_reference + ABSTRACT SUPERTYPE OF (ONEOF ( + PRODUCT_DEFINITION_REFERENCE, + PRODUCT_DEFINITION_REFERENCE_WITH_LOCAL_REPRESENTATION)); + source : external_source; + END_ENTITY; +(* USED FROM (product_definition_schema); *) + ENTITY product_definition_reference + SUBTYPE OF (generic_product_definition_reference); + product_id : identifier; + product_definition_formation_id : identifier; + product_definition_id : identifier; + id_owning_organization_name : OPTIONAL label; + END_ENTITY; +(* USED FROM (product_definition_schema); *) + ENTITY product_definition_reference_with_local_representation + SUBTYPE OF (generic_product_definition_reference, product_definition); + END_ENTITY; +(* USED FROM (measure_schema); *) +ENTITY absorbed_dose_measure_with_unit + SUBTYPE OF (measure_with_unit); +WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.ABSORBED_DOSE_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); +END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY inductance_unit + SUBTYPE OF(derived_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.henry); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY si_absorbed_dose_unit + SUBTYPE OF (absorbed_dose_unit,si_unit); + WHERE + WR1: SELF\si_unit.name = si_unit_name.gray; + WR2: NOT EXISTS(SELF\derived_unit.name); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY acceleration_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.ACCELERATION_UNIT' IN TYPEOF (SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY acceleration_unit + SUBTYPE OF (derived_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = + dimensional_exponents ( 1.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0 ); + END_ENTITY; +(* USED FROM (measure_schema); *) +ENTITY radioactivity_measure_with_unit + SUBTYPE OF (measure_with_unit); +WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.RADIOACTIVITY_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); +END_ENTITY; +(* USED FROM (measure_schema); *) +ENTITY radioactivity_unit + SUBTYPE OF (derived_unit); +WHERE + WR1: derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.becquerel); +END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY si_radioactivity_unit + SUBTYPE OF (radioactivity_unit,si_unit); + WHERE + WR1: SELF\si_unit.name = si_unit_name.becquerel; + WR2: NOT EXISTS(SELF\derived_unit.name); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY amount_of_substance_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.AMOUNT_OF_SUBSTANCE_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY amount_of_substance_unit + SUBTYPE OF (named_unit); + WHERE + WR1: (SELF\named_unit.dimensions.length_exponent = 0.0) AND (SELF\named_unit.dimensions.mass_exponent = 0.0) AND (SELF\named_unit.dimensions.time_exponent = 0.0) AND (SELF\named_unit.dimensions.electric_current_exponent = 0.0) AND (SELF\named_unit.dimensions.thermodynamic_temperature_exponent = 0.0) AND (SELF\named_unit.dimensions.amount_of_substance_exponent = 1.0) AND (SELF\named_unit.dimensions.luminous_intensity_exponent = 0.0); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY area_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.AREA_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY area_unit + SUBTYPE OF (derived_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = + dimensional_exponents ( 2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY celsius_temperature_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.THERMODYNAMIC_TEMPERATURE_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY context_dependent_unit + SUBTYPE OF (named_unit); + name : label; + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY conversion_based_unit + SUBTYPE OF (named_unit); + name : label; + conversion_factor : measure_with_unit; + WHERE + WR1: SELF\named_unit.dimensions = derive_dimensional_exponents(conversion_factor\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY derived_unit + SUPERTYPE OF (ONEOF ( + ABSORBED_DOSE_UNIT, + ACCELERATION_UNIT, + RADIOACTIVITY_UNIT, + AREA_UNIT, + CAPACITANCE_UNIT, + DOSE_EQUIVALENT_UNIT, + ELECTRIC_CHARGE_UNIT, + CONDUCTANCE_UNIT, + ELECTRIC_POTENTIAL_UNIT, + ENERGY_UNIT, + MAGNETIC_FLUX_DENSITY_UNIT, + FORCE_UNIT, + FREQUENCY_UNIT, + ILLUMINANCE_UNIT, + INDUCTANCE_UNIT, + MAGNETIC_FLUX_UNIT, + POWER_UNIT, + PRESSURE_UNIT, + RESISTANCE_UNIT, + VELOCITY_UNIT, + VOLUME_UNIT)); + elements : SET [1:?] OF derived_unit_element; + DERIVE + name : label := get_name_value(SELF); + WHERE + WR1: (SIZEOF(elements) > 1) OR ((SIZEOF(elements) = 1) AND (elements[1].exponent <> 1.0)); + WR2: SIZEOF(USEDIN(SELF, 'ASSEMBLY_STRUCTURE_MIM_LF.' + 'NAME_ATTRIBUTE.NAMED_ITEM')) <= 1; + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY derived_unit_element; + unit : named_unit; + exponent : REAL; + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY dimensional_exponents; + length_exponent : REAL; + mass_exponent : REAL; + time_exponent : REAL; + electric_current_exponent : REAL; + thermodynamic_temperature_exponent : REAL; + amount_of_substance_exponent : REAL; + luminous_intensity_exponent : REAL; + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY capacitance_unit + SUBTYPE OF(derived_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.farad); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY capacitance_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.CAPACITANCE_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY si_capacitance_unit + SUBTYPE OF (capacitance_unit,si_unit); + WHERE + WR1: SELF\si_unit.name = si_unit_name.farad; + WR2: NOT EXISTS(SELF\derived_unit.name); + END_ENTITY; +(* USED FROM (measure_schema); *) +ENTITY dose_equivalent_measure_with_unit + SUBTYPE OF (measure_with_unit); +WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.DOSE_EQUIVALENT_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); +END_ENTITY; +(* USED FROM (measure_schema); *) +ENTITY dose_equivalent_unit + SUBTYPE OF (derived_unit); +WHERE + WR1: derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.sievert); +END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY si_dose_equivalent_unit + SUBTYPE OF (dose_equivalent_unit,si_unit); + WHERE + WR1: SELF\si_unit.name = si_unit_name.sievert; + WR2: NOT EXISTS(SELF\derived_unit.name); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY electric_charge_unit + SUBTYPE OF(derived_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.coulomb); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY electric_charge_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.ELECTRIC_CHARGE_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY si_electric_charge_unit + SUBTYPE OF (electric_charge_unit,si_unit); + WHERE + WR1: SELF\si_unit.name = si_unit_name.coulomb; + WR2: NOT EXISTS(SELF\derived_unit.name); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY electric_current_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.ELECTRIC_CURRENT_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY electric_current_unit + SUBTYPE OF (named_unit); + WHERE + WR1: (SELF\named_unit.dimensions.length_exponent = 0.0) AND (SELF\named_unit.dimensions.mass_exponent = 0.0) AND (SELF\named_unit.dimensions.time_exponent = 0.0) AND (SELF\named_unit.dimensions.electric_current_exponent = 1.0) AND (SELF\named_unit.dimensions.thermodynamic_temperature_exponent = 0.0) AND (SELF\named_unit.dimensions.amount_of_substance_exponent = 0.0) AND (SELF\named_unit.dimensions.luminous_intensity_exponent = 0.0); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY conductance_unit + SUBTYPE OF(derived_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.siemens); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY conductance_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.CONDUCTANCE_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY si_conductance_unit + SUBTYPE OF (conductance_unit,si_unit); + WHERE + WR1: SELF\si_unit.name = si_unit_name.siemens; + WR2: NOT EXISTS(SELF\derived_unit.name); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY electric_potential_unit + SUBTYPE OF(derived_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.volt); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY electric_potential_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.ELECTRIC_POTENTIAL_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY si_electric_potential_unit + SUBTYPE OF (electric_potential_unit,si_unit); + WHERE + WR1: SELF\si_unit.name = si_unit_name.volt; + WR2: NOT EXISTS(SELF\derived_unit.name); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY energy_unit + SUBTYPE OF(derived_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.joule); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY energy_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.ENERGY_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY si_energy_unit + SUBTYPE OF (energy_unit,si_unit); + WHERE + WR1: SELF\si_unit.name = si_unit_name.joule; + WR2: NOT EXISTS(SELF\derived_unit.name); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY magnetic_flux_density_unit + SUBTYPE OF(derived_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.tesla); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY magnetic_flux_density_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.MAGNETIC_FLUX_DENSITY_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY si_magnetic_flux_density_unit + SUBTYPE OF (magnetic_flux_density_unit,si_unit); + WHERE + WR1: SELF\si_unit.name = si_unit_name.tesla; + WR2: NOT EXISTS(SELF\derived_unit.name); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY force_unit + SUBTYPE OF(derived_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.newton); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY force_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.FORCE_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY pressure_unit + SUBTYPE OF(derived_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.pascal); + END_ENTITY; +(* REFERENCE FROM (representation_schema); *) + ENTITY representation_context; + context_identifier : identifier; + context_type : text; + INVERSE + representations_in_context : SET [1:?] OF representation FOR context_of_items; + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY pressure_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.PRESSURE_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY si_frequency_unit + SUBTYPE OF (frequency_unit,si_unit); + WHERE + WR1: SELF\si_unit.name = si_unit_name.hertz; + WR2: NOT EXISTS(SELF\derived_unit.name); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY global_unit_assigned_context + SUBTYPE OF (representation_context); + units : SET [1:?] OF unit; + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY illuminance_unit + SUBTYPE OF(derived_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.lux); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY illuminance_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.ILLUMINANCE_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY si_illuminance_unit + SUBTYPE OF (illuminance_unit,si_unit); + WHERE + WR1: SELF\si_unit.name = si_unit_name.lux; + WR2: NOT EXISTS(SELF\derived_unit.name); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY ratio_unit + SUBTYPE OF (named_unit); + WHERE + WR1: (SELF\named_unit.dimensions.length_exponent = 0.0) AND (SELF\named_unit.dimensions.mass_exponent = 0.0) AND (SELF\named_unit.dimensions.time_exponent = 0.0) AND (SELF\named_unit.dimensions.electric_current_exponent = 0.0) AND (SELF\named_unit.dimensions.thermodynamic_temperature_exponent = 0.0) AND (SELF\named_unit.dimensions.amount_of_substance_exponent = 0.0) AND (SELF\named_unit.dimensions.luminous_intensity_exponent = 0.0); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY inductance_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.INDUCTANCE_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY si_inductance_unit + SUBTYPE OF (inductance_unit,si_unit); + WHERE + WR1: SELF\si_unit.name = si_unit_name.henry; + WR2: NOT EXISTS(SELF\derived_unit.name); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY length_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.LENGTH_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY length_unit + SUBTYPE OF (named_unit); + WHERE + WR1: (SELF\named_unit.dimensions.length_exponent = 1.0) AND + (SELF\named_unit.dimensions.mass_exponent = 0.0) AND + (SELF\named_unit.dimensions.time_exponent = 0.0) AND + (SELF\named_unit.dimensions.electric_current_exponent = 0.0) AND + (SELF\named_unit.dimensions.thermodynamic_temperature_exponent = 0.0) AND + (SELF\named_unit.dimensions.amount_of_substance_exponent = 0.0) AND + (SELF\named_unit.dimensions.luminous_intensity_exponent = 0.0); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY luminous_flux_unit + SUBTYPE OF(named_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.lumen); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY luminous_flux_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.LUMINOUS_FLUX_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY luminous_intensity_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.LUMINOUS_INTENSITY_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY luminous_intensity_unit + SUBTYPE OF (named_unit); + WHERE + WR1: (SELF\named_unit.dimensions.length_exponent = 0.0) AND (SELF\named_unit.dimensions.mass_exponent = 0.0) AND (SELF\named_unit.dimensions.time_exponent = 0.0) AND (SELF\named_unit.dimensions.electric_current_exponent = 0.0) AND (SELF\named_unit.dimensions.thermodynamic_temperature_exponent = 0.0) AND (SELF\named_unit.dimensions.amount_of_substance_exponent = 0.0) AND (SELF\named_unit.dimensions.luminous_intensity_exponent = 1.0); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY magnetic_flux_unit + SUBTYPE OF(derived_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.weber); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY magnetic_flux_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.MAGNETIC_FLUX_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY si_magnetic_flux_unit + SUBTYPE OF (magnetic_flux_unit,si_unit); + WHERE + WR1: SELF\si_unit.name = si_unit_name.weber; + WR2: NOT EXISTS(SELF\derived_unit.name); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY mass_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.MASS_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY mass_unit + SUBTYPE OF (named_unit); + WHERE + WR1: (SELF\named_unit.dimensions.length_exponent = 0.0) AND (SELF\named_unit.dimensions.mass_exponent = 1.0) AND (SELF\named_unit.dimensions.time_exponent = 0.0) AND (SELF\named_unit.dimensions.electric_current_exponent = 0.0) AND (SELF\named_unit.dimensions.thermodynamic_temperature_exponent = 0.0) AND (SELF\named_unit.dimensions.amount_of_substance_exponent = 0.0) AND (SELF\named_unit.dimensions.luminous_intensity_exponent = 0.0); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY thermodynamic_temperature_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.THERMODYNAMIC_TEMPERATURE_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY named_unit + SUPERTYPE OF (ONEOF ( + SI_UNIT, + CONVERSION_BASED_UNIT, + CONTEXT_DEPENDENT_UNIT) + ANDOR ONEOF ( + LENGTH_UNIT, + MASS_UNIT, + TIME_UNIT, + ELECTRIC_CURRENT_UNIT, + THERMODYNAMIC_TEMPERATURE_UNIT, + AMOUNT_OF_SUBSTANCE_UNIT, + LUMINOUS_FLUX_UNIT, + LUMINOUS_INTENSITY_UNIT, + PLANE_ANGLE_UNIT, + SOLID_ANGLE_UNIT, + RATIO_UNIT)); + dimensions : dimensional_exponents; + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY plane_angle_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.PLANE_ANGLE_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY plane_angle_unit + SUBTYPE OF (named_unit); + WHERE + WR1: (SELF\named_unit.dimensions.length_exponent = 0.0) AND (SELF\named_unit.dimensions.mass_exponent = 0.0) AND (SELF\named_unit.dimensions.time_exponent = 0.0) AND (SELF\named_unit.dimensions.electric_current_exponent = 0.0) AND (SELF\named_unit.dimensions.thermodynamic_temperature_exponent = 0.0) AND (SELF\named_unit.dimensions.amount_of_substance_exponent = 0.0) AND (SELF\named_unit.dimensions.luminous_intensity_exponent = 0.0); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY power_unit + SUBTYPE OF(derived_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.watt); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY power_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.POWER_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY si_power_unit + SUBTYPE OF (power_unit,si_unit); + WHERE + WR1: SELF\si_unit.name = si_unit_name.watt; + WR2: NOT EXISTS(SELF\derived_unit.name); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY velocity_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.VELOCITY_UNIT' IN TYPEOF (SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY time_unit + SUBTYPE OF (named_unit); + WHERE + WR1: (SELF\named_unit.dimensions.length_exponent = 0.0) AND (SELF\named_unit.dimensions.mass_exponent = 0.0) AND (SELF\named_unit.dimensions.time_exponent = 1.0) AND (SELF\named_unit.dimensions.electric_current_exponent = 0.0) AND (SELF\named_unit.dimensions.thermodynamic_temperature_exponent = 0.0) AND (SELF\named_unit.dimensions.amount_of_substance_exponent = 0.0) AND (SELF\named_unit.dimensions.luminous_intensity_exponent = 0.0); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY si_pressure_unit + SUBTYPE OF (pressure_unit,si_unit); + WHERE + WR1: SELF\si_unit.name = si_unit_name.pascal; + WR2: NOT EXISTS(SELF\derived_unit.name); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY ratio_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.RATIO_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY velocity_unit + SUBTYPE OF (derived_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = + dimensional_exponents ( 1.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0 ); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY resistance_unit + SUBTYPE OF(derived_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.ohm); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY resistance_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.RESISTANCE_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY si_resistance_unit + SUBTYPE OF (resistance_unit,si_unit); + WHERE + WR1: SELF\si_unit.name = si_unit_name.ohm; + WR2: NOT EXISTS(SELF\derived_unit.name); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY si_unit + SUBTYPE OF (named_unit); + prefix : OPTIONAL si_prefix; + name : si_unit_name; + DERIVE + SELF\named_unit.dimensions : dimensional_exponents := dimensions_for_si_unit(name); + WHERE + WR1: NOT(('ASSEMBLY_STRUCTURE_MIM_LF.MASS_UNIT' IN TYPEOF(SELF)) AND + (SIZEOF(USEDIN(SELF,'ASSEMBLY_STRUCTURE_MIM_LF.DERIVED_UNIT_ELEMENT.UNIT')) > 0)) OR + (prefix = si_prefix.kilo); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY solid_angle_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.SOLID_ANGLE_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY solid_angle_unit + SUBTYPE OF (named_unit); + WHERE + WR1: (SELF\named_unit.dimensions.length_exponent = 0.0) AND (SELF\named_unit.dimensions.mass_exponent = 0.0) AND (SELF\named_unit.dimensions.time_exponent = 0.0) AND (SELF\named_unit.dimensions.electric_current_exponent = 0.0) AND (SELF\named_unit.dimensions.thermodynamic_temperature_exponent = 0.0) AND (SELF\named_unit.dimensions.amount_of_substance_exponent = 0.0) AND (SELF\named_unit.dimensions.luminous_intensity_exponent = 0.0); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY volume_unit + SUBTYPE OF (derived_unit); + WHERE + WR1: derive_dimensional_exponents(SELF) = + dimensional_exponents ( 3.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY thermodynamic_temperature_unit + SUBTYPE OF (named_unit); + WHERE + WR1: (SELF\named_unit.dimensions.length_exponent = 0.0) AND (SELF\named_unit.dimensions.mass_exponent = 0.0) AND (SELF\named_unit.dimensions.time_exponent = 0.0) AND (SELF\named_unit.dimensions.electric_current_exponent = 0.0) AND (SELF\named_unit.dimensions.thermodynamic_temperature_exponent = 1.0) AND (SELF\named_unit.dimensions.amount_of_substance_exponent = 0.0) AND (SELF\named_unit.dimensions.luminous_intensity_exponent = 0.0); + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY time_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.TIME_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; + +(* Implicit interfaced from: management_resources_schema *) + ENTITY identification_assignment + ABSTRACT SUPERTYPE; + assigned_id : identifier; + role : identification_role; + END_ENTITY; + +(* Implicit interfaced from: management_resources_schema *) + ENTITY identification_role; + name : label; + description : OPTIONAL text; + END_ENTITY; +(* REFERENCE FROM (product_definition_schema); *) + ENTITY product_definition_relationship; + id : identifier; + name : label; + description : OPTIONAL text; + relating_product_definition : product_definition_or_reference; + related_product_definition : product_definition_or_reference; + END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY volume_measure_with_unit + SUBTYPE OF (measure_with_unit); + WHERE + WR1: 'ASSEMBLY_STRUCTURE_MIM_LF.VOLUME_UNIT' IN TYPEOF(SELF\measure_with_unit.unit_component); + END_ENTITY; + +(* Implicit interfaced from: product_definition_schema *) + ENTITY product_definition_context_role; + name : label; + description : OPTIONAL text; + END_ENTITY; +(* REFERENCE FROM (application_context_schema); *) + ENTITY product_context + SUBTYPE OF (application_context_element); + discipline_type : label; + END_ENTITY; + +(* Implicit interfaced from: basic_attribute_schema *) + ENTITY description_attribute; + attribute_value : text; + described_item : description_attribute_select; + END_ENTITY; + +(* Implicit interfaced from: application_context_schema *) +(* Pruned SUPERTYPE *) + ENTITY application_context_element + SUPERTYPE OF (ONEOF ( + PRODUCT_CONTEXT, + PRODUCT_DEFINITION_CONTEXT)); + name : label; + frame_of_reference : application_context; + END_ENTITY; + +(* Implicit interfaced from: application_context_schema *) + ENTITY application_context; + application : label; + DERIVE + description : text := get_description_value(SELF); + id : identifier := get_id_value(SELF); + INVERSE + context_elements : SET [1:?] OF application_context_element FOR frame_of_reference; + WHERE + WR1: SIZEOF(USEDIN(SELF, 'ASSEMBLY_STRUCTURE_MIM_LF.' + 'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1; + WR2: SIZEOF(USEDIN(SELF, 'ASSEMBLY_STRUCTURE_MIM_LF.' + 'ID_ATTRIBUTE.IDENTIFIED_ITEM')) <= 1; + END_ENTITY; + +(* Implicit interfaced from: basic_attribute_schema *) + ENTITY id_attribute; + attribute_value : identifier; + identified_item : id_attribute_select; + END_ENTITY; +(* USED FROM (measure_schema); *) +ENTITY absorbed_dose_unit + SUBTYPE OF (derived_unit); +WHERE + WR1: derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.gray); +END_ENTITY; + +(* Implicit interfaced from: product_structure_schema *) +(* Pruned SUPERTYPE *) +ENTITY product_definition_usage + + SUBTYPE OF (product_definition_relationship); +UNIQUE + UR1: SELF\product_definition_relationship.id, + SELF\product_definition_relationship.relating_product_definition, + SELF\product_definition_relationship.related_product_definition; +WHERE + WR1: acyclic_product_definition_relationship + (SELF, + [SELF\product_definition_relationship.related_product_definition], + 'ASSEMBLY_STRUCTURE_MIM_LF.PRODUCT_DEFINITION_USAGE'); +END_ENTITY; +(* USED FROM (measure_schema); *) + ENTITY measure_with_unit + SUPERTYPE OF (ONEOF ( + LENGTH_MEASURE_WITH_UNIT, + MASS_MEASURE_WITH_UNIT, + TIME_MEASURE_WITH_UNIT, + ELECTRIC_CURRENT_MEASURE_WITH_UNIT, + THERMODYNAMIC_TEMPERATURE_MEASURE_WITH_UNIT, + CELSIUS_TEMPERATURE_MEASURE_WITH_UNIT, + AMOUNT_OF_SUBSTANCE_MEASURE_WITH_UNIT, + LUMINOUS_INTENSITY_MEASURE_WITH_UNIT, + PLANE_ANGLE_MEASURE_WITH_UNIT, + SOLID_ANGLE_MEASURE_WITH_UNIT, + AREA_MEASURE_WITH_UNIT, + VOLUME_MEASURE_WITH_UNIT, + RATIO_MEASURE_WITH_UNIT, + ACCELERATION_MEASURE_WITH_UNIT, + CAPACITANCE_MEASURE_WITH_UNIT, + ELECTRIC_CHARGE_MEASURE_WITH_UNIT, + CONDUCTANCE_MEASURE_WITH_UNIT, + ELECTRIC_POTENTIAL_MEASURE_WITH_UNIT, + ENERGY_MEASURE_WITH_UNIT, + MAGNETIC_FLUX_DENSITY_MEASURE_WITH_UNIT, + FORCE_MEASURE_WITH_UNIT, + FREQUENCY_MEASURE_WITH_UNIT, + ILLUMINANCE_MEASURE_WITH_UNIT, + INDUCTANCE_MEASURE_WITH_UNIT, + LUMINOUS_FLUX_MEASURE_WITH_UNIT, + MAGNETIC_FLUX_MEASURE_WITH_UNIT, + POWER_MEASURE_WITH_UNIT, + PRESSURE_MEASURE_WITH_UNIT, + RESISTANCE_MEASURE_WITH_UNIT, + VELOCITY_MEASURE_WITH_UNIT, + ABSORBED_DOSE_MEASURE_WITH_UNIT, + RADIOACTIVITY_MEASURE_WITH_UNIT, + DOSE_EQUIVALENT_MEASURE_WITH_UNIT)); + value_component : measure_value; + unit_component : unit; + WHERE + WR1: valid_units(SELF); + END_ENTITY; +(* USED FROM (representation_schema); *) + ENTITY uncertainty_measure_with_unit + SUBTYPE OF (measure_with_unit); + name : label; + description : OPTIONAL text; + WHERE + WR1: valid_measure_value (SELF\measure_with_unit.value_component); + END_ENTITY; +(* USED FROM (product_structure_schema); *) +ENTITY multi_level_reference_designator + SUBTYPE OF (assembly_component_usage); + location : LIST[1:?] OF UNIQUE next_assembly_usage_occurrence; + DERIVE + SELF\product_definition_relationship.relating_product_definition : product_definition := location[1]\product_definition_relationship.relating_product_definition; -- root : This ATTRIBUTE was RENAMED in the EXPRESS E2 source, an attribute with the new name is in the DERIVE clause + SELF\product_definition_relationship.related_product_definition : product_definition_or_reference := location[HIINDEX(location)]\product_definition_relationship.related_product_definition; -- leaf : This ATTRIBUTE was RENAMED in the EXPRESS E2 source, an attribute with the new name is in the DERIVE clause + leaf : PRODUCT_DEFINITION_OR_REFERENCE := SELF\product_definition_relationship.related_product_definition; -- RELATED_PRODUCT_DEFINITION : This ATTRIBUTE was RENAMED in the EXPRESS E2 source, this is the new name implemented as DERIVE + root : PRODUCT_DEFINITION := SELF\product_definition_relationship.relating_product_definition; -- RELATING_PRODUCT_DEFINITION : This ATTRIBUTE was RENAMED in the EXPRESS E2 source, this is the new name implemented as DERIVE + +WHERE + WR1: unambiguously_specified_multi_level_reference_designator(location); + WR2: SIZEOF(QUERY(cp <* location | NOT ( + EXISTS(cp\assembly_component_usage.reference_designator)))) = 0; +END_ENTITY; +(* USED FROM (product_structure_schema); *) +ENTITY assembly_component_usage + SUPERTYPE OF ( + QUANTIFIED_ASSEMBLY_COMPONENT_USAGE + ANDOR ONEOF ( + MULTI_LEVEL_REFERENCE_DESIGNATOR, + NEXT_ASSEMBLY_USAGE_OCCURRENCE, + PROMISSORY_USAGE_OCCURRENCE, + SPECIFIED_HIGHER_USAGE_OCCURRENCE)) + SUBTYPE OF (product_definition_usage); + reference_designator : OPTIONAL identifier; +END_ENTITY; +(* USED FROM (product_structure_schema); *) +ENTITY specified_higher_usage_occurrence + SUBTYPE OF (assembly_component_usage); + upper_usage : assembly_component_usage; + next_usage : next_assembly_usage_occurrence; +UNIQUE + UR1: upper_usage, next_usage; +WHERE + WR1: SELF :<>: upper_usage; + WR2: SELF\product_definition_relationship.relating_product_definition + :=: upper_usage.relating_product_definition; + WR3: SELF\product_definition_relationship.related_product_definition + :=: next_usage.related_product_definition; + WR4: (upper_usage.related_product_definition :=: + next_usage.relating_product_definition) OR + (SIZEOF (QUERY (pdr <* USEDIN (upper_usage.related_product_definition, + 'ASSEMBLY_STRUCTURE_MIM_LF.PRODUCT_DEFINITION_RELATIONSHIP.' + + 'RELATED_PRODUCT_DEFINITION') | + pdr.relating_product_definition :=: + next_usage.relating_product_definition)) = 1); + WR5: SIZEOF (['ASSEMBLY_STRUCTURE_MIM_LF.NEXT_ASSEMBLY_USAGE_OCCURRENCE', + 'ASSEMBLY_STRUCTURE_MIM_LF.SPECIFIED_HIGHER_USAGE_OCCURRENCE'] + * TYPEOF(upper_usage)) = 1; +END_ENTITY; + +(* Implicit interfaced from: representation_schema *) + ENTITY representation; + name : label; + items : SET[1:?] OF representation_item; + context_of_items : representation_context; + DERIVE + id : identifier := get_id_value (SELF); + description : text := get_description_value (SELF); + WHERE + WR1: SIZEOF (USEDIN (SELF, 'ASSEMBLY_STRUCTURE_MIM_LF.' + + 'ID_ATTRIBUTE.IDENTIFIED_ITEM')) + <= 1; + WR2: SIZEOF (USEDIN (SELF, 'ASSEMBLY_STRUCTURE_MIM_LF.' + + 'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) + <= 1; + END_ENTITY; + +(* Implicit interfaced from: representation_schema *) +(* Pruned SUPERTYPE *) + ENTITY representation_item + ; + name : label; + WHERE + WR1: SIZEOF(using_representations(SELF)) > 0; + END_ENTITY; + +(* Implicit interfaced from: measure_schema *) + FUNCTION derive_dimensional_exponents (x : unit):dimensional_exponents; + LOCAL + result : dimensional_exponents := dimensional_exponents(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + END_LOCAL; + + IF 'ASSEMBLY_STRUCTURE_MIM_LF.DERIVED_UNIT' IN TYPEOF(x) THEN + REPEAT i := LOINDEX(x\derived_unit.elements) TO HIINDEX(x\derived_unit.elements); + result.length_exponent := result.length_exponent + + (x\derived_unit.elements[i]\derived_unit_element.exponent * + x\derived_unit.elements[i]\derived_unit_element.unit\named_unit.dimensions.length_exponent); + result.mass_exponent := result.mass_exponent + + (x\derived_unit.elements[i]\derived_unit_element.exponent * + x\derived_unit.elements[i]\derived_unit_element.unit\named_unit.dimensions.mass_exponent); + result.time_exponent := result.time_exponent + + (x\derived_unit.elements[i]\derived_unit_element.exponent * + x\derived_unit.elements[i]\derived_unit_element.unit\named_unit.dimensions.time_exponent); + result.electric_current_exponent := result.electric_current_exponent + + (x\derived_unit.elements[i]\derived_unit_element.exponent * + x\derived_unit.elements[i]\derived_unit_element.unit\named_unit.dimensions.electric_current_exponent); + result.thermodynamic_temperature_exponent := result.thermodynamic_temperature_exponent + + (x\derived_unit.elements[i]\derived_unit_element.exponent * + x\derived_unit.elements[i]\derived_unit_element.unit\named_unit.dimensions.thermodynamic_temperature_exponent); + result.amount_of_substance_exponent := result.amount_of_substance_exponent + + (x\derived_unit.elements[i]\derived_unit_element.exponent * + x\derived_unit.elements[i]\derived_unit_element.unit\named_unit.dimensions.amount_of_substance_exponent); + result.luminous_intensity_exponent := result.luminous_intensity_exponent + + (x\derived_unit.elements[i]\derived_unit_element.exponent * + x\derived_unit.elements[i]\derived_unit_element.unit\named_unit.dimensions.luminous_intensity_exponent); + END_REPEAT; + ELSE + result := x\named_unit.dimensions; + END_IF; + RETURN (result); + END_FUNCTION; +(* REFERENCE FROM (support_resource_schema); *) + FUNCTION bag_to_set (the_bag : BAG OF GENERIC:intype):SET OF GENERIC:intype; + LOCAL + the_set : SET OF GENERIC:intype := []; + END_LOCAL; + + IF SIZEOF(the_bag) > 0 THEN + REPEAT i := 1 TO HIINDEX(the_bag); + the_set := the_set + the_bag[i]; + END_REPEAT; + END_IF; + RETURN (the_set); + END_FUNCTION; + +(* Implicit interfaced from: product_structure_schema *) +FUNCTION unambiguously_specified_multi_level_reference_designator (links : LIST[1:?] OF next_assembly_usage_occurrence) : BOOLEAN; +REPEAT i := 1 to SIZEOF(links) - 1; +--case 1 all in one file; had to disambiguate link[i].relating instance type to distinguish case 1 from case 3. + CASE TRUE OF + ('ASSEMBLY_STRUCTURE_MIM_LF.PRODUCT_DEFINITION' IN TYPEOF(links[i]\product_definition_relationship.relating_product_definition)) + AND + ('ASSEMBLY_STRUCTURE_MIM_LF.PRODUCT_DEFINITION' IN TYPEOF(links[i]\product_definition_relationship.related_product_definition)) + AND + ('ASSEMBLY_STRUCTURE_MIM_LF.PRODUCT_DEFINITION' IN TYPEOF(links[i+1]\product_definition_relationship.relating_product_definition)) : + BEGIN + IF NOT ( + (links[i]\product_definition_relationship.related_product_definition :=: + links[i+1]\product_definition_relationship.relating_product_definition) + OR + ((SIZEOF (QUERY (pdr <* USEDIN(links[i]\product_definition_relationship.related_product_definition, + 'ASSEMBLY_STRUCTURE_MIM_LF.PRODUCT_DEFINITION_RELATIONSHIP.' + 'RELATED_PRODUCT_DEFINITION') | + pdr\product_definition_relationship.relating_product_definition :=: + links[i+1]\product_definition_relationship.relating_product_definition)) = 1) + AND + (links[i]\product_definition_relationship.related_product_definition\product_definition.formation\product_definition_formation.of_product + :=: + links[i+1]\product_definition_relationship.relating_product_definition\product_definition.formation\product_definition_formation.of_product))) + THEN + RETURN(FALSE); + END_IF; + END; + +--case 2 ; intermediate node reference from main to external file or both node references in external file. links[i].relating instance can be either pd or pdref. + ('ASSEMBLY_STRUCTURE_MIM_LF.PRODUCT_DEFINITION_REFERENCE' IN TYPEOF(links[i]\product_definition_relationship.related_product_definition)) + AND + ('ASSEMBLY_STRUCTURE_MIM_LF.PRODUCT_DEFINITION_REFERENCE' IN TYPEOF(links[i+1]\product_definition_relationship.relating_product_definition)) : + BEGIN + IF NOT ( + (links[i]\product_definition_relationship.related_product_definition :=: + links[i+1]\product_definition_relationship.relating_product_definition) + OR + ((SIZEOF (QUERY (pdr <* USEDIN(links[i]\product_definition_relationship.related_product_definition, + 'ASSEMBLY_STRUCTURE_MIM_LF.PRODUCT_DEFINITION_RELATIONSHIP.' + 'RELATED_PRODUCT_DEFINITION') | + pdr\product_definition_relationship.relating_product_definition :=: + links[i+1]\product_definition_relationship.relating_product_definition)) = 1) + AND + (links[i]\product_definition_relationship.related_product_definition\product_definition_reference.product_id + = + links[i+1]\product_definition_relationship.relating_product_definition\product_definition_reference.product_id) + AND + (links[i]\product_definition_relationship.related_product_definition\product_definition_reference.id_owning_organization_name + = + links[i+1]\product_definition_relationship.relating_product_definition\product_definition_reference.id_owning_organization_name) + AND + (links[i]\product_definition_relationship.related_product_definition\product_definition_reference.product_definition_id + <> + links[i+1]\product_definition_relationship.relating_product_definition\product_definition_reference.product_definition_id))) + THEN + RETURN(FALSE); + END_IF; + END; + +--case 3 should never see -- link in external file referencing a node in main assembly file. Note link is just links[i]. + ('ASSEMBLY_STRUCTURE_MIM_LF.PRODUCT_DEFINITION_REFERENCE' IN TYPEOF(links[i]\product_definition_relationship.relating_product_definition)) + AND + ('ASSEMBLY_STRUCTURE_MIM_LF.PRODUCT_DEFINITION' IN TYPEOF(links[i]\product_definition_relationship.related_product_definition)) : + RETURN(FALSE); + + OTHERWISE : RETURN(FALSE); + END_CASE; + +END_REPEAT; +RETURN(TRUE); +END_FUNCTION; +(* REFERENCE FROM (basic_attribute_schema); *) + FUNCTION get_description_value (obj : description_attribute_select):text; + LOCAL + description_bag : BAG OF description_attribute := (USEDIN(obj, 'ASSEMBLY_STRUCTURE_MIM_LF.' + 'DESCRIPTION_ATTRIBUTE.' + 'DESCRIBED_ITEM')); + END_LOCAL; + + IF SIZEOF(description_bag) = 1 THEN + RETURN (description_bag[1].attribute_value); + ELSE + RETURN (?); + END_IF; + END_FUNCTION; +(* REFERENCE FROM (basic_attribute_schema); *) + FUNCTION get_id_value (obj : id_attribute_select):identifier; + LOCAL + id_bag : BAG OF id_attribute := (USEDIN(obj, 'ASSEMBLY_STRUCTURE_MIM_LF.' + 'ID_ATTRIBUTE.' + 'IDENTIFIED_ITEM')); + END_LOCAL; + + IF SIZEOF(id_bag) = 1 THEN + RETURN (id_bag[1].attribute_value); + ELSE + RETURN (?); + END_IF; + END_FUNCTION; +(* REFERENCE FROM (basic_attribute_schema); *) + FUNCTION get_name_value (obj : name_attribute_select):label; + LOCAL + name_bag : BAG OF name_attribute := (USEDIN(obj, 'ASSEMBLY_STRUCTURE_MIM_LF.' + 'NAME_ATTRIBUTE.' + 'NAMED_ITEM')); + END_LOCAL; + + IF SIZEOF(name_bag) = 1 THEN + RETURN (name_bag[1].attribute_value); + ELSE + RETURN (?); + END_IF; + END_FUNCTION; +(* REFERENCE FROM (product_definition_schema); *) + FUNCTION acyclic_product_definition_relationship (relation : product_definition_relationship; relatives : SET [1:?] OF product_definition_or_reference; specific_relation : STRING):BOOLEAN; + LOCAL + x : SET OF product_definition_relationship; + END_LOCAL; + + IF relation.relating_product_definition IN relatives THEN + RETURN (FALSE); + END_IF; + x := QUERY(pd <* bag_to_set(USEDIN(relation.relating_product_definition, 'ASSEMBLY_STRUCTURE_MIM_LF.' + 'PRODUCT_DEFINITION_RELATIONSHIP.' + 'RELATED_PRODUCT_DEFINITION')) | specific_relation IN TYPEOF(pd)); + REPEAT i := 1 TO HIINDEX(x); + IF NOT acyclic_product_definition_relationship(x[i], relatives + relation.relating_product_definition, specific_relation) THEN + RETURN (FALSE); + END_IF; + END_REPEAT; + RETURN (TRUE); + END_FUNCTION; + +(* Implicit interfaced from: measure_schema *) + FUNCTION dimensions_for_si_unit (n : si_unit_name):dimensional_exponents; + CASE n OF + metre: + RETURN (dimensional_exponents(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); + gram: + RETURN (dimensional_exponents(0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0)); + second: + RETURN (dimensional_exponents(0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0)); + ampere: + RETURN (dimensional_exponents(0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0)); + kelvin: + RETURN (dimensional_exponents(0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0)); + mole: + RETURN (dimensional_exponents(0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)); + candela: + RETURN (dimensional_exponents(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0)); + radian: + RETURN (dimensional_exponents(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); + steradian: + RETURN (dimensional_exponents(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); + hertz: + RETURN (dimensional_exponents(0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0)); + newton: + RETURN (dimensional_exponents(1.0, 1.0, -2.0, 0.0, 0.0, 0.0, 0.0)); + pascal: + RETURN (dimensional_exponents(-1.0, 1.0, -2.0, 0.0, 0.0, 0.0, 0.0)); + joule: + RETURN (dimensional_exponents(2.0, 1.0, -2.0, 0.0, 0.0, 0.0, 0.0)); + watt: + RETURN (dimensional_exponents(2.0, 1.0, -3.0, 0.0, 0.0, 0.0, 0.0)); + coulomb: + RETURN (dimensional_exponents(0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0)); + volt: + RETURN (dimensional_exponents(2.0, 1.0, -3.0, -1.0, 0.0, 0.0, 0.0)); + farad: + RETURN (dimensional_exponents(-2.0, -1.0, 4.0, 2.0, 0.0, 0.0, 0.0)); + ohm: + RETURN (dimensional_exponents(2.0, 1.0, -3.0, -2.0, 0.0, 0.0, 0.0)); + siemens: + RETURN (dimensional_exponents(-2.0, -1.0, 3.0, 2.0, 0.0, 0.0, 0.0)); + weber: + RETURN (dimensional_exponents(2.0, 1.0, -2.0, -1.0, 0.0, 0.0, 0.0)); + tesla: + RETURN (dimensional_exponents(0.0, 1.0, -2.0, -1.0, 0.0, 0.0, 0.0)); + henry: + RETURN (dimensional_exponents(2.0, 1.0, -2.0, -2.0, 0.0, 0.0, 0.0)); + degree_Celsius: + RETURN (dimensional_exponents(0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0)); + lumen: + RETURN (dimensional_exponents(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0)); + lux: + RETURN (dimensional_exponents(-2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0)); + becquerel: + RETURN (dimensional_exponents(0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0)); + gray: + RETURN (dimensional_exponents(2.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0)); + sievert: + RETURN (dimensional_exponents(2.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0)); + OTHERWISE: + RETURN (?); + END_CASE; + END_FUNCTION; + +(* Implicit interfaced from: representation_schema *) + FUNCTION using_representations (item : founded_item_select) + : SET OF representation; + LOCAL + results : SET OF representation; + result_bag : BAG OF representation; + intermediate_items : SET OF founded_item_select; + END_LOCAL; + -- Find the representations in which the item is used and add to the + -- results set. + results := []; + result_bag := USEDIN(item,'ASSEMBLY_STRUCTURE_MIM_LF.REPRESENTATION.ITEMS'); + IF SIZEOF(result_bag) > 0 THEN + REPEAT i := 1 TO HIINDEX(result_bag); + results := results + result_bag[i]; + END_REPEAT; + END_IF; + -- Find all representation_items or founded_items + -- by which item is referenced directly or indirectly. + intermediate_items := using_items(item,[]); + -- If the set of intermediate items is not empty; + IF SIZEOF(intermediate_items) > 0 THEN + -- For each element in the set, add the + -- representations of that element. + REPEAT i := 1 TO HIINDEX(intermediate_items); + result_bag := USEDIN(intermediate_items[i], + 'ASSEMBLY_STRUCTURE_MIM_LF.REPRESENTATION.ITEMS'); + IF SIZEOF(result_bag) > 0 THEN + REPEAT j := 1 TO HIINDEX(result_bag); + results := results + result_bag[j]; + END_REPEAT; + END_IF; + END_REPEAT; + END_IF; + -- Return the set of representation in which the input item is + -- used directly and indirectly (through intervening + -- representation_items or founded items). + RETURN (results); + END_FUNCTION; + +(* Implicit interfaced from: representation_schema *) + FUNCTION using_items (item : founded_item_select; + checked_items: SET OF founded_item_select) + : SET OF founded_item_select; + LOCAL + new_check_items : SET OF founded_item_select; + result_items : SET OF founded_item_select; + next_items : SET OF founded_item_select; + END_LOCAL; + result_items := []; + new_check_items := checked_items + item; + -- Find the set of representation_items or founded_items + -- in which item is used directly. + next_items := QUERY(z <* bag_to_set( USEDIN(item , '')) | + ('ASSEMBLY_STRUCTURE_MIM_LF.REPRESENTATION_ITEM' IN TYPEOF(z)) OR + ('ASSEMBLY_STRUCTURE_MIM_LF.FOUNDED_ITEM' IN TYPEOF(z))); + -- If the set of next_items is not empty; + IF SIZEOF(next_items) > 0 THEN + -- For each element in the set, find the using_items recursively + REPEAT i := 1 TO HIINDEX(next_items); + -- Check for loop in data model, i.e. one of the next_items + -- occurred earlier in the set of check_items; + IF NOT(next_items[i] IN new_check_items) THEN + result_items := result_items + next_items[i] + + using_items(next_items[i],new_check_items); + END_IF; + END_REPEAT; + END_IF; + -- return the set of representation_items or founded_items + -- in which the input item is used directly and indirectly. + RETURN (result_items); + END_FUNCTION; + +(* Implicit interfaced from: measure_schema *) + FUNCTION valid_units (m : measure_with_unit):BOOLEAN; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.LENGTH_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.MASS_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents(0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.TIME_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents(0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.ELECTRIC_CURRENT_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents(0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.THERMODYNAMIC_TEMPERATURE_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents(0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.CELSIUS_TEMPERATURE_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents(0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.AMOUNT_OF_SUBSTANCE_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents(0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.LUMINOUS_INTENSITY_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.PLANE_ANGLE_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.SOLID_ANGLE_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.AREA_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents(2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.VOLUME_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents(3.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.RATIO_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.POSITIVE_LENGTH_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.POSITIVE_PLANE_ANGLE_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.ACCELERATION_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents( 1.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0 ) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.CAPACITANCE_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents( -2.0, -1.0, 4.0, 2.0, 0.0, 0.0, 0.0 ) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.ELECTRIC_CHARGE_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents( 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0 ) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.CONDUCTANCE_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents( -2.0, -1.0, 3.0, 2.0, 0.0, 0.0, 0.0 ) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.ELECTRIC_POTENTIAL_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents( 2.0, 1.0, -3.0, -1.0, 0.0, 0.0, 0.0 ) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.ENERGY_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents( 2.0, 1.0, -2.0, 0.0, 0.0, 0.0, 0.0 ) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.FORCE_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents( 1.0, 1.0, -2.0, 0.0, 0.0, 0.0, 0.0 ) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.FREQUENCY_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents( 0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0 ) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.ILLUMINANCE_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents( -2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0 ) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.INDUCTANCE_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents( 2.0, 1.0, -2.0, -2.0, 0.0, 0.0, 0.0 ) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.LUMINOUS_FLUX_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0 ) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.MAGNETIC_FLUX_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents( 2.0, 1.0, -2.0, -1.0, 0.0, 0.0, 0.0 ) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.MAGNETIC_FLUX_DENSITY_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents( 0.0, 1.0, -2.0, -1.0, 0.0, 0.0, 0.0 ) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.POWER_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents( 2.0, 1.0, -3.0, 0.0, 0.0, 0.0, 0.0 ) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.PRESSURE_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents( -1.0, 1.0, -2.0, 0.0, 0.0, 0.0, 0.0 ) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.RESISTANCE_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents( 2.0, 1.0, -3.0, -2.0, 0.0, 0.0, 0.0 ) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.VELOCITY_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents( 1.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0 ) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.RADIOACTIVITY_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents(0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.ABSORBED_DOSE_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents(2.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0) THEN + RETURN (FALSE); + END_IF; + END_IF; + IF 'ASSEMBLY_STRUCTURE_MIM_LF.DOSE_EQUIVALENT_MEASURE' IN TYPEOF(m.value_component) THEN + IF derive_dimensional_exponents(m.unit_component) <> + dimensional_exponents(2.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0) THEN + RETURN (FALSE); + END_IF; + END_IF; + RETURN (TRUE); + END_FUNCTION; + +(* Implicit interfaced from: representation_schema *) + FUNCTION valid_measure_value + (m : measure_value) : BOOLEAN; + IF ('REAL' IN TYPEOF (m)) THEN + RETURN (m > 0.0); + ELSE + IF ('INTEGER' IN TYPEOF (m)) THEN + RETURN (m > 0); + ELSE + RETURN (TRUE); + END_IF; + END_IF; + END_FUNCTION; + +(*** 2003=>1994 conversion: insert a rule to control if instances are legal according to USE/REF clauses ***) + +RULE validate_dependently_instantiable_entity_data_types FOR + (application_context,application_context_element,description_attribute,id_attribute,identification_assignment,identification_role,product_context,product_definition_context_role,product_definition_relationship,product_definition_usage,representation,representation_context,representation_item -- + ); +LOCAL + number_of_input_instances : INTEGER; + previous_in_chain : LIST OF GENERIC := []; + set_of_input_types : SET OF STRING := []; + all_instances : SET OF GENERIC := []; +END_LOCAL; + + all_instances := all_instances + application_context; + all_instances := all_instances + application_context_element; + all_instances := all_instances + description_attribute; + all_instances := all_instances + id_attribute; + all_instances := all_instances + identification_assignment; + all_instances := all_instances + identification_role; + all_instances := all_instances + product_context; + all_instances := all_instances + product_definition_context_role; + all_instances := all_instances + product_definition_relationship; + all_instances := all_instances + product_definition_usage; + all_instances := all_instances + representation; + all_instances := all_instances + representation_context; + all_instances := all_instances + representation_item; +;-- +number_of_input_instances := SIZEOF(all_instances); +(* Collect all type strings of all FOR instances into one set. *) +REPEAT i:=1 TO number_of_input_instances; + set_of_input_types := set_of_input_types + TYPEOF(all_instances[i]); +END_REPEAT; + +WHERE + WR1: dependently_instantiated(all_instances, set_of_input_types, + previous_in_chain); +END_RULE; + +FUNCTION dependently_instantiated( + set_of_input_instances : SET OF GENERIC:igen; + set_of_input_types : SET OF STRING; + previous_in_chain : LIST OF GENERIC:cgen): BOOLEAN; +(*'dependently_instantiated' To test whether all instances in the + input set_of_input_instances are referenced by independently + instantiable instances. If so, this function returns true. + Set_of_input_types includes the type strings for all input instances. + The instances in previous_in_chain are used to detect cyclic + references during recursive calls to this function. The parameter + lists already tested instances in a chain of references. +*) +LOCAL + number_of_input_instances : INTEGER; + number_of_referring_instances : INTEGER; + bag_of_referring_instances : BAG OF GENERIC:igen := []; + dependently_instantiated_flag : BOOLEAN; + previous_in_chain_plus : LIST OF GENERIC:cgen := []; + result : BOOLEAN := true; + set_of_types : SET OF STRING := []; +END_LOCAL; + +IF EXISTS(set_of_input_instances) THEN + number_of_input_instances := SIZEOF(set_of_input_instances); + (* Add the declared type of bag_of_referring_instances to the set of + types of the REFERENCEd instances for the subset comparison later. + *) + set_of_input_types := set_of_input_types + 'GENERIC'; + REPEAT i:=1 TO number_of_input_instances; + (* Determine all references to the current input instance. *) + bag_of_referring_instances := USEDIN (set_of_input_instances[i] , ''); + IF EXISTS(bag_of_referring_instances) THEN + number_of_referring_instances := SIZEOF(bag_of_referring_instances); + dependently_instantiated_flag := false; + REPEAT j:=1 TO number_of_referring_instances; + (* Determine the type strings of the current referencing instance. + *) + set_of_types := TYPEOF(bag_of_referring_instances[j]); + (* If the referencing instance is of one of the types of the + only dependently instantiable select items, the current input + instance may still be invalidly instantiated. + Otherwise it is OK, and the next input instance is tested. + *) + IF set_of_types <= set_of_input_types THEN -- subset operator + (* The referring instance is of one of the restricted types. + However, it may itself be referred to by a valid instance; + then also the current instance would be valid. + Thus, call this function recursively with the referring + instance as input. + To avoid an infinite loop in case a set of instances + reference each other in a closed loop, test first whether + the current referencing instance is in the list of + previously processed chain members. + *) + IF NOT (bag_of_referring_instances[j] IN previous_in_chain) THEN + previous_in_chain_plus := previous_in_chain + + set_of_input_instances[i]; + IF dependently_instantiated([bag_of_referring_instances[j]], + set_of_input_types, + previous_in_chain_plus) THEN + dependently_instantiated_flag := true; + ESCAPE; -- dependently instantiated; next input instance + ELSE + (* Not dependently instantiated: go to next referring + instance. *) + SKIP; + END_IF; + END_IF; + ELSE + dependently_instantiated_flag := true; + ESCAPE; -- dependently instantiated; take next input instance + END_IF; + END_REPEAT; + IF NOT dependently_instantiated_flag THEN + RETURN(false); + END_IF; + ELSE + RETURN(false); -- not referenced at all => invalidly instantiated + END_IF; + END_REPEAT; +ELSE + RETURN(false); -- no input +END_IF; + +RETURN(true); +END_FUNCTION; -- end dependently_instantiated + + + +END_SCHEMA; + diff --git a/src/express/test/libexpress_prob_func.exp b/src/express/test/libexpress_prob_func.exp new file mode 100644 index 00000000..dad1a1a3 --- /dev/null +++ b/src/express/test/libexpress_prob_func.exp @@ -0,0 +1,15 @@ +SCHEMA libexpress_prob_func; + + FUNCTION comma_accepted( + lis: LIST [0:?] OF GENERIC:t + ): ARRAY [1:5] OF GENERIC:t; + + LOCAL + res : ARRAY [1:5] OF GENERIC:t; + END_LOCAL; + res := [lis[1],5]; -- libexpress parser will accept this - I think it should fail + RETURN(res); + + END_FUNCTION; -- comma_accepted + +END_SCHEMA; -- libexpress_prob_func diff --git a/src/test/list_attributes/list_attributes.cc b/src/test/list_attributes/list_attributes.cc new file mode 100644 index 00000000..d27f7638 --- /dev/null +++ b/src/test/list_attributes/list_attributes.cc @@ -0,0 +1,42 @@ +/** \file list_attributes.cc + * + * early-bound implementation of an attribute printer + * list_attributes -a entity + */ +#include +extern void SchemaInit( class Registry & ); +#include "sc_version.h" +// #include +// #include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_UNISTD_H +# include +#include +#endif +#include +#include "schema.h" + + +int main( int argc, char * argv[] ) { + const char * entity = "si_energy_unit"; //TODO + if( argc == 2 ) { + entity = argv[1]; + } else if( ( argc == 3 ) && ( 0 == strncasecmp( argv[1], "-a", 2 ) ) ) { + entity = argv[2]; + } /*else { + std::cerr << "Bad args. Use:" << std::endl << argv[0] << " [-aA] " << std::endl; + std::cerr << "Prints entity attributes as STEPcode thinks they should be" << std::endl; + exit( EXIT_FAILURE ); + }*/ //TODO + + Registry registry( SchemaInit ); + EntityDescriptor * seu = registry.FindEntity( entity ); + AttrDescriptorList adl = seu->ExplicitAttr(); + +} + diff --git a/test/unitary_schemas/si_energy_unit_snippet.exp b/test/unitary_schemas/si_energy_unit_snippet.exp new file mode 100644 index 00000000..d5254f70 --- /dev/null +++ b/test/unitary_schemas/si_energy_unit_snippet.exp @@ -0,0 +1,274 @@ +SCHEMA si_energy_unit_snippet_209; + +(* derived from Ap209_multidisciplinary_analysis_and_design_mim_LF, N2617 MIM LF *) + +ENTITY si_energy_unit + SUBTYPE OF (energy_unit, si_unit); + WHERE + WR1 : SELF\si_unit.name = si_unit_name.joule; + WR2 : NOT EXISTS(SELF\derived_unit.name); +END_ENTITY; + +ENTITY energy_unit + SUBTYPE OF (derived_unit); + WHERE + WR1 : derive_dimensional_exponents(SELF) = dimensions_for_si_unit (si_unit_name.joule); +END_ENTITY; + +ENTITY derived_unit + SUPERTYPE OF (ONEOF ((*absorbed_dose_unit, acceleration_unit, radioactivity_unit, area_unit, capacitance_unit, dose_equivalent_unit, electric_charge_unit, conductance_unit, electric_potential_unit,*) energy_unit(*, magnetic_flux_density_unit, force_unit, frequency_unit, illuminance_unit, inductance_unit, magnetic_flux_unit, power_unit, pressure_unit, resistance_unit, velocity_unit, volume_unit*))); + elements : SET [1:?] OF derived_unit_element; + DERIVE + name : label := get_name_value(SELF); + WHERE + WR1 : (SIZEOF(elements) > 1) OR ((SIZEOF(elements) = 1) AND (elements[1].exponent <> 1.0)); + WR2 : SIZEOF(USEDIN(SELF, 'AP209_MULTIDISCIPLINARY_ANALYSIS_AND_DESIGN_MIM_LF.' + 'NAME_ATTRIBUTE.NAMED_ITEM')) <= 1; +END_ENTITY; + +ENTITY si_unit + SUBTYPE OF (named_unit); + prefix : OPTIONAL si_prefix; + name : si_unit_name; + DERIVE + SELF\named_unit.dimensions : dimensional_exponents := dimensions_for_si_unit(name); + WHERE + WR1 : NOT(('AP209_MULTIDISCIPLINARY_ANALYSIS_AND_DESIGN_MIM_LF.MASS_UNIT' IN TYPEOF(SELF)) AND + (SIZEOF(USEDIN(SELF,'AP209_MULTIDISCIPLINARY_ANALYSIS_AND_DESIGN_MIM_LF.DERIVED_UNIT_ELEMENT.UNIT')) > 0)) OR + (prefix = si_prefix.kilo); +END_ENTITY; + +ENTITY named_unit +SUPERTYPE OF ((ONEOF (si_unit(*, conversion_based_unit, context_dependent_unit *)) ANDOR ONEOF (length_unit, mass_unit, time_unit (*, electric_current_unit, thermodynamic_temperature_unit, amount_of_substance_unit, luminous_flux_unit, luminous_intensity_unit, plane_angle_unit, solid_angle_unit, ratio_unit*)))); + dimensions : dimensional_exponents; +END_ENTITY; + +ENTITY dimensional_exponents; + length_exponent : REAL; + mass_exponent : REAL; + time_exponent : REAL; + electric_current_exponent : REAL; + thermodynamic_temperature_exponent : REAL; + amount_of_substance_exponent : REAL; + luminous_intensity_exponent : REAL; +END_ENTITY; + +TYPE si_prefix = ENUMERATION OF ( + exa, + peta, + tera, + giga, + mega, + kilo, + hecto, + deca, + deci, + centi, + milli, + micro, + nano, + pico, + femto, + atto ); +END_TYPE; + +TYPE si_unit_name = ENUMERATION OF ( + metre, + gram, + second, + ampere, + kelvin, + mole, + candela, + radian, + steradian, + hertz, + newton, + pascal, + joule, + watt, + coulomb, + volt, + farad, + ohm, + siemens, + weber, + tesla, + henry, + degree_Celsius, + lumen, + lux, + becquerel, + gray, + sievert ); +END_TYPE; + +FUNCTION dimensions_for_si_unit + (n: si_unit_name) : dimensional_exponents; + CASE n OF + metre: + RETURN (dimensional_exponents(1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); + gram: + RETURN (dimensional_exponents(0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0)); + second: + RETURN (dimensional_exponents(0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0)); + ampere: + RETURN (dimensional_exponents(0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0)); + kelvin: + RETURN (dimensional_exponents(0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0)); + mole: + RETURN (dimensional_exponents(0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0)); + candela: + RETURN (dimensional_exponents(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0)); + radian: + RETURN (dimensional_exponents(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); + steradian: + RETURN (dimensional_exponents(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); + hertz: + RETURN (dimensional_exponents(0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0)); + newton: + RETURN (dimensional_exponents(1.0, 1.0, -2.0, 0.0, 0.0, 0.0, 0.0)); + pascal: + RETURN (dimensional_exponents(-1.0, 1.0, -2.0, 0.0, 0.0, 0.0, 0.0)); + joule: + RETURN (dimensional_exponents(2.0, 1.0, -2.0, 0.0, 0.0, 0.0, 0.0)); + watt: + RETURN (dimensional_exponents(2.0, 1.0, -3.0, 0.0, 0.0, 0.0, 0.0)); + coulomb: + RETURN (dimensional_exponents(0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0)); + volt: + RETURN (dimensional_exponents(2.0, 1.0, -3.0, -1.0, 0.0, 0.0, 0.0)); + farad: + RETURN (dimensional_exponents(-2.0, -1.0, 4.0, 1.0, 0.0, 0.0, 0.0)); + ohm: + RETURN (dimensional_exponents(2.0, 1.0, -3.0, -2.0, 0.0, 0.0, 0.0)); + siemens: + RETURN (dimensional_exponents(-2.0, -1.0, 3.0, 2.0, 0.0, 0.0, 0.0)); + weber: + RETURN (dimensional_exponents(2.0, 1.0, -2.0, -1.0, 0.0, 0.0, 0.0)); + tesla: + RETURN (dimensional_exponents(0.0, 1.0, -2.0, -1.0, 0.0, 0.0, 0.0)); + henry: + RETURN (dimensional_exponents(2.0, 1.0, -2.0, -2.0, 0.0, 0.0, 0.0)); + degree_Celsius: + RETURN (dimensional_exponents(0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0)); + lumen: + RETURN (dimensional_exponents(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0)); + lux: + RETURN (dimensional_exponents(-2.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0)); + becquerel: + RETURN (dimensional_exponents(0.0, 0.0, -1.0, 0.0, 0.0, 0.0, 0.0)); + gray: + RETURN (dimensional_exponents(2.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0)); + sievert: + RETURN (dimensional_exponents(2.0, 0.0, -2.0, 0.0, 0.0, 0.0, 0.0)); + OTHERWISE: + RETURN (?); + END_CASE; +END_FUNCTION; + +FUNCTION get_name_value + (obj: name_attribute_select) : label; + LOCAL + name_bag : BAG OF name_attribute := (USEDIN(obj, 'AP209_MULTIDISCIPLINARY_ANALYSIS_AND_DESIGN_MIM_LF.' + 'NAME_ATTRIBUTE.' + 'NAMED_ITEM')); + END_LOCAL; + + IF SIZEOF(name_bag) = 1 THEN + RETURN (name_bag[1].attribute_value); + ELSE + RETURN (?); + END_IF; +END_FUNCTION; + +TYPE name_attribute_select = SELECT ( +-- action_request_solution, +-- address, +-- configuration_design, +-- context_dependent_shape_representation, + derived_unit(*, + effectivity, + person_and_organization, + product_definition, + product_definition_substitute, + property_definition_representation*)); +END_TYPE; + +ENTITY name_attribute; + attribute_value : label; + named_item : name_attribute_select; +END_ENTITY; + +ENTITY derived_unit_element; + unit : named_unit; + exponent : REAL; +END_ENTITY; + +FUNCTION derive_dimensional_exponents + (x: unit) : dimensional_exponents; + LOCAL + result : dimensional_exponents := dimensional_exponents(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + END_LOCAL; + + IF 'AP209_MULTIDISCIPLINARY_ANALYSIS_AND_DESIGN_MIM_LF.DERIVED_UNIT' IN TYPEOF(x) THEN + REPEAT i := LOINDEX(x\derived_unit.elements) TO HIINDEX(x\derived_unit.elements); + result.length_exponent := result.length_exponent + + (x\derived_unit.elements[i]\derived_unit_element.exponent * + x\derived_unit.elements[i]\derived_unit_element.unit\named_unit.dimensions.length_exponent); + result.mass_exponent := result.mass_exponent + + (x\derived_unit.elements[i]\derived_unit_element.exponent * + x\derived_unit.elements[i]\derived_unit_element.unit\named_unit.dimensions.mass_exponent); + result.time_exponent := result.time_exponent + + (x\derived_unit.elements[i]\derived_unit_element.exponent * + x\derived_unit.elements[i]\derived_unit_element.unit\named_unit.dimensions.time_exponent); + result.electric_current_exponent := result.electric_current_exponent + + (x\derived_unit.elements[i]\derived_unit_element.exponent * + x\derived_unit.elements[i]\derived_unit_element.unit\named_unit.dimensions.electric_current_exponent); + result.thermodynamic_temperature_exponent := result.thermodynamic_temperature_exponent + + (x\derived_unit.elements[i]\derived_unit_element.exponent * + x\derived_unit.elements[i]\derived_unit_element.unit\named_unit.dimensions.thermodynamic_temperature_exponent); + result.amount_of_substance_exponent := result.amount_of_substance_exponent + + (x\derived_unit.elements[i]\derived_unit_element.exponent * + x\derived_unit.elements[i]\derived_unit_element.unit\named_unit.dimensions.amount_of_substance_exponent); + result.luminous_intensity_exponent := result.luminous_intensity_exponent + + (x\derived_unit.elements[i]\derived_unit_element.exponent * + x\derived_unit.elements[i]\derived_unit_element.unit\named_unit.dimensions.luminous_intensity_exponent); + END_REPEAT; + ELSE + result := x\named_unit.dimensions; + END_IF; + RETURN (result); +END_FUNCTION; + +TYPE label = STRING; +END_TYPE; + +TYPE unit = SELECT ( + derived_unit, + named_unit); +END_TYPE; + +ENTITY mass_unit + SUBTYPE OF (named_unit); + WHERE + WR1 : (SELF\named_unit.dimensions.length_exponent = 0.0) AND (SELF\named_unit.dimensions.mass_exponent = 1.0) AND (SELF\named_unit.dimensions.time_exponent = 0.0) AND (SELF\named_unit.dimensions.electric_current_exponent = 0.0) AND (SELF\named_unit.dimensions.thermodynamic_temperature_exponent = 0.0) AND (SELF\named_unit.dimensions.amount_of_substance_exponent = 0.0) AND (SELF\named_unit.dimensions.luminous_intensity_exponent = 0.0); +END_ENTITY; + +ENTITY length_unit + SUBTYPE OF (named_unit); + WHERE + WR1 : (SELF\named_unit.dimensions.length_exponent = 1.0) AND + (SELF\named_unit.dimensions.mass_exponent = 0.0) AND + (SELF\named_unit.dimensions.time_exponent = 0.0) AND + (SELF\named_unit.dimensions.electric_current_exponent = 0.0) AND + (SELF\named_unit.dimensions.thermodynamic_temperature_exponent = 0.0) AND + (SELF\named_unit.dimensions.amount_of_substance_exponent = 0.0) AND + (SELF\named_unit.dimensions.luminous_intensity_exponent = 0.0); +END_ENTITY; + +ENTITY time_unit + SUBTYPE OF (named_unit); + WHERE + WR1 : (SELF\named_unit.dimensions.length_exponent = 0.0) AND (SELF\named_unit.dimensions.mass_exponent = 0.0) AND (SELF\named_unit.dimensions.time_exponent = 1.0) AND (SELF\named_unit.dimensions.electric_current_exponent = 0.0) AND (SELF\named_unit.dimensions.thermodynamic_temperature_exponent = 0.0) AND (SELF\named_unit.dimensions.amount_of_substance_exponent = 0.0) AND (SELF\named_unit.dimensions.luminous_intensity_exponent = 0.0); +END_ENTITY; + + +END_SCHEMA; diff --git a/test/unitary_schemas/uninitialized_edge_list.exp b/test/unitary_schemas/uninitialized_edge_list.exp new file mode 100644 index 00000000..bbe6b582 --- /dev/null +++ b/test/unitary_schemas/uninitialized_edge_list.exp @@ -0,0 +1,41 @@ +(* + * Fragment of ap203.exp + * starseeker: _edge_list is initialized to null when an SdaiEdge_loop is created + *) + +SCHEMA uninitialized_edge_list; + + ENTITY edge_loop + SUBTYPE OF (loop, path); + DERIVE + ne : INTEGER := SIZEOF(SELF\path.edge_list); +-- WHERE +-- wr1: (SELF\path.edge_list[1].edge_start :=: SELF\path.edge_list[ne]. +-- edge_end); + END_ENTITY; -- edge_loop + + ENTITY loop + SUPERTYPE OF (edge_loop) + SUBTYPE OF (topological_representation_item); + END_ENTITY; -- loop + + ENTITY path + SUPERTYPE OF (edge_loop) + SUBTYPE OF (topological_representation_item); + edge_list : LIST [1:?] OF UNIQUE INTEGER; -- was oriented_edge +-- WHERE +-- wr1: path_head_to_tail(SELF); + END_ENTITY; -- path + + ENTITY topological_representation_item + SUPERTYPE OF (ONEOF (loop ANDOR path)) + SUBTYPE OF (representation_item); + END_ENTITY; -- topological_representation_item + + ENTITY representation_item; + name : STRING; -- was label +-- WHERE +-- wr1: (SIZEOF(using_representations(SELF)) > 0); + END_ENTITY; -- representation_item + +END_SCHEMA;