(* AIM EXPRESS long form for ISO/CD 10303-219
   2004-10-15
   Len Slovensky
   ISO TC184/SC4/WG3 N1517
*)

SCHEMA dimensional_inspection_schema;

  CONSTANT
  dummy_gri : geometric_representation_item := representation_item('') || 
       geometric_representation_item();
  dummy_tri : topological_representation_item := representation_item('') 
       || topological_representation_item();
  END_CONSTANT;

  TYPE ahead_or_behind = ENUMERATION OF
    (exact,
     ahead,
     behind);
  END_TYPE; -- ahead_or_behind

  TYPE amount_of_substance_measure = REAL;
  END_TYPE; -- amount_of_substance_measure

  TYPE angle_relator = ENUMERATION OF
    (equal,
     small,
     large);
  END_TYPE; -- angle_relator

  TYPE area_measure = REAL;
  END_TYPE; -- area_measure

  TYPE attribute_type = SELECT
    (label,
     text);
  END_TYPE; -- attribute_type

  TYPE axis2_placement = SELECT
    (axis2_placement_2d,
     axis2_placement_3d);
  END_TYPE; -- axis2_placement

  TYPE b_spline_curve_form = ENUMERATION OF
    (elliptic_arc,
     polyline_form,
     parabolic_arc,
     circular_arc,
     unspecified,
     hyperbolic_arc);
  END_TYPE; -- b_spline_curve_form

  TYPE b_spline_surface_form = ENUMERATION OF
    (surf_of_linear_extrusion,
     plane_surf,
     generalised_cone,
     toroidal_surf,
     conical_surf,
     spherical_surf,
     unspecified,
     ruled_surf,
     surf_of_revolution,
     cylindrical_surf,
     quadric_surf);
  END_TYPE; -- b_spline_surface_form

  TYPE boolean_operand = SELECT
    (solid_model);
  END_TYPE; -- boolean_operand

  TYPE celsius_temperature_measure = REAL;
  END_TYPE; -- celsius_temperature_measure

  TYPE characterized_action_definition = SELECT
    (action,
     action_method);
  END_TYPE; -- characterized_action_definition

  TYPE characterized_definition = SELECT
    (characterized_object,
     characterized_product_definition,
     shape_definition);
  END_TYPE; -- characterized_definition

  TYPE characterized_product_definition = SELECT
    (product_definition);
  END_TYPE; -- characterized_product_definition

  TYPE characterized_resource_definition = SELECT
    (action_resource,
     action_resource_requirement);
  END_TYPE; -- characterized_resource_definition

  TYPE compound_item_definition = SELECT
    (set_representation_item);
  END_TYPE; -- compound_item_definition

  TYPE count_measure = NUMBER;
  END_TYPE; -- count_measure

  TYPE curve_on_surface = SELECT
    (pcurve,
     surface_curve,
     composite_curve_on_surface);
  END_TYPE; -- curve_on_surface

  TYPE date_item = SELECT
    (dm_program_run);
  END_TYPE; -- date_item

  TYPE date_time_or_event_occurrence = SELECT
    (date_time_select);
  END_TYPE; -- date_time_or_event_occurrence

  TYPE date_time_select = SELECT
    (date,
     local_time,
     date_and_time);
  END_TYPE; -- date_time_select

  TYPE day_in_month_number = INTEGER;
  WHERE
wr1: (1 <= SELF) AND (SELF <= 31);
  END_TYPE; -- day_in_month_number

  TYPE derived_property_select = SELECT
    (property_definition,
     action_property,
     resource_property);
  END_TYPE; -- derived_property_select

  TYPE description_attribute_select = SELECT
    (application_context,
     date_role,
     external_source,
     organization_role,
     person_and_organization_role,
     person_and_organization,
     property_definition_representation,
     representation);
  END_TYPE; -- description_attribute_select

  TYPE dimension_count = INTEGER;
  WHERE
wr1: SELF > 0;
  END_TYPE; -- dimension_count

  TYPE dimensional_characteristic = SELECT
    (dimensional_location,
     dimensional_size);
  END_TYPE; -- dimensional_characteristic

  TYPE document_reference_item = SELECT
    (product_definition_formation,
     externally_defined_feature_definition,
     externally_defined_dimension_definition);
  END_TYPE; -- document_reference_item

  TYPE electric_current_measure = REAL;
  END_TYPE; -- electric_current_measure

  TYPE founded_item_select = SELECT
    (founded_item,
     representation_item);
  END_TYPE; -- founded_item_select

  TYPE geometric_set_select = SELECT
    (point,
     curve,
     surface);
  END_TYPE; -- geometric_set_select

  TYPE hour_in_day = INTEGER;
  WHERE
wr1: (0 <= SELF) AND (SELF < 24);
  END_TYPE; -- hour_in_day

  TYPE id_attribute_select = SELECT
    (action,
     address,
     property_definition,
     shape_aspect,
     shape_aspect_relationship,
     application_context,
     organizational_project,
     representation);
  END_TYPE; -- id_attribute_select

  TYPE identifier = STRING;
  END_TYPE; -- identifier

  TYPE knot_type = ENUMERATION OF
    (uniform_knots,
     quasi_uniform_knots,
     piecewise_bezier_knots,
     unspecified);
  END_TYPE; -- knot_type

  TYPE label = STRING;
  END_TYPE; -- label

  TYPE length_measure = REAL;
  END_TYPE; -- length_measure

  TYPE limit_condition = ENUMERATION OF
    (regardless_of_feature_size,
     maximum_material_condition,
     least_material_condition);
  END_TYPE; -- limit_condition

  TYPE list_of_reversible_topology_item = LIST [0:?] OF
    reversible_topology_item;
  END_TYPE; -- list_of_reversible_topology_item

  TYPE luminous_intensity_measure = REAL;
  END_TYPE; -- luminous_intensity_measure

  TYPE mass_measure = REAL;
  END_TYPE; -- mass_measure

  TYPE measure_value = SELECT
    (length_measure,
     mass_measure,
     time_measure,
     electric_current_measure,
     thermodynamic_temperature_measure,
     celsius_temperature_measure,
     amount_of_substance_measure,
     luminous_intensity_measure,
     plane_angle_measure,
     solid_angle_measure,
     area_measure,
     volume_measure,
     ratio_measure,
     parameter_value,
     positive_length_measure,
     positive_plane_angle_measure,
     count_measure);
  END_TYPE; -- measure_value

  TYPE minute_in_hour = INTEGER;
  WHERE
wr1: (0 <= SELF) AND (SELF <= 59);
  END_TYPE; -- minute_in_hour

  TYPE month_in_year_number = INTEGER;
  WHERE
wr1: (1 <= SELF) AND (SELF <= 12);
  END_TYPE; -- month_in_year_number

  TYPE name_attribute_select = SELECT
    (address,
     derived_unit,
     person_and_organization,
     product_definition,
     property_definition_representation);
  END_TYPE; -- name_attribute_select

  TYPE organization_item = SELECT
    (dm_program_identification,
     dm_program_run);
  END_TYPE; -- organization_item

  TYPE parameter_value = REAL;
  END_TYPE; -- parameter_value

  TYPE pcurve_or_surface = SELECT
    (pcurve,
     surface);
  END_TYPE; -- pcurve_or_surface

  TYPE person_and_organization_item = SELECT
    (dm_program_identification,
     dm_program_run);
  END_TYPE; -- person_and_organization_item

  TYPE person_organization_select = SELECT
    (person,
     organization,
     person_and_organization);
  END_TYPE; -- person_organization_select

  TYPE plane_angle_measure = REAL;
  END_TYPE; -- plane_angle_measure

  TYPE positive_length_measure = length_measure;
  WHERE
wr1: SELF > 0;
  END_TYPE; -- positive_length_measure

  TYPE positive_plane_angle_measure = plane_angle_measure;
  WHERE
wr1: SELF > 0;
  END_TYPE; -- positive_plane_angle_measure

  TYPE preferred_surface_curve_representation = ENUMERATION OF
    (pcurve_s2,
     pcurve_s1,
     curve_3d);
  END_TYPE; -- preferred_surface_curve_representation

  TYPE product_or_formation_or_definition = SELECT
    (product,
     product_definition_formation,
     product_definition);
  END_TYPE; -- product_or_formation_or_definition

  TYPE property_or_shape_select = SELECT
    (property_definition,
     shape_definition);
  END_TYPE; -- property_or_shape_select

  TYPE ratio_measure = REAL;
  END_TYPE; -- ratio_measure

  TYPE represented_definition = SELECT
    (property_definition,
     property_definition_relationship,
     shape_aspect,
     shape_aspect_relationship);
  END_TYPE; -- represented_definition

  TYPE reversible_topology = SELECT
    (reversible_topology_item,
     list_of_reversible_topology_item,
     set_of_reversible_topology_item);
  END_TYPE; -- reversible_topology

  TYPE reversible_topology_item = SELECT
    (edge,
     path,
     face,
     face_bound,
     closed_shell,
     open_shell);
  END_TYPE; -- reversible_topology_item

  TYPE role_select = SELECT
    (document_reference,
     security_classification_assignment);
  END_TYPE; -- role_select

  TYPE second_in_minute = REAL;
  WHERE
wr1: (0 <= SELF) AND (SELF <= 60);
  END_TYPE; -- second_in_minute

  TYPE security_classification_item = SELECT
    (product_definition_formation);
  END_TYPE; -- security_classification_item

  TYPE set_of_reversible_topology_item = SET [0:?] OF
    reversible_topology_item;
  END_TYPE; -- set_of_reversible_topology_item

  TYPE set_representation_item = SET [1:?] OF representation_item;
  END_TYPE; -- set_representation_item

  TYPE shape_definition = SELECT
    (product_definition_shape,
     shape_aspect,
     shape_aspect_relationship);
  END_TYPE; -- shape_definition

  TYPE shell = SELECT
    (open_shell,
     closed_shell);
  END_TYPE; -- shell

  TYPE si_prefix = ENUMERATION OF
    (exa,
     pico,
     mega,
     femto,
     atto,
     centi,
     nano,
     hecto,
     micro,
     tera,
     giga,
     milli,
     peta,
     deci,
     kilo,
     deca);
  END_TYPE; -- si_prefix

  TYPE si_unit_name = ENUMERATION OF
    (hertz,
     degree_celsius,
     siemens,
     sievert,
     lux,
     watt,
     ohm,
     second,
     becquerel,
     pascal,
     henry,
     tesla,
     volt,
     joule,
     kelvin,
     ampere,
     gram,
     steradian,
     mole,
     lumen,
     gray,
     candela,
     farad,
     radian,
     newton,
     metre,
     weber,
     coulomb);
  END_TYPE; -- si_unit_name

  TYPE solid_angle_measure = REAL;
  END_TYPE; -- solid_angle_measure

  TYPE source_item = SELECT
    (identifier);
  END_TYPE; -- source_item

  TYPE supported_item = SELECT
    (action,
     action_method);
  END_TYPE; -- supported_item

  TYPE text = STRING;
  END_TYPE; -- text

  TYPE thermodynamic_temperature_measure = REAL;
  END_TYPE; -- thermodynamic_temperature_measure

  TYPE time_measure = REAL;
  END_TYPE; -- time_measure

  TYPE tolerance_method_definition = SELECT
    (tolerance_value,
     limits_and_fits);
  END_TYPE; -- tolerance_method_definition

  TYPE tolerance_select = SELECT
    (geometric_tolerance,
     plus_minus_tolerance);
  END_TYPE; -- tolerance_select

  TYPE transformation = SELECT
    (functionally_defined_transformation);
  END_TYPE; -- transformation

  TYPE transition_code = ENUMERATION OF
    (discontinuous,
     cont_same_gradient_same_curvature,
     cont_same_gradient,
     continuous);
  END_TYPE; -- transition_code

  TYPE trimming_select = SELECT
    (cartesian_point,
     parameter_value);
  END_TYPE; -- trimming_select

  TYPE unit = SELECT
    (named_unit,
     derived_unit);
  END_TYPE; -- unit

  TYPE value_qualifier = SELECT
    (precision_qualifier,
     type_qualifier,
     uncertainty_qualifier);
  END_TYPE; -- value_qualifier

  TYPE vector_or_direction = SELECT
    (vector,
     direction);
  END_TYPE; -- vector_or_direction

  TYPE volume_measure = REAL;
  END_TYPE; -- volume_measure

  TYPE year_number = INTEGER;
  END_TYPE; -- year_number

  ENTITY action;
      name: label;
      description   : OPTIONAL text;
      chosen_method : action_method;
    DERIVE
      id : identifier := get_id_value(SELF);
    WHERE
  wr1: SIZEOF(USEDIN(SELF,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'ID_ATTRIBUTE.IDENTIFIED_ITEM')) <= 1;
  END_ENTITY; -- action

  ENTITY action_method;
      name        : label;
      description : OPTIONAL text;
      consequence : text;
      purpose     : text;
  END_ENTITY; -- action_method

  ENTITY action_property;
      name        : label;
      description : text;
      definition  : characterized_action_definition;
  END_ENTITY; -- action_property

  ENTITY action_property_representation;
      name : label;
      description    : text;
      property       : action_property;
      representation : representation;
  END_ENTITY; -- action_property_representation

  ENTITY action_resource;
      name        : label;
      description : OPTIONAL text;
      usage       : SET [1:?] OF supported_item;
      kind        : action_resource_type;
  END_ENTITY; -- action_resource

  ENTITY action_resource_requirement;
      name        : label;
      description : text;
      kind        : resource_requirement_type;
      OPERATIONS  : SET [1:?] OF characterized_action_definition;
  END_ENTITY; -- action_resource_requirement

  ENTITY action_resource_type;
      name : label;
  END_ENTITY; -- action_resource_type

  ENTITY address;
      internal_location       : OPTIONAL label;
      street_number : OPTIONAL label;
      street        : OPTIONAL label;
      postal_box    : OPTIONAL label;
      town: OPTIONAL label;
      region        : OPTIONAL label;
      postal_code   : OPTIONAL label;
      country       : OPTIONAL label;
      facsimile_number        : OPTIONAL label;
      telephone_number        : OPTIONAL label;
      electronic_mail_address : OPTIONAL label;
      telex_number  : OPTIONAL label;
    DERIVE
      name : label := get_name_value(SELF);
      url  : identifier := get_id_value(SELF);
    WHERE
  wr1: ((((((((((EXISTS(internal_location) OR EXISTS(street_number)) 
         OR EXISTS(street)) OR EXISTS(postal_box)) OR EXISTS(town)) 
         OR EXISTS(region)) OR EXISTS(postal_code)) OR EXISTS(country)) 
         OR EXISTS(facsimile_number)) OR EXISTS(telephone_number)) OR
         EXISTS(electronic_mail_address)) OR EXISTS(telex_number);
  END_ENTITY; -- address

  ENTITY advanced_brep_shape_representation
    SUBTYPE OF (shape_representation);
    WHERE
  wr1: SIZEOF(QUERY ( it <* SELF.items | (NOT (SIZEOF([
       'DIMENSIONAL_INSPECTION_SCHEMA.MANIFOLD_SOLID_BREP',
       'DIMENSIONAL_INSPECTION_SCHEMA.FACETED_BREP',
       'DIMENSIONAL_INSPECTION_SCHEMA.MAPPED_ITEM',
       'DIMENSIONAL_INSPECTION_SCHEMA.AXIS2_PLACEMENT_3D'] * 
       TYPEOF(it)) = 1)) )) = 0;
  wr2: SIZEOF(QUERY ( it <* SELF.items | (SIZEOF([
       'DIMENSIONAL_INSPECTION_SCHEMA.MANIFOLD_SOLID_BREP',
       'DIMENSIONAL_INSPECTION_SCHEMA.MAPPED_ITEM'] * TYPEOF(it)) =
        1) )) > 0;
  wr3: SIZEOF(QUERY ( msb <* QUERY ( it <* SELF.items | (
       'DIMENSIONAL_INSPECTION_SCHEMA.MANIFOLD_SOLID_BREP' IN 
       TYPEOF(it)) ) | (NOT (SIZEOF(QUERY ( csh <* msb_shells(msb)
       | (NOT (SIZEOF(QUERY ( fcs <* csh\connected_face_set.
       cfs_faces | (NOT (
       'DIMENSIONAL_INSPECTION_SCHEMA.ADVANCED_FACE' 
        IN TYPEOF(fcs))) )) = 0)) )) = 0)) )) = 0;
  wr4: SIZEOF(QUERY ( msb <* QUERY ( it <* items | (
       'DIMENSIONAL_INSPECTION_SCHEMA.MANIFOLD_SOLID_BREP' IN 
       TYPEOF(it)) ) | (
       'DIMENSIONAL_INSPECTION_SCHEMA.ORIENTED_CLOSED_SHELL' IN 
       TYPEOF(msb\manifold_solid_brep.outer)) )) = 0;
  wr5: SIZEOF(QUERY ( brv <* QUERY ( it <* items | (
       'DIMENSIONAL_INSPECTION_SCHEMA.BREP_WITH_VOIDS' IN TYPEOF(it)) )
       | (NOT (SIZEOF(QUERY ( csh <* brv\brep_with_voids.voids | 
       csh\oriented_closed_shell.orientation )) = 0)) )) = 0;
  wr6: SIZEOF(QUERY ( mi <* QUERY ( it <* items | (
       'DIMENSIONAL_INSPECTION_SCHEMA.MAPPED_ITEM' IN TYPEOF(it)) )| (NOT 
       ('DIMENSIONAL_INSPECTION_SCHEMA.ADVANCED_BREP_SHAPE_REPRESENTATION' 
       IN TYPEOF(mi\mapped_item.mapping_source.
       mapped_representation))) )) = 0;
  END_ENTITY; -- advanced_brep_shape_representation

  ENTITY advanced_face
    SUBTYPE OF (face_surface);
    WHERE
  wr1 : SIZEOF(['DIMENSIONAL_INSPECTION_SCHEMA.ELEMENTARY_SURFACE',
      'DIMENSIONAL_INSPECTION_SCHEMA.B_SPLINE_SURFACE',
      'DIMENSIONAL_INSPECTION_SCHEMA.SWEPT_SURFACE'] * TYPEOF(
      face_geometry)) = 1;
  wr2 : SIZEOF(QUERY ( elp_fbnds <* QUERY ( bnds <* bounds | (
      'DIMENSIONAL_INSPECTION_SCHEMA.EDGE_LOOP' IN TYPEOF(bnds.
      bound)) ) | (NOT (SIZEOF(QUERY ( oe <* elp_fbnds.bound\path
      .edge_list | (NOT (
      'DIMENSIONAL_INSPECTION_SCHEMA.EDGE_CURVE' IN TYPEOF(oe\
      oriented_edge.edge_element))) )) = 0)) )) = 0;
  wr3 : SIZEOF(QUERY ( elp_fbnds <* QUERY ( bnds <* bounds | (
      'DIMENSIONAL_INSPECTION_SCHEMA.EDGE_LOOP' IN TYPEOF(bnds.
      bound)) ) | (NOT (SIZEOF(QUERY ( oe <* elp_fbnds.bound\path
      .edge_list | (NOT (SIZEOF([
      'DIMENSIONAL_INSPECTION_SCHEMA.LINE',
      'DIMENSIONAL_INSPECTION_SCHEMA.CONIC',
      'DIMENSIONAL_INSPECTION_SCHEMA.POLYLINE',
      'DIMENSIONAL_INSPECTION_SCHEMA.SURFACE_CURVE',
      'DIMENSIONAL_INSPECTION_SCHEMA.B_SPLINE_CURVE'] * TYPEOF(oe
      .edge_element\edge_curve.edge_geometry)) = 1)) )) = 0)) )) 
      = 0;
  wr4 : SIZEOF(QUERY ( elp_fbnds <* QUERY ( bnds <* bounds | (
      'DIMENSIONAL_INSPECTION_SCHEMA.EDGE_LOOP' IN TYPEOF(bnds.
      bound)) ) | (NOT (SIZEOF(QUERY ( oe <* elp_fbnds.bound\path
      .edge_list | (NOT (((
      'DIMENSIONAL_INSPECTION_SCHEMA.VERTEX_POINT' IN TYPEOF(oe\
      edge.edge_start)) AND (
      'DIMENSIONAL_INSPECTION_SCHEMA.CARTESIAN_POINT' IN TYPEOF(
      oe\edge.edge_start\vertex_point.vertex_geometry))) AND ((
      'DIMENSIONAL_INSPECTION_SCHEMA.VERTEX_POINT' IN TYPEOF(oe\
      edge.edge_end)) AND (
      'DIMENSIONAL_INSPECTION_SCHEMA.CARTESIAN_POINT' IN TYPEOF(
      oe\edge.edge_end\vertex_point.vertex_geometry))))) )) = 0)) )) 
      = 0;
  wr5 : SIZEOF(QUERY ( elp_fbnds <* QUERY ( bnds <* bounds | (
      'DIMENSIONAL_INSPECTION_SCHEMA.EDGE_LOOP' IN TYPEOF(bnds.
      bound)) ) | ('DIMENSIONAL_INSPECTION_SCHEMA.ORIENTED_PATH' 
      IN TYPEOF(elp_fbnds.bound)) )) = 0;
  wr6 : (NOT ('DIMENSIONAL_INSPECTION_SCHEMA.SWEPT_SURFACE' IN TYPEOF(
      face_geometry))) OR (SIZEOF([
      'DIMENSIONAL_INSPECTION_SCHEMA.LINE',
      'DIMENSIONAL_INSPECTION_SCHEMA.CONIC',
      'DIMENSIONAL_INSPECTION_SCHEMA.POLYLINE',
      'DIMENSIONAL_INSPECTION_SCHEMA.B_SPLINE_CURVE'] * TYPEOF(
      face_geometry\swept_surface.swept_curve)) = 1);
  wr7 : SIZEOF(QUERY ( vlp_fbnds <* QUERY ( bnds <* bounds | (
      'DIMENSIONAL_INSPECTION_SCHEMA.VERTEX_LOOP' IN TYPEOF(bnds.
      bound)) ) | (NOT ((
      'DIMENSIONAL_INSPECTION_SCHEMA.VERTEX_POINT' IN TYPEOF(
      vlp_fbnds\face_bound.bound\vertex_loop.loop_vertex)) AND (
      'DIMENSIONAL_INSPECTION_SCHEMA.CARTESIAN_POINT' IN TYPEOF(
      vlp_fbnds\face_bound.bound\vertex_loop.loop_vertex\
      vertex_point.vertex_geometry)))) )) = 0;
  wr8 : SIZEOF(QUERY ( bnd <* bounds | (NOT (SIZEOF([
      'DIMENSIONAL_INSPECTION_SCHEMA.EDGE_LOOP',
      'DIMENSIONAL_INSPECTION_SCHEMA.VERTEX_LOOP'] * TYPEOF(bnd.
      bound)) = 1)) )) = 0;
  wr9 : SIZEOF(QUERY ( elp_fbnds <* QUERY ( bnds <* bounds | (
      'DIMENSIONAL_INSPECTION_SCHEMA.EDGE_LOOP' IN TYPEOF(bnds.
      bound)) ) | (NOT (SIZEOF(QUERY ( oe <* elp_fbnds.bound\path
      .edge_list | ((
      'DIMENSIONAL_INSPECTION_SCHEMA.SURFACE_CURVE' IN TYPEOF(oe\
      oriented_edge.edge_element\edge_curve.edge_geometry)) AND (
      NOT (SIZEOF(QUERY ( sc_ag <* oe.edge_element\edge_curve.
      edge_geometry\surface_curve.associated_geometry | (NOT (
      'DIMENSIONAL_INSPECTION_SCHEMA.PCURVE' IN TYPEOF(sc_ag))) )) 
      = 0))) )) = 0)) )) = 0;
  wr10: ((NOT ('DIMENSIONAL_INSPECTION_SCHEMA.SWEPT_SURFACE' IN 
      TYPEOF(face_geometry))) OR ((NOT (
      'DIMENSIONAL_INSPECTION_SCHEMA.POLYLINE' IN TYPEOF(
      face_geometry\swept_surface.swept_curve))) OR (SIZEOF(
      face_geometry\swept_surface.swept_curve\polyline.points) >=
       3))) AND (SIZEOF(QUERY ( elp_fbnds <* QUERY ( bnds <* 
      bounds | ('DIMENSIONAL_INSPECTION_SCHEMA.EDGE_LOOP' IN 
      TYPEOF(bnds.bound)) ) | (NOT (SIZEOF(QUERY ( oe <* 
      elp_fbnds.bound\path.edge_list | ((
      'DIMENSIONAL_INSPECTION_SCHEMA.POLYLINE' IN TYPEOF(oe\
      oriented_edge.edge_element\edge_curve.edge_geometry)) AND (
      NOT (SIZEOF(oe\oriented_edge.edge_element\edge_curve.
      edge_geometry\polyline.points) >= 3))) )) = 0)) )) = 0);
  END_ENTITY; -- advanced_face

  ENTITY angular_location
    SUBTYPE OF (dimensional_location);
      angle_selection : angle_relator;
  END_ENTITY; -- angular_location

  ENTITY angular_size
    SUBTYPE OF (dimensional_size);
      angle_selection : angle_relator;
  END_ENTITY; -- angular_size

  ENTITY angularity_tolerance
    SUBTYPE OF (geometric_tolerance_with_datum_reference);
    WHERE
  wr1: SIZEOF(SELF\geometric_tolerance_with_datum_reference.
     datum_system) < 3;
  END_ENTITY; -- angularity_tolerance

  ENTITY apex
    SUBTYPE OF (derived_shape_aspect);
  END_ENTITY; -- apex

  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,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1;
  wr2: SIZEOF(USEDIN(SELF,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'ID_ATTRIBUTE.IDENTIFIED_ITEM')) <= 1;
  END_ENTITY; -- application_context

  ENTITY application_context_element
    SUPERTYPE OF (ONEOF (product_context,product_definition_context));
      name     : label;
      frame_of_reference : application_context;
  END_ENTITY; -- application_context_element

  ENTITY application_protocol_definition;
      status      : label;
      application_interpreted_model_schema_name : label;
      application_protocol_year       : year_number;
      application : application_context;
  END_ENTITY; -- application_protocol_definition

  ENTITY applied_area
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN 
     TYPEOF(SELF.of_shape);
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) )) = 1)) )) = 0;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT ((2 <= SIZEOF(impl_rep.
     used_representation.items)) AND (SIZEOF(impl_rep.
     used_representation.items) <= 3))) )) = 0)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) AND (SIZEOF(QUERY ( srwp_i <* pdr.
     used_representation.items | (NOT (srwp_i.name IN [
     'orientation','effective length','maximum length'])) )) > 0)) )) 
     = 0) )) = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
     TYPEOF(it)) = 2) AND (it.name = 'effective length')) )) = 1)) )) 
     = 0)) )) <= 1;
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
     TYPEOF(it)) = 2) AND (it.name = 'maximum length')) )) <= 1)) )) 
     = 0)) )) = 0;
  wr7: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) AND
      (it.name = 'orientation')) )) = 1)) )) = 0)) )) = 0;
  END_ENTITY; -- applied_area

  ENTITY applied_date_assignment
    SUBTYPE OF (date_assignment);
      items : SET [1:?] OF date_item;
  END_ENTITY; -- applied_date_assignment

  ENTITY applied_document_reference
    SUBTYPE OF (document_reference);
      items : SET [1:?] OF document_reference_item;
  END_ENTITY; -- applied_document_reference

  ENTITY applied_organization_assignment
    SUBTYPE OF (organization_assignment);
      items : SET [1:?] OF organization_item;
  END_ENTITY; -- applied_organization_assignment

  ENTITY applied_person_organization_assignment
    SUBTYPE OF (person_and_organization_assignment);
      items : SET [1:?] OF person_and_organization_item;
  END_ENTITY; -- applied_person_organization_assignment

  ENTITY applied_security_classification_assignment
    SUBTYPE OF (security_classification_assignment);
      items : SET [1:?] OF security_classification_item;
  END_ENTITY; -- applied_security_classification_assignment

  ENTITY axis1_placement
    SUBTYPE OF (placement);
      axis : OPTIONAL direction;
    DERIVE
      z : direction := NVL(normalise(axis),dummy_gri || direction([0,0,1]));
    WHERE
  wr1: SELF\geometric_representation_item.dim = 3;
  END_ENTITY; -- axis1_placement

  ENTITY axis2_placement_2d
    SUBTYPE OF (placement);
      ref_direction : OPTIONAL direction;
    DERIVE
      p : LIST [2:2] OF direction := build_2axes(ref_direction);
    WHERE
  wr1: SELF\geometric_representation_item.dim = 2;
  END_ENTITY; -- axis2_placement_2d

  ENTITY axis2_placement_3d
    SUBTYPE OF (placement);
      axis: OPTIONAL direction;
      ref_direction : OPTIONAL direction;
    DERIVE
      p : LIST [3:3] OF direction := build_axes(axis,ref_direction);
    WHERE
  wr1: SELF\placement.location.dim = 3;
  wr2: (NOT EXISTS(axis)) OR (axis.dim = 3);
  wr3: (NOT EXISTS(ref_direction)) OR (ref_direction.dim = 3);
  wr4: ((NOT EXISTS(axis)) OR (NOT EXISTS(ref_direction))) OR (
     cross_product(axis,ref_direction).magnitude > 0);
  END_ENTITY; -- axis2_placement_3d

  ENTITY b_spline_curve
    SUPERTYPE OF (ONEOF (uniform_curve,b_spline_curve_with_knots,
        quasi_uniform_curve,bezier_curve) ANDOR rational_b_spline_curve)
    SUBTYPE OF (bounded_curve);
      degree    : INTEGER;
      control_points_list : LIST [2:?] OF cartesian_point;
      curve_form: b_spline_curve_form;
      closed_curve        : LOGICAL;
      self_intersect      : LOGICAL;
    DERIVE
      upper_index_on_control_points : INTEGER := SIZEOF(
      control_points_list) - 1;
      control_points      : ARRAY [0:
      upper_index_on_control_points] OF
      cartesian_point := list_to_array(
      control_points_list,0,
      upper_index_on_control_points);
    WHERE
  wr1: ((('DIMENSIONAL_INSPECTION_SCHEMA.UNIFORM_CURVE' IN TYPEOF(SELF)) 
    OR ('DIMENSIONAL_INSPECTION_SCHEMA.QUASI_UNIFORM_CURVE' IN 
    TYPEOF(SELF))) OR (
    'DIMENSIONAL_INSPECTION_SCHEMA.BEZIER_CURVE' IN TYPEOF(SELF))) 
    OR (
    'DIMENSIONAL_INSPECTION_SCHEMA.B_SPLINE_CURVE_WITH_KNOTS' IN
     TYPEOF(SELF));
  END_ENTITY; -- b_spline_curve

  ENTITY b_spline_curve_with_knots
    SUBTYPE OF (b_spline_curve);
      knot_multiplicities : LIST [2:?] OF INTEGER;
      knots    : LIST [2:?] OF parameter_value;
      knot_spec: knot_type;
    DERIVE
      upper_index_on_knots : INTEGER := SIZEOF(knots);
    WHERE
  wr1: constraints_param_b_spline(degree,upper_index_on_knots,
    upper_index_on_control_points,knot_multiplicities,knots);
  wr2: SIZEOF(knot_multiplicities) = upper_index_on_knots;
  END_ENTITY; -- b_spline_curve_with_knots

  ENTITY b_spline_surface
    SUPERTYPE OF (ONEOF (b_spline_surface_with_knots,uniform_surface,
        quasi_uniform_surface,bezier_surface) ANDOR 
        rational_b_spline_surface)
    SUBTYPE OF (bounded_surface);
      u_degree : INTEGER;
      v_degree : INTEGER;
      control_points_list : LIST [2:?] OF LIST [2:?] OF cartesian_point;
      surface_form        : b_spline_surface_form;
      u_closed : LOGICAL;
      v_closed : LOGICAL;
      self_intersect      : LOGICAL;
    DERIVE
      u_upper        : INTEGER := SIZEOF(control_points_list) - 1;
      v_upper        : INTEGER := SIZEOF(control_points_list[1]) - 1;
      control_points : ARRAY [0:u_upper] OF ARRAY [0:v_upper] OF
     cartesian_point := make_array_of_array(
    control_points_list,0,u_upper,0,v_upper);
    WHERE
  wr1: ((('DIMENSIONAL_INSPECTION_SCHEMA.UNIFORM_SURFACE' IN TYPEOF(
    SELF)) OR (
    'DIMENSIONAL_INSPECTION_SCHEMA.QUASI_UNIFORM_SURFACE' IN 
    TYPEOF(SELF))) OR (
    'DIMENSIONAL_INSPECTION_SCHEMA.BEZIER_SURFACE' IN TYPEOF(
    SELF))) OR (
    'DIMENSIONAL_INSPECTION_SCHEMA.B_SPLINE_SURFACE_WITH_KNOTS' 
    IN TYPEOF(SELF));
  END_ENTITY; -- b_spline_surface

  ENTITY b_spline_surface_with_knots
    SUBTYPE OF (b_spline_surface);
      u_multiplicities : LIST [2:?] OF INTEGER;
      v_multiplicities : LIST [2:?] OF INTEGER;
      u_knots          : LIST [2:?] OF parameter_value;
      v_knots          : LIST [2:?] OF parameter_value;
      knot_spec        : knot_type;
    DERIVE
      knot_u_upper : INTEGER := SIZEOF(u_knots);
      knot_v_upper : INTEGER := SIZEOF(v_knots);
    WHERE
  wr1: constraints_param_b_spline(SELF\b_spline_surface.u_degree,
    knot_u_upper,SELF\b_spline_surface.u_upper,u_multiplicities,
    u_knots);
  wr2: constraints_param_b_spline(SELF\b_spline_surface.v_degree,
    knot_v_upper,SELF\b_spline_surface.v_upper,v_multiplicities,
    v_knots);
  wr3: SIZEOF(u_multiplicities) = knot_u_upper;
  wr4: SIZEOF(v_multiplicities) = knot_v_upper;
  END_ENTITY; -- b_spline_surface_with_knots

  ENTITY bezier_curve
    SUBTYPE OF (b_spline_curve);
  END_ENTITY; -- bezier_curve

  ENTITY bezier_surface
    SUBTYPE OF (b_spline_surface);
  END_ENTITY; -- bezier_surface

  ENTITY block_shape_representation
    SUBTYPE OF (shape_representation_with_parameters);
    WHERE
  wr1: SIZEOF(SELF.items) = 4;
  wr2: SIZEOF(QUERY ( it <* SELF.items | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) AND
     (it.name = 'orientation')) )) = 1;
  wr3: SIZEOF(QUERY ( it <* SELF.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'length')) )) = 1;
  wr4: SIZEOF(QUERY ( it <* SELF.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'width')) )) = 1;
  wr5: SIZEOF(QUERY ( it <* SELF.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'height')) )) = 1;
  END_ENTITY; -- block_shape_representation

  ENTITY boss
    SUBTYPE OF (feature_definition);
    WHERE
  wr1 : SELF\characterized_object.description IN ['circular','complex',
     'rectangular'];
  wr2 : SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'boss height occurrence') AND (SIZEOF(
     QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'path feature component usage') AND ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_DEFINING_RELATIONSHIP') IN TYPEOF(sar))) ) | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.PATH_FEATURE_COMPONENT' IN 
     TYPEOF(sdr.relating_shape_aspect)) AND (sdr.
     relating_shape_aspect.description = 'linear')) AND (sdr.
     name = 'boss height')) )) = 1)) )) = 1)) )) = 0;
  wr3 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) AND ((1 <= SIZEOF(pdr.
     used_representation.items)) AND (SIZEOF(pdr.
     used_representation.items) <= 2))) )) = 1) )) = 1;
  wr4 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) AND (SIZEOF(QUERY ( srwp_i <* pdr.
     used_representation.items | ((srwp_i.name = 'orientation') 
     OR (srwp_i.name = 'fillet radius')) )) = SIZEOF(pdr.
     used_representation.items))) )) = 1) )) = 1;
  wr5 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
       'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'fillet radius')) )) <= 1)) )) 
     = 0)) )) = 0;
  wr6 : (NOT (SELF\characterized_object.description = 'circular')) OR 
     (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
       'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'circular profile occurrence') AND (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'profile usage') AND ('DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_CLOSED_PROFILE' IN 
     TYPEOF(sdr.relating_shape_aspect)) )) = 1)) )) = 1)) )) = 0);
  wr7 : SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'top condition occurrence') AND (
     SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.'+
     'RELATED_SHAPE_ASPECT')
      | ((sar.description = 'boss top usage') AND 
      ('DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.BOSS_TOP' IN TYPEOF(fcr.
     relating_shape_aspect)) )) = 1)) )) = 1)) )) = 0;
  wr8 : (NOT (SELF\characterized_object.description = 'circular')) OR 
     (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'change in diameter occurrence') AND (
     SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'taper usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.TAPER' IN TYPEOF(fcr.
     related_shape_aspect)) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.BOSS' IN TYPEOF(fcr.
     relating_shape_aspect))) )) = 1)) )) <= 1)) )) = 0);
  wr9 : (NOT (SELF\characterized_object.description = 'complex')) OR (
     SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'enclosed boundary occurrence') AND (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'profile usage') AND 
     ('DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.NGON_CLOSED_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.CLOSED_PATH_PROFILE'] * 
     TYPEOF(sdr.relating_shape_aspect)) = 1) )) = 1)) )) = 1)) )) 
     = 0);
  wr10: (NOT (SELF\characterized_object.description IN ['complex',
     'rectangular'])) OR (SIZEOF(QUERY ( pds <* QUERY ( pd <* 
     USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'change in boundary occurrence') AND (
     SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATING_SHAPE_ASPECT') | ((sar.description = 
     'taper usage') AND 
     ('DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.TAPER' IN TYPEOF(fcr.
     related_shape_aspect)) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.BOSS' IN TYPEOF(fcr.
     relating_shape_aspect))) AND (fcr.related_shape_aspect.
     description IN ['angle taper','directed taper'])) )) = 1)) )) 
     <= 1)) )) = 0);
  wr11: (NOT (SELF\characterized_object.description = 'rectangular')) 
     OR (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'rectangular profile occurrence') AND 
     (SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'profile usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_CLOSED_PROFILE' 
     IN TYPEOF(sdr.relating_shape_aspect)) )) = 1)) )) = 1)) )) 
     = 0);
  wr12: SIZEOF(QUERY ( pdr <* get_property_definition_representations(
     SELF) | (('DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
     IN TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'maximum feature limit')) )) >= 
     0;
  END_ENTITY; -- boss

  ENTITY boss_top
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' IN
     TYPEOF(SELF.of_shape.definition);
  wr2: SELF.description IN ['planar','complex'];
  wr3: (NOT (SELF.description = 'planar')) OR (SIZEOF(QUERY ( pd <* 
    USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.DIRECTION_SHAPE_REPRESENTATION' 
    IN TYPEOF(pdr.used_representation)) )) = 1)) )) = 0);
  wr4: (NOT (SELF.description = 'planar')) OR (SIZEOF(QUERY ( pd <* 
    USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.LOCATION_SHAPE_REPRESENTATION' 
    IN TYPEOF(pdr.used_representation)) )) = 1)) )) = 0);
  wr5: (NOT (SELF.description = 'complex')) OR (SIZEOF(QUERY ( pd <* 
    USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.FACE_SHAPE_REPRESENTATION' IN
     TYPEOF(pdr.used_representation)) )) = 1)) )) = 0);
  wr6: SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATING_SHAPE_ASPECT') | (((sar.description = 
    'boss top usage') AND (sar.name IN ['boss height start',
    'boss height end'])) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | (((fcr.related_shape_aspect.description 
    = 'top condition occurrence') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.BOSS' IN TYPEOF(fcr.
    related_shape_aspect.of_shape.definition))) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.BOSS_TOP' IN TYPEOF(fcr.
    relating_shape_aspect))) )) >= 1;
  wr7: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) )) <= 1)) )) = 0;
  wr8: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(impl_rep.
    used_representation.items) = 1)) )) = 0)) )) = 0;
  wr9: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'top radius')) )) <= 1)) )) 
    = 0)) )) = 0;
  END_ENTITY; -- boss_top

  ENTITY bounded_curve
    SUPERTYPE OF (ONEOF (polyline,b_spline_curve,composite_curve))
    SUBTYPE OF (curve);
  END_ENTITY; -- bounded_curve

  ENTITY bounded_surface
    SUPERTYPE OF (b_spline_surface)
    SUBTYPE OF (surface);
  END_ENTITY; -- bounded_surface

  ENTITY brep_with_voids
    SUBTYPE OF (manifold_solid_brep);
      voids : SET [1:?] OF oriented_closed_shell;
  END_ENTITY; -- brep_with_voids

  ENTITY calendar_date
    SUBTYPE OF (date);
      day_component   : day_in_month_number;
      month_component : month_in_year_number;
    WHERE
  wr1: valid_calendar_date(SELF);
  END_ENTITY; -- calendar_date

  ENTITY cartesian_point
    SUBTYPE OF (point);
      coordinates : LIST [1:3] OF length_measure;
  END_ENTITY; -- cartesian_point

  ENTITY cartesian_transformation_operator
    SUPERTYPE OF (cartesian_transformation_operator_3d)
    SUBTYPE OF (geometric_representation_item, 
        functionally_defined_transformation);
      axis1        : OPTIONAL direction;
      axis2        : OPTIONAL direction;
      local_origin : cartesian_point;
      scale        : OPTIONAL REAL;
    DERIVE
      scl : REAL := NVL(scale,1);
    WHERE
  wr1: scl > 0;
  END_ENTITY; -- cartesian_transformation_operator

  ENTITY cartesian_transformation_operator_3d
    SUBTYPE OF (cartesian_transformation_operator);
      axis3 : OPTIONAL direction;
    DERIVE
      u : LIST [3:3] OF direction := base_axis(3,SELF\
  cartesian_transformation_operator.axis1,SELF\
  cartesian_transformation_operator.axis2,axis3);
    WHERE
  wr1: SELF\geometric_representation_item.dim = 3;
  END_ENTITY; -- cartesian_transformation_operator_3d

  ENTITY centre_of_symmetry
    SUBTYPE OF (derived_shape_aspect);
    WHERE
  wr1: SIZEOF(QUERY ( sadr <* deriving_relationships | (NOT (
    'DIMENSIONAL_INSPECTION_SCHEMA.SYMMETRIC_SHAPE_ASPECT' IN 
    TYPEOF(sadr.related_shape_aspect))) )) = 0;
  END_ENTITY; -- centre_of_symmetry

  ENTITY chamfer
    SUBTYPE OF (transition_feature);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.FACE_SHAPE_REPRESENTATION' IN
     TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'chamfer face')) )) <= 1)) )) = 0;
  wr2: SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATING_SHAPE_ASPECT') | 
     ('DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar)) ) | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.CHAMFER_OFFSET' IN TYPEOF(fcr
    .related_shape_aspect)) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.CHAMFER' IN TYPEOF(fcr.
    relating_shape_aspect))) AND (fcr.related_shape_aspect.
    description = 'first offset')) )) = 1;
  wr3: SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATING_SHAPE_ASPECT') | 
     ('DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar)) ) | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.CHAMFER_OFFSET' IN TYPEOF(fcr
    .related_shape_aspect)) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.CHAMFER' IN TYPEOF(fcr.
    relating_shape_aspect))) AND (fcr.related_shape_aspect.
    description = 'second offset')) )) = 1;
  END_ENTITY; -- chamfer

  ENTITY chamfer_offset
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1: SELF.description IN ['first offset','second offset'];
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) )) = 1)) )) = 0;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(impl_rep.
    used_representation.items) = 1)) )) = 0)) )) = 0;
  wr4: (NOT (SELF.description = 'first offset')) OR (SIZEOF(
    QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'offset amount')) )) = 1)) )) 
    = 0)) )) = 0);
  wr5: (NOT (SELF.description = 'first offset')) OR (SIZEOF(
    QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.FACE_SHAPE_REPRESENTATION' IN
     TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'first face shape')) )) <= 1)) )) 
    = 0);
  wr6: (NOT (SELF.description = 'second offset')) OR (SIZEOF(
    QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | (((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'offset amount')) OR ((
    SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
    * TYPEOF(it)) = 2) AND (it.name = 'offset angle'))) )) = 1)) )) 
    = 0)) )) = 0);
  wr7: (NOT (SELF.description = 'second offset')) OR (SIZEOF(
    QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.FACE_SHAPE_REPRESENTATION' IN
     TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'second face shape')) )) <= 1)) )) 
    = 0);
  wr8: SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'FEATURE_COMPONENT_RELATIONSHIP') IN TYPEOF(sar)) ) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.CHAMFER' IN TYPEOF(sdr.
    relating_shape_aspect)) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.CHAMFER_OFFSET' IN TYPEOF(sdr
    .related_shape_aspect))) )) = 1;
  END_ENTITY; -- chamfer_offset

  ENTITY characterized_object;
      name        : label;
      description : OPTIONAL text;
  END_ENTITY; -- characterized_object

  ENTITY circle
    SUBTYPE OF (conic);
      radius : positive_length_measure;
  END_ENTITY; -- circle

  ENTITY circular_closed_profile
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' IN
     TYPEOF(SELF.of_shape.definition);
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) )) = 1)) )) = 0;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(impl_rep.
    used_representation.items) = 2)) )) = 0)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) AND
     (it.name = 'orientation')) )) = 1)) )) = 0)) )) = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'diameter')) )) = 1)) )) = 0)) )) 
    = 0;
  END_ENTITY; -- circular_closed_profile

  ENTITY circular_pattern
    SUBTYPE OF (replicate_feature);
    WHERE
  wr1: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
    SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATING_SHAPE_ASPECT') | 
     ('DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar)) ) | (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT' IN TYPEOF(sdr.
    related_shape_aspect)) )) = 1) )) <= 3)) )) = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) )) = 1)) )) = 0;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT ((SIZEOF(impl_rep.
    used_representation.items) >= 3) AND (SIZEOF(impl_rep.
    used_representation.items) <= 5))) )) = 0)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'diameter')) )) <= 1)) )) = 
    0)) )) = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
    * TYPEOF(it)) = 2) AND (it.name = 'base feature rotation')) )) 
    <= 1)) )) = 0)) )) = 0;
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.COUNT_MEASURE' IN TYPEOF(it\
    measure_with_unit.value_component))) AND (it.name = 
    'number of features')) )) = 1)) )) = 0)) )) = 0;
  wr7: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
    * TYPEOF(it)) = 2) AND (it.name = 'angular spacing')) )) = 1)) )) 
    = 0)) )) = 0;
  wr8: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) AND
     (it.name = 'orientation')) )) = 1)) )) = 0)) )) = 0;
  END_ENTITY; -- circular_pattern

  ENTITY circular_runout_tolerance
    SUBTYPE OF (geometric_tolerance_with_datum_reference);
    WHERE
  wr1: SIZEOF(SELF\geometric_tolerance_with_datum_reference.
    datum_system) <= 2;
  END_ENTITY; -- circular_runout_tolerance

  ENTITY closed_path_profile
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' IN
     TYPEOF(SELF.of_shape.definition);
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.' + 
    'DEFINITION') | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) )) = 1)) )) = 0;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(impl_rep.
    used_representation.items) = 1)) )) = 0)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) AND
     (it.name = 'orientation')) )) = 1)) )) = 0)) )) = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.' + 
    'DEFINITION') | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.PATH_SHAPE_REPRESENTATION' IN
     TYPEOF(pdr.used_representation)) )) = 1)) )) = 0;
  END_ENTITY; -- closed_path_profile

  ENTITY closed_shell
    SUBTYPE OF (connected_face_set);
  END_ENTITY; -- closed_shell

  ENTITY coaxiality_tolerance
    SUBTYPE OF (geometric_tolerance_with_datum_reference);
    WHERE
  wr1: SIZEOF(SELF\geometric_tolerance_with_datum_reference.
    datum_system) <= 2;
  END_ENTITY; -- coaxiality_tolerance

  ENTITY common_datum
    SUBTYPE OF (composite_shape_aspect, datum);
    WHERE
  wr1: SIZEOF(SELF.component_relationships) = 2;
  wr2: SIZEOF(QUERY ( sar <* SELF.component_relationships | (NOT ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DATUM' IN TYPEOF(sar.
    related_shape_aspect)) AND (NOT (
    'DIMENSIONAL_INSPECTION_SCHEMA.COMMON_DATUM' IN TYPEOF(sar.
    related_shape_aspect))))) )) = 0;
  END_ENTITY; -- common_datum

  ENTITY composite_curve
    SUBTYPE OF (bounded_curve);
      segments       : LIST [1:?] OF composite_curve_segment;
      self_intersect : LOGICAL;
    DERIVE
      n_segments   : INTEGER := SIZEOF(segments);
      closed_curve : LOGICAL := segments[n_segments].transition <> 
  discontinuous;
    WHERE
  wr1: ((NOT closed_curve) AND (SIZEOF(QUERY ( temp <* segments | (
    temp.transition = discontinuous) )) = 1)) OR (closed_curve 
    AND (SIZEOF(QUERY ( temp <* segments | (temp.transition = 
    discontinuous) )) = 0));
  END_ENTITY; -- composite_curve

  ENTITY composite_curve_on_surface
    SUBTYPE OF (composite_curve);
    DERIVE
      basis_surface : SET [0:2] OF surface := get_basis_surface(SELF);
    WHERE
  wr1: SIZEOF(basis_surface) > 0;
  wr2: constraints_composite_curve_on_surface(SELF);
  END_ENTITY; -- composite_curve_on_surface

  ENTITY composite_curve_segment
    SUBTYPE OF (founded_item);
      transition   : transition_code;
      same_sense   : BOOLEAN;
      parent_curve : curve;
    INVERSE
      using_curves : BAG [1:?] OF composite_curve FOR segments;
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.BOUNDED_CURVE' IN TYPEOF(
    parent_curve);
  END_ENTITY; -- composite_curve_segment

  ENTITY composite_hole
    SUBTYPE OF (compound_feature);
    WHERE
  wr1: SELF\characterized_object.description IN ['counterbore',
    'countersunk'];
  wr2: SIZEOF(QUERY ( pds <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN 
    TYPEOF(pds)) AND (SIZEOF(QUERY ( csa <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.COMPOSITE_SHAPE_ASPECT' IN 
    TYPEOF(csa)) AND (SIZEOF(QUERY ( sar <* csa.
    component_relationships | 
    (('DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar)) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.ROUND_HOLE' IN TYPEOF(sar.
    related_shape_aspect))) )) = 2)) )) = 1)) )) = 1;
  wr3: (NOT (SELF\characterized_object.description = 'countersunk')) 
    OR (SIZEOF(QUERY ( pds <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN 
    TYPEOF(pds)) AND (SIZEOF(QUERY ( csa <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.COMPOSITE_SHAPE_ASPECT' IN 
    TYPEOF(csa)) AND (SIZEOF(QUERY ( sar <* csa.
    component_relationships | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.ROUND_HOLE' IN TYPEOF(sar.
    related_shape_aspect)) AND (NOT (SIZEOF(QUERY ( pds <* 
    QUERY ( pd <* USEDIN(sar.related_shape_aspect,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'change in diameter occurrence') AND (
    SIZEOF(QUERY ( fcr2 <* QUERY ( sar2 <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.'+
    'RELATING_SHAPE_ASPECT')
     | ((sar2.description = 'taper usage') AND 
     ('DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar2))) ) | ('DIMENSIONAL_INSPECTION_SCHEMA.TAPER' 
    IN TYPEOF(fcr2.related_shape_aspect)) )) = 1)) )) = 0)) )) =
     0))) )) = 1)) )) = 1)) )) = 1);
  END_ENTITY; -- composite_hole

  ENTITY composite_shape_aspect
    SUBTYPE OF (shape_aspect);
    INVERSE
      component_relationships : SET [2:?] OF shape_aspect_relationship FOR 
  relating_shape_aspect;
  END_ENTITY; -- composite_shape_aspect

  ENTITY compound_feature
    SUBTYPE OF (feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pds <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN 
    TYPEOF(pds)) AND (SIZEOF(QUERY ( csa <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    csa.name = 'compound feature in solid') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.COMPOSITE_SHAPE_ASPECT' IN 
    TYPEOF(csa))) )) = 1)) )) = 1;
  wr2: SIZEOF(QUERY ( pds <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN 
    TYPEOF(pds)) AND (SIZEOF(QUERY ( csa <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.COMPOSITE_SHAPE_ASPECT' IN 
    TYPEOF(csa)) )) = 1)) )) = 1;
  wr3: SIZEOF(QUERY ( pds <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN 
    TYPEOF(pds)) AND (SIZEOF(QUERY ( csa <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.COMPOSITE_SHAPE_ASPECT' IN 
    TYPEOF(csa)) AND (SIZEOF(QUERY ( fcr <* csa.
    component_relationships | (NOT (
    'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(fcr))) )) = 0)) )) = 1)) )) = 1;
  wr4: SIZEOF(QUERY ( pds <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN 
    TYPEOF(pds)) AND (SIZEOF(QUERY ( csa <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.COMPOSITE_SHAPE_ASPECT' IN 
    TYPEOF(csa)) )) = 1)) )) = 1;
  wr5: SIZEOF(QUERY ( pds <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN 
    TYPEOF(pds)) AND (SIZEOF(QUERY ( csa <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.COMPOSITE_SHAPE_ASPECT' IN 
    TYPEOF(csa)) AND (SIZEOF(QUERY ( sar <* csa.
    component_relationships | (
    'DIMENSIONAL_INSPECTION_SCHEMA.THREAD' IN TYPEOF(sar.
    related_shape_aspect)) )) = 0)) )) = 1)) )) = 1;
  wr6: SIZEOF(QUERY ( pds <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN 
    TYPEOF(pds)) AND (SIZEOF(QUERY ( csa <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.COMPOSITE_SHAPE_ASPECT' IN 
    TYPEOF(csa)) AND (SIZEOF(QUERY ( sar <* csa.
    component_relationships | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.COMPOUND_FEATURE' IN TYPEOF(
    sar.related_shape_aspect)) AND (sar.related_shape_aspect\
    characterized_object.name <> SELF\characterized_object.name)) )) 
    = 0)) )) = 1)) )) = 1;
  END_ENTITY; -- compound_feature

  ENTITY compound_representation_item
    SUBTYPE OF (representation_item);
      item_element : compound_item_definition;
  END_ENTITY; -- compound_representation_item

  ENTITY concentricity_tolerance
    SUBTYPE OF (geometric_tolerance_with_datum_reference);
    WHERE
  wr1: SIZEOF(SELF\geometric_tolerance_with_datum_reference.
    datum_system) = 1;
  END_ENTITY; -- concentricity_tolerance

  ENTITY conic
    SUPERTYPE OF (ONEOF (circle,ellipse,hyperbola,parabola))
    SUBTYPE OF (curve);
      position : axis2_placement;
  END_ENTITY; -- conic

  ENTITY conical_surface
    SUBTYPE OF (elementary_surface);
      radius     : length_measure;
      semi_angle : plane_angle_measure;
    WHERE
  wr1: radius >= 0;
  END_ENTITY; -- conical_surface

  ENTITY connected_face_set
    SUPERTYPE OF (ONEOF (closed_shell,open_shell))
    SUBTYPE OF (topological_representation_item);
      cfs_faces : SET [1:?] OF face;
  END_ENTITY; -- connected_face_set

  ENTITY context_dependent_unit
    SUBTYPE OF (named_unit);
      name : label;
  END_ENTITY; -- context_dependent_unit

  ENTITY conversion_based_unit
    SUBTYPE OF (named_unit);
      name   : label;
      conversion_factor : measure_with_unit;
  END_ENTITY; -- conversion_based_unit

  ENTITY coordinated_universal_time_offset;
      hour_offset   : INTEGER;
      minute_offset : OPTIONAL INTEGER;
      sense         : ahead_or_behind;
    DERIVE
      actual_minute_offset : INTEGER := NVL(minute_offset,0);
    WHERE
  wr1: (0 <= hour_offset) AND (hour_offset < 24);
  wr2: (0 <= actual_minute_offset) AND (actual_minute_offset <= 59);
  wr3: NOT (((hour_offset <> 0) OR (actual_minute_offset <> 0)) AND (
    sense = exact));
  END_ENTITY; -- coordinated_universal_time_offset

  ENTITY curve
    SUPERTYPE OF (ONEOF (line,conic,pcurve,surface_curve))
    SUBTYPE OF (geometric_representation_item);
  END_ENTITY; -- curve

  ENTITY cylindrical_shape_representation
    SUBTYPE OF (shape_representation_with_parameters);
    WHERE
  wr1: SIZEOF(SELF.items) = 3;
  wr2: SIZEOF(QUERY ( it <* SELF.items | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) AND
     (it.name = 'orientation')) )) = 1;
  wr3: SIZEOF(QUERY ( it <* SELF.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'length')) )) = 1;
  wr4: SIZEOF(QUERY ( it <* SELF.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'diameter')) )) = 1;
  END_ENTITY; -- cylindrical_shape_representation

  ENTITY cylindrical_surface
    SUBTYPE OF (elementary_surface);
      radius : positive_length_measure;
  END_ENTITY; -- cylindrical_surface

  ENTITY cylindricity_tolerance
    SUBTYPE OF (geometric_tolerance);
    WHERE
  wr1: NOT (('DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'GEOMETRIC_TOLERANCE_WITH_DATUM_REFERENCE') IN TYPEOF(SELF));
  END_ENTITY; -- cylindricity_tolerance

  ENTITY date
    SUPERTYPE OF (calendar_date);
      year_component : year_number;
  END_ENTITY; -- date

  ENTITY date_and_time;
      date_component : date;
      time_component : local_time;
  END_ENTITY; -- date_and_time

  ENTITY date_assignment
    ABSTRACT SUPERTYPE;
      assigned_date : date;
      role          : date_role;
  END_ENTITY; -- date_assignment

  ENTITY date_role;
      name : label;
    DERIVE
      description : text := get_description_value(SELF);
    WHERE
  wr1: SIZEOF(USEDIN(SELF,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1;
  END_ENTITY; -- date_role

  ENTITY datum
    SUBTYPE OF (shape_aspect);
      identification : identifier;
    INVERSE
      established_by_relationships : SET [1:?] OF
        shape_aspect_relationship FOR 
       related_shape_aspect;
    WHERE
  wr1: SIZEOF(QUERY ( x <* SELF.established_by_relationships | (
    SIZEOF(TYPEOF(x.relating_shape_aspect) * [
    'DIMENSIONAL_INSPECTION_SCHEMA.DATUM_FEATURE',
    'DIMENSIONAL_INSPECTION_SCHEMA.DATUM_TARGET']) <> 1) )) = 0;
  END_ENTITY; -- datum

  ENTITY datum_feature
    SUBTYPE OF (shape_aspect);
    INVERSE
      feature_basis_relationship : shape_aspect_relationship FOR 
     relating_shape_aspect;
    WHERE
  wr1: SIZEOF(QUERY ( sar <* bag_to_set(USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATING_SHAPE_ASPECT')) | (NOT (
    'DIMENSIONAL_INSPECTION_SCHEMA.DATUM' IN TYPEOF(sar.
    related_shape_aspect))) )) = 0;
  wr2: SELF.product_definitional = TRUE;
  END_ENTITY; -- datum_feature

  ENTITY datum_reference;
      precedence       : INTEGER;
      referenced_datum : datum;
    WHERE
  wr1: precedence > 0;
  END_ENTITY; -- datum_reference

  ENTITY datum_target
    SUBTYPE OF (shape_aspect);
      target_id : identifier;
    INVERSE
      target_basis_relationship : shape_aspect_relationship FOR 
    relating_shape_aspect;
    WHERE
  wr1: SIZEOF(QUERY ( sar <* bag_to_set(USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATING_SHAPE_ASPECT')) | (NOT (
    'DIMENSIONAL_INSPECTION_SCHEMA.DATUM' IN TYPEOF(sar.
    related_shape_aspect))) )) = 0;
  wr2: SELF.product_definitional = TRUE;
  END_ENTITY; -- datum_target

  ENTITY definitional_representation
    SUBTYPE OF (representation);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.'+
       'PARAMETRIC_REPRESENTATION_CONTEXT' 
    IN TYPEOF(SELF\representation.context_of_items);
  END_ENTITY; -- definitional_representation

  ENTITY degenerate_toroidal_surface
    SUBTYPE OF (toroidal_surface);
      select_outer : BOOLEAN;
    WHERE
  wr1: major_radius < minor_radius;
  END_ENTITY; -- degenerate_toroidal_surface

  ENTITY derived_shape_aspect
    SUPERTYPE OF (ONEOF (apex,centre_of_symmetry,
        geometric_alignment,
        geometric_intersection,parallel_offset,
        perpendicular_to,extension,
        tangent))
    SUBTYPE OF (shape_aspect);
    INVERSE
      deriving_relationships : SET [1:?] OF
  shape_aspect_deriving_relationship FOR 
 relating_shape_aspect;
  END_ENTITY; -- derived_shape_aspect

  ENTITY derived_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));
  wr2: SIZEOF(USEDIN(SELF,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'NAME_ATTRIBUTE.NAMED_ITEM')) <= 1;
  END_ENTITY; -- derived_unit

  ENTITY derived_unit_element;
      unit     : named_unit;
      exponent : REAL;
  END_ENTITY; -- derived_unit_element

  ENTITY description_attribute;
      attribute_value : text;
      described_item  : description_attribute_select;
  END_ENTITY; -- description_attribute

  ENTITY descriptive_representation_item
    SUBTYPE OF (representation_item);
      description : text;
  END_ENTITY; -- descriptive_representation_item

  ENTITY dimension_related_tolerance_zone_element;
      related_dimension : dimensional_location;
      related_element   : tolerance_zone_definition;
  END_ENTITY; -- dimension_related_tolerance_zone_element

  ENTITY dimensional_characteristic_representation;
      dimension      : dimensional_characteristic;
      representation : shape_dimension_representation;
  END_ENTITY; -- dimensional_characteristic_representation

  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; -- dimensional_exponents

  ENTITY dimensional_location
    SUPERTYPE OF (ONEOF (angular_location, 
          dimensional_location_with_path))
    SUBTYPE OF (shape_aspect_relationship);
  END_ENTITY; -- dimensional_location

  ENTITY dimensional_location_with_path
    SUBTYPE OF (dimensional_location);
      path : shape_aspect;
  END_ENTITY; -- dimensional_location_with_path

  ENTITY dimensional_measurement_representation
    SUBTYPE OF (representation);
  END_ENTITY; -- dimensional_measurement_representation

  ENTITY dimensional_size
    SUPERTYPE OF (ONEOF (angular_size,
         dimensional_size_with_path));
      applies_to : shape_aspect;
      name       : label;
    WHERE
  wr1: applies_to.product_definitional = TRUE;
  END_ENTITY; -- dimensional_size

  ENTITY dimensional_size_with_path
    SUBTYPE OF (dimensional_size);
      path : shape_aspect;
  END_ENTITY; -- dimensional_size_with_path

  ENTITY directed_dimensional_location
    SUBTYPE OF (dimensional_location);
  END_ENTITY; -- directed_dimensional_location

  ENTITY direction
    SUBTYPE OF (geometric_representation_item);
      direction_ratios : LIST [2:3] OF REAL;
    WHERE
  wr1: SIZEOF(QUERY ( tmp <* direction_ratios | (tmp <> 0) )) > 0;
  END_ENTITY; -- direction

  ENTITY direction_shape_representation
    SUBTYPE OF (shape_representation);
    WHERE
  wr1: SIZEOF(SELF.items) = 1;
  wr2: SIZEOF(QUERY ( it <* SELF.items | (NOT (
    'DIMENSIONAL_INSPECTION_SCHEMA.DIRECTION' IN TYPEOF(it))) )) 
    = 0;
  END_ENTITY; -- direction_shape_representation

  ENTITY dm_analysis_dofs_dml
    SUBTYPE OF (dimensional_measurement_representation);
    WHERE
  wr1: SIZEOF(QUERY ( repi <* SELF.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.QUALIFIED_REPRESENTATION_ITEM'] 
    * TYPEOF(repi)) = 2) AND (repi.name = 'transx')) )) = 1;
  wr2: SIZEOF(QUERY ( repi <* SELF.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.QUALIFIED_REPRESENTATION_ITEM'] 
    * TYPEOF(repi)) = 2) AND (repi.name = 'transy')) )) = 1;
  wr3: SIZEOF(QUERY ( repi <* SELF.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.QUALIFIED_REPRESENTATION_ITEM'] 
    * TYPEOF(repi)) = 2) AND (repi.name = 'transz')) )) = 1;
  wr4: SIZEOF(QUERY ( repi <* SELF.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.QUALIFIED_REPRESENTATION_ITEM'] 
    * TYPEOF(repi)) = 2) AND (repi.name = 'rotx')) )) = 1;
  wr5: SIZEOF(QUERY ( repi <* SELF.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.QUALIFIED_REPRESENTATION_ITEM'] 
    * TYPEOF(repi)) = 2) AND (repi.name = 'roty')) )) = 1;
  wr6: SIZEOF(QUERY ( repi <* SELF.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.QUALIFIED_REPRESENTATION_ITEM'] 
    * TYPEOF(repi)) = 2) AND (repi.name = 'rotz')) )) = 1;
  END_ENTITY; -- dm_analysis_dofs_dml

  ENTITY dm_dimension_parameter
    SUBTYPE OF (dm_result_parameter);
    WHERE
  wr1: SIZEOF(QUERY ( pdr <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.USED_REPRESENTATION') | 
    ('DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT' 
 IN TYPEOF(pdr.definition.definition)) )) <= 1;
 
  wr2: SIZEOF(QUERY ( sri <* SELF.items | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
    IN TYPEOF(sri)) AND (sri.name = 'specification')) )) <= 1;
  wr3: SIZEOF(QUERY ( sri <* SELF.items | (
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
    IN TYPEOF(sri)) )) <= 2;
  END_ENTITY; -- dm_dimension_parameter

  ENTITY dm_execution_result
    SUBTYPE OF (executed_action);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.DM_PROGRAM_RUN' IN TYPEOF(SELF.
    chosen_method);
  wr2: SIZEOF(QUERY ( rp <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.ACTION_PROPERTY.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.DM_EXECUTION_RESULT_MEASUREMENT' 
    IN TYPEOF(rp)) )) >= 1;
  END_ENTITY; -- dm_execution_result

  ENTITY dm_execution_result_measurement
    SUBTYPE OF (action_property);
    WHERE
  wr1: NOT (SIZEOF(QUERY ( apr <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.ACTION_PROPERTY_REPRESENTATION.PROPERTY')
     | (SIZEOF(QUERY ( it <* apr.representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (it.name = 'application name')) )) <= 1) )) 
    = 0);
  wr2: NOT (SIZEOF(QUERY ( apr <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.ACTION_PROPERTY_REPRESENTATION.PROPERTY')
     | (SIZEOF(QUERY ( it <* apr.representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (it.name = 'application version')) )) <= 
    1) )) = 0);
  wr3: NOT (SIZEOF(QUERY ( apr <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.ACTION_PROPERTY_REPRESENTATION.PROPERTY')
     | (SIZEOF(QUERY ( it <* apr.representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (it.name = 'vendor name')) )) <= 1) )) = 
    0);
  wr4: SIZEOF(QUERY ( apr <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.ACTION_PROPERTY_REPRESENTATION.PROPERTY')
     | ((apr.representation.name = 'measurement points') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT' IN TYPEOF(apr.
    representation))) )) <= 1;
  wr5: SIZEOF(QUERY ( apr <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.ACTION_PROPERTY_REPRESENTATION.PROPERTY')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.DM_RESULT_PARAMETER' IN 
    TYPEOF(apr.representation)) )) = 1;
  END_ENTITY; -- dm_execution_result_measurement

  ENTITY dm_feature_analysis_mode_dml
    SUBTYPE OF (dimensional_measurement_representation);
    WHERE
  wr1: SIZEOF(QUERY ( repi <* SELF.items | ((NOT ((
  'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(repi)) AND (repi.name = 'axis'))) AND (SELF.
    description IN ['least square','minimum radius',
    'cross section centers'])) )) <= 1;
  wr2: SIZEOF(QUERY ( repi <* SELF.items | ((NOT ((
  'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(repi)) AND (repi.name = 'aelpr'))) AND (SELF.
    description IN ['least square','minimum maximum'])) )) <= 1;
  wr3: SIZEOF(QUERY ( repi <* SELF.items | ((NOT ((
  'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(repi)) AND (repi.name = 'cccpst'))) AND (SELF.
    description IN ['least square','minimum maximum',
    'circumscribed circle or cylinder',
    'maximum inscribed circle or cylinder'])) )) <= 1;
  wr4: SIZEOF(QUERY ( repi <* SELF.items | ((NOT ((
  'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(repi)) AND (repi.name = 'curve'))) AND (SELF.
    description IN ['least square','minimum maximum','bspline'])) )) 
    <= 1;
  wr5: SIZEOF(QUERY ( repi <* SELF.items | ((NOT ((
  'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(repi)) AND (repi.name = 'limits'))) AND (SELF.
    description IN ['functional','mrs average','two point'])) )) 
    <= 1;
  wr6: SIZEOF(QUERY ( repi <* SELF.items | ((NOT ((
  'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(repi)) AND (repi.name = 'surface'))) AND (SELF.
    description IN ['least square','minimum maximum','nurbs',
    'bezier'])) )) <= 1;
  wr7: SIZEOF(QUERY ( repi <* SELF.items | ((NOT ((
  'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(repi)) AND (repi.name = 'axis extrapolate'))) AND 
    (SELF.description IN ['TRUE','FALSE'])) )) <= 1;
  END_ENTITY; -- dm_feature_analysis_mode_dml

  ENTITY dm_feature_definition
    SUBTYPE OF (characterized_object);
    WHERE
  wr1: SIZEOF(QUERY ( pdr <* get_property_definition_representations(
    SELF) | ('DIMENSIONAL_INSPECTION_SCHEMA.'+
    'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS' 
    IN TYPEOF(pdr.used_representation)) )) >= 1;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'+
    'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS' 
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    QUERY ( it <* impl_rep.used_representation.items | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) AND
     (it.name = 'orientation')) )) = 1)) )) = 0)) )) = 0;
  wr3: SIZEOF(['DIMENSIONAL_INSPECTION_SCHEMA.DMF_ARC',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_LINE_UNBOUNDED',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_CIRCLE',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_PATTERN',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_CONE',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_PLANE',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_PLANE_CLOSED_PARALLEL',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_CYLINDER',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_ELLIPSE',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_PLANE_SYMMETRIC',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_GEOMETRIC_CURVE',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_POINT',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_GEOMETRIC_SURFACE',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_EDGE_POINT',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_SPHERE',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_GENERIC_FEATURE',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_LINE_BOUNDED',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_TORUS',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_LINE_CLOSED_PARALLEL',
    'DIMENSIONAL_INSPECTION_SCHEMA.DMF_SURFACE_OF_REVOLUTION_DML'] 
    * TYPEOF(SELF)) = 1;
  END_ENTITY; -- dm_feature_definition

  ENTITY dm_feature_relationship
    SUBTYPE OF (shape_aspect_relationship);
  END_ENTITY; -- dm_feature_relationship

  ENTITY dm_instanced_feature
    SUBTYPE OF (dm_feature_definition, shape_aspect);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION' IN TYPEOF(
    SELF.of_shape.definition);
  wr2: SELF.product_definitional;
  END_ENTITY; -- dm_instanced_feature

  ENTITY dm_parameter_analysis_dml
    SUBTYPE OF (action_property);
    WHERE
  wr1: SIZEOF(QUERY ( apr <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.ACTION_PROPERTY_REPRESENTATION.PROPERTY')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.DM_FEATURE_ANALYSIS_MODE_DML' 
    IN TYPEOF(apr.representation)) )) = 1;
  wr2: SIZEOF(QUERY ( apr <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.ACTION_PROPERTY_REPRESENTATION.PROPERTY')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.DM_TOLERANCE_ANALYSIS_MODE_DML' 
    IN TYPEOF(apr.representation)) )) = 1;
  wr3: SIZEOF(QUERY ( apr <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.ACTION_PROPERTY_REPRESENTATION.PROPERTY')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.DM_ANALYSIS_DOFS_DML' IN 
    TYPEOF(apr.representation)) )) = 1;
  END_ENTITY; -- dm_parameter_analysis_dml

  ENTITY dm_parameter_value_limits
    SUBTYPE OF (compound_representation_item);
    WHERE
    wr1: (SIZEOF(QUERY ( it <* SELF.item_element |        
  (((SIZEOF([
  'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
  'DIMENSIONAL_INSPECTION_SCHEMA.QUALIFIED_REPRESENTATION_ITEM'] *
  TYPEOF(it)) = 2) AND (it.name = 'calculated limit')) AND 
  ((SIZEOF(QUERY(qri <* it.qualifiers|
         (('DIMENSIONAL_INSPECTION_SCHEMA.TYPE_QUALIFIER' IN TYPEOF(qri)) AND 
         (qri.name='limits method')  )))>0)))))=1); 
  END_ENTITY; -- dm_parameter_value_limits

  ENTITY dm_point
    SUBTYPE OF (representation);
    WHERE
  wr1: SIZEOF(QUERY ( repi <* SELF.items | (NOT ((
    'DIMENSIONAL_INSPECTION_SCHEMA.CARTESIAN_POINT' IN TYPEOF(
    repi)) AND (repi.name = 'measured point'))) )) = 1;
  wr2: SIZEOF(QUERY ( repi <* SELF.items | (NOT ((
    'DIMENSIONAL_INSPECTION_SCHEMA.CARTESIAN_POINT' IN TYPEOF(
    repi)) AND (repi.name = 'expected point'))) )) <= 1;
  END_ENTITY; -- dm_point

  ENTITY dm_point_parameter
    SUBTYPE OF (dm_result_parameter);
    WHERE
  wr1: SIZEOF(QUERY ( repi <* SELF.items | (
    'DIMENSIONAL_INSPECTION_SCHEMA.CARTESIAN_POINT' IN TYPEOF(
    repi)) )) = 1;
  END_ENTITY; -- dm_point_parameter

  ENTITY dm_program_identification
    SUBTYPE OF (action_resource_requirement);
    WHERE
  wr1: SIZEOF(QUERY ( rp <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.RESOURCE_PROPERTY.RESOURCE')
     | (rp.name = 'angular units dml') )) <= 1;
  wr2: SIZEOF(QUERY ( rp <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.RESOURCE_PROPERTY.RESOURCE')
     | (rp.name = 'linear units dml') )) <= 1;
  wr3: SIZEOF(QUERY ( rp <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.RESOURCE_PROPERTY.RESOURCE')
     | (rp.name = 'tolerance standard dml') )) <= 1;
  wr4: (SIZEOF(QUERY ( adr <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.APPLIED_ORGANIZATION_ASSIGNMENT.ITEMS')
     | ((adr.role.name = 'program custodian') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.ORGANIZATION' IN TYPEOF(adr.
    assigned_organization))) )) <= 1) OR (SIZEOF(QUERY ( adr <* 
    USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.'+
    'APPLIED_PERSON_ORGANIZATION_ASSIGNMENT.ITEMS')
     | ((adr.role.name = 'program custodian') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.PERSON_AND_ORGANIZATION' IN 
    TYPEOF(adr.assigned_person_and_organization))) )) <= 1);
  END_ENTITY; -- dm_program_identification

  ENTITY dm_program_run
    SUBTYPE OF (action_method);
    WHERE
  wr1 : SIZEOF(QUERY ( ap <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.ACTION_PROPERTY.DEFINITION')
      | (NOT (SIZEOF(QUERY ( apr <* USEDIN(ap,
      'DIMENSIONAL_INSPECTION_SCHEMA.ACTION_PROPERTY_REPRESENTATION.PROPERTY')
      | (NOT (SIZEOF(QUERY ( it <* apr.representation.items | ((
     SIZEOF(['DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.QUALIFIED_REPRESENTATION_ITEM'] 
     * TYPEOF(it)) = 2) AND (it.name = 'measurement temperature')) )) 
     >= 0)) )) = 0)) )) = 0;
  wr2 : SIZEOF(QUERY ( ap <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.ACTION_PROPERTY.DEFINITION')
      | (NOT (SIZEOF(QUERY ( apr <* USEDIN(ap,
      'DIMENSIONAL_INSPECTION_SCHEMA.ACTION_PROPERTY_REPRESENTATION.PROPERTY')
      | (NOT (SIZEOF(QUERY ( it <* apr.representation.items | ((
     SIZEOF(['DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.QUALIFIED_REPRESENTATION_ITEM'] 
     * TYPEOF(it)) = 2) AND (it.name = 'workpiece temperature')) )) 
     >= 0)) )) = 0)) )) = 0;
  wr3 : SIZEOF(QUERY ( ap <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.ACTION_PROPERTY.DEFINITION')
      | (NOT (SIZEOF(QUERY ( apr <* USEDIN(ap,
      'DIMENSIONAL_INSPECTION_SCHEMA.ACTION_PROPERTY_REPRESENTATION.PROPERTY')
      | (NOT (SIZEOF(QUERY ( it <* apr.representation.items | ((
     SIZEOF(['DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.QUALIFIED_REPRESENTATION_ITEM'] 
     * TYPEOF(it)) = 2) AND (it.name = 'measurement humidity')) )) 
     >= 0)) )) = 0)) )) = 0;
  wr4 : SIZEOF(QUERY ( ap <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.ACTION_RESOURCE.USAGE') | (
     ap.name = 'part inspection status') )) <= 1;
  wr5 : SIZEOF(QUERY ( ap <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.ACTION_RESOURCE.USAGE') | (
     ap.name = 'url') )) <= 1;
  wr6 : SIZEOF(QUERY ( arr <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.'+
    'ACTION_RESOURCE_REQUIREMENT.OPERATIONS')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_PROGRAM_IDENTIFICATION' 
     IN TYPEOF(arr)) )) = 1;
  wr7 : (SIZEOF(QUERY ( adr <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.'+
     'APPLIED_ORGANIZATION_ASSIGNMENT.ITEMS')
      | ((adr.role.name = 'run administrator') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.ORGANIZATION' IN TYPEOF(adr.
     assigned_organization))) )) <= 1) OR (SIZEOF(
     QUERY ( adr <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.'+
     'APPLIED_PERSON_ORGANIZATION_ASSIGNMENT.ITEMS')
      | ((adr.role.name = 'run administrator') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.PERSON_AND_ORGANIZATION' IN 
     TYPEOF(adr.assigned_person_and_organization))) )) <= 1);
  wr8 : SIZEOF(QUERY ( rp <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.ACTION_PROPERTY.DEFINITION')
      | ('DIMENSIONAL_INSPECTION_SCHEMA.MEASURMENT_LOCATION' IN 
     TYPEOF(rp)) )) <= 1;
  wr9 : (SIZEOF(QUERY ( adr <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.APPLIED_DATE_ASSIGNMENT.ITEMS')
      | ((adr.role.name = 'run end') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.DATE' IN TYPEOF(adr.
     assigned_date))) )) <= 1) OR (SIZEOF(QUERY ( adr <* USEDIN(
     SELF,'DIMENSIONAL_INSPECTION_SCHEMA.APPLIED_DATE_ASSIGNMENT.ITEMS')
      | ((adr.role.name = 'run end') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.CALENDAR_DATE' IN TYPEOF(adr
     .assigned_date))) )) <= 1);
  wr10: (SIZEOF(QUERY ( adr <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.APPLIED_DATE_ASSIGNMENT.ITEMS')
      | ((adr.role.name = 'run start') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.DATE' IN TYPEOF(adr.
     assigned_date))) )) <= 1) OR (SIZEOF(QUERY ( adr <* USEDIN(
     SELF,'DIMENSIONAL_INSPECTION_SCHEMA.APPLIED_DATE_ASSIGNMENT.ITEMS')
      | ((adr.role.name = 'run start') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.CALENDAR_DATE' IN TYPEOF(adr
     .assigned_date))) )) <= 1);
  wr11: (SIZEOF(QUERY ( adr <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.APPLIED_DATE_ASSIGNMENT.ITEMS')
      | ((adr.role.name = 'run date') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.DATE' IN TYPEOF(adr.
     assigned_date))) )) <= 1) OR (SIZEOF(QUERY ( adr <* USEDIN(
     SELF,'DIMENSIONAL_INSPECTION_SCHEMA.APPLIED_DATE_ASSIGNMENT.ITEMS')
      | ((adr.role.name = 'run date') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.CALENDAR_DATE' IN TYPEOF(adr
     .assigned_date))) )) <= 1);
  END_ENTITY; -- dm_program_run

  ENTITY dm_result_parameter
    SUBTYPE OF (representation);
    WHERE
  wr1: SIZEOF(QUERY ( sri <* SELF.items | (
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_PARAMETER_VALUE_LIMITS' IN
     TYPEOF(sri)) )) = 1;
  wr2: SIZEOF(QUERY ( sri <* SELF.items | ((
  'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(sri)) AND (sri.name = 'calculation method')) )) <=
     1;
  wr3: SIZEOF(QUERY ( apr <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.'+
    'ACTION_PROPERTY_REPRESENTATION.REPRESENTATION')
     | (
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_PARAMETER_ANALYSIS_DML' IN
     TYPEOF(apr.property)) )) <= 1;
  END_ENTITY; -- dm_result_parameter

  ENTITY dm_shape_representation_with_parameters
    SUBTYPE OF (shape_representation);
    WHERE
  wr1: SIZEOF(QUERY ( it <* SELF.items | (NOT (SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT',
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.COMPOUND_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM'] 
    * TYPEOF(it)) = 1)) )) = 0;
  END_ENTITY; -- dm_shape_representation_with_parameters

  ENTITY dm_tolerance_analysis_mode_dml
    SUBTYPE OF (dimensional_measurement_representation);
    WHERE
  wr1: SIZEOF(QUERY ( repi <* SELF.items | ((NOT ((
  'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(repi)) AND (repi.name = 'method'))) AND (SELF.
    description IN ['least square 3d','least square normal',
    'minimum deviation 3d','standard'])) )) <= 1;
  wr2: SIZEOF(QUERY ( repi <* SELF.items | ((NOT ((
  'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(repi)) AND (repi.name = 'option'))) AND (SELF.
    description IN ['high point','best fit'])) )) <= 1;
  wr3: SIZEOF(QUERY ( repi <* SELF.items | ((NOT ((
  'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(repi)) AND (repi.name = 'setting'))) AND (SELF.
    description IN ['inner','outer','standard'])) )) <= 1;
  END_ENTITY; -- dm_tolerance_analysis_mode_dml

  ENTITY dm_vector_parameter
    SUBTYPE OF (dm_result_parameter);
    WHERE
  wr1: SIZEOF(QUERY ( repi <* SELF.items | (
    'DIMENSIONAL_INSPECTION_SCHEMA.VECTOR' IN TYPEOF(repi)) )) =
     1;
  END_ENTITY; -- dm_vector_parameter

  ENTITY dmf_arc
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'+
    'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS' 
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    impl_rep.used_representation.items) = 2)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.'+
    'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS' 
    IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
    QUERY ( srwp_i <* pdr.used_representation.items | ((srwp_i.
    name = 'orientation') OR (srwp_i.name = 'inner outer')) )) =
     SIZEOF(pdr.used_representation.items))) )) = 1) )) = 1;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
      'DIMENSIONAL_INSPECTION_SCHEMA.'+
      'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS' 
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    QUERY ( it <* impl_rep.used_representation.items | (((
      'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (it.name = 'inner outer')) AND ((it.
    description = 'inner') OR (it.description = 'outer'))) )) = 
    1)) )) = 0)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'start vector')) )) = 1)) )) = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'end vector')) )) = 1)) )) = 0;
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'axis direction vector')) )) = 1)) )) 
    = 0;
  wr7: SIZEOF(QUERY ( pd <* USEDIN(SELF, 
   'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'center point')) )) = 1)) )) = 0;
  wr8: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'radius')) )) = 1)) )) = 0;
  END_ENTITY; -- dmf_arc

  ENTITY dmf_circle
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
   'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.'+
     'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS' 
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    impl_rep.used_representation.items) = 2)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.'+
    'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS' 
    IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
    QUERY ( srwp_i <* pdr.used_representation.items | ((srwp_i.
    name = 'orientation') OR (srwp_i.name = 'inner outer')) )) =
     SIZEOF(pdr.used_representation.items))) )) = 1) )) = 1;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'+
    'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS' 
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    QUERY ( it <* impl_rep.used_representation.items | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (it.name = 'inner outer')) AND ((it.
    description = 'inner') OR (it.description = 'outer'))) )) = 
    1)) )) = 0)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
   'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'axis direction vector')) )) = 1)) )) 
    = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
   'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'center point')) )) = 1)) )) = 0;
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
   'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'diameter')) )) = 1)) )) = 0;
  END_ENTITY; -- dmf_circle

  ENTITY dmf_cone
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
   'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     impl_rep.used_representation.items) = 2)) )) = 0)) )) = 0;
  wr2 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
   'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
      'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
     IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
     QUERY ( srwp_i <* pdr.used_representation.items | ((srwp_i.
     name = 'orientation') OR (srwp_i.name = 'inner outer')) )) 
     = SIZEOF(pdr.used_representation.items))) )) = 1) )) = 1;
  wr3 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
      'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | (((
      'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'inner outer')) AND ((it.
     description = 'inner') OR (it.description = 'outer'))) )) =
      1)) )) = 0)) )) = 0;
  wr4 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
   'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'start vector')) )) <= 1)) )) = 
     0;
  wr5 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
   'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'end vector')) )) <= 1)) )) = 0;
  wr6 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'axis direction vector')) )) = 1)) )) 
     = 0;
  wr7 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'diameter')) )) = 1)) )) = 0;
  wr8 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'start length dml')) )) <= 1)) )) 
     = 0;
  wr9 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'end length dml')) )) <= 1)) )) 
     = 0;
  wr10: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'include angle')) )) = 1)) )) = 
     0;
  wr11: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'start point')) )) <= 1)) )) = 0;
  wr12: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'end point')) )) <= 1)) )) = 0;
  wr13: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'apex point')) )) = 1)) )) = 0;
  END_ENTITY; -- dmf_cone

  ENTITY dmf_cylinder
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     impl_rep.used_representation.items) = 2)) )) = 0)) )) = 0;
  wr2 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
     IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
     QUERY ( srwp_i <* pdr.used_representation.items | ((srwp_i.
     name = 'orientation') OR (srwp_i.name = 'inner outer')) )) 
     = SIZEOF(pdr.used_representation.items))) )) = 1) )) = 1;
  wr3 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'inner outer')) AND ((it.
     description = 'inner') OR (it.description = 'outer'))) )) =
      1)) )) = 0)) )) = 0;
  wr4 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'axis direction vector')) )) = 1)) )) 
     = 0;
  wr5 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'diameter')) )) = 1)) )) = 0;
  wr6 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'length dml')) )) <= 1)) )) = 0;
  wr7 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'start point')) )) = 1)) )) = 0;
  wr8 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'end point')) )) = 1)) )) = 0;
  wr9 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'center point')) )) = 1)) )) = 0;
  wr10: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'boundary')) )) >= 2)) )) = 0;
  END_ENTITY; -- dmf_cylinder

  ENTITY dmf_edge_point
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    impl_rep.used_representation.items) = 1)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
    QUERY ( srwp_i <* pdr.used_representation.items | (srwp_i.
    name = 'orientation') )) = SIZEOF(pdr.used_representation.
    items))) )) = 1) )) = 1;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'edge normal vector')) )) = 1)) )) 
    = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'surface normal vector')) )) = 1)) )) 
    = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'location point')) )) = 1)) )) = 
    0;
  END_ENTITY; -- dmf_edge_point

  ENTITY dmf_ellipse
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     impl_rep.used_representation.items) = 2)) )) = 0)) )) = 0;
  wr2 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
     IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
     QUERY ( srwp_i <* pdr.used_representation.items | ((srwp_i.
     name = 'orientation') OR (srwp_i.name = 'inner outer')) )) 
     = SIZEOF(pdr.used_representation.items))) )) = 1) )) = 1;
  wr3 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'inner outer')) AND ((it.
     description = 'inner') OR (it.description = 'outer'))) )) =
      1)) )) = 0)) )) = 0;
  wr4 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'normal direction')) )) = 1)) )) 
     = 0;
  wr5 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'major axis vector')) )) = 1)) )) 
     = 0;
  wr6 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'center point')) )) = 1)) )) = 0;
  wr7 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'focus point one dml')) )) <= 1)) )) 
     = 0;
  wr8 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'focus point two dml')) )) <= 1)) )) 
     = 0;
  wr9 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'minor diameter')) )) = 1)) )) =
      0;
  wr10: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'major diameter')) )) = 1)) )) =
      0;
  END_ENTITY; -- dmf_ellipse

  ENTITY dmf_generic_feature
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    impl_rep.used_representation.items) = 1)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
    QUERY ( srwp_i <* pdr.used_representation.items | (srwp_i.
    name = 'orientation') )) = SIZEOF(pdr.used_representation.
    items))) )) = 1) )) = 1;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'center point')) )) = 1)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'secondary vector')) )) <= 1)) )) 
    = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'vector from center of object')) )) 
    = 1)) )) = 0;
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'parameters')) )) <= 1)) )) = 0;
  END_ENTITY; -- dmf_generic_feature

  ENTITY dmf_geometric_curve
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    impl_rep.used_representation.items) = 1)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
    QUERY ( srwp_i <* pdr.used_representation.items | (srwp_i.
    name = 'orientation') )) = SIZEOF(pdr.used_representation.
    items))) )) = 1) )) = 1;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'curve plane direction')) )) = 1)) )) 
    = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'point on plane or curve')) )) = 
    1)) )) = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'data point')) )) >= 2)) )) = 0;
  END_ENTITY; -- dmf_geometric_curve

  ENTITY dmf_geometric_surface
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    impl_rep.used_representation.items) = 1)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
    QUERY ( srwp_i <* pdr.used_representation.items | (srwp_i.
    name = 'orientation') )) = SIZEOF(pdr.used_representation.
    items))) )) = 1) )) = 1;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'curve plane direction')) )) = 1)) )) 
    = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'point on plane or curve')) )) = 
    1)) )) = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'data point')) )) >= 2)) )) = 0;
  END_ENTITY; -- dmf_geometric_surface

  ENTITY dmf_line_bounded
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    impl_rep.used_representation.items) = 1)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
    QUERY ( srwp_i <* pdr.used_representation.items | (srwp_i.
    name = 'orientation') )) = SIZEOF(pdr.used_representation.
    items))) )) = 1) )) = 1;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'first end point')) )) = 1)) )) =
     0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'second end point')) )) = 1)) )) 
    = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'vector dml')) )) = 1)) )) = 0;
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'surface approach vector')) )) = 
    1)) )) = 0;
  wr7: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'length dml')) )) = 1)) )) = 0;
  END_ENTITY; -- dmf_line_bounded

  ENTITY dmf_line_closed_parallel
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    impl_rep.used_representation.items) = 3)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
    QUERY ( srwp_i <* pdr.used_representation.items | (((srwp_i.
    name = 'orientation') OR (srwp_i.name = 'inner outer')) OR (
    srwp_i.name = 'end kind')) )) = SIZEOF(pdr.
    used_representation.items))) )) = 1) )) = 1;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'center point')) )) = 1)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'axis direction vector')) )) = 1)) )) 
    = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'longitude vector')) )) = 1)) )) 
    = 0;
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'feature length')) )) = 1)) )) = 
    0;
  wr7: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'width')) )) = 1)) )) = 0;
  wr8: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    QUERY ( it <* impl_rep.used_representation.items | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (it.name = 'inner outer')) AND ((it.
    description = 'inner') OR (it.description = 'outer'))) )) = 
    1)) )) = 0)) )) = 0;
  wr9: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    QUERY ( it <* impl_rep.used_representation.items | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (it.name = 'end kind')) AND ((it.
    description = 'round') OR (it.description = 'square'))) )) =
     1)) )) = 0)) )) = 0;
  END_ENTITY; -- dmf_line_closed_parallel

  ENTITY dmf_line_unbounded
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    impl_rep.used_representation.items) = 1)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
    QUERY ( srwp_i <* pdr.used_representation.items | (srwp_i.
    name = 'orientation') )) = SIZEOF(pdr.used_representation.
    items))) )) = 1) )) = 1;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'point on line')) )) = 1)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'surface approach vector')) )) = 
    1)) )) = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'direction vector')) )) = 1)) )) 
    = 0;
  END_ENTITY; -- dmf_line_unbounded

  ENTITY dmf_pattern
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    impl_rep.used_representation.items) = 1)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
    QUERY ( srwp_i <* pdr.used_representation.items | (srwp_i.
    name = 'orientation') )) = SIZEOF(pdr.used_representation.
    items))) )) = 1) )) = 1;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'point')) )) <= 1)) )) = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'direction vector')) )) = 1)) )) 
    = 0;
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_ASPECT_RELATIONSHIP.RELATING_SHAPE_ASPECT') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_FEATURE_RELATIONSHIP' IN 
    TYPEOF(pd)) )) >= 2;
  END_ENTITY; -- dmf_pattern

  ENTITY dmf_plane
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    impl_rep.used_representation.items) = 3)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
    QUERY ( srwp_i <* pdr.used_representation.items | (((srwp_i.
    name = 'orientation') OR (srwp_i.name = 'inner outer')) OR (
    srwp_i.name = 'boundary')) )) = SIZEOF(pdr.
    used_representation.items))) )) = 1) )) = 1;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'point on plane')) )) = 1)) )) = 
    0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'point dml')) )) = 1)) )) = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'direction vector')) )) = 1)) )) 
    = 0;
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.CARTESIAN_POINT' IN TYPEOF(
    pdr.used_representation)) AND (pdr.used_representation.name 
    = 'boundary')) )) >= 2)) )) = 0;
  END_ENTITY; -- dmf_plane

  ENTITY dmf_plane_closed_parallel
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     impl_rep.used_representation.items) = 3)) )) = 0)) )) = 0;
  wr2 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
     IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
     QUERY ( srwp_i <* pdr.used_representation.items | (((srwp_i
     .name = 'orientation') OR (srwp_i.name = 'inner outer')) OR
      (srwp_i.name = 'end kind')) )) = SIZEOF(pdr.
     used_representation.items))) )) = 1) )) = 1;
  wr3 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'center point')) )) = 1)) )) = 0;
  wr4 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'axis direction vector')) )) = 1)) )) 
     = 0;
  wr5 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'longitude vector')) )) = 1)) )) 
     = 0;
  wr6 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'normal dml')) )) = 1)) )) = 0;
  wr7 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'feature length')) )) = 1)) )) =
      0;
  wr8 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'width')) )) = 1)) )) = 0;
  wr9 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'height')) )) = 1)) )) = 0;
  wr10: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'inner outer')) AND ((it.
     description = 'inner') OR (it.description = 'outer'))) )) =
      1)) )) = 0)) )) = 0;
  wr11: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'end kind')) AND ((it.
     description = 'round') OR (it.description = 'square'))) )) 
     = 1)) )) = 0)) )) = 0;
  END_ENTITY; -- dmf_plane_closed_parallel

  ENTITY dmf_plane_symmetric
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    impl_rep.used_representation.items) = 2)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
    QUERY ( srwp_i <* pdr.used_representation.items | ((srwp_i.
    name = 'orientation') OR (srwp_i.name = 'inner outer')) )) =
     SIZEOF(pdr.used_representation.items))) )) = 1) )) = 1;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'point on one side')) )) = 1)) )) 
    = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'point on other side')) )) = 1)) )) 
    = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'point on mid side')) )) = 1)) )) 
    = 0;
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'direction vector side one')) )) 
    = 1)) )) = 0;
  wr7: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'direction vector side two')) )) 
    = 1)) )) = 0;
  wr8: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'width at mid point')) )) = 1)) )) 
    = 0;
  wr9: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    QUERY ( it <* impl_rep.used_representation.items | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (it.name = 'inner outer')) AND ((it.
    description = 'inner') OR (it.description = 'outer'))) )) = 
    1)) )) = 0)) )) = 0;
  END_ENTITY; -- dmf_plane_symmetric

  ENTITY dmf_point
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    impl_rep.used_representation.items) = 2)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
    QUERY ( srwp_i <* pdr.used_representation.items | ((srwp_i.
    name = 'orientation') OR (srwp_i.name = 'point type dml')) )) 
    = SIZEOF(pdr.used_representation.items))) )) = 1) )) = 1;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'point')) )) = 1)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'direction vector')) )) = 1)) )) 
    = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    QUERY ( it <* impl_rep.used_representation.items | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (it.name = 'point type dml')) AND ((it.
    description = 'h edge') OR (it.description = 't edge'))) )) 
    = 1)) )) = 0)) )) = 0;
  END_ENTITY; -- dmf_point

  ENTITY dmf_sphere
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     impl_rep.used_representation.items) = 2)) )) = 0)) )) = 0;
  wr2 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
     IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
     QUERY ( srwp_i <* pdr.used_representation.items | ((srwp_i.
     name = 'orientation') OR (srwp_i.name = 'boundary')) )) = 
     SIZEOF(pdr.used_representation.items))) )) = 1) )) = 1;
  wr3 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'center point')) )) = 1)) )) = 0;
  wr4 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'north pole vector')) )) = 1)) )) 
     = 0;
  wr5 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'prime meridian vector')) )) = 1)) )) 
     = 0;
  wr6 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'latitude start angle')) )) = 1)) )) 
     = 0;
  wr7 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'latitude stop point')) )) = 1)) )) 
     = 0;
  wr8 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'longitude start point')) )) = 1)) )) 
     = 0;
  wr9 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'longitude stop point')) )) = 1)) )) 
     = 0;
  wr10: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
     TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'diameter')) )) = 1)) )) = 0;
  wr11: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.CARTESIAN_POINT' IN TYPEOF(
     pdr.used_representation)) AND (pdr.used_representation.name 
     = 'boundary')) )) >= 2)) )) = 0;
  END_ENTITY; -- dmf_sphere

  ENTITY dmf_surface_of_revolution_dml
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    impl_rep.used_representation.items) = 1)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
    QUERY ( srwp_i <* pdr.used_representation.items | (srwp_i.
    name = 'orientation') )) = SIZEOF(pdr.used_representation.
    items))) )) = 1) )) = 1;
  END_ENTITY; -- dmf_surface_of_revolution_dml

  ENTITY dmf_torus
    SUBTYPE OF (dm_feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    impl_rep.used_representation.items) = 2)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
    QUERY ( srwp_i <* pdr.used_representation.items | ((srwp_i.
    name = 'orientation') OR (srwp_i.name = 'inner outer')) )) =
     SIZEOF(pdr.used_representation.items))) )) = 1) )) = 1;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_POINT_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'center point')) )) = 1)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_VECTOR_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'vector or plane')) )) = 1)) )) =
     0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'major diameter')) )) = 1)) )) = 
    0;
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DM_DIMENSION_PARAMETER' IN 
    TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'minor diameter')) )) = 1)) )) = 
    0;
  wr7: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.'
      +'DM_SHAPE_REPRESENTATION_WITH_PARAMETERS'  
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    QUERY ( it <* impl_rep.used_representation.items | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (it.name = 'inner outer')) AND ((it.
    description = 'inner') OR (it.description = 'outer'))) )) = 
    1)) )) = 0)) )) = 0;
  END_ENTITY; -- dmf_torus

  ENTITY document;
      id          : identifier;
      name        : label;
      description : OPTIONAL text;
      kind        : document_type;
    INVERSE
      representation_types : SET [0:?] OF document_representation_type FOR 
          represented_document;
  END_ENTITY; -- document

  ENTITY document_reference
    ABSTRACT SUPERTYPE;
      assigned_document : document;
      source : label;
    DERIVE
      role : object_role := get_role(SELF);
    WHERE
  wr1: SIZEOF(USEDIN(SELF,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'ROLE_ASSOCIATION.ITEM_WITH_ROLE')) <= 1;
  END_ENTITY; -- document_reference

  ENTITY document_representation_type;
      name      : label;
      represented_document : document;
  END_ENTITY; -- document_representation_type

  ENTITY document_type;
      product_data_type : label;
  END_ENTITY; -- document_type

  ENTITY document_usage_constraint;
      source     : document;
      subject_element       : label;
      subject_element_value : text;
  END_ENTITY; -- document_usage_constraint

  ENTITY document_with_class
    SUBTYPE OF (document);
      class : identifier;
  END_ENTITY; -- document_with_class

  ENTITY edge
    SUPERTYPE OF (ONEOF (edge_curve,oriented_edge))
    SUBTYPE OF (topological_representation_item);
      edge_start : vertex;
      edge_end   : vertex;
  END_ENTITY; -- edge

  ENTITY edge_curve
    SUBTYPE OF (edge, geometric_representation_item);
      edge_geometry : curve;
      same_sense    : BOOLEAN;
  END_ENTITY; -- edge_curve

  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 edge_round
    SUBTYPE OF (transition_feature);
    WHERE
  wr1: (NOT (SELF\shape_aspect.description = 'constant radius')) OR (
    SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
    IN TYPEOF(pdr.used_representation)) )) = 1)) )) = 0);
  wr2: (NOT (SELF\shape_aspect.description = 'constant radius')) OR (
    SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
    IN TYPEOF(pdr.used_representation)) ) | ((NOT (SIZEOF(
    impl_rep.used_representation.items) >= 1)) AND (SIZEOF(
    impl_rep.used_representation.items) <= 3)) )) = 0)) )) = 0);
  wr3: (NOT (SELF.description = 'constant radius')) OR (SIZEOF(
    QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    QUERY ( it <* impl_rep.used_representation.items | ((SIZEOF(
    ['DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'radius')) )) = 1)) )) = 0)) )) 
    = 0);
  wr4: (NOT (SELF.description = 'constant radius')) OR (SIZEOF(
    QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    QUERY ( it <* impl_rep.used_representation.items | ((SIZEOF(
    ['DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'first offset')) )) <= 1)) )) 
    = 0)) )) = 0);
  wr5: (NOT (SELF.description = 'constant radius')) OR (SIZEOF(
    QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
    IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
    QUERY ( it <* impl_rep.used_representation.items | ((SIZEOF(
    ['DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'second offset')) )) <= 1)) )) 
    = 0)) )) = 0);
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.FACE_SHAPE_REPRESENTATION' IN
     TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'edge round face')) )) <= 1)) )) 
    = 0;
  wr7: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.FACE_SHAPE_REPRESENTATION' IN
     TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'first face shape')) )) <= 1)) )) 
    = 0;
  wr8: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.FACE_SHAPE_REPRESENTATION' IN
     TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'second face shape')) )) <= 1)) )) 
    = 0;
  END_ENTITY; -- edge_round

  ENTITY elementary_surface
    SUPERTYPE OF (ONEOF (plane,cylindrical_surface,conical_surface,
        spherical_surface,toroidal_surface))
    SUBTYPE OF (surface);
      position : axis2_placement_3d;
  END_ENTITY; -- elementary_surface

  ENTITY ellipse
    SUBTYPE OF (conic);
      semi_axis_1 : positive_length_measure;
      semi_axis_2 : positive_length_measure;
  END_ENTITY; -- ellipse

  ENTITY executed_action
    SUBTYPE OF (action);
  END_ENTITY; -- executed_action

  ENTITY extension
    SUBTYPE OF (derived_shape_aspect);
    WHERE
  wr1: SIZEOF(SELF\derived_shape_aspect.deriving_relationships) = 1;
  END_ENTITY; -- extension

  ENTITY external_source;
      source_id : source_item;
    DERIVE
      description : text := get_description_value(SELF);
    WHERE
  wr1: SIZEOF(USEDIN(SELF,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1;
  END_ENTITY; -- external_source

  ENTITY externally_defined_dimension_definition
    SUBTYPE OF (externally_defined_item, dimensional_size);
    WHERE
  wr1: SELF.source.description = 'externally dimension specification';
  wr2: SIZEOF(QUERY ( adr <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.APPLIED_DOCUMENT_REFERENCE.ITEMS')
     | (adr.assigned_document.description = 
    'externally dimension specification') )) <= 1;
  END_ENTITY; -- externally_defined_dimension_definition

  ENTITY externally_defined_feature_definition
    SUBTYPE OF (feature_definition, externally_defined_item);
    WHERE
  wr1 : (((((SELF\characterized_object.description = 'thread') AND (
     SELF\externally_defined_item.item_id = 'external thread')) 
     AND (SELF\externally_defined_item.source.source_id = 
     'external feature specification')) OR (((SELF\
     characterized_object.description = 'gear') AND (SELF\
     externally_defined_item.item_id = 'external gear')) AND (
     SELF\externally_defined_item.source.source_id = 
     'external feature specification'))) OR (((SELF\
     characterized_object.description = 'marking') AND (SELF\
     externally_defined_item.item_id = 'external marking')) AND 
     (SELF\externally_defined_item.source.source_id = 
     'external feature specification'))) OR (((SELF\
     characterized_object.description = 'knurl') AND (SELF\
     externally_defined_item.item_id = 'external knurl')) AND (
     SELF\externally_defined_item.source.source_id = 
     'external feature specification'));
  wr2 : (NOT (SELF\characterized_object.description = 'thread')) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) AND ((5 <= SIZEOF(pdr.
     used_representation.items)) AND (SIZEOF(pdr.
     used_representation.items) <= 10))) )) = 1) )) = 1);
  wr3 : (NOT (SELF\characterized_object.description = 'marking')) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) AND (SIZEOF(pdr.used_representation.
     items) = 2)) )) = 1) )) = 1);
  wr4 : (NOT (SELF\characterized_object.description = 'knurl')) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) AND (SIZEOF(pdr.used_representation.
     items) = 1)) )) = 1) )) = 1);
  wr5 : (NOT (SELF\characterized_object.description IN ['knurl',
     'thread'])) OR (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(
     SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'partial area occurrence') AND (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'applied area usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.APPLIED_AREA' IN TYPEOF(sdr.
     relating_shape_aspect)) )) = 1)) )) <= 1)) )) = 0);
  wr6 : (NOT (SELF\characterized_object.description = 'marking')) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'marking text')) )) = 1)) )) 
     = 0)) )) = 0);
  wr7 : (NOT (SELF\characterized_object.description = 'thread')) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'removal direction')) AND ((
     it.description = 'internal') OR (it.description = 
     'external'))) )) = 1)) )) = 0)) )) = 0);
  wr8 : (NOT (SELF\characterized_object.description = 'thread')) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'qualifier')) )) <= 1)) )) = 
     0)) )) = 0);
  wr9 : (NOT (SELF\characterized_object.description = 'thread')) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'hand')) )) = 1)) )) = 0)) )) 
     = 0);
  wr10: (NOT (SELF\characterized_object.description = 'thread')) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'fit class')) )) = 1)) )) = 0)) )) 
     = 0);
  wr11: (NOT (SELF\characterized_object.description = 'thread')) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'form')) )) = 1)) )) = 0)) )) 
     = 0);
  wr12: (NOT (SELF\characterized_object.description = 'thread')) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'major diameter')) )) <= 1)) )) 
     = 0)) )) = 0);
  wr13: (NOT (SELF\characterized_object.description = 'thread')) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.RATIO_MEASURE_WITH_UNIT'] * 
     TYPEOF(it)) = 2) AND (it.name = 'number of threads')) )) = 
     1)) )) = 0)) )) = 0);
  wr14: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'fit class 2')) )) <= 1)) )) 
     = 0)) )) = 0;
  wr15: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'nominal size')) )) <= 1)) )) 
     = 0)) )) = 0;
  wr16: (NOT (SELF\characterized_object.description IN ['knurl','gear',
     'thread'])) OR (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(
     SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'applied shape') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT' IN TYPEOF(sdr.
     relating_shape_aspect)) )) = 1) )) <= 1)) )) = 0);
  wr17: (NOT (SELF\characterized_object.description IN ['gear'])) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) AND (10 <= SIZEOF(pdr.
     used_representation.items))) AND (SIZEOF(pdr.
     used_representation.items) >= 11)) )) = 1) )) = 1);
  wr18: (NOT (SELF\characterized_object.description IN ['gear'])) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.RATIO_MEASURE_WITH_UNIT'] * 
     TYPEOF(it)) = 2) AND (it.name = 'number of teeth')) )) = 1)) )) 
     = 0)) )) = 0);
  wr19: (NOT (SELF\characterized_object.description IN ['gear'])) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
     * TYPEOF(it)) = 2) AND (it.name = 'reference presure angle')) )) 
     = 1)) )) = 0)) )) = 0);
  wr20: (NOT (SELF\characterized_object.description IN ['gear'])) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'rake shift factor')) )) =
      1)) )) = 0)) )) = 0);
  wr21: (NOT (SELF\characterized_object.description IN ['gear'])) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'nominal tool depth')) )) 
     = 1)) )) = 0)) )) = 0);
  wr22: (NOT (SELF\characterized_object.description IN ['gear'])) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'face width')) )) = 1)) )) 
     = 0)) )) = 0);
  wr23: (NOT (SELF\characterized_object.description IN ['gear'])) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'tip diameter')) )) = 1)) )) 
     = 0)) )) = 0);
  wr24: (NOT (SELF\characterized_object.description IN ['gear'])) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'module or diametral pitch')) 
     AND ((it.description = 'module') OR (it.description = 
     'diameter pitch'))) )) = 1)) )) = 0)) )) = 0);
  wr25: (NOT (SELF\characterized_object.description IN ['gear'])) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'normal attribute')) )) = 
     1)) )) = 0)) )) = 0);
  wr26: (NOT (SELF\characterized_object.description IN ['gear'])) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'internal or external gear')) 
     AND ((it.description = 'internal') OR (it.description = 
     'external'))) )) = 1)) )) = 0)) )) = 0);
  wr27: (NOT (SELF\characterized_object.description IN ['gear'])) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
     * TYPEOF(it)) = 2) AND (it.name = 'root fillet radius')) )) 
     <= 1)) )) = 0)) )) = 0);
  END_ENTITY; -- externally_defined_feature_definition

  ENTITY externally_defined_item;
      item_id : source_item;
      source  : external_source;
  END_ENTITY; -- externally_defined_item

  ENTITY face
    SUPERTYPE OF (ONEOF (face_surface,oriented_face))
    SUBTYPE OF (topological_representation_item);
      bounds : SET [1:?] OF face_bound;
    WHERE
  wr1: NOT mixed_loop_type_set(list_to_set(list_face_loops(SELF)));
  wr2: SIZEOF(QUERY ( temp <* bounds | (
    'DIMENSIONAL_INSPECTION_SCHEMA.FACE_OUTER_BOUND' IN TYPEOF(
    temp)) )) <= 1;
  END_ENTITY; -- face

  ENTITY face_bound
    SUBTYPE OF (topological_representation_item);
      bound       : loop;
      orientation : BOOLEAN;
  END_ENTITY; -- face_bound

  ENTITY face_outer_bound
    SUBTYPE OF (face_bound);
  END_ENTITY; -- face_outer_bound

  ENTITY face_shape_representation
    SUBTYPE OF (shape_representation);
    WHERE
  wr1: SIZEOF(SELF.items) >= 1;
  wr2: SIZEOF(QUERY ( it <* SELF.items | (NOT ((
    'DIMENSIONAL_INSPECTION_SCHEMA.FACE_SURFACE' IN TYPEOF(it)) 
    OR ('DIMENSIONAL_INSPECTION_SCHEMA.ORIENTED_FACE' IN TYPEOF(
    it)))) )) = 0;
  END_ENTITY; -- face_shape_representation

  ENTITY face_surface
    SUBTYPE OF (face, geometric_representation_item);
      face_geometry : surface;
      same_sense    : BOOLEAN;
    WHERE
  wr1: NOT ('DIMENSIONAL_INSPECTION_SCHEMA.ORIENTED_SURFACE' IN 
    TYPEOF(face_geometry));
  END_ENTITY; -- face_surface

  ENTITY faceted_brep
    SUBTYPE OF (manifold_solid_brep);
  END_ENTITY; -- faceted_brep

  ENTITY feature_component_definition
    SUBTYPE OF (characterized_object);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE')) = 1)) )) 
    = 0;
  END_ENTITY; -- feature_component_definition

  ENTITY feature_component_relationship
    SUPERTYPE OF (ONEOF (pattern_omit_membership,pattern_offset_membership))
    SUBTYPE OF (shape_aspect_relationship);
    WHERE
  wr1: ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.COMPOSITE_SHAPE_ASPECT',
    'DIMENSIONAL_INSPECTION_SCHEMA.REPLICATE_FEATURE',
    'DIMENSIONAL_INSPECTION_SCHEMA.TRANSITION_FEATURE',
    'DIMENSIONAL_INSPECTION_SCHEMA.MODIFIED_PATTERN'] * TYPEOF(
    SELF.relating_shape_aspect)) = 1) OR (
    'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_DEFINITION' IN 
    TYPEOF(SELF.relating_shape_aspect.of_shape.definition))) OR 
    ('DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' 
    IN TYPEOF(SELF.relating_shape_aspect.of_shape.definition));
  END_ENTITY; -- feature_component_relationship

  ENTITY feature_definition
    SUBTYPE OF (characterized_object);
    WHERE
  wr1: SIZEOF(QUERY ( pdr <* get_property_definition_representations(
    SELF) | (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
    IN TYPEOF(pdr.used_representation)) )) <= 1;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) AND
     (it.name = 'orientation')) )) = 1)) )) = 0)) )) = 0;
  wr3: SIZEOF(['DIMENSIONAL_INSPECTION_SCHEMA.BOSS',
    'DIMENSIONAL_INSPECTION_SCHEMA.TURNED_KNURL',
    'DIMENSIONAL_INSPECTION_SCHEMA.THREAD',
    'DIMENSIONAL_INSPECTION_SCHEMA.GEAR',
    'DIMENSIONAL_INSPECTION_SCHEMA.MARKING',
    'DIMENSIONAL_INSPECTION_SCHEMA.RIB_TOP',
    'DIMENSIONAL_INSPECTION_SCHEMA.ROUND_HOLE',
    'DIMENSIONAL_INSPECTION_SCHEMA.OUTSIDE_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.POCKET',
    'DIMENSIONAL_INSPECTION_SCHEMA.REMOVAL_VOLUME',
    'DIMENSIONAL_INSPECTION_SCHEMA.REVOLVED_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.OUTER_ROUND',
    'DIMENSIONAL_INSPECTION_SCHEMA.FLAT_FACE',
    'DIMENSIONAL_INSPECTION_SCHEMA.PROTRUSION',
    'DIMENSIONAL_INSPECTION_SCHEMA.ROUNDED_END',
    'DIMENSIONAL_INSPECTION_SCHEMA.SLOT',
    'DIMENSIONAL_INSPECTION_SCHEMA.SPHERICAL_CAP',
    'DIMENSIONAL_INSPECTION_SCHEMA.STEP',
    'DIMENSIONAL_INSPECTION_SCHEMA.COMPOUND_FEATURE',
    'DIMENSIONAL_INSPECTION_SCHEMA.REPLICATE_FEATURE',
    'DIMENSIONAL_INSPECTION_SCHEMA.EXTERNALLY_DEFINED_FEATURE_DEFINITION'] 
    * TYPEOF(SELF)) = 1;
  wr4: (NOT (SIZEOF(['DIMENSIONAL_INSPECTION_SCHEMA.ROUND_HOLE',
    'DIMENSIONAL_INSPECTION_SCHEMA.BOSS',
    'DIMENSIONAL_INSPECTION_SCHEMA.OUTSIDE_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.REMOVAL_VOLUME',
    'DIMENSIONAL_INSPECTION_SCHEMA.FLAT_FACE',
    'DIMENSIONAL_INSPECTION_SCHEMA.POCKET',
    'DIMENSIONAL_INSPECTION_SCHEMA.PROTRUSION',
    'DIMENSIONAL_INSPECTION_SCHEMA.RIB_TOP',
    'DIMENSIONAL_INSPECTION_SCHEMA.ROUNDED_END',
    'DIMENSIONAL_INSPECTION_SCHEMA.SLOT',
    'DIMENSIONAL_INSPECTION_SCHEMA.STEP'] * TYPEOF(SELF)) = 1)) 
    OR (SIZEOF(QUERY ( pdr <* 
    get_property_definition_representations(SELF) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
    IN TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'maximum feature limit')) )) >= 0);
  END_ENTITY; -- feature_definition

  ENTITY feature_pattern
    SUBTYPE OF (replicate_feature);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) AND (SIZEOF(QUERY ( srwp_i <* pdr.
    used_representation.items | (NOT (
    'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(srwp_i))) )) 
    > 0)) )) > 0) )) = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) AND
     (it.name = 'base feature placement')) )) > 1)) )) = 0)) )) 
    = 0;
  END_ENTITY; -- feature_pattern

  ENTITY fillet
    SUBTYPE OF (transition_feature);
    WHERE
  wr1: (NOT (SELF\shape_aspect.description = 'constant radius')) OR (
    SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) )) = 1)) )) = 0);
  wr2: (NOT (SELF\shape_aspect.description = 'constant radius')) OR (
    SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | ((NOT (SIZEOF(impl_rep.
    used_representation.items) >= 1)) AND (SIZEOF(impl_rep.
    used_representation.items) <= 3)) )) = 0)) )) = 0);
  wr3: (NOT (SELF.description = 'constant radius')) OR (SIZEOF(
    QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'radius')) )) = 1)) )) = 0)) )) 
    = 0);
  wr4: (NOT (SELF.description = 'constant radius')) OR (SIZEOF(
    QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'first offset')) )) <= 1)) )) 
    = 0)) )) = 0);
  wr5: (NOT (SELF.description = 'constant radius')) OR (SIZEOF(
    QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'second offset')) )) <= 1)) )) 
    = 0)) )) = 0);
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.' + 
    'DEFINITION') | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.FACE_SHAPE_REPRESENTATION' IN
     TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'fillet face')) )) = 1)) )) = 0;
  wr7: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.' + 
    'DEFINITION') | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.FACE_SHAPE_REPRESENTATION' IN
     TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'first face shape')) )) = 1)) )) 
    = 0;
  wr8: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.' + 
    'DEFINITION') | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.FACE_SHAPE_REPRESENTATION' IN
     TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'second face shape')) )) = 1)) )) 
    = 0;
  END_ENTITY; -- fillet

  ENTITY flat_face
    SUBTYPE OF (feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DIRECTION_SHAPE_REPRESENTATION' 
    IN TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'removal direction')) )) = 1)) )) 
    = 0;
  wr2: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'course of travel occurrence') AND (
    SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'path feature component usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.PATH_FEATURE_COMPONENT' IN 
    TYPEOF(sdr.relating_shape_aspect)) AND (sdr.
    relating_shape_aspect.description = 'linear')) AND (sdr.name 
    = 'course of travel')) )) = 1)) )) = 1)) )) = 0;
  wr3: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'removal boundary occurrence') AND (
    SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'profile usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.LINEAR_PROFILE' IN TYPEOF(sdr
    .relating_shape_aspect)) AND (sdr.name = 'removal boundary')) )) 
    = 1)) )) = 1)) )) = 0;
  wr4: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'enclosed boundary occurrence') AND (
    SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'profile usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_CLOSED_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.NGON_CLOSED_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_CLOSED_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.CLOSED_PATH_PROFILE'] * 
    TYPEOF(sdr.relating_shape_aspect)) = 1) AND (sdr.
    relating_shape_aspect.description = 'boundary')) )) = 1)) )) 
    <= 1)) )) = 0;
  wr5: SIZEOF(QUERY ( pdr <* get_property_definition_representations(
    SELF) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
    IN TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'maximum feature limit')) )) >= 0;
  wr6: SIZEOF(QUERY ( pds <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN 
    TYPEOF(pds)) AND (SIZEOF(QUERY ( csa <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.COMPOSITE_SHAPE_ASPECT' IN 
    TYPEOF(csa)) AND (csa.name = 'uncut area')) AND (SIZEOF(
    QUERY ( sar <* csa.component_relationships | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar)) AND (SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.BOSS',
    'DIMENSIONAL_INSPECTION_SCHEMA.PROTRUSION'] * TYPEOF(sar.
    related_shape_aspect)) = 1)) )) = 1)) )) <= 1)) )) = 1;
  wr7: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'removal depth')) )) <= 1)) )) 
    = 0)) )) = 0;
  END_ENTITY; -- flat_face

  ENTITY flatness_tolerance
    SUBTYPE OF (geometric_tolerance);
    WHERE
  wr1: NOT (('DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'GEOMETRIC_TOLERANCE_WITH_DATUM_REFERENCE') IN TYPEOF(SELF));
  END_ENTITY; -- flatness_tolerance

  ENTITY founded_item;
  END_ENTITY; -- founded_item

  ENTITY functionally_defined_transformation;
      name        : label;
      description : OPTIONAL text;
  END_ENTITY; -- functionally_defined_transformation

  ENTITY gear
    SUBTYPE OF (feature_definition);
    WHERE
  wr1 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
      'DIMENSIONAL_INSPECTION_SCHEMA.'+
      'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION')| (((
      'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) AND (10 <= SIZEOF(pdr.
     used_representation.items))) AND (SIZEOF(pdr.
     used_representation.items) >= 13)) )) = 1) )) = 1;
  wr2 : (NOT (SELF\characterized_object.description IN [
     'straight bevel gear','helical bevel gear','spur gear',
     'helical gear'])) OR (SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.'+
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION')| 
      ('DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | ((
     SIZEOF(['DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.RATIO_MEASURE_WITH_UNIT'] * 
     TYPEOF(it)) = 2) AND (it.name = 'number of teeth')) )) = 1)) )) 
     = 0)) )) = 0);
  wr3 : (NOT (SELF\characterized_object.description IN [
     'straight bevel gear','helical bevel gear','spur gear',
     'helical gear'])) OR (SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.'+
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION')| 
      ('DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | ((
     SIZEOF(['DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
     * TYPEOF(it)) = 2) AND (it.name = 
     'reference pressure angle')) )) = 1)) )) = 0)) )) = 0);
  wr4 : (NOT (SELF\characterized_object.description IN [
     'straight bevel gear','helical bevel gear','spur gear',
     'helical gear'])) OR (SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.'+
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION')| 
      ('DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | ((
     SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'rake shift factor')) )) =
      1)) )) = 0)) )) = 0);
  wr5 : (NOT (SELF\characterized_object.description IN [
     'straight bevel gear','helical bevel gear','spur gear',
     'helical gear'])) OR (SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.'+
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | 
      ('DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | ((
     SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'nominal tooth depth')) )) 
     = 1)) )) = 0)) )) = 0);
  wr6 : (NOT (SELF\characterized_object.description IN [
     'straight bevel gear','helical bevel gear','spur gear',
     'helical gear'])) OR (SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.'+
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | 
      ('DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | ((
     SIZEOF(['DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'face width')) )) = 1)) )) 
     = 0)) )) = 0);
  wr7 : (NOT (SELF\characterized_object.description IN [
     'straight bevel gear','helical bevel gear','spur gear',
     'helical gear'])) OR (SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.'+
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | 
      ('DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | ((
     SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'tip diameter')) )) = 1)) )) 
     = 0)) )) = 0);
  wr8 : (NOT (SELF\characterized_object.description IN [
     'straight bevel gear','helical bevel gear','spur gear',
     'helical gear'])) OR (SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.'+
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | 
      ('DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'module or diametral pitch')) 
     AND ((it.description = 'module') OR (it.description = 
     'diametral pitch'))) )) = 1)) )) = 0)) )) = 0);
  wr9 : (NOT (SELF\characterized_object.description IN [
     'straight bevel gear','helical bevel gear','spur gear',
     'helical gear'])) OR (SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.'+
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | 
      ('DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'internal or external gear')) 
     AND ((it.description = 'internal') OR (it.description = 
     'external'))) )) = 1)) )) = 0)) )) = 0);
  wr10: (NOT (SELF\characterized_object.description IN [
     'straight bevel gear','helical bevel gear','spur gear',
     'helical gear'])) OR (SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.'+
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | 
      ('DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | ((
     SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'normal attribute')) )) = 
     1)) )) = 0)) )) = 0);
  wr11: (NOT (SELF\characterized_object.description IN [
     'straight bevel gear','helical bevel gear','spur gear',
     'helical gear'])) OR (SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.'+
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | 
      ('DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | ((
     SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'root fillet radius')) )) 
     <= 1)) )) = 0)) )) = 0);
  wr12: (NOT (SELF\characterized_object.description IN ['helix gear',
     'helical bevel gear'])) OR (SIZEOF(QUERY ( pd <* USEDIN(
     SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.'+
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | 
      ('DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | ((
     SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
     * TYPEOF(it)) = 2) AND (it.name = 'reference helix angle')) )) 
     = 1)) )) = 0)) )) = 0);
  wr13: (NOT (SELF\characterized_object.description IN ['helix gear',
     'helical bevel gear'])) OR (SIZEOF(QUERY ( pd <* USEDIN(
     SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.'+
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | 
      ('DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'gear tooth')) AND ((it.
     description = 'left hand tooth') OR (it.description = 
     'right hand tooth'))) )) = 1)) )) = 0)) )) = 0);
  wr14: (NOT (SELF\characterized_object.description IN [
     'straight bevel gear','helical bevel gear'])) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.'+
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION')| 
      ('DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | ((
     SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
     * TYPEOF(it)) = 2) AND (it.name = 'tip angle')) )) = 1)) )) 
     = 0)) )) = 0);
  wr15: (NOT (SELF\characterized_object.description IN [
     'straight bevel gear','helical bevel gear'])) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.'+
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | 
      ('DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | ((
     SIZEOF(['DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
     * TYPEOF(it)) = 2) AND (it.name = 'root angle')) )) = 1)) )) 
     = 0)) )) = 0);
  wr16: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.'+
     'SHAPE_ASPECT_RELATIONSHIP.RELATED_SHAPE_ASPECT')
      | ((sar.description = 'applied shape') AND (
      'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT' IN TYPEOF(sdr.
     relating_shape_aspect)) )) = 1) )) = 1)) )) = 0;
  END_ENTITY; -- gear

  ENTITY geometric_alignment
    SUBTYPE OF (derived_shape_aspect);
    WHERE
  wr1: SIZEOF(SELF\derived_shape_aspect.deriving_relationships) > 1;
  END_ENTITY; -- geometric_alignment

  ENTITY geometric_intersection
    SUBTYPE OF (derived_shape_aspect);
    WHERE
  wr1: SIZEOF(SELF\derived_shape_aspect.deriving_relationships) > 1;
  END_ENTITY; -- geometric_intersection

  ENTITY geometric_representation_context
    SUBTYPE OF (representation_context);
      coordinate_space_dimension : dimension_count;
  END_ENTITY; -- geometric_representation_context

  ENTITY geometric_representation_item
    SUPERTYPE OF (ONEOF (point,direction,vector,placement,
        cartesian_transformation_operator,curve,surface,edge_curve,
        face_surface,poly_loop,vertex_point,solid_model))
    SUBTYPE OF (representation_item);
    DERIVE
      dim : dimension_count := dimension_of(SELF);
    WHERE
  wr1: SIZEOF(QUERY ( using_rep <* using_representations(SELF) | (NOT 
    ('DIMENSIONAL_INSPECTION_SCHEMA.GEOMETRIC_REPRESENTATION_CONTEXT' 
    IN TYPEOF(using_rep.context_of_items))) )) = 0;
  END_ENTITY; -- geometric_representation_item

  ENTITY geometric_tolerance;
      name         : label;
      description  : text;
      magnitude    : measure_with_unit;
      toleranced_shape_aspect : shape_aspect;
    WHERE
  wr1: magnitude.value_component >= 0;
  END_ENTITY; -- geometric_tolerance

  ENTITY geometric_tolerance_relationship;
      name   : label;
      description       : text;
      relating_geometric_tolerance : geometric_tolerance;
      related_geometric_tolerance  : geometric_tolerance;
  END_ENTITY; -- geometric_tolerance_relationship

  ENTITY geometric_tolerance_with_datum_reference
    SUBTYPE OF (geometric_tolerance);
      datum_system : SET [1:?] OF datum_reference;
  END_ENTITY; -- geometric_tolerance_with_datum_reference

  ENTITY geometric_tolerance_with_defined_unit
    SUBTYPE OF (geometric_tolerance);
      unit_size : measure_with_unit;
    WHERE
  wr1: unit_size.value_component > 0;
  END_ENTITY; -- geometric_tolerance_with_defined_unit

  ENTITY global_uncertainty_assigned_context
    SUBTYPE OF (representation_context);
      uncertainty : SET [1:?] OF uncertainty_measure_with_unit;
  END_ENTITY; -- global_uncertainty_assigned_context

  ENTITY global_unit_assigned_context
    SUBTYPE OF (representation_context);
      units : SET [1:?] OF unit;
  END_ENTITY; -- global_unit_assigned_context

  ENTITY hole_bottom
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1 : 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' 
     IN TYPEOF(SELF.of_shape.definition);
  wr2 : SELF.description IN ['through','flat','flat with radius',
     'flat with taper','spherical','conical'];
  wr3 : (NOT (SELF.description = 'through')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(USEDIN(pd,'DIMENSIONAL_INSPECTION_SCHEMA.' 
     + 'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION')) = 0)) )) 
     = 0);
  wr4 : (NOT (SELF.description IN ['flat with radius',
     'flat with taper','spherical','conical'])) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) )) = 1)) )) = 0);
  wr5 : (NOT (SELF.description = 'flat')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(impl_rep.
     used_representation.items) = 0)) )) = 0)) )) = 0);
  wr6 : (NOT (SELF.description IN ['flat with radius','spherical'])) 
     OR (SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(impl_rep.
     used_representation.items) = 1)) )) = 0)) )) = 0);
  wr7 : (NOT (SELF.description = 'flat with taper')) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(impl_rep.
     used_representation.items) = 2)) )) = 0)) )) = 0);
  wr8 : (NOT (SELF.description = 'conical')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | ((NOT (SIZEOF(impl_rep.
     used_representation.items) >= 1)) AND (SIZEOF(impl_rep.
     used_representation.items) <= 2)) )) = 0)) )) = 0);
  wr9 : (SELF.description = 'through') OR (SIZEOF(QUERY ( fcr <* 
     QUERY ( sar <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATING_SHAPE_ASPECT') | ((sar.description = 
     'hole bottom usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (fcr.name IN ['hole depth start',
     'hole depth end']) )) >= 1);
  wr10: (NOT (SELF.description = 'flat with radius')) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'corner radius')) )) = 1)) )) 
     = 0)) )) = 0);
  wr11: (NOT (SELF.description = 'spherical')) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'radius')) )) = 1)) )) = 0)) )) 
     = 0);
  wr12: (NOT (SELF.description = 'conical')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'tip radius')) )) <= 1)) )) 
     = 0)) )) = 0);
  wr13: (NOT (SELF.description = 'conical')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
     * TYPEOF(it)) = 2) AND (it.name = 'tip angle')) )) = 1)) )) 
     = 0)) )) = 0);
  wr14: SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATING_SHAPE_ASPECT') | ((sar.description = 
     'hole bottom usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (((fcr.related_shape_aspect.
     description = 'bottom condition occurrence') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.ROUND_HOLE' IN TYPEOF(fcr.
     related_shape_aspect.of_shape.definition))) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.HOLE_BOTTOM' IN TYPEOF(fcr.
     relating_shape_aspect))) )) >= 1;
  wr15: (NOT (SELF.description = 'flat with taper')) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'final diameter')) )) = 1)) )) 
     = 0)) )) = 0);
  wr16: (NOT (SELF.description = 'flat with taper')) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
     * TYPEOF(it)) = 2) AND (it.name = 'taper diameter')) )) = 1)) )) 
     = 0)) )) = 0);
  END_ENTITY; -- hole_bottom

  ENTITY hyperbola
    SUBTYPE OF (conic);
      semi_axis      : positive_length_measure;
      semi_imag_axis : positive_length_measure;
  END_ENTITY; -- hyperbola

  ENTITY id_attribute;
      attribute_value : identifier;
      identified_item : id_attribute_select;
  END_ENTITY; -- id_attribute

  ENTITY instanced_feature
    SUBTYPE OF (feature_definition, shape_aspect);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION' IN TYPEOF(
    SELF.of_shape.definition);
  wr2: SELF.product_definitional;
  END_ENTITY; -- instanced_feature

  ENTITY length_measure_with_unit
    SUBTYPE OF (measure_with_unit);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_UNIT' IN TYPEOF(SELF\
    measure_with_unit.unit_component);
  END_ENTITY; -- length_measure_with_unit

  ENTITY length_unit
    SUBTYPE OF (named_unit);
    WHERE
  wr1: ((((((SELF\named_unit.dimensions.length_exponent = 1) AND (SELF
    \named_unit.dimensions.mass_exponent = 0)) AND (SELF\
    named_unit.dimensions.time_exponent = 0)) AND (SELF\
    named_unit.dimensions.electric_current_exponent = 0)) AND (
    SELF\named_unit.dimensions.
    thermodynamic_temperature_exponent = 0)) AND (SELF\
    named_unit.dimensions.amount_of_substance_exponent = 0)) AND
     (SELF\named_unit.dimensions.luminous_intensity_exponent = 0);
  END_ENTITY; -- length_unit

  ENTITY limits_and_fits;
      form_variance : label;
      zone_variance : label;
      grade         : label;
      source        : text;
  END_ENTITY; -- limits_and_fits

  ENTITY line
    SUBTYPE OF (curve);
      pnt : cartesian_point;
      dir : vector;
    WHERE
  wr1: dir.dim = pnt.dim;
  END_ENTITY; -- line

  ENTITY line_profile_tolerance
    SUBTYPE OF (geometric_tolerance);
    WHERE
  wr1: (NOT (('DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'GEOMETRIC_TOLERANCE_WITH_DATUM_REFERENCE') IN TYPEOF(SELF))) 
    OR (SIZEOF(SELF\geometric_tolerance_with_datum_reference.
    datum_system) <= 3);
  wr2: SIZEOF(QUERY ( sar <* USEDIN(SELF\geometric_tolerance.
    toleranced_shape_aspect,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_ASPECT_RELATIONSHIP.RELATING_SHAPE_ASPECT') | (sar.
    name IN ['affected plane association',
    'resulting intersection curve association']) )) = 1;
  END_ENTITY; -- line_profile_tolerance

  ENTITY linear_profile
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' IN
     TYPEOF(SELF.of_shape.definition);
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) )) = 1)) )) = 0;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(impl_rep.
    used_representation.items) = 2)) )) = 0)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) AND
     (it.name = 'orientation')) )) = 1)) )) = 0)) )) = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'profile length')) )) = 1)) )) 
    = 0)) )) = 0;
  END_ENTITY; -- linear_profile

  ENTITY local_time;
      hour_component   : hour_in_day;
      minute_component : OPTIONAL minute_in_hour;
      second_component : OPTIONAL second_in_minute;
      zone  : coordinated_universal_time_offset;
    WHERE
  wr1: valid_time(SELF);
  END_ENTITY; -- local_time

  ENTITY location_shape_representation
    SUBTYPE OF (shape_representation);
    WHERE
  wr1: SIZEOF(SELF.items) = 1;
  wr2: SIZEOF(QUERY ( it <* SELF.items | (NOT (
    'DIMENSIONAL_INSPECTION_SCHEMA.POINT' IN TYPEOF(it))) )) = 0;
  END_ENTITY; -- location_shape_representation

  ENTITY loop
    SUPERTYPE OF (ONEOF (vertex_loop,edge_loop,poly_loop))
    SUBTYPE OF (topological_representation_item);
  END_ENTITY; -- loop

  ENTITY manifold_solid_brep
    SUBTYPE OF (solid_model);
      outer : closed_shell;
  END_ENTITY; -- manifold_solid_brep

  ENTITY mapped_item
    SUBTYPE OF (representation_item);
      mapping_source : representation_map;
      mapping_target : representation_item;
    WHERE
  wr1: acyclic_mapped_representation(using_representations(SELF),[SELF]);
  END_ENTITY; -- mapped_item

  ENTITY marking
    SUBTYPE OF (feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) AND ((2 <= SIZEOF(pdr.
    used_representation.items)) AND (SIZEOF(pdr.
    used_representation.items) <= 6))) )) = 1) )) = 1;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (it.name = 'marking text')) )) = 1)) )) =
     0)) )) = 0;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (it.name = 'special instructions')) )) <=
     1)) )) = 0)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (it.name = 'font name')) )) <= 1)) )) = 0)) )) 
    = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'character height')) )) <= 1)) )) 
    = 0)) )) = 0;
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'character spacing')) )) <= 
    1)) )) = 0)) )) = 0;
  wr7: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
    SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'applied shape') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT' IN TYPEOF(sdr.
    relating_shape_aspect)) )) = 1) )) = 1)) )) = 0;
  END_ENTITY; -- marking

  ENTITY mass_measure_with_unit
    SUBTYPE OF (measure_with_unit);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.MASS_UNIT' IN TYPEOF(SELF\
    measure_with_unit.unit_component);
  END_ENTITY; -- mass_measure_with_unit

  ENTITY mass_unit
    SUBTYPE OF (named_unit);
    WHERE
  wr1: ((((((SELF\named_unit.dimensions.length_exponent = 0) AND (SELF
    \named_unit.dimensions.mass_exponent = 1)) AND (SELF\
    named_unit.dimensions.time_exponent = 0)) AND (SELF\
    named_unit.dimensions.electric_current_exponent = 0)) AND (
    SELF\named_unit.dimensions.
    thermodynamic_temperature_exponent = 0)) AND (SELF\
    named_unit.dimensions.amount_of_substance_exponent = 0)) AND
     (SELF\named_unit.dimensions.luminous_intensity_exponent = 0);
  END_ENTITY; -- mass_unit

  ENTITY measure_qualification;
      name   : label;
      description       : text;
      qualified_measure : measure_with_unit;
      qualifiers        : SET [1:?] OF value_qualifier;
    WHERE
  wr1: SIZEOF(QUERY ( temp <* qualifiers | (
    'DIMENSIONAL_INSPECTION_SCHEMA.PRECISION_QUALIFIER' IN 
    TYPEOF(temp)) )) < 2;
  END_ENTITY; -- measure_qualification

  ENTITY measure_representation_item
    SUBTYPE OF (representation_item, measure_with_unit);
  END_ENTITY; -- measure_representation_item

  ENTITY measure_with_unit
    SUPERTYPE OF (ONEOF (length_measure_with_unit,mass_measure_with_unit,
        time_measure_with_unit,plane_angle_measure_with_unit,
        ratio_measure_with_unit));
      value_component : measure_value;
      unit_component  : unit;
    WHERE
  wr1: valid_units(SELF);
  END_ENTITY; -- measure_with_unit

  ENTITY measurment_location
    SUBTYPE OF (action_property);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.DM_PROGRAM_RUN' IN TYPEOF(SELF.
    definition);
  END_ENTITY; -- measurment_location

  ENTITY modified_geometric_tolerance
    SUBTYPE OF (geometric_tolerance);
      modifier : limit_condition;
  END_ENTITY; -- modified_geometric_tolerance

  ENTITY modified_pattern
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1: SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATING_SHAPE_ASPECT') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar)) ) | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.REPLICATE_FEATURE',
    'DIMENSIONAL_INSPECTION_SCHEMA.INSTANCED_FEATURE'] * TYPEOF(
    fcr.related_shape_aspect.of_shape.definition)) >= 1) AND (
    fcr.description = 'base shape')) )) = 1;
  wr2: SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATING_SHAPE_ASPECT') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar)) ) | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_PATTERN',
    'DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_PATTERN'] * 
    TYPEOF(fcr.related_shape_aspect.of_shape.definition)) = 1) 
    AND (fcr.description = 'base pattern')) )) = 1;
  wr3: SIZEOF(QUERY ( sar <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATING_SHAPE_ASPECT') | (SIZEOF(QUERY ( msar <* USEDIN(
    sar.related_shape_aspect,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | (((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.PATTERN_OFFSET_MEMBERSHIP',
    'DIMENSIONAL_INSPECTION_SCHEMA.PATTERN_OMIT_MEMBERSHIP'] * 
    TYPEOF(sar)) = 1) AND (sar.description = 'modified pattern')) 
    AND (sar :<>: msar)) )) >= 1) )) = 0;
  END_ENTITY; -- modified_pattern

  ENTITY name_attribute;
      attribute_value : label;
      named_item      : name_attribute_select;
  END_ENTITY; -- name_attribute

  ENTITY named_unit
    SUPERTYPE OF (ONEOF (si_unit,conversion_based_unit,
        context_dependent_unit) ANDOR ONEOF (length_unit,mass_unit,
        time_unit,plane_angle_unit,solid_angle_unit,ratio_unit));
      dimensions : dimensional_exponents;
  END_ENTITY; -- named_unit

  ENTITY ngon_closed_profile
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' IN
     TYPEOF(SELF.of_shape.definition);
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) )) = 1)) )) = 0;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT ((SIZEOF(impl_rep.
    used_representation.items) >= 3) AND (SIZEOF(impl_rep.
    used_representation.items) <= 4))) )) = 0)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) AND (SIZEOF(QUERY ( srwp_i <* pdr.
    used_representation.items | (((((srwp_i.name = 'orientation') 
    OR (srwp_i.name = 'number of sides')) OR (srwp_i.name = 
    'circumscribed diameter')) OR (srwp_i.name = 'corner radius')) 
    OR (srwp_i.name = 'diameter across flats')) )) = SIZEOF(pdr.
    used_representation.items))) )) = 1) )) = 1;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) AND
     (it.name = 'orientation')) )) = 1)) )) = 0)) )) = 0;
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.COUNT_MEASURE' IN TYPEOF(it\
    measure_with_unit.value_component))) AND (it.name = 
    'number of sides')) )) = 1)) )) = 0)) )) = 0;
  wr7: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name IN ['circumscribed diameter',
    'diameter across flats'])) )) = 1)) )) = 0)) )) = 0;
  wr8: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'corner radius')) )) <= 1)) )) 
    = 0)) )) = 0;
  END_ENTITY; -- ngon_closed_profile

  ENTITY ngon_shape_representation
    SUBTYPE OF (shape_representation_with_parameters);
    WHERE
  wr1: SIZEOF(SELF.items) = 5;
  wr2: SIZEOF(QUERY ( it <* SELF.items | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) AND
     (it.name = 'orientation')) )) = 1;
  wr3: SIZEOF(QUERY ( it <* SELF.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'length')) )) = 1;
  wr4: SIZEOF(QUERY ( it <* SELF.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'corner radius')) )) = 1;
  wr5: SIZEOF(QUERY ( it <* SELF.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name IN ['circumscribed diameter',
    'diameter across flats'])) )) = 1;
  wr6: SIZEOF(QUERY ( it <* SELF.items | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.COUNT_MEASURE' IN TYPEOF(it\
    measure_with_unit.value_component))) AND (it.name = 
    'number of sides')) )) = 1;
  END_ENTITY; -- ngon_shape_representation

  ENTITY object_role;
      name        : label;
      description : OPTIONAL text;
  END_ENTITY; -- object_role

  ENTITY open_path_profile
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' IN
     TYPEOF(SELF.of_shape.definition);
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) )) = 1)) )) = 0;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(impl_rep.
    used_representation.items) = 1)) )) = 0)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) AND
     (it.name = 'orientation')) )) = 1)) )) = 0)) )) = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
    'DIMENSIONAL_INSPECTION_SCHEMA.PATH_SHAPE_REPRESENTATION' IN
     TYPEOF(pdr.used_representation)) )) = 1)) )) = 0;
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
    IN TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'profile limit')) )) <= 1)) )) = 
    0;
  END_ENTITY; -- open_path_profile

  ENTITY open_shell
    SUBTYPE OF (connected_face_set);
  END_ENTITY; -- open_shell

  ENTITY organization;
      id          : OPTIONAL identifier;
      name        : label;
      description : OPTIONAL text;
  END_ENTITY; -- organization

  ENTITY organization_assignment
    ABSTRACT SUPERTYPE;
      assigned_organization : organization;
      role       : organization_role;
  END_ENTITY; -- organization_assignment

  ENTITY organization_role;
      name : label;
    DERIVE
      description : text := get_description_value(SELF);
    WHERE
  wr1: SIZEOF(USEDIN(SELF,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1;
  END_ENTITY; -- organization_role

  ENTITY organizational_address
    SUBTYPE OF (address);
      organizations : SET [1:?] OF organization;
      description   : OPTIONAL text;
  END_ENTITY; -- organizational_address

  ENTITY organizational_project;
      name: label;
      description    : OPTIONAL text;
      responsible_organizations : SET [1:?] OF organization;
    DERIVE
      id : identifier := get_id_value(SELF);
    WHERE
  wr1: SIZEOF(USEDIN(SELF,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'ID_ATTRIBUTE.IDENTIFIED_ITEM')) <= 1;
  END_ENTITY; -- organizational_project

  ENTITY oriented_closed_shell
    SUBTYPE OF (closed_shell);
      closed_shell_element : closed_shell;
      orientation          : BOOLEAN;
    DERIVE
      SELF\connected_face_set.cfs_faces : SET [1:?] OF face := 
 conditional_reverse(SELF.
 orientation,SELF.
 closed_shell_element.cfs_faces);
    WHERE
  wr1: NOT ('DIMENSIONAL_INSPECTION_SCHEMA.ORIENTED_CLOSED_SHELL' IN 
    TYPEOF(SELF.closed_shell_element));
  END_ENTITY; -- oriented_closed_shell

  ENTITY oriented_edge
    SUBTYPE OF (edge);
      edge_element : edge;
      orientation  : BOOLEAN;
    DERIVE
      SELF\edge.edge_start : vertex := boolean_choose(SELF.orientation,
          SELF.edge_element.edge_start,SELF.
          edge_element.edge_end);
      SELF\edge.edge_end   : vertex := boolean_choose(SELF.orientation,
          SELF.edge_element.edge_end,SELF.
          edge_element.edge_start);
    WHERE
  wr1: NOT ('DIMENSIONAL_INSPECTION_SCHEMA.ORIENTED_EDGE' IN TYPEOF(
    SELF.edge_element));
  END_ENTITY; -- oriented_edge

  ENTITY oriented_face
    SUBTYPE OF (face);
      face_element : face;
      orientation  : BOOLEAN;
    DERIVE
      SELF\face.bounds : SET [1:?] OF face_bound := conditional_reverse(
      SELF.orientation,SELF.face_element.bounds);
    WHERE
  wr1: NOT ('DIMENSIONAL_INSPECTION_SCHEMA.ORIENTED_FACE' IN TYPEOF(
    SELF.face_element));
  END_ENTITY; -- oriented_face

  ENTITY oriented_open_shell
    SUBTYPE OF (open_shell);
      open_shell_element : open_shell;
      orientation        : BOOLEAN;
    DERIVE
      SELF\connected_face_set.cfs_faces : SET [1:?] OF face := 
 conditional_reverse(SELF.
 orientation,SELF.
 open_shell_element.cfs_faces);
    WHERE
  wr1: NOT ('DIMENSIONAL_INSPECTION_SCHEMA.ORIENTED_OPEN_SHELL' IN 
    TYPEOF(SELF.open_shell_element));
  END_ENTITY; -- oriented_open_shell

  ENTITY oriented_path
    SUBTYPE OF (path);
      path_element : path;
      orientation  : BOOLEAN;
    DERIVE
      SELF\path.edge_list : LIST [1:?] OF UNIQUE oriented_edge := 
         conditional_reverse(SELF.orientation,SELF.
         path_element.edge_list);
    WHERE
  wr1: NOT ('DIMENSIONAL_INSPECTION_SCHEMA.ORIENTED_PATH' IN TYPEOF(
    SELF.path_element));
  END_ENTITY; -- oriented_path

  ENTITY oriented_surface
    SUBTYPE OF (surface);
      orientation : BOOLEAN;
  END_ENTITY; -- oriented_surface

  ENTITY outer_round
    SUBTYPE OF (feature_definition);
    WHERE
  wr1: (NOT (SELF\characterized_object.description = 'outer diameter')) 
    OR (SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
    IN TYPEOF(pdr.used_representation)) AND (SIZEOF(pdr.
    used_representation.items) = 3)) )) = 1) )) = 1);
  wr2: (NOT (SELF\characterized_object.description = 
    'outer diameter to shoulder')) OR (SIZEOF(QUERY ( pd <* 
    USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
    IN TYPEOF(pdr.used_representation)) AND ((2 <= SIZEOF(pdr.
    used_representation.items)) AND (SIZEOF(pdr.
    used_representation.items) <= 3))) )) = 1) )) = 1);
  wr3: SELF\characterized_object.description IN ['outer diameter',
    'outer diameter to shoulder'];
  wr4: (NOT (SELF\characterized_object.description = 'outer diameter')) 
    OR (SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'length')) )) = 1)) )) = 0)) )) 
    = 0);
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'diameter')) )) = 1)) )) = 0)) )) 
    = 0;
  wr6: (NOT (SELF\characterized_object.description = 
    'outer diameter to shoulder')) OR (SIZEOF(QUERY ( pds <* 
    QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'v-shape boundary occurrence') AND (
    SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'profile usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.VEE_PROFILE' IN TYPEOF(sdr.
    relating_shape_aspect)) AND (sdr.relating_shape_aspect.
    description = 'v-shape')) )) = 1)) )) = 1)) )) = 0);
  wr7: (NOT (SELF\characterized_object.description = 'outer diameter')) 
    OR (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'reduced size occurrence') AND (SIZEOF(
    QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 'taper usage') 
    AND ('DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.TAPER' IN TYPEOF(sdr.
    relating_shape_aspect)) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.OUTER_ROUND' IN TYPEOF(sdr.
    related_shape_aspect.of_shape.definition))) AND (sdr.name = 
    'reduced size')) )) = 1)) )) <= 1)) )) = 0);
  wr8: (NOT (SELF\characterized_object.description = 
    'outer diameter to shoulder')) OR (SIZEOF(QUERY ( pd <* 
    USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'length')) )) <= 1)) )) = 0)) )) 
    = 0);
  wr9: (NOT (SELF\characterized_object.description = 
    'outer diameter to shoulder')) OR (SIZEOF(QUERY ( pd <* 
    USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'feature length')) )) <= 1)) )) 
    = 0)) )) = 0);
  END_ENTITY; -- outer_round

  ENTITY outside_profile
    SUBTYPE OF (feature_definition);
    WHERE
  wr1 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) AND (SIZEOF(pdr.
     used_representation.items) = 1)) )) = 1) )) = 1;
  wr2 : SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     sa_occ.description IN ['boundary occurrence',
     'non-planar boundary occurrence',
     'partial circular boundary occurrence',
     'closed circular boundary occurrence',
     'open rectangular boundary occurrence',
     'closed rectangular boundary occurrence']) )) = 1)) )) = 0;
  wr3 : (NOT (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     sa_occ.description = 'boundary occurrence') )) = 1)) )) = 0)) 
     OR (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'profile usage') AND (('DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_DEFINING_RELATIONSHIP') IN TYPEOF(sar))) ) | ((
     SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_CLOSED_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.NGON_CLOSED_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_CLOSED_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.CLOSED_PATH_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.SQUARE_U_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.PARTIAL_CIRCULAR_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.ROUNDED_U_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.LINEAR_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.VEE_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.TEE_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.OPEN_PATH_PROFILE'] * 
     TYPEOF(sdr.relating_shape_aspect)) = 1) AND (sdr.
     relating_shape_aspect.description = 'outside boundary')) )) 
     = 1) )) = 1)) )) = 0);
  wr4 : (NOT (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     sa_occ.description IN ['complex boundary occurrence',
     'partial circular boundary occurrence',
     'closed circular boundary occurrence',
     'open rectangular boundary occurrence',
     'closed rectangular boundary occurrence']) )) = 1)) )) = 0)) 
     OR (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     NOT (SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'profile floor usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.PROFILE_FLOOR' IN TYPEOF(sdr
     .relating_shape_aspect)) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.OUTSIDE_PROFILE' IN TYPEOF(
     sdr.related_shape_aspect.of_shape.definition))) )) = 1)) )) 
     = 0)) )) = 0);
  wr5 : (NOT (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     sa_occ.description IN ['outside boundary',
     'complex boundary occurrence',
     'partial circular boundary occurrence',
     'closed circular boundary occurrence',
     'open rectangular boundary occurrence',
     'closed rectangular boundary occurrence']) )) = 1)) )) = 0)) 
     OR (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'path feature component usage') AND ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_DEFINING_RELATIONSHIP') IN TYPEOF(sar))) ) | (((
     SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.PATH_FEATURE_COMPONENT'] * 
     TYPEOF(sdr.relating_shape_aspect)) = 1) AND (sdr.name = 
     'profile swept shape')) AND (sdr.relating_shape_aspect.
     description = 'linear')) )) = 1) )) = 1)) )) = 0);
  wr6 : (NOT (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     sa_occ.description = 'complex boundary occurrence') )) = 1)) )) 
     = 0)) OR (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'profile usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_CLOSED_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.NGON_CLOSED_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_CLOSED_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.CLOSED_PATH_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.SQUARE_U_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.PARTIAL_CIRCULAR_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.ROUNDED_U_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.VEE_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.TEE_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.LINEAR_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.OPEN_PATH_PROFILE'] * 
     TYPEOF(sdr.relating_shape_aspect)) = 1) )) = 1) )) = 1)) )) 
     = 0);
  wr7 : (NOT (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     sa_occ.description = 'partial circular boundary occurrence') )) 
     = 1)) )) = 0)) OR (SIZEOF(QUERY ( pds <* QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'profile usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PARTIAL_CIRCULAR_PROFILE' IN
      TYPEOF(sdr.relating_shape_aspect)) )) = 1) )) = 1)) )) = 0);
  wr8 : (NOT (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     sa_occ.description = 'closed circular boundary occurrence') )) 
     = 1)) )) = 0)) OR (SIZEOF(QUERY ( pds <* QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'profile usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_CLOSED_PROFILE' IN 
     TYPEOF(sdr.relating_shape_aspect)) )) = 1) )) = 1)) )) = 0);
  wr9 : (NOT (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     sa_occ.description = 'open rectangular boundary occurrence') )) 
     = 1)) )) = 0)) OR (SIZEOF(QUERY ( pds <* QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'profile usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.SQUARE_U_PROFILE' IN TYPEOF(
     sdr.relating_shape_aspect)) )) = 1) )) = 1)) )) = 0);
  wr10: (NOT (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     sa_occ.description = 
     'closed rectangular boundary occurrence') )) = 1)) )) = 0)) 
     OR (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'profile usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_CLOSED_PROFILE' 
     IN TYPEOF(sdr.relating_shape_aspect)) )) = 1) )) = 1)) )) =
      0);
  wr11: (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     sa_occ.description IN ['boundary occurrence',
     'complex boundary occurrence',
     'partial circular boundary occurrence',
     'closed circular boundary occurrence',
     'open rectangular boundary occurrence',
     'closed rectangular boundary occurrence']) )) = 1)) )) = 0) 
     OR (SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DIRECTION_SHAPE_REPRESENTATION' 
     IN TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'removal direction')) )) = 1)) )) 
     = 0);
  wr12: SIZEOF(QUERY ( pdr <* get_property_definition_representations(
     SELF) | (('DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
     IN TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'maximum feature limit')) )) >= 
     0;
  END_ENTITY; -- outside_profile

  ENTITY parabola
    SUBTYPE OF (conic);
      focal_dist : length_measure;
    WHERE
  wr1: focal_dist <> 0;
  END_ENTITY; -- parabola

  ENTITY parallel_offset
    SUBTYPE OF (derived_shape_aspect);
      offset : measure_with_unit;
    WHERE
  wr1: SIZEOF(SELF\derived_shape_aspect.deriving_relationships) = 1;
  END_ENTITY; -- parallel_offset

  ENTITY parallelism_tolerance
    SUBTYPE OF (geometric_tolerance_with_datum_reference);
    WHERE
  wr1: SIZEOF(SELF\geometric_tolerance_with_datum_reference.
    datum_system) < 3;
  END_ENTITY; -- parallelism_tolerance

  ENTITY parametric_representation_context
    SUBTYPE OF (representation_context);
  END_ENTITY; -- parametric_representation_context

  ENTITY partial_circular_profile
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' IN
     TYPEOF(SELF.of_shape.definition);
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) )) = 1)) )) = 0;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(impl_rep.
    used_representation.items) >= 3)) )) = 0)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) AND
     (it.name = 'orientation')) )) = 1)) )) = 0)) )) = 0;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'radius')) )) = 1)) )) = 0)) )) 
    = 0;
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
    * TYPEOF(it)) = 2) AND (it.name = 'sweep angle')) )) = 1)) )) 
    = 0)) )) = 0;
  wr7: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
    IN TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'profile limit')) )) <= 1)) )) = 
    0;
  END_ENTITY; -- partial_circular_profile

  ENTITY path
    SUPERTYPE OF (ONEOF (edge_loop,oriented_path))
    SUBTYPE OF (topological_representation_item);
      edge_list : LIST [1:?] OF UNIQUE oriented_edge;
    WHERE
  wr1: path_head_to_tail(SELF);
  END_ENTITY; -- path

  ENTITY path_feature_component
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1 : 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' 
     IN TYPEOF(SELF.of_shape.definition);
  wr2 : SELF.description IN ['partial circular','complete circular',
     'linear','complex'];
  wr3 : (NOT (SELF.description = 'complex')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) )) = 1)) )) = 0);
  wr4 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) 
     AND (it.name = 'orientation')) )) = 1)) )) = 0)) )) = 0;
  wr5 : (NOT (SELF.description = 'partial circular')) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(impl_rep.
     used_representation.items) = 3)) )) = 0)) )) = 0);
  wr6 : (NOT (SELF.description = 'partial circular')) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'radius')) )) = 1)) )) = 0)) )) 
     = 0);
  wr7 : (NOT (SELF.description = 'partial circular')) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
     * TYPEOF(it)) = 2) AND (it.name = 'sweep angle')) )) = 1)) )) 
     = 0)) )) = 0);
  wr8 : (NOT (SELF.description = 'complete circular')) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(impl_rep.
     used_representation.items) = 2)) )) = 0)) )) = 0);
  wr9 : (NOT (SELF.description = 'complete circular')) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'radius')) )) = 1)) )) = 0)) )) 
     = 0);
  wr10: (NOT (SELF.description = 'linear')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(impl_rep.
     used_representation.items) = 2)) )) = 0)) )) = 0);
  wr11: (NOT (SELF.description = 'linear')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'distance')) )) = 1)) )) =
      0)) )) = 0);
  wr12: (NOT (SELF.description = 'linear')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.DIRECTION_SHAPE_REPRESENTATION' 
     IN TYPEOF(pdr.used_representation)) )) = 1)) )) = 0);
  wr13: (NOT (SELF.description = 'complex')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.PATH_SHAPE_REPRESENTATION' 
     IN TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'sweep path')) AND (SIZEOF(
     QUERY ( srwp_i <* pdr.used_representation.items | (srwp_i.
     name = 'profile shape') )) = 1)) )) = 1)) )) = 0);
  END_ENTITY; -- path_feature_component

  ENTITY path_shape_representation
    SUBTYPE OF (shape_representation);
    WHERE
  wr1: SIZEOF(SELF.items) >= 1;
  wr2: SIZEOF(QUERY ( i <* SELF.items | (SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.BOUNDED_CURVE',
    'DIMENSIONAL_INSPECTION_SCHEMA.EDGE_CURVE',
    'DIMENSIONAL_INSPECTION_SCHEMA.PATH'] * TYPEOF(i)) = 1) )) 
    >= 1;
  END_ENTITY; -- path_shape_representation

  ENTITY pattern_offset_membership
    SUBTYPE OF (feature_component_relationship);
    WHERE
  wr1 : SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(SELF.
     relating_shape_aspect,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATING_SHAPE_ASPECT') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar)) AND (sar :<>: SELF)) ) | (SIZEOF(
     QUERY ( pdr <* QUERY ( pd <* USEDIN(fcr.
     related_shape_aspect.of_shape,
     'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_PATTERN',
     'DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_PATTERN'] * 
     TYPEOF(pdr.definition)) = 1) )) = 0) )) = 0;
  wr2 : SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(SELF.
     related_shape_aspect,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar)) AND (sar :<>: SELF)) ) | ((fcr.description 
     = 'modified pattern') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.MODIFIED_PATTERN' IN TYPEOF(
     fcr.relating_shape_aspect))) )) >= 1;
  wr3 : SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(SELF.
     related_shape_aspect,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar)) AND (sar :<>: SELF)) ) | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.MODIFIED_PATTERN' IN TYPEOF(
     fcr.relating_shape_aspect)) AND (NOT (SIZEOF(
     QUERY ( modfcr <* QUERY ( modsar <* USEDIN(fcr.
     relating_shape_aspect,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_ASPECT_RELATIONSHIP.RELATING_SHAPE_ASPECT') | ((
     SIZEOF(['DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_PATTERN',
     'DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_PATTERN'] * 
     TYPEOF(modsar.related_shape_aspect.of_shape.definition)) = 
     1) AND (modsar :<>: fcr)) ) | (NOT (modfcr.
     related_shape_aspect.of_shape.definition :=: SELF.
     relating_shape_aspect.of_shape.definition)) )) = 0))) )) = 
     0;
  wr4 : (NOT ('DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_PATTERN' IN 
     TYPEOF(SELF.relating_shape_aspect.of_shape.definition))) OR
      (SIZEOF(QUERY ( pd <* USEDIN(SELF.related_shape_aspect,
      'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(USEDIN(pd,'DIMENSIONAL_INSPECTION_SCHEMA.' 
     + 'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION')) = 2)) )) 
     = 0);
  wr5 : (NOT ('DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_PATTERN' IN 
     TYPEOF(SELF.relating_shape_aspect.of_shape.definition))) OR
      (SIZEOF(QUERY ( pd <* USEDIN(SELF.related_shape_aspect,
      'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(USEDIN(pd,'DIMENSIONAL_INSPECTION_SCHEMA.' 
     + 'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION')) = 1)) )) 
     = 0);
  wr6 : (NOT ('DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_PATTERN' IN 
     TYPEOF(SELF.relating_shape_aspect.of_shape.definition))) OR
      (SIZEOF(QUERY ( pd <* USEDIN(SELF.related_shape_aspect,
      'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (NOT (
     SIZEOF(pdr.used_representation.items) = 2)) )) = 0)) )) = 0);
  wr7 : (NOT ('DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_PATTERN' IN 
     TYPEOF(SELF.relating_shape_aspect.of_shape.definition))) OR
      (SIZEOF(QUERY ( pd <* USEDIN(SELF.related_shape_aspect,
      'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.COUNT_MEASURE' IN TYPEOF(it\
     measure_with_unit.value_component))) AND (it.name = 
     'index number')) )) = 1)) )) = 0)) )) = 0);
  wr8 : (NOT ('DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_PATTERN' IN 
     TYPEOF(SELF.relating_shape_aspect.of_shape.definition))) OR
      (SIZEOF(QUERY ( pd <* USEDIN(SELF.related_shape_aspect,
      'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT' 
     IN TYPEOF(it)) AND (it.name = 'offset')) )) = 1)) )) = 0)) )) 
     = 0);
  wr9 : (NOT ('DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_PATTERN' IN 
     TYPEOF(SELF.relating_shape_aspect.of_shape.definition))) OR
      (SIZEOF(QUERY ( pd <* USEDIN(SELF.related_shape_aspect,
      'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(impl_rep.
     used_representation.items) = 3)) )) = 0)) )) = 0);
  wr10: (NOT ('DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_PATTERN' IN 
     TYPEOF(SELF.relating_shape_aspect.of_shape.definition))) OR
      (SIZEOF(QUERY ( pd <* USEDIN(SELF.related_shape_aspect,
      'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.COUNT_MEASURE' IN TYPEOF(it\
     measure_with_unit.value_component))) AND (it.name = 
     'row index')) )) = 1)) )) = 0)) )) = 0);
  wr11: (NOT ('DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_PATTERN' IN 
     TYPEOF(SELF.relating_shape_aspect.of_shape.definition))) OR
      (SIZEOF(QUERY ( pd <* USEDIN(SELF.related_shape_aspect,
      'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.COUNT_MEASURE' IN TYPEOF(it\
     measure_with_unit.value_component))) AND (it.name = 
     'column index')) )) = 1)) )) = 0)) )) = 0);
  wr12: (NOT ('DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_PATTERN' IN 
     TYPEOF(SELF.relating_shape_aspect.of_shape.definition))) OR
      (SIZEOF(QUERY ( pd <* USEDIN(SELF.related_shape_aspect,
      'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT' IN
      TYPEOF(it)) AND (it.name = 'offset distance')) )) = 1)) )) 
     = 0)) )) = 0);
  wr13: (NOT ('DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_PATTERN' IN 
     TYPEOF(SELF.relating_shape_aspect.of_shape.definition))) OR
      (SIZEOF(QUERY ( pd <* USEDIN(SELF.related_shape_aspect,
      'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DIRECTION_SHAPE_REPRESENTATION' 
     IN TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'offset direction')) )) = 1)) )) 
     = 0);
  END_ENTITY; -- pattern_offset_membership

  ENTITY pattern_omit_membership
    SUBTYPE OF (feature_component_relationship);
    WHERE
  wr1: SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(SELF.
    relating_shape_aspect,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATING_SHAPE_ASPECT') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar)) AND (sar :<>: SELF)) ) | (SIZEOF(
    QUERY ( pdr <* QUERY ( pd <* USEDIN(fcr.related_shape_aspect
    .of_shape,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_PATTERN',
    'DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_PATTERN'] * 
    TYPEOF(pdr.definition)) = 1) )) = 0) )) = 0;
  wr2: SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(SELF.
    related_shape_aspect,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar)) AND (sar :<>: SELF)) ) | ((fcr.description =
     'modified pattern') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.MODIFIED_PATTERN' IN TYPEOF(
    fcr.relating_shape_aspect))) )) >= 1;
  wr3: SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(SELF.
    related_shape_aspect,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar)) AND (sar :<>: SELF)) ) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.MODIFIED_PATTERN' IN TYPEOF(
    fcr.relating_shape_aspect)) AND (NOT (SIZEOF(
    QUERY ( modfcr <* QUERY ( modsar <* USEDIN(fcr.
    relating_shape_aspect,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_ASPECT_RELATIONSHIP.RELATING_SHAPE_ASPECT') | ((
    SIZEOF(['DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_PATTERN',
    'DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_PATTERN'] * 
    TYPEOF(modsar.related_shape_aspect.of_shape.definition)) = 1) 
    AND (modsar :<>: fcr)) ) | (NOT (modfcr.related_shape_aspect
    .of_shape.definition :=: SELF.relating_shape_aspect.of_shape
    .definition)) )) = 0))) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF.related_shape_aspect,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(USEDIN(pd,'DIMENSIONAL_INSPECTION_SCHEMA.' +
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION')) = 1)) )) 
    = 0;
  wr5: (NOT ('DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_PATTERN' IN 
    TYPEOF(SELF.relating_shape_aspect.of_shape.definition))) OR 
    (SIZEOF(QUERY ( pd <* USEDIN(SELF.related_shape_aspect,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (NOT (
    SIZEOF(pdr.used_representation.items) = 1)) )) = 0)) )) = 0);
  wr6: (NOT ('DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_PATTERN' IN 
    TYPEOF(SELF.relating_shape_aspect.of_shape.definition))) OR 
    (SIZEOF(QUERY ( pd <* USEDIN(SELF.related_shape_aspect,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.COUNT_MEASURE' IN TYPEOF(it\
    measure_with_unit.value_component))) AND (it.name = 
    'index number')) )) = 1)) )) = 0)) )) = 0);
  wr7: (NOT ('DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_PATTERN' IN 
    TYPEOF(SELF.relating_shape_aspect.of_shape.definition))) OR 
    (SIZEOF(QUERY ( pd <* USEDIN(SELF.related_shape_aspect,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (NOT (
    SIZEOF(pdr.used_representation.items) = 2)) )) = 0)) )) = 0);
  wr8: (NOT ('DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_PATTERN' IN 
    TYPEOF(SELF.relating_shape_aspect.of_shape.definition))) OR 
    (SIZEOF(QUERY ( pd <* USEDIN(SELF.related_shape_aspect,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.COUNT_MEASURE' IN TYPEOF(it\
    measure_with_unit.value_component))) AND (it.name = 
    'row index')) )) = 1)) )) = 0)) )) = 0);
  wr9: (NOT ('DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_PATTERN' IN 
    TYPEOF(SELF.relating_shape_aspect.of_shape.definition))) OR 
    (SIZEOF(QUERY ( pd <* USEDIN(SELF.related_shape_aspect,
    'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
    IN TYPEOF(it)) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.COUNT_MEASURE' IN TYPEOF(it\
    measure_with_unit.value_component))) AND (it.name = 
    'column index')) )) = 1)) )) = 0)) )) = 0);
  END_ENTITY; -- pattern_omit_membership

  ENTITY pcurve
    SUBTYPE OF (curve);
      basis_surface      : surface;
      reference_to_curve : definitional_representation;
    WHERE
  wr1: SIZEOF(reference_to_curve\representation.items) = 1;
  wr2: 'DIMENSIONAL_INSPECTION_SCHEMA.CURVE' IN TYPEOF(
    reference_to_curve\representation.items[1]);
  wr3: reference_to_curve\representation.items[1]\
    geometric_representation_item.dim = 2;
  END_ENTITY; -- pcurve

  ENTITY perpendicular_to
    SUBTYPE OF (derived_shape_aspect);
    WHERE
  wr1: SIZEOF(SELF\derived_shape_aspect.deriving_relationships) = 1;
  END_ENTITY; -- perpendicular_to

  ENTITY perpendicularity_tolerance
    SUBTYPE OF (geometric_tolerance_with_datum_reference);
    WHERE
  wr1: SIZEOF(SELF\geometric_tolerance_with_datum_reference.
    datum_system) <= 3;
  END_ENTITY; -- perpendicularity_tolerance

  ENTITY person;
      id : identifier;
      last_name     : OPTIONAL label;
      first_name    : OPTIONAL label;
      middle_names  : OPTIONAL LIST [1:?] OF label;
      prefix_titles : OPTIONAL LIST [1:?] OF label;
      suffix_titles : OPTIONAL LIST [1:?] OF label;
    WHERE
  wr1: EXISTS(last_name) OR EXISTS(first_name);
  END_ENTITY; -- person

  ENTITY person_and_organization;
      the_person       : person;
      the_organization : organization;
    DERIVE
      name        : label := get_name_value(SELF);
      description : text := get_description_value(SELF);
    WHERE
  wr1: SIZEOF(USEDIN(SELF,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'NAME_ATTRIBUTE.NAMED_ITEM')) <= 1;
  wr2: SIZEOF(USEDIN(SELF,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1;
  END_ENTITY; -- person_and_organization

  ENTITY person_and_organization_assignment
    ABSTRACT SUPERTYPE;
      assigned_person_and_organization : person_and_organization;
      role       : person_and_organization_role;
  END_ENTITY; -- person_and_organization_assignment

  ENTITY person_and_organization_role;
      name : label;
    DERIVE
      description : text := get_description_value(SELF);
    WHERE
  wr1: SIZEOF(USEDIN(SELF,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1;
  END_ENTITY; -- person_and_organization_role

  ENTITY personal_address
    SUBTYPE OF (address);
      people      : SET [1:?] OF person;
      description : OPTIONAL text;
  END_ENTITY; -- personal_address

  ENTITY placement
    SUPERTYPE OF (ONEOF (axis1_placement,axis2_placement_2d,
        axis2_placement_3d))
    SUBTYPE OF (geometric_representation_item);
      location : cartesian_point;
  END_ENTITY; -- placement

  ENTITY planar_shape_representation
    SUBTYPE OF (shape_representation);
    WHERE
  wr1: SIZEOF(SELF.items) = 1;
  wr2: SIZEOF(QUERY ( it <* SELF.items | (
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANE' IN TYPEOF(it)) )) = 1;
  END_ENTITY; -- planar_shape_representation

  ENTITY plane
    SUBTYPE OF (elementary_surface);
  END_ENTITY; -- plane

  ENTITY plane_angle_measure_with_unit
    SUBTYPE OF (measure_with_unit);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_UNIT' IN TYPEOF(SELF
    \measure_with_unit.unit_component);
  END_ENTITY; -- plane_angle_measure_with_unit

  ENTITY plane_angle_unit
    SUBTYPE OF (named_unit);
    WHERE
  wr1: ((((((SELF\named_unit.dimensions.length_exponent = 0) AND (SELF
    \named_unit.dimensions.mass_exponent = 0)) AND (SELF\
    named_unit.dimensions.time_exponent = 0)) AND (SELF\
    named_unit.dimensions.electric_current_exponent = 0)) AND (
    SELF\named_unit.dimensions.
    thermodynamic_temperature_exponent = 0)) AND (SELF\
    named_unit.dimensions.amount_of_substance_exponent = 0)) AND
     (SELF\named_unit.dimensions.luminous_intensity_exponent = 0);
  END_ENTITY; -- plane_angle_unit

  ENTITY plus_minus_tolerance;
      range     : tolerance_method_definition;
      toleranced_dimension : dimensional_characteristic;
    UNIQUE
      ur1 : toleranced_dimension;
  END_ENTITY; -- plus_minus_tolerance

  ENTITY pocket
    SUBTYPE OF (feature_definition);
    WHERE
  wr1 : SELF\characterized_object.description IN ['closed rectangular',
     'open rectangular','complex','circular cutout',
     'complex cutout','recess'];
  wr2 : SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'pocket depth occurrence') AND (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | (((sar.description = 
     'path feature component usage') AND (sar.name = 
     'pocket depth')) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.PATH_FEATURE_COMPONENT' IN 
     TYPEOF(sdr.relating_shape_aspect)) AND (sdr.
     relating_shape_aspect.description = 'linear')) )) = 1)) )) 
     = 1)) )) = 0;
  wr3 : SIZEOF(QUERY ( pdr <* get_property_definition_representations(
     SELF) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) )) = 1;
  wr4 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) AND ((1 <= SIZEOF(pdr.
     used_representation.items)) AND (SIZEOF(pdr.
     used_representation.items) <= 2))) )) = 1) )) = 1;
  wr5 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) AND (SIZEOF(QUERY ( srwp_i <* pdr.
     used_representation.items | ((srwp_i.name = 'orientation') 
     OR (srwp_i.name = 'fillet radius')) )) = SIZEOF(pdr.
     used_representation.items))) )) = 1) )) = 1;
  wr6 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'fillet radius')) )) <= 1)) )) 
     = 0)) )) = 0;
  wr7 : (NOT (SELF\characterized_object.description IN ['complex',
     'non-circular cutout','recess'])) OR (SIZEOF(
     QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'boundary occurrence') AND (SIZEOF(
     QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'profile usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_CLOSED_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.NGON_CLOSED_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_CLOSED_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.CLOSED_PATH_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.SQUARE_U_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.PARTIAL_CIRCULAR_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.ROUNDED_U_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.VEE_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.TEE_PROFILE',
     'DIMENSIONAL_INSPECTION_SCHEMA.OPEN_PATH_PROFILE'] * 
     TYPEOF(sdr.relating_shape_aspect)) = 1) )) = 1)) )) = 1)) )) 
     = 0);
  wr8 : (NOT (SELF\characterized_object.description = 
     'closed rectangular')) OR (SIZEOF(QUERY ( pds <* 
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'closed boundary occurrence') AND (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'profile usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_CLOSED_PROFILE' 
     IN TYPEOF(sdr.relating_shape_aspect)) )) = 1)) )) = 1)) )) 
     = 0);
  wr9 : (NOT (SELF\characterized_object.description = 
     'open rectangular')) OR (SIZEOF(QUERY ( pds <* 
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'open boundary occurrence') AND (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'profile usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.SQUARE_U_PROFILE' IN TYPEOF(
     sdr.relating_shape_aspect)) )) = 1)) )) = 1)) )) = 0);
  wr10: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'bottom condition occurrence') AND (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'pocket bottom usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.POCKET_BOTTOM' IN TYPEOF(sdr
     .relating_shape_aspect)) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.POCKET' IN TYPEOF(sdr.
     related_shape_aspect.of_shape.definition))) )) = 1)) )) = 1)) )) 
     = 0;
  wr11: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'change in boundary occurrence') AND (
     SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATING_SHAPE_ASPECT') | ((sar.description = 
     'taper usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.TAPER' IN TYPEOF(fcr.
     relating_shape_aspect)) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.POCKET' IN TYPEOF(fcr.
     related_shape_aspect.of_shape.definition))) AND (fcr.
     related_shape_aspect.description IN ['angle taper',
     'directed taper'])) )) = 1)) )) <= 1)) )) = 0;
  wr12: (NOT (SELF\characterized_object.description = 
     'circular cutout')) OR (SIZEOF(QUERY ( pds <* 
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'enclosed boundary occurrence') AND (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'profile usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_CLOSED_PROFILE' IN 
     TYPEOF(sdr.relating_shape_aspect)) )) = 1)) )) = 1)) )) = 0);
  wr13: (NOT (SELF\characterized_object.description IN [
     'circular cutout','complex cutout'])) OR (SIZEOF(
     QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'bottom condition occurrence') AND (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'pocket bottom usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.POCKET_BOTTOM' IN TYPEOF(sdr
     .relating_shape_aspect)) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.POCKET' IN TYPEOF(sdr.
     related_shape_aspect.of_shape.definition))) AND (sdr.
     relating_shape_aspect.description = 'through')) )) = 1)) )) 
     = 1)) )) = 0);
  wr14: (NOT (SELF\characterized_object.description = 'recess')) OR (
     SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'bottom condition occurrence') AND (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'pocket bottom usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.POCKET_BOTTOM' IN TYPEOF(sdr
     .relating_shape_aspect)) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.POCKET' IN TYPEOF(sdr.
     related_shape_aspect.of_shape.definition))) AND (sdr.
     relating_shape_aspect.description IN ['planar','complex'])) )) 
     = 1)) )) = 1)) )) = 0);
  wr15: SIZEOF(QUERY ( pdr <* get_property_definition_representations(
     SELF) | (('DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
     IN TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'maximum feature limit')) )) >= 
     0;
  wr16: (NOT (SELF\characterized_object.description IN [
     'closed rectangular','open rectangular','complex','recess'])) 
     OR (SIZEOF(QUERY ( pds <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pds)) AND (SIZEOF(QUERY ( csa <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     ('DIMENSIONAL_INSPECTION_SCHEMA.COMPOSITE_SHAPE_ASPECT' IN 
     TYPEOF(csa)) AND (csa.name = 'uncut area')) AND (SIZEOF(
     QUERY ( sar <* csa.component_relationships | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar)) AND (SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.BOSS',
     'DIMENSIONAL_INSPECTION_SCHEMA.PROTRUSION'] * TYPEOF(sar.
     related_shape_aspect)) = 1)) )) = 1)) )) <= 1)) )) = 1);
  END_ENTITY; -- pocket

  ENTITY pocket_bottom
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1 : 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' 
     IN TYPEOF(SELF.of_shape.definition);
  wr2 : SELF.description IN ['planar','complex','through'];
  wr3 : (NOT (SELF.description = 'planar')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DIRECTION_SHAPE_REPRESENTATION' 
     IN TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'floor normal')) )) = 1)) )) = 0);
  wr4 : (NOT (SELF.description = 'planar')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.LOCATION_SHAPE_REPRESENTATION' 
     IN TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'floor location')) )) = 1)) )) =
      0);
  wr5 : (NOT (SELF.description = 'complex')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.FACE_SHAPE_REPRESENTATION' 
     IN TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'floor face')) )) = 1)) )) = 0);
  wr6 : (NOT (SELF.description IN ['planar','complex'])) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) )) = 1)) )) = 0);
  wr7 : (NOT (SELF.description IN ['planar','complex'])) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(impl_rep.
     used_representation.items) <= 1)) )) = 0)) )) = 0);
  wr8 : (NOT (SELF.description = 'through')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) )) = 0)) )) = 0);
  wr9 : (NOT (SELF.description IN ['planar','complex'])) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'radius')) )) <= 1)) )) = 
     0)) )) = 0);
  wr10: SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATING_SHAPE_ASPECT') | ((sar.description = 
     'pocket bottom usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (((fcr.related_shape_aspect.
     description = 'bottom condition occurrence') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.POCKET' IN TYPEOF(fcr.
     related_shape_aspect.of_shape.definition))) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.POCKET_BOTTOM' IN TYPEOF(fcr
     .relating_shape_aspect))) )) >= 1;
  wr11: (NOT (SELF.description IN ['planar','complex'])) OR (SIZEOF(
     QUERY ( fcr <* QUERY ( sar <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATING_SHAPE_ASPECT') | ((sar.description = 
     'pocket bottom usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | ((fcr.related_shape_aspect.description 
     = 'bottom condition occurrence') AND (fcr.
     related_shape_aspect.name IN ['pocket depth start',
     'pocket depth end'])) )) = 0);
  END_ENTITY; -- pocket_bottom

  ENTITY point
    SUPERTYPE OF (cartesian_point)
    SUBTYPE OF (geometric_representation_item);
  END_ENTITY; -- point

  ENTITY poly_loop
    SUBTYPE OF (loop, geometric_representation_item);
      polygon : LIST [3:?] OF UNIQUE cartesian_point;
  END_ENTITY; -- poly_loop

  ENTITY polyline
    SUBTYPE OF (bounded_curve);
      points : LIST [2:?] OF cartesian_point;
  END_ENTITY; -- polyline

  ENTITY position_tolerance
    SUBTYPE OF (geometric_tolerance_with_datum_reference);
    WHERE
  wr1: SIZEOF(SELF\geometric_tolerance_with_datum_reference.
    datum_system) <= 3;
  END_ENTITY; -- position_tolerance

  ENTITY precision_qualifier;
      precision_value : INTEGER;
  END_ENTITY; -- precision_qualifier

  ENTITY product;
      id      : identifier;
      name    : label;
      description        : OPTIONAL text;
      frame_of_reference : SET [1:?] OF product_context;
  END_ENTITY; -- product

  ENTITY product_context
    SUBTYPE OF (application_context_element);
      discipline_type : label;
  END_ENTITY; -- product_context

  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,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'NAME_ATTRIBUTE.NAMED_ITEM')) <= 1;
  END_ENTITY; -- product_definition

  ENTITY product_definition_context
    SUBTYPE OF (application_context_element);
      life_cycle_stage : label;
  END_ENTITY; -- product_definition_context

  ENTITY product_definition_formation;
      id          : identifier;
      description : OPTIONAL text;
      of_product  : product;
    UNIQUE
      ur1 : id, of_product;
  END_ENTITY; -- product_definition_formation

  ENTITY product_definition_shape
    SUBTYPE OF (property_definition);
    UNIQUE
      ur1 : definition;
    WHERE
  wr1: SIZEOF([
  'DIMENSIONAL_INSPECTION_SCHEMA.CHARACTERIZED_PRODUCT_DEFINITION',
    'DIMENSIONAL_INSPECTION_SCHEMA.CHARACTERIZED_OBJECT'] * 
    TYPEOF(SELF\property_definition.definition)) > 0;
  END_ENTITY; -- product_definition_shape

  ENTITY profile_floor
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1 : 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' 
     IN TYPEOF(SELF.of_shape.definition);
  wr2 : SELF.description IN ['planar','complex','through'];
  wr3 : (NOT (SELF.description IN ['planar','complex'])) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) )) = 1)) )) = 0);
  wr4 : (NOT (SELF.description IN ['planar','complex'])) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | ((NOT (SIZEOF(impl_rep.
     used_representation.items) >= 1)) AND (SIZEOF(impl_rep.
     used_representation.items) <= 2)) )) = 0)) )) = 0);
  wr5 : (NOT (SELF.description = 'through')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) )) = 0)) )) = 0);
  wr6 : (NOT (SELF.description IN ['planar','complex'])) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'radius')) )) = 1)) )) = 0)) )) 
     = 0);
  wr7 : SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATING_SHAPE_ASPECT') | ((sar.description = 
     'profile floor usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.OUTSIDE_PROFILE' IN TYPEOF(
     fcr.related_shape_aspect.of_shape.definition)) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.PROFILE_FLOOR' IN TYPEOF(fcr
     .relating_shape_aspect))) )) >= 1;
  wr8 : (NOT (SELF.description IN ['planar','complex'])) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 
     'shape profile floor orientation')) AND (it.description IN 
     ['shape profile start','shape profile end'])) )) = 1)) )) =
      0)) )) = 0);
  wr9 : (NOT (SELF.description = 'complex')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.FACE_SHAPE_REPRESENTATION' 
     IN TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'floor')) )) = 1)) )) = 1);
  wr10: (NOT (SELF.description = 'planar')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
     IN TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'floor')) )) = 1)) )) = 1);
  END_ENTITY; -- profile_floor

  ENTITY projected_zone_definition
    SUBTYPE OF (tolerance_zone_definition);
      projection_end   : shape_aspect;
      projected_length : measure_with_unit;
    WHERE
  wr1: projected_length.value_component > 0;
  END_ENTITY; -- projected_zone_definition

  ENTITY property_definition;
      name        : label;
      description : OPTIONAL text;
      definition  : characterized_definition;
    DERIVE
      id : identifier := get_id_value(SELF);
    WHERE
  wr1: SIZEOF(USEDIN(SELF,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'ID_ATTRIBUTE.IDENTIFIED_ITEM')) <= 1;
  END_ENTITY; -- property_definition

  ENTITY property_definition_relationship;
      name   : label;
      description       : text;
      relating_property_definition : property_definition;
      related_property_definition  : property_definition;
  END_ENTITY; -- property_definition_relationship

  ENTITY property_definition_representation;
      definition          : represented_definition;
      used_representation : representation;
    DERIVE
      description : text := get_description_value(SELF);
      name        : label := get_name_value(SELF);
    WHERE
  wr1: SIZEOF(USEDIN(SELF,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1;
  wr2: SIZEOF(USEDIN(SELF,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'NAME_ATTRIBUTE.NAMED_ITEM')) <= 1;
  END_ENTITY; -- property_definition_representation

  ENTITY protrusion
    SUBTYPE OF (feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(impl_rep.
    used_representation.items) = 1)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'shape volume occurrence') AND (SIZEOF(
    QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'volume shape usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | (sdr.relating_shape_aspect.description 
    = 'volume shape') )) = 1)) )) = 1)) )) = 0;
  wr3: SIZEOF(QUERY ( pdr <* get_property_definition_representations(
    SELF) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
    IN TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'maximum feature limit')) )) >= 0;
  END_ENTITY; -- protrusion

  ENTITY qualified_representation_item
    SUBTYPE OF (representation_item);
      qualifiers : SET [1:?] OF value_qualifier;
    WHERE
  wr1: SIZEOF(QUERY ( temp <* qualifiers | (
    'DIMENSIONAL_INSPECTION_SCHEMA.PRECISION_QUALIFIER' IN 
    TYPEOF(temp)) )) < 2;
  END_ENTITY; -- qualified_representation_item

  ENTITY quasi_uniform_curve
    SUBTYPE OF (b_spline_curve);
  END_ENTITY; -- quasi_uniform_curve

  ENTITY quasi_uniform_surface
    SUBTYPE OF (b_spline_surface);
  END_ENTITY; -- quasi_uniform_surface

  ENTITY ratio_measure_with_unit
    SUBTYPE OF (measure_with_unit);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.RATIO_UNIT' IN TYPEOF(SELF\
    measure_with_unit.unit_component);
  END_ENTITY; -- ratio_measure_with_unit

  ENTITY ratio_unit
    SUBTYPE OF (named_unit);
    WHERE
  wr1: ((((((SELF\named_unit.dimensions.length_exponent = 0) AND (SELF
    \named_unit.dimensions.mass_exponent = 0)) AND (SELF\
    named_unit.dimensions.time_exponent = 0)) AND (SELF\
    named_unit.dimensions.electric_current_exponent = 0)) AND (
    SELF\named_unit.dimensions.
    thermodynamic_temperature_exponent = 0)) AND (SELF\
    named_unit.dimensions.amount_of_substance_exponent = 0)) AND
     (SELF\named_unit.dimensions.luminous_intensity_exponent = 0);
  END_ENTITY; -- ratio_unit

  ENTITY rational_b_spline_curve
    SUBTYPE OF (b_spline_curve);
      weights_data : LIST [2:?] OF REAL;
    DERIVE
      weights : ARRAY [0:upper_index_on_control_points] OF REAL := 
        list_to_array(weights_data,0,
        upper_index_on_control_points);
    WHERE
  wr1: SIZEOF(weights_data) = SIZEOF(SELF\b_spline_curve.
    control_points_list);
  wr2: curve_weights_positive(SELF);
  END_ENTITY; -- rational_b_spline_curve

  ENTITY rational_b_spline_surface
    SUBTYPE OF (b_spline_surface);
      weights_data : LIST [2:?] OF LIST [2:?] OF REAL;
    DERIVE
      weights : ARRAY [0:u_upper] OF ARRAY [0:v_upper] OF REAL := 
        make_array_of_array(weights_data,0,u_upper,0,v_upper);
    WHERE
  wr1: (SIZEOF(weights_data) = SIZEOF(SELF\b_spline_surface.
    control_points_list)) AND (SIZEOF(weights_data[1]) = SIZEOF(
    SELF\b_spline_surface.control_points_list[1]));
  wr2: surface_weights_positive(SELF);
  END_ENTITY; -- rational_b_spline_surface

  ENTITY rectangular_closed_profile
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' IN
     TYPEOF(SELF.of_shape.definition);
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) )) = 1)) )) = 0;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT ((SIZEOF(impl_rep.
    used_representation.items) >= 3) AND (SIZEOF(impl_rep.
    used_representation.items) <= 4))) )) = 0)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION.DEFINITION') | (SIZEOF(QUERY ( pdr <* 
    USEDIN(pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
    IN TYPEOF(pdr.used_representation)) AND (SIZEOF(
    QUERY ( srwp_i <* pdr.used_representation.items | ((((srwp_i
    .name = 'orientation') OR (srwp_i.name = 'length')) OR (
    srwp_i.name = 'width')) OR (srwp_i.name = 'corner radius')) )) 
    = SIZEOF(pdr.used_representation.items))) )) = 1) )) = 1;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) AND
     (it.name = 'orientation')) )) = 1)) )) = 0)) )) = 0;
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'width')) )) = 1)) )) = 0)) )) 
    = 0;
  wr7: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'length')) )) = 1)) )) = 0)) )) 
    = 0;
  wr8: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'corner radius')) )) <= 1)) )) 
    = 0)) )) = 0;
  END_ENTITY; -- rectangular_closed_profile

  ENTITY rectangular_pattern
    SUBTYPE OF (replicate_feature);
    WHERE
  wr1 : SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATING_SHAPE_ASPECT') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar)) ) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT' IN TYPEOF(sdr.
     related_shape_aspect)) )) = 1) )) <= 5)) )) = 0;
  wr2 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DIRECTION_SHAPE_REPRESENTATION' 
     IN TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'row layout direction')) )) = 1)) )) 
     = 0;
  wr3 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DIRECTION_SHAPE_REPRESENTATION' 
     IN TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'column layout direction')) )) =
      1)) )) = 0;
  wr4 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.' + 
     'DEFINITION') | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) )) = 1)) )) = 0;
  wr5 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(impl_rep.
     used_representation.items) = 5)) )) = 0)) )) = 0;
  wr6 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.COUNT_MEASURE' IN TYPEOF(it\
     measure_with_unit.value_component))) AND (it.name = 
     'number of rows')) )) = 1)) )) = 0)) )) = 0;
  wr7 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.COUNT_MEASURE' IN TYPEOF(it\
     measure_with_unit.value_component))) AND (it.name = 
     'number of columns')) )) = 1)) )) = 0)) )) = 0;
  wr8 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'row spacing')) )) = 1)) )) 
     = 0)) )) = 0;
  wr9 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'column spacing')) )) = 1)) )) 
     = 0)) )) = 0;
  wr10: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) 
     AND (it.name = 'orientation')) )) = 1)) )) = 0)) )) = 0;
  END_ENTITY; -- rectangular_pattern

  ENTITY referenced_modified_datum
    SUBTYPE OF (datum_reference);
      modifier : limit_condition;
  END_ENTITY; -- referenced_modified_datum

  ENTITY removal_volume
    SUBTYPE OF (feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(impl_rep.
    used_representation.items) = 1)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'shape volume occurrence') AND (SIZEOF(
    QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'volume shape usage') AND (('DIMENSIONAL_INSPECTION_SCHEMA.' 
    + 'SHAPE_DEFINING_RELATIONSHIP') IN TYPEOF(sar))) ) | (sdr.
    relating_shape_aspect.description = 'volume shape') )) = 1)) )) 
    = 1)) )) = 0;
  END_ENTITY; -- removal_volume

  ENTITY replicate_feature
    SUPERTYPE OF (ONEOF (circular_pattern,rectangular_pattern,
        feature_pattern))
    SUBTYPE OF (feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) )) = 1)) )) = 0;
  wr2: SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATING_SHAPE_ASPECT') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar)) ) | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.REPLICATE_FEATURE',
    'DIMENSIONAL_INSPECTION_SCHEMA.INSTANCED_FEATURE'] * TYPEOF(
    fcr.related_shape_aspect)) >= 1) AND (fcr.name = 
    'pattern basis')) )) = 1;
  wr3: (SIZEOF(QUERY ( sar <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATING_SHAPE_ASPECT') | (NOT (
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar))) )) + SIZEOF(QUERY ( sar <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | (NOT (
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar))) ))) = 0;
  END_ENTITY; -- replicate_feature

  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,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'ID_ATTRIBUTE.IDENTIFIED_ITEM')) <= 1;
  wr2: SIZEOF(USEDIN(SELF,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'DESCRIPTION_ATTRIBUTE.DESCRIBED_ITEM')) <= 1;
  END_ENTITY; -- representation

  ENTITY representation_context;
      context_identifier : identifier;
      context_type       : text;
    INVERSE
      representations_in_context : SET [1:?] OF representation FOR 
     context_of_items;
  END_ENTITY; -- representation_context

  ENTITY representation_item;
      name : label;
    WHERE
  wr1: SIZEOF(using_representations(SELF)) > 0;
  END_ENTITY; -- representation_item

  ENTITY representation_map;
      mapping_origin        : representation_item;
      mapped_representation : representation;
    INVERSE
      map_usage : SET [1:?] OF mapped_item FOR mapping_source;
    WHERE
  wr1: item_in_context(SELF.mapping_origin,SELF.mapped_representation.
    context_of_items);
  END_ENTITY; -- representation_map

  ENTITY resource_property;
      name        : label;
      description : text;
      resource    : characterized_resource_definition;
  END_ENTITY; -- resource_property

  ENTITY resource_requirement_type;
      name        : label;
      description : text;
  END_ENTITY; -- resource_requirement_type

  ENTITY revolved_profile
    SUBTYPE OF (feature_definition);
    WHERE
  wr1: SELF\characterized_object.description IN ['groove','flat',
    'round','open profile'];
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(impl_rep.
    used_representation.items) = 2)) )) = 0)) )) = 0;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'radius')) )) = 1)) )) = 0)) )) 
    = 0;
  wr4: SIZEOF(QUERY ( pdr <* get_property_definition_representations(
    SELF) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DIRECTION_SHAPE_REPRESENTATION' 
    IN TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'removal direction')) )) = 1;
  wr5: (NOT (SELF\characterized_object.description = 'open profile')) 
    OR (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'outer edge shape occurrence') AND (
    SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'profile usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.OPEN_PATH_PROFILE' IN TYPEOF(
    sdr.relating_shape_aspect)) AND (sdr.relating_shape_aspect.
    description = 'outer edge shape')) )) = 1)) )) = 1)) )) = 0);
  wr6: (NOT (SELF\characterized_object.description = 'flat')) OR (
    SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'flat edge shape occurrence') AND (
    SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'profile usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.LINEAR_PROFILE' IN TYPEOF(sdr
    .relating_shape_aspect)) AND (sdr.relating_shape_aspect.
    description = 'flat edge shape')) )) = 1)) )) = 1)) )) = 0);
  wr7: (NOT (SELF\characterized_object.description = 'round')) OR (
    SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'rounded edge shape occurrence') AND (
    SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'profile usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PARTIAL_CIRCULAR_PROFILE' IN 
    TYPEOF(sdr.relating_shape_aspect)) AND (sdr.
    relating_shape_aspect.description = 'rounded edge shape')) )) 
    = 1)) )) = 1)) )) = 0);
  wr8: (NOT (SELF\characterized_object.description = 'groove')) OR (
    SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'sweep occurrence') AND (SIZEOF(
    QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'profile usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.SQUARE_U_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.PARTIAL_CIRCULAR_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.ROUNDED_U_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.VEE_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.TEE_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.OPEN_PATH_PROFILE'] * TYPEOF(
    sdr.relating_shape_aspect)) = 1) AND (sdr.
    relating_shape_aspect.description = 'sweep')) )) = 1)) )) = 
    1)) )) = 0);
  wr9: SIZEOF(QUERY ( pdr <* get_property_definition_representations(
    SELF) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
    IN TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'maximum feature limit')) )) >= 0;
  END_ENTITY; -- revolved_profile

  ENTITY rib_top
    SUBTYPE OF (feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'rib top condition occurrence') AND (
    SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'rib top usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.RIB_TOP_FLOOR' IN TYPEOF(sdr.
    relating_shape_aspect)) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.RIB_TOP' IN TYPEOF(sdr.
    related_shape_aspect.of_shape.definition))) )) = 1)) )) = 1)) )) 
    = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DIRECTION_SHAPE_REPRESENTATION' 
    IN TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'removal direction')) )) = 1)) )) 
    = 1;
  wr3: SIZEOF(QUERY ( pdr <* get_property_definition_representations(
    SELF) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
    IN TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'maximum feature limit')) )) >= 0;
  END_ENTITY; -- rib_top

  ENTITY rib_top_floor
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' IN
     TYPEOF(SELF.of_shape.definition);
  wr2: SELF.description IN ['planar','complex'];
  wr3: SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(SELF,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATING_SHAPE_ASPECT') | ((sar.description = 
    'rib top usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | (((fcr.related_shape_aspect.description 
    = 'rib top condition occurrence') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.RIB_TOP' IN TYPEOF(fcr.
    related_shape_aspect.of_shape.definition))) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.RIB_TOP_FLOOR' IN TYPEOF(fcr.
    relating_shape_aspect))) )) >= 1;
  wr4: (NOT (SELF.description = 'complex')) OR (SIZEOF(QUERY ( pd <* 
    USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.FACE_SHAPE_REPRESENTATION' IN
     TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'rib top face')) )) = 1)) )) = 0);
  wr5: (NOT (SELF.description = 'planar')) OR (SIZEOF(QUERY ( pd <* 
    USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
    IN TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'rib top face')) )) = 1)) )) = 0);
  wr6: (NOT (SELF.description = 'planar')) OR (SIZEOF(QUERY ( pds <* 
    QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'boundary occurrence') AND (SIZEOF(
    QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'profile usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_CLOSED_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.NGON_CLOSED_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_CLOSED_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.CLOSED_PATH_PROFILE'] * 
    TYPEOF(sdr.relating_shape_aspect)) = 1) AND (sdr.
    relating_shape_aspect.description = 'rib top floor boundary')) )) 
    = 1)) )) = 1)) )) = 0);
  END_ENTITY; -- rib_top_floor

  ENTITY role_association;
      role: object_role;
      item_with_role : role_select;
  END_ENTITY; -- role_association

  ENTITY round_hole
    SUBTYPE OF (feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'diameter occurrence') AND (SIZEOF(
    QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'profile usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_CLOSED_PROFILE' IN 
    TYPEOF(sdr.relating_shape_aspect)) AND (sdr.name = 
    'diameter')) )) = 1)) )) = 1)) )) = 0;
  wr2: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'hole depth occurrence') AND (SIZEOF(
    QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'path feature component usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.PATH_FEATURE_COMPONENT' IN 
    TYPEOF(sdr.relating_shape_aspect)) AND (sdr.name = 
    'hole depth')) AND (sdr.relating_shape_aspect.description = 
    'linear')) )) = 1)) )) = 1)) )) = 0;
  wr3: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'bottom condition occurrence') AND (
    SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'hole bottom usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.HOLE_BOTTOM' IN TYPEOF(fcr.
    relating_shape_aspect)) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.ROUND_HOLE' IN TYPEOF(fcr.
    related_shape_aspect.of_shape.definition))) )) = 1)) )) = 1)) )) 
    = 0;
  wr4: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'change in diameter occurrence') AND (
    SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 'taper usage') 
    AND ('DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | (('DIMENSIONAL_INSPECTION_SCHEMA.TAPER' 
    IN TYPEOF(fcr.relating_shape_aspect)) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.ROUND_HOLE' IN TYPEOF(fcr.
    related_shape_aspect.of_shape.definition))) )) = 1)) )) <= 1)) )) 
    = 0;
  wr5: SIZEOF(QUERY ( pdr <* get_property_definition_representations(
    SELF) | (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
    IN TYPEOF(pdr.used_representation)) )) = 1;
  END_ENTITY; -- round_hole

  ENTITY rounded_end
    SUBTYPE OF (feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(impl_rep.
    used_representation.items) = 1)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'partial circular boundary occurrence') 
    AND (SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'profile usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | (
    'DIMENSIONAL_INSPECTION_SCHEMA.PARTIAL_CIRCULAR_PROFILE' IN 
    TYPEOF(sdr.relating_shape_aspect)) )) = 1)) )) = 1)) )) = 0;
  wr3: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'course of travel occurrence') AND (
    SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'path feature component usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PATH_FEATURE_COMPONENT' IN 
    TYPEOF(sdr.relating_shape_aspect)) AND (sdr.
    relating_shape_aspect.description = 'linear')) )) = 1)) )) =
     1)) )) = 0;
  wr4: SIZEOF(QUERY ( pdr <* get_property_definition_representations(
    SELF) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
    IN TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'maximum feature limit')) )) >= 0;
  END_ENTITY; -- rounded_end

  ENTITY rounded_u_profile
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' IN
     TYPEOF(SELF.of_shape.definition);
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) )) = 1)) )) = 0;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | ((NOT (SIZEOF(impl_rep.
    used_representation.items) >= 1)) AND (SIZEOF(impl_rep.
    used_representation.items) <= 2)) )) = 0)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) AND (SIZEOF(QUERY ( srwp_i <* pdr.
    used_representation.items | ((srwp_i.name = 'orientation') 
    OR (srwp_i.name = 'depth')) )) = SIZEOF(pdr.
    used_representation.items))) )) = 1) )) = 1;
  wr5: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'width')) )) = 1)) )) = 0)) )) 
    = 0;
  wr6: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
    IN TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'profile limit')) )) <= 1)) )) = 
    0;
  wr7: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'depth')) )) <= 1)) )) = 0)) )) 
    = 0;
  END_ENTITY; -- rounded_u_profile

  ENTITY roundness_tolerance
    SUBTYPE OF (geometric_tolerance);
    WHERE
  wr1: NOT (('DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'GEOMETRIC_TOLERANCE_WITH_DATUM_REFERENCE') IN TYPEOF(SELF));
  END_ENTITY; -- roundness_tolerance

  ENTITY runout_zone_definition
    SUBTYPE OF (tolerance_zone_definition);
      orientation : runout_zone_orientation;
  END_ENTITY; -- runout_zone_definition

  ENTITY runout_zone_orientation;
      angle : measure_with_unit;
  END_ENTITY; -- runout_zone_orientation

  ENTITY runout_zone_orientation_reference_direction
    SUBTYPE OF (runout_zone_orientation);
      orientation_defining_relationship : shape_aspect_relationship;
  END_ENTITY; -- runout_zone_orientation_reference_direction

  ENTITY security_classification;
      name: label;
      purpose        : text;
      security_level : security_classification_level;
  END_ENTITY; -- security_classification

  ENTITY security_classification_assignment
    ABSTRACT SUPERTYPE;
      assigned_security_classification : security_classification;
    DERIVE
      role : object_role := get_role(SELF);
    WHERE
  wr1: SIZEOF(USEDIN(SELF,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'ROLE_ASSOCIATION.ITEM_WITH_ROLE')) <= 1;
  END_ENTITY; -- security_classification_assignment

  ENTITY security_classification_level;
      name : label;
  END_ENTITY; -- security_classification_level

  ENTITY shape_aspect;
      name      : label;
      description          : OPTIONAL text;
      of_shape  : product_definition_shape;
      product_definitional : LOGICAL;
    DERIVE
      id : identifier := get_id_value(SELF);
    WHERE
  wr1: SIZEOF(USEDIN(SELF,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'ID_ATTRIBUTE.IDENTIFIED_ITEM')) <= 1;
  END_ENTITY; -- shape_aspect

  ENTITY shape_aspect_deriving_relationship
    SUBTYPE OF (shape_aspect_relationship);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.DERIVED_SHAPE_ASPECT' IN TYPEOF(
    SELF\shape_aspect_relationship.relating_shape_aspect);
  END_ENTITY; -- shape_aspect_deriving_relationship

  ENTITY shape_aspect_relationship;
      name       : label;
      description: OPTIONAL text;
      relating_shape_aspect : shape_aspect;
      related_shape_aspect  : shape_aspect;
    DERIVE
      id : identifier := get_id_value(SELF);
    WHERE
  wr1: SIZEOF(USEDIN(SELF,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'ID_ATTRIBUTE.IDENTIFIED_ITEM')) <= 1;
  END_ENTITY; -- shape_aspect_relationship

  ENTITY shape_defining_relationship
    SUBTYPE OF (shape_aspect_relationship);
  END_ENTITY; -- shape_defining_relationship

  ENTITY shape_definition_representation
    SUBTYPE OF (property_definition_representation);
    WHERE
  wr1: ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN 
    TYPEOF(SELF.definition)) OR (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINITION' IN TYPEOF(
    SELF.definition.definition));
  wr2: 'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION' IN TYPEOF(
    SELF.used_representation);
  END_ENTITY; -- shape_definition_representation

  ENTITY shape_dimension_representation
    SUBTYPE OF (shape_representation);
    WHERE
  wr1: SIZEOF(QUERY ( temp <* SELF.items | (NOT (
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
    IN TYPEOF(temp))) )) = 0;
  wr2: SIZEOF(SELF.items) <= 2;
  wr3: SIZEOF(QUERY ( pos_mri <* QUERY ( real_mri <* SELF.items | (
    'REAL' IN TYPEOF(real_mri\measure_with_unit.value_component)) )
     | (NOT (pos_mri\measure_with_unit.value_component > 0)) )) 
    = 0;
  END_ENTITY; -- shape_dimension_representation

  ENTITY shape_representation
    SUBTYPE OF (representation);
  END_ENTITY; -- shape_representation

  ENTITY shape_representation_with_parameters
    SUBTYPE OF (shape_representation);
    WHERE
  wr1: SIZEOF(QUERY ( it <* SELF.items | (NOT (SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT',
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM'] 
    * TYPEOF(it)) = 1)) )) = 0;
  END_ENTITY; -- shape_representation_with_parameters

  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);
  END_ENTITY; -- si_unit

  ENTITY slot
    SUBTYPE OF (feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(impl_rep.
    used_representation.items) = 1)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'swept shape occurrence') AND (SIZEOF(
    QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'profile usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | (SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.SQUARE_U_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.PARTIAL_CIRCULAR_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.ROUNDED_U_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.VEE_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.TEE_PROFILE',
    'DIMENSIONAL_INSPECTION_SCHEMA.OPEN_PATH_PROFILE'] * TYPEOF(
    sdr.relating_shape_aspect)) = 1) )) = 1)) )) = 1)) )) = 0;
  wr3: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'course of travel occurrence') AND (
    SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'path feature component usage') AND ((sar.name = 
    'course of travel') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar)))) ) | (
    'DIMENSIONAL_INSPECTION_SCHEMA.PATH_FEATURE_COMPONENT' IN 
    TYPEOF(sdr.relating_shape_aspect)) )) = 1)) )) = 1)) )) = 0;
  wr4: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'end condition occurrence') AND (
    SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | (((sar.description = 
    'slot end usage') AND (sar.name IN ['course of travel start',
    'course of travel end'])) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.SLOT_END' IN TYPEOF(fcr.
    relating_shape_aspect)) AND (fcr.relating_shape_aspect.
    description IN ['open','radiused','flat','woodruff'])) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SLOT' IN TYPEOF(fcr.
    related_shape_aspect.of_shape.definition))) )) = 1)) )) = 2)) )) 
    = 0;
  wr5: (NOT (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'end condition occurrence') AND (
    SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP' + 
    '.RELATED_SHAPE_ASPECT') | (((sar.description = 
    'slot end usage') AND (sar.name IN ['course of travel start',
    'course of travel end'])) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.SLOT_END' IN TYPEOF(fcr.
    relating_shape_aspect)) AND (fcr.relating_shape_aspect.
    description IN ['loop'])) AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SLOT' IN TYPEOF(fcr.
    related_shape_aspect.of_shape.definition))) )) = 1)) )) = 1)) )) 
    = 0)) OR (SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'course of travel occurrence') AND (
    SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'path feature component usage') AND ((sar.name = 
    'course of travel') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar)))) ) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PATH_FEATURE_COMPONENT' IN 
    TYPEOF(sdr.relating_shape_aspect)) AND (sdr.
    relating_shape_aspect.description IN ['complex',
    'complete circular'])) )) = 1)) )) = 1)) )) = 0);
  wr6: SIZEOF(QUERY ( pdr <* get_property_definition_representations(
    SELF) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
    IN TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'maximum feature limit')) )) >= 0;
  END_ENTITY; -- slot

  ENTITY slot_end
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1 : 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' 
     IN TYPEOF(SELF.of_shape.definition);
  wr2 : SELF.description IN ['open','radiused','flat','woodruff',
     'loop'];
  wr3 : (NOT (SELF.description IN ['open','radiused','loop'])) OR (
     SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) )) = 0)) )) = 0);
  wr4 : (NOT (SELF.description IN ['flat','woodruff'])) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) )) = 1)) )) = 0);
  wr5 : (NOT (SELF.description IN ['flat'])) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     impl_rep.used_representation.items) = 2)) )) = 0)) )) = 0);
  wr6 : (NOT (SELF.description = 'flat')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | ((
     SIZEOF(['DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'first radius')) )) = 1)) )) 
     = 0)) )) = 0);
  wr7 : (NOT (SELF.description = 'flat')) OR (SIZEOF(QUERY ( pd <* 
     USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | ((
     SIZEOF(['DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'second radius')) )) = 1)) )) 
     = 0)) )) = 0);
  wr8 : (NOT (SELF.description = 'woodruff')) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     QUERY ( it <* impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT' IN
      TYPEOF(it)) AND (it.name = 'radius')) )) = 1)) )) = 0)) )) 
     = 0);
  wr9 : (NOT (SELF.description IN ['woodruff'])) OR (SIZEOF(
     QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS' 
     IN TYPEOF(pdr.used_representation)) ) | (NOT (SIZEOF(
     impl_rep.used_representation.items) = 1)) )) = 0)) )) = 0);
  wr10: SIZEOF(QUERY ( fcr <* QUERY ( sar <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATING_SHAPE_ASPECT') | (((sar.description = 
     'slot end usage') AND (sar.name IN [
     'course of travel start','course of travel end'])) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (((fcr.related_shape_aspect.
     description = 'end condition occurrence') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.SLOT' IN TYPEOF(fcr.
     related_shape_aspect.of_shape.definition))) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.SLOT_END' IN TYPEOF(fcr.
     relating_shape_aspect))) )) >= 1;
  END_ENTITY; -- slot_end

  ENTITY solid_angle_unit
    SUBTYPE OF (named_unit);
    WHERE
  wr1: ((((((SELF\named_unit.dimensions.length_exponent = 0) AND (SELF
    \named_unit.dimensions.mass_exponent = 0)) AND (SELF\
    named_unit.dimensions.time_exponent = 0)) AND (SELF\
    named_unit.dimensions.electric_current_exponent = 0)) AND (
    SELF\named_unit.dimensions.
    thermodynamic_temperature_exponent = 0)) AND (SELF\
    named_unit.dimensions.amount_of_substance_exponent = 0)) AND
     (SELF\named_unit.dimensions.luminous_intensity_exponent = 0);
  END_ENTITY; -- solid_angle_unit

  ENTITY solid_model
    SUPERTYPE OF (manifold_solid_brep)
    SUBTYPE OF (geometric_representation_item);
  END_ENTITY; -- solid_model

  ENTITY spherical_cap
    SUBTYPE OF (feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(impl_rep.
    used_representation.items) = 3)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'radius')) )) = 1)) )) = 0)) )) 
    = 0;
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
    * TYPEOF(it)) = 2) AND (it.name = 'internal angle')) )) = 1)) )) 
    = 0)) )) = 0;
  END_ENTITY; -- spherical_cap

  ENTITY spherical_surface
    SUBTYPE OF (elementary_surface);
      radius : positive_length_measure;
  END_ENTITY; -- spherical_surface

  ENTITY square_u_profile
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1 : 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' 
     IN TYPEOF(SELF.of_shape.definition);
  wr2 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) )) = 1)) )) = 0;
  wr3 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | ((NOT (SIZEOF(impl_rep.
     used_representation.items) >= 4)) AND (SIZEOF(impl_rep.
     used_representation.items) <= 7)) )) = 0)) )) = 0;
  wr4 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) AND (SIZEOF(QUERY ( srwp_i <* pdr.
     used_representation.items | ((((((((srwp_i.name = 
     'orientation') OR (srwp_i.name = 'width')) OR (srwp_i.name 
     = 'first angle')) OR (srwp_i.name = 'second angle')) OR (
     srwp_i.name = 'first radius')) OR (srwp_i.name = 
     'second radius')) OR (srwp_i.name = 'profile limit')) OR (
     srwp_i.name = 'depth')) )) = SIZEOF(pdr.used_representation
     .items))) )) = 1) )) = 1;
  wr5 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) 
     AND (it.name = 'orientation')) )) = 1)) )) = 0)) )) = 0;
  wr6 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'width')) )) = 1)) )) = 0)) )) 
     = 0;
  wr7 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'first radius')) )) <= 1)) )) 
     = 0)) )) = 0;
  wr8 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'second radius')) )) <= 1)) )) 
     = 0)) )) = 0;
  wr9 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
     * TYPEOF(it)) = 2) AND (it.name = 'first angle')) )) = 1)) )) 
     = 0)) )) = 0;
  wr10: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
     * TYPEOF(it)) = 2) AND (it.name = 'second angle')) )) = 1)) )) 
     = 0)) )) = 0;
  wr11: SIZEOF(QUERY ( pd <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.' + 
     'DEFINITION') | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
     IN TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'profile limit')) )) <= 1)) )) =
      0;
  wr12: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'depth')) )) <= 1)) )) = 0)) )) 
     = 0;
  END_ENTITY; -- square_u_profile

  ENTITY standard_uncertainty
    SUBTYPE OF (uncertainty_qualifier);
      uncertainty_value : REAL;
  END_ENTITY; -- standard_uncertainty

  ENTITY step
    SUBTYPE OF (feature_definition);
    WHERE
  wr1: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(impl_rep.
    used_representation.items) = 1)) )) = 0)) )) = 0;
  wr2: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'course of travel occurrence') AND (
    SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'path feature component usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PATH_FEATURE_COMPONENT' IN 
    TYPEOF(sdr.relating_shape_aspect)) AND (sdr.
    relating_shape_aspect.description = 'linear')) )) = 1)) )) =
     1)) )) = 0;
  wr3: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ('DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' 
    IN TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
    sa_occ.description = 'removal boundary occurrence') AND (
    SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' +
     'RELATED_SHAPE_ASPECT') | ((sar.description = 
    'profile usage') AND (
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
    IN TYPEOF(sar))) ) | (
    'DIMENSIONAL_INSPECTION_SCHEMA.VEE_PROFILE' IN TYPEOF(sdr.
    relating_shape_aspect)) )) = 1)) )) = 1)) )) = 0;
  wr4: SIZEOF(QUERY ( pdr <* get_property_definition_representations(
    SELF) | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
    IN TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'maximum feature limit')) )) >= 0;
  wr5: SIZEOF(QUERY ( pds <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN 
    TYPEOF(pds)) AND (SIZEOF(QUERY ( csa <* USEDIN(pds,
    'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (((
    'DIMENSIONAL_INSPECTION_SCHEMA.COMPOSITE_SHAPE_ASPECT' IN 
    TYPEOF(csa)) AND (csa.name = 'uncut area')) AND (SIZEOF(
    QUERY ( sar <* csa.component_relationships | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP' 
    IN TYPEOF(sar)) AND (SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.BOSS',
    'DIMENSIONAL_INSPECTION_SCHEMA.PROTRUSION'] * TYPEOF(sar.
    related_shape_aspect)) = 1)) )) = 1)) )) <= 1)) )) = 1;
  END_ENTITY; -- step

  ENTITY straightness_tolerance
    SUBTYPE OF (geometric_tolerance);
    WHERE
  wr1: NOT (('DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'GEOMETRIC_TOLERANCE_WITH_DATUM_REFERENCE') IN TYPEOF(SELF));
  END_ENTITY; -- straightness_tolerance

  ENTITY surface
    SUPERTYPE OF (ONEOF (elementary_surface,swept_surface,bounded_surface))
    SUBTYPE OF (geometric_representation_item);
  END_ENTITY; -- surface

  ENTITY surface_curve
    SUBTYPE OF (curve);
      curve_3d   : curve;
      associated_geometry   : LIST [1:2] OF pcurve_or_surface;
      master_representation : preferred_surface_curve_representation;
    DERIVE
      basis_surface : SET [1:2] OF surface := get_basis_surface(SELF);
    WHERE
  wr1: curve_3d.dim = 3;
  wr2: ('DIMENSIONAL_INSPECTION_SCHEMA.PCURVE' IN TYPEOF(
    associated_geometry[1])) OR (master_representation <> 
    pcurve_s1);
  wr3: ('DIMENSIONAL_INSPECTION_SCHEMA.PCURVE' IN TYPEOF(
    associated_geometry[2])) OR (master_representation <> 
    pcurve_s2);
  wr4: NOT ('DIMENSIONAL_INSPECTION_SCHEMA.PCURVE' IN TYPEOF(curve_3d));
  END_ENTITY; -- surface_curve

  ENTITY surface_of_linear_extrusion
    SUBTYPE OF (swept_surface);
      extrusion_axis : vector;
  END_ENTITY; -- surface_of_linear_extrusion

  ENTITY surface_of_revolution
    SUBTYPE OF (swept_surface);
      axis_position : axis1_placement;
    DERIVE
      axis_line : line := (dummy_gri || curve()) || line(axis_position.
          location,dummy_gri || vector(axis_position.z,1));
  END_ENTITY; -- surface_of_revolution

  ENTITY surface_profile_tolerance
    SUBTYPE OF (geometric_tolerance);
    WHERE
  wr1: (NOT (('DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'GEOMETRIC_TOLERANCE_WITH_DATUM_REFERENCE') IN TYPEOF(SELF))) 
    OR (SIZEOF(SELF\geometric_tolerance_with_datum_reference.
    datum_system) <= 3);
  END_ENTITY; -- surface_profile_tolerance

  ENTITY swept_surface
    SUPERTYPE OF (ONEOF (surface_of_linear_extrusion,surface_of_revolution))
    SUBTYPE OF (surface);
      swept_curve : curve;
  END_ENTITY; -- swept_surface

  ENTITY symmetric_shape_aspect
    SUBTYPE OF (shape_aspect);
    INVERSE
      basis_relationships : SET [1:?] OF shape_aspect_relationship FOR 
         relating_shape_aspect;
    WHERE
  wr1: SIZEOF(QUERY ( x <* SELF.basis_relationships | (
    'DIMENSIONAL_INSPECTION_SCHEMA.CENTRE_OF_SYMMETRY' IN 
    TYPEOF(x.related_shape_aspect)) )) >= 1;
  END_ENTITY; -- symmetric_shape_aspect

  ENTITY symmetry_tolerance
    SUBTYPE OF (geometric_tolerance_with_datum_reference);
    WHERE
  wr1: SIZEOF(SELF\geometric_tolerance_with_datum_reference.
    datum_system) <= 3;
  END_ENTITY; -- symmetry_tolerance

  ENTITY tangent
    SUBTYPE OF (derived_shape_aspect);
    WHERE
  wr1: SIZEOF(SELF\derived_shape_aspect.deriving_relationships) = 1;
  END_ENTITY; -- tangent

  ENTITY taper
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' IN
     TYPEOF(SELF.of_shape.definition);
  wr2: SELF.description IN ['angle taper','diameter taper',
    'directed taper'];
  wr3: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) )) = 1)) )) = 0;
  wr4: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(impl_rep.
    used_representation.items) = 1)) )) = 0)) )) = 0;
  wr5: (NOT (SELF.description = 'angle taper')) OR (SIZEOF(
    QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
    * TYPEOF(it)) = 2) AND (it.name = 'taper angle')) )) = 1)) )) 
    = 0)) )) = 0);
  wr6: (NOT (SELF.description = 'diameter taper')) OR (SIZEOF(
    QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] * 
    TYPEOF(it)) = 2) AND (it.name = 'final diameter')) )) = 1)) )) 
    = 0)) )) = 0);
  wr7: (NOT (SELF.description = 'directed taper')) OR (SIZEOF(
    QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
    used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
    impl_rep.used_representation.items | ((SIZEOF([
    'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
    'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
    * TYPEOF(it)) = 2) AND (it.name = 'angle')) )) = 1)) )) = 0)) )) 
    = 0);
  wr8: (NOT (SELF.description = 'directed taper')) OR (SIZEOF(
    QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
     | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
    'DIMENSIONAL_INSPECTION_SCHEMA.' + 
    'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
    'DIMENSIONAL_INSPECTION_SCHEMA.DIRECTION_SHAPE_REPRESENTATION' 
    IN TYPEOF(pdr.used_representation)) AND (pdr.
    used_representation.name = 'direction')) )) = 1)) )) = 0);
  END_ENTITY; -- taper

  ENTITY tee_profile
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1 : 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' 
     IN TYPEOF(SELF.of_shape.definition);
  wr2 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) )) = 1)) )) = 0;
  wr3 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | ((NOT (SIZEOF(impl_rep.
     used_representation.items) >= 9)) AND (SIZEOF(impl_rep.
     used_representation.items) <= 10)) )) = 0)) )) = 0;
  wr4 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) AND (SIZEOF(QUERY ( srwp_i <* pdr.
     used_representation.items | ((((((((((srwp_i.name = 
     'orientation') OR (srwp_i.name = 'width')) OR (srwp_i.name 
     = 'depth')) OR (srwp_i.name = 'cross bar width')) OR (
     srwp_i.name = 'cross bar depth')) OR (srwp_i.name = 
     'first offset')) OR (srwp_i.name = 'second offset')) OR (
     srwp_i.name = 'first angle')) OR (srwp_i.name = 
     'second angle')) OR (srwp_i.name = 'radius')) )) = SIZEOF(
     pdr.used_representation.items))) )) = 1) )) = 1;
  wr5 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) 
     AND (it.name = 'orientation')) )) = 1)) )) = 0)) )) = 0;
  wr6 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'width')) )) = 1)) )) = 0)) )) 
     = 0;
  wr7 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'depth')) )) = 1)) )) = 0)) )) 
     = 0;
  wr8 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'cross bar width')) )) = 1)) )) 
     = 0)) )) = 0;
  wr9 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'cross bar depth')) )) = 1)) )) 
     = 0)) )) = 0;
  wr10: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'first offset')) )) = 1)) )) 
     = 0)) )) = 0;
  wr11: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'second offset')) )) = 1)) )) 
     = 0)) )) = 0;
  wr12: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
     * TYPEOF(it)) = 2) AND (it.name = 'first angle')) )) = 1)) )) 
     = 0)) )) = 0;
  wr13: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
     * TYPEOF(it)) = 2) AND (it.name = 'second angle')) )) = 1)) )) 
     = 0)) )) = 0;
  wr14: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'radius')) )) <= 1)) )) = 
     0)) )) = 0;
  wr15: SIZEOF(QUERY ( pd <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.' + 
     'DEFINITION') | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
     IN TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'profile limit')) )) <= 1)) )) =
      0;
  END_ENTITY; -- tee_profile

  ENTITY thread
    SUBTYPE OF (feature_definition);
    WHERE
  wr1 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) AND (8 <= SIZEOF(pdr.
     used_representation.items))) AND (SIZEOF(pdr.
     used_representation.items) <= 11)) )) = 1) )) = 1;
  wr2 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'major diameter')) )) = 1)) )) 
     = 0)) )) = 0;
  wr3 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'minor diameter')) )) <= 1)) )) 
     = 0)) )) = 0;
  wr4 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'pitch diameter')) )) <= 1)) )) 
     = 0)) )) = 0;
  wr5 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.RATIO_MEASURE_WITH_UNIT'] * 
     TYPEOF(it)) = 2) AND (it.name = 'number of threads')) )) = 
     1)) )) = 0)) )) = 0;
  wr6 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'fit class')) )) = 1)) )) = 0)) )) 
     = 0;
  wr7 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'form')) )) = 1)) )) = 0)) )) 
     = 0;
  wr8 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'hand')) AND (it.description 
     IN ['left','right'])) )) = 1)) )) = 0)) )) = 0;
  wr9 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'qualifier')) )) <= 1)) )) = 
     0)) )) = 0;
  wr10: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'thread side')) AND ((it.
     description = 'internal') OR (it.description = 'external'))) )) 
     = 1)) )) = 0)) )) = 0;
  wr11: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'crest')) )) <= 1)) )) = 0)) )) 
     = 0;
  wr12: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'partial area occurrence') AND (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'applied area usage') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.APPLIED_AREA' IN TYPEOF(sdr.
     relating_shape_aspect)) )) = 1)) )) = 1)) )) = 0;
  wr13: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'applied shape') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT' IN TYPEOF(sdr.
     relating_shape_aspect)) )) = 1) )) = 1)) )) = 0;
  wr14: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'fit class 2')) )) <= 1)) )) 
     = 0)) )) = 0;
  wr15: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'nominal size')) )) <= 1)) )) 
     = 0)) )) = 0;
  END_ENTITY; -- thread

  ENTITY time_measure_with_unit
    SUBTYPE OF (measure_with_unit);
    WHERE
  wr1: 'DIMENSIONAL_INSPECTION_SCHEMA.TIME_UNIT' IN TYPEOF(SELF\
    measure_with_unit.unit_component);
  END_ENTITY; -- time_measure_with_unit

  ENTITY time_unit
    SUBTYPE OF (named_unit);
    WHERE
  wr1: ((((((SELF\named_unit.dimensions.length_exponent = 0) AND (SELF
    \named_unit.dimensions.mass_exponent = 0)) AND (SELF\
    named_unit.dimensions.time_exponent = 1)) AND (SELF\
    named_unit.dimensions.electric_current_exponent = 0)) AND (
    SELF\named_unit.dimensions.
    thermodynamic_temperature_exponent = 0)) AND (SELF\
    named_unit.dimensions.amount_of_substance_exponent = 0)) AND
     (SELF\named_unit.dimensions.luminous_intensity_exponent = 0);
  END_ENTITY; -- time_unit

  ENTITY tolerance_value;
      lower_bound : measure_with_unit;
      upper_bound : measure_with_unit;
    WHERE
  wr1: upper_bound.value_component > lower_bound.value_component;
  wr2: upper_bound.unit_component = lower_bound.unit_component;
  END_ENTITY; -- tolerance_value

  ENTITY tolerance_zone
    SUBTYPE OF (shape_aspect);
      defining_tolerance : SET [1:?] OF geometric_tolerance;
      form    : tolerance_zone_form;
  END_ENTITY; -- tolerance_zone

  ENTITY tolerance_zone_definition
    SUPERTYPE OF (ONEOF (projected_zone_definition,runout_zone_definition));
      zone       : tolerance_zone;
      boundaries : SET [1:?] OF shape_aspect;
  END_ENTITY; -- tolerance_zone_definition

  ENTITY tolerance_zone_form;
      name : label;
  END_ENTITY; -- tolerance_zone_form

  ENTITY topological_representation_item
    SUPERTYPE OF (ONEOF (vertex,edge,face_bound,face,connected_face_set,
        loop ANDOR path))
    SUBTYPE OF (representation_item);
  END_ENTITY; -- topological_representation_item

  ENTITY toroidal_surface
    SUBTYPE OF (elementary_surface);
      major_radius : positive_length_measure;
      minor_radius : positive_length_measure;
  END_ENTITY; -- toroidal_surface

  ENTITY total_runout_tolerance
    SUBTYPE OF (geometric_tolerance_with_datum_reference);
    WHERE
  wr1: SIZEOF(SELF\geometric_tolerance_with_datum_reference.
    datum_system) <= 2;
  END_ENTITY; -- total_runout_tolerance

  ENTITY transition_feature
    SUPERTYPE OF (ONEOF (chamfer,edge_round,fillet))
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1: SIZEOF(['DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION',
    'DIMENSIONAL_INSPECTION_SCHEMA.COMPOUND_FEATURE'] * TYPEOF(
    SELF.of_shape.definition)) = 1;
  wr2: SIZEOF(['DIMENSIONAL_INSPECTION_SCHEMA.CHAMFER',
    'DIMENSIONAL_INSPECTION_SCHEMA.EDGE_ROUND',
    'DIMENSIONAL_INSPECTION_SCHEMA.FILLET'] * TYPEOF(SELF)) = 1;
  END_ENTITY; -- transition_feature

  ENTITY turned_knurl
    SUBTYPE OF (feature_definition);
    WHERE
  wr1 : SELF\characterized_object.description IN ['diamond','diagonal',
     'straight'];
  wr2 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) AND ((6 <= SIZEOF(pdr.
     used_representation.items)) AND (SIZEOF(pdr.
     used_representation.items) <= 9))) )) = 1) )) = 1;
  wr3 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.COUNT_MEASURE' IN TYPEOF(it\
     measure_with_unit.value_component))) AND (it.name = 
     'number of teeth')) )) <= 1)) )) = 0)) )) = 0;
  wr4 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'major diameter')) )) = 1)) )) 
     = 0)) )) = 0;
  wr5 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'nominal diameter')) )) = 
     1)) )) = 0)) )) = 0;
  wr6 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
     'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.' + 
     'DEFINITION') | (NOT (SIZEOF(QUERY ( impl_rep <* 
     QUERY ( pdr <* USEDIN(pd,'DIMENSIONAL_INSPECTION_SCHEMA.' +
      'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'tooth depth')) )) <= 1)) )) 
     = 0)) )) = 0;
  wr7 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'root fillet')) )) <= 1)) )) 
     = 0)) )) = 0;
  wr8 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT'] *
      TYPEOF(it)) = 2) AND (it.name = 'diametral pitch')) )) = 1)) )) 
     = 0)) )) = 0;
  wr9 : (NOT (SELF\characterized_object.description IN ['diamond',
     'diagonal'])) OR (SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
     * TYPEOF(it)) = 2) AND (it.name = 'helix angle')) )) = 1)) )) 
     = 0)) )) = 0);
  wr10: (NOT (SELF\characterized_object.description = 'diagonal')) OR 
     (SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.DESCRIPTIVE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (it.name = 'helix hand')) )) = 1)) )) = 
     0)) )) = 0);
  wr11: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | ((
     sa_occ.description = 'partial area occurrence') AND (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'applied area usage') AND ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_DEFINING_RELATIONSHIP') IN TYPEOF(sar))) ) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.APPLIED_AREA' IN TYPEOF(sdr.
     relating_shape_aspect)) )) = 1)) )) = 1)) )) = 0;
  wr12: SIZEOF(QUERY ( pds <* QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (
     'DIMENSIONAL_INSPECTION_SCHEMA.PRODUCT_DEFINITION_SHAPE' IN
      TYPEOF(pd)) ) | (NOT (SIZEOF(QUERY ( sa_occ <* USEDIN(pds,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT.OF_SHAPE') | (
     SIZEOF(QUERY ( sdr <* QUERY ( sar <* USEDIN(sa_occ,
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT_RELATIONSHIP.' 
     + 'RELATED_SHAPE_ASPECT') | ((sar.description = 
     'applied shape') AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP' 
     IN TYPEOF(sar))) ) | (
     'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_ASPECT' IN TYPEOF(sdr.
     relating_shape_aspect)) )) = 1) )) = 1)) )) = 0;
  END_ENTITY; -- turned_knurl

  ENTITY type_qualifier;
      name : label;
  END_ENTITY; -- type_qualifier

  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; -- uncertainty_measure_with_unit

  ENTITY uncertainty_qualifier
    SUPERTYPE OF (standard_uncertainty);
      measure_name : label;
      description  : text;
  END_ENTITY; -- uncertainty_qualifier

  ENTITY uniform_curve
    SUBTYPE OF (b_spline_curve);
  END_ENTITY; -- uniform_curve

  ENTITY uniform_surface
    SUBTYPE OF (b_spline_surface);
  END_ENTITY; -- uniform_surface

  ENTITY value_range
    SUBTYPE OF (compound_representation_item);
WHERE
wr1:  SIZEOF(QUERY ( mri <* QUERY( sri <* SELF.item_element |
      ('DIMENSIONAL_INSPECTION_SCHEMA.SET_REPRESENTATION_ITEM' 
      IN TYPEOF (sri))) | 
      ('DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
      IN TYPEOF (mri))
       ))=2;
wr2:  SIZEOF(QUERY ( mri <* QUERY( sri <* SELF.item_element |
      ('DIMENSIONAL_INSPECTION_SCHEMA.SET_REPRESENTATION_ITEM' 
      IN TYPEOF (sri))) | 
  (('DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
  IN TYPEOF (mri)) AND
      (mri.name='lower limit'))
       ))=1;
wr3:  SIZEOF(QUERY ( mri <* QUERY( sri <* SELF.item_element |
      ('DIMENSIONAL_INSPECTION_SCHEMA.SET_REPRESENTATION_ITEM' 
      IN TYPEOF (sri))) | 
  (('DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
  IN TYPEOF (mri)) AND
      (mri.name='upper limit'))
       ))=1;
      
wr4: SIZEOF(QUERY( i1 <* SELF.item_element |
 ('DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
 IN TYPEOF (i1)) AND 
     (SIZEOF ( QUERY (i2 <* SELF.item_element |
 ('DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
 IN TYPEOF (i2)) AND 
     (i1 :<>: i2) AND 
     (i1\measure_with_unit.unit_component :=:
      i2\measure_with_unit.unit_component) 
     ) ) = 1 ))) = 2 ;
  END_ENTITY; -- value_range

  ENTITY vector
    SUBTYPE OF (geometric_representation_item);
      orientation : direction;
      magnitude   : length_measure;
    WHERE
  wr1: magnitude >= 0;
  END_ENTITY; -- vector

  ENTITY vee_profile
    SUBTYPE OF (shape_aspect);
    WHERE
  wr1 : 'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION' 
     IN TYPEOF(SELF.of_shape.definition);
  wr2 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) )) = 1)) )) = 0;
  wr3 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | ((NOT (SIZEOF(impl_rep.
     used_representation.items) >= 3)) AND (SIZEOF(impl_rep.
     used_representation.items) <= 6)) )) = 0)) )) = 0;
  wr4 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) AND (SIZEOF(QUERY ( srwp_i <* pdr.
     used_representation.items | ((((((srwp_i.name = 
     'orientation') OR (srwp_i.name = 'profile angle')) OR (
     srwp_i.name = 'tilt angle')) OR (srwp_i.name = 
     'profile radius')) OR (srwp_i.name = 'first length')) OR (
     srwp_i.name = 'second length')) )) = SIZEOF(pdr.
     used_representation.items))) )) = 1) )) = 1;
  wr5 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.PLACEMENT' IN TYPEOF(it)) 
     AND (it.name = 'orientation')) )) = 1)) )) = 0)) )) = 0;
  wr6 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT' IN
      TYPEOF(it\measure_with_unit.value_component))) AND (it.
     name = 'profile radius')) )) <= 1)) )) = 0)) )) = 0;
  wr7 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
     * TYPEOF(it)) = 2) AND (it.name = 'profile angle')) )) = 1)) )) 
     = 0)) )) = 0;
  wr8 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | ((SIZEOF([
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM',
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANE_ANGLE_MEASURE_WITH_UNIT'] 
     * TYPEOF(it)) = 2) AND (it.name = 'tilt angle')) )) = 1)) )) 
     = 0)) )) = 0;
  wr9 : SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( pdr <* USEDIN(pd,
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION' 
     IN TYPEOF(pdr.used_representation)) AND (pdr.
     used_representation.name = 'profile limit')) )) <= 1)) )) =
      0;
  wr10: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT' IN
      TYPEOF(it\measure_with_unit.value_component))) AND (it.
     name = 'first length')) )) <= 1)) )) = 0)) )) = 0;
  wr11: SIZEOF(QUERY ( pd <* USEDIN(SELF,
  'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION')
      | (NOT (SIZEOF(QUERY ( impl_rep <* QUERY ( pdr <* USEDIN(
     pd,'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION') | ((
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 
     'SHAPE_REPRESENTATION_WITH_PARAMETERS') IN TYPEOF(pdr.
     used_representation)) ) | (NOT (SIZEOF(QUERY ( it <* 
     impl_rep.used_representation.items | (((
     'DIMENSIONAL_INSPECTION_SCHEMA.MEASURE_REPRESENTATION_ITEM' 
     IN TYPEOF(it)) AND (
     'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE_WITH_UNIT' IN
      TYPEOF(it\measure_with_unit.value_component))) AND (it.
     name = 'second length')) )) <= 1)) )) = 0)) )) = 0;
  END_ENTITY; -- vee_profile

  ENTITY vertex
    SUBTYPE OF (topological_representation_item);
  END_ENTITY; -- vertex

  ENTITY vertex_loop
    SUBTYPE OF (loop);
      loop_vertex : vertex;
  END_ENTITY; -- vertex_loop

  ENTITY vertex_point
    SUBTYPE OF (vertex, geometric_representation_item);
      vertex_geometry : point;
  END_ENTITY; -- vertex_point

  RULE compatible_dimension FOR (cartesian_point, direction, 
     representation_context, 
     geometric_representation_context);

  WHERE
wr1: SIZEOF(QUERY ( x <* cartesian_point | (SIZEOF(QUERY ( y <* 
  geometric_representation_context | (item_in_context(x,y) AND (
  HIINDEX(x.coordinates) <> y.coordinate_space_dimension)) )) > 
  0) )) = 0;
wr2: SIZEOF(QUERY ( x <* direction | (SIZEOF(QUERY ( y <* 
  geometric_representation_context | (item_in_context(x,y) AND (
  HIINDEX(x.direction_ratios) <> y.coordinate_space_dimension)) )) 
  > 0) )) = 0;

  END_RULE; -- compatible_dimension

  RULE dependent_instantiable_security_classification_level FOR (
  security_classification_level);

  WHERE
wr1: SIZEOF(QUERY ( scl <* security_classification_level | (NOT (
  SIZEOF(USEDIN(scl,'')) >= 1)) )) = 0;

  END_RULE; -- dependent_instantiable_security_classification_level

  RULE dependent_instantiable_shape_representation FOR (
  shape_representation);

  WHERE
wr1: SIZEOF(QUERY ( sr <* shape_representation | (NOT (SIZEOF(USEDIN(
  sr,'')) >= 1)) )) = 0;

  END_RULE; -- dependent_instantiable_shape_representation

  RULE geometric_tolerance_subtype_exclusiveness FOR (geometric_tolerance);

  WHERE
wr1: SIZEOF(QUERY ( gt <* geometric_tolerance | (NOT (SIZEOF(TYPEOF(gt) 
  * ['DIMENSIONAL_INSPECTION_SCHEMA.ANGULARITY_TOLERANCE',
  'DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_RUNOUT_TOLERANCE',
  'DIMENSIONAL_INSPECTION_SCHEMA.CONCENTRICITY_TOLERANCE',
  'DIMENSIONAL_INSPECTION_SCHEMA.CYLINDRICITY_TOLERANCE',
  'DIMENSIONAL_INSPECTION_SCHEMA.FLATNESS_TOLERANCE',
  'DIMENSIONAL_INSPECTION_SCHEMA.LINE_PROFILE_TOLERANCE',
  'DIMENSIONAL_INSPECTION_SCHEMA.PARALLELISM_TOLERANCE',
  'DIMENSIONAL_INSPECTION_SCHEMA.PERPENDICULARITY_TOLERANCE',
  'DIMENSIONAL_INSPECTION_SCHEMA.POSITION_TOLERANCE',
  'DIMENSIONAL_INSPECTION_SCHEMA.ROUNDNESS_TOLERANCE',
  'DIMENSIONAL_INSPECTION_SCHEMA.STRAIGHTNESS_TOLERANCE',
  'DIMENSIONAL_INSPECTION_SCHEMA.SURFACE_PROFILE_TOLERANCE',
  'DIMENSIONAL_INSPECTION_SCHEMA.SYMMETRY_TOLERANCE',
  'DIMENSIONAL_INSPECTION_SCHEMA.TOTAL_RUNOUT_TOLERANCE']) <= 2)) )) 
  = 0;

  END_RULE; -- geometric_tolerance_subtype_exclusiveness

  RULE machining_feature_life_cycle FOR (instanced_feature);

  WHERE
wr1: SIZEOF(QUERY ( mf <* instanced_feature | (NOT (mf.of_shape.
  definition.frame_of_reference.life_cycle_stage = 
  'manufacturing planning')) )) = 0;

  END_RULE; -- machining_feature_life_cycle

  RULE product_definition_formation_requires_security_classification FOR (
  product_definition_formation, 
  applied_security_classification_assignment);

  WHERE
wr1: SIZEOF(QUERY ( pdf <* product_definition_formation | (NOT (
  SIZEOF(QUERY ( asca <* 
  applied_security_classification_assignment | (pdf IN asca.
  items) )) = 1)) )) = 0;

  END_RULE; -- product_definition_formation_requires_security_classification

  RULE product_requires_version FOR (product, product_definition_formation);

  WHERE
wr1: SIZEOF(QUERY ( prod <* product | (NOT (SIZEOF(QUERY ( pdf <* 
  product_definition_formation | (prod :=: pdf.of_product) )) >=
   1)) )) = 0;

  END_RULE; -- product_requires_version

  RULE representation_subtype_exclusiveness FOR (representation);

  WHERE
wr1: SIZEOF(QUERY ( rep <* representation | (NOT (SIZEOF(TYPEOF(rep) *
   ['DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION',
  'DIMENSIONAL_INSPECTION_SCHEMA.DEFINITIONAL_REPRESENTATION',
  'DIMENSIONAL_INSPECTION_SCHEMA.DIRECTION_SHAPE_REPRESENTATION',
  'DIMENSIONAL_INSPECTION_SCHEMA.FACE_SHAPE_REPRESENTATION',
  'DIMENSIONAL_INSPECTION_SCHEMA.PLANAR_SHAPE_REPRESENTATION',
  'DIMENSIONAL_INSPECTION_SCHEMA.LOCATION_SHAPE_REPRESENTATION',
  'DIMENSIONAL_INSPECTION_SCHEMA.PATH_SHAPE_REPRESENTATION']) <=
   2)) )) = 0;

  END_RULE; -- representation_subtype_exclusiveness

  RULE restrict_security_classification_level FOR (
  security_classification_level);

  WHERE
wr1: SIZEOF(QUERY ( scl <* security_classification_level | (NOT (scl.
  name IN ['unclassified','classified','proprietary',
  'confidential','secret','top_secret'])) )) = 0;

  END_RULE; -- restrict_security_classification_level

  RULE shape_aspect_relationship_subtype_exclusiveness FOR (
  shape_aspect_relationship);

  WHERE
wr1: SIZEOF(QUERY ( sr <* shape_aspect_relationship | (NOT (SIZEOF(
  TYPEOF(sr) * [
  'DIMENSIONAL_INSPECTION_SCHEMA.DIMENSIONAL_LOCATION',
  'DIMENSIONAL_INSPECTION_SCHEMA.GEOMETRIC_TOLERANCE_RELATIONSHIP',
  'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_RELATIONSHIP',
  'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DEFINING_RELATIONSHIP']) 
  <= 2)) )) = 0;

  END_RULE; -- shape_aspect_relationship_subtype_exclusiveness

  RULE shape_aspect_subtype_exclusiveness FOR (shape_aspect);

  WHERE
wr1: SIZEOF(QUERY ( sr <* shape_aspect | (NOT (SIZEOF(TYPEOF(sr) * [
  'DIMENSIONAL_INSPECTION_SCHEMA.PATH_FEATURE_COMPONENT',
  'DIMENSIONAL_INSPECTION_SCHEMA.SLOT_END',
  'DIMENSIONAL_INSPECTION_SCHEMA.POCKET_BOTTOM',
  'DIMENSIONAL_INSPECTION_SCHEMA.PROFILE_FLOOR',
  'DIMENSIONAL_INSPECTION_SCHEMA.RIB_TOP_FLOOR',
  'DIMENSIONAL_INSPECTION_SCHEMA.BOSS_TOP',
  'DIMENSIONAL_INSPECTION_SCHEMA.HOLE_BOTTOM',
  'DIMENSIONAL_INSPECTION_SCHEMA.APPLIED_AREA',
  'DIMENSIONAL_INSPECTION_SCHEMA.TAPER',
  'DIMENSIONAL_INSPECTION_SCHEMA.CHAMFER_OFFSET',
  'DIMENSIONAL_INSPECTION_SCHEMA.CIRCULAR_CLOSED_PROFILE',
  'DIMENSIONAL_INSPECTION_SCHEMA.NGON_CLOSED_PROFILE',
  'DIMENSIONAL_INSPECTION_SCHEMA.CLOSED_PATH_PROFILE',
  'DIMENSIONAL_INSPECTION_SCHEMA.SQUARE_U_PROFILE',
  'DIMENSIONAL_INSPECTION_SCHEMA.LINEAR_PROFILE',
  'DIMENSIONAL_INSPECTION_SCHEMA.TEE_PROFILE',
  'DIMENSIONAL_INSPECTION_SCHEMA.VEE_PROFILE',
  'DIMENSIONAL_INSPECTION_SCHEMA.RECTANGULAR_CLOSED_PROFILE',
  'DIMENSIONAL_INSPECTION_SCHEMA.PARTIAL_CIRCULAR_PROFILE',
  'DIMENSIONAL_INSPECTION_SCHEMA.ROUNDED_U_PROFILE',
  'DIMENSIONAL_INSPECTION_SCHEMA.OPEN_PATH_PROFILE',
  'DIMENSIONAL_INSPECTION_SCHEMA.INSTANCED_FEATURE',
  'DIMENSIONAL_INSPECTION_SCHEMA.REPLICATE_FEATURE',
  'DIMENSIONAL_INSPECTION_SCHEMA.TRANSITION_FEATURE',
  'DIMENSIONAL_INSPECTION_SCHEMA.DATUM',
  'DIMENSIONAL_INSPECTION_SCHEMA.DATUM_FEATURE',
  'DIMENSIONAL_INSPECTION_SCHEMA.DATUM_TARGET']) <= 2)) )) = 0;

  END_RULE; -- shape_aspect_subtype_exclusiveness

  RULE shape_representation_subtype_exclusiveness FOR (
  shape_representation);

  WHERE
wr1: SIZEOF(QUERY ( sr <* shape_representation | (NOT (SIZEOF(TYPEOF(
  sr) * ['DIMENSIONAL_INSPECTION_SCHEMA.ADVANCED_BREP_SHAPE_REPRESENTATION',
  'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_REPRESENTATION_WITH_PARAMETERS',
  'DIMENSIONAL_INSPECTION_SCHEMA.SHAPE_DIMENSION_REPRESENTATION']) 
  <= 2)) )) = 0;

  END_RULE; -- shape_representation_subtype_exclusiveness

  RULE subtype_mandatory_characterized_object FOR (characterized_object);

  WHERE
wr1: SIZEOF(QUERY ( csa <* characterized_object | (NOT (SIZEOF([
  'DIMENSIONAL_INSPECTION_SCHEMA.DM_FEATURE_DEFINITION',
  'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_DEFINITION',
  'DIMENSIONAL_INSPECTION_SCHEMA.FEATURE_COMPONENT_DEFINITION'] 
  * TYPEOF(csa)) = 1)) )) = 0;

  END_RULE; -- subtype_mandatory_characterized_object

  RULE transition_feature_life_cycle FOR (transition_feature);

  WHERE
wr1: SIZEOF(QUERY ( tf <* transition_feature | (NOT (tf.of_shape.
  definition.frame_of_reference.life_cycle_stage = 
  'manufacturing planning')) )) = 0;

  END_RULE; -- transition_feature_life_cycle

  RULE transition_feature_on_part_boundary FOR (transition_feature);

  WHERE
wr1: SIZEOF(QUERY ( tf <* transition_feature | (NOT tf.
  product_definitional) )) = 0;

  END_RULE; -- transition_feature_on_part_boundary

  FUNCTION acyclic_mapped_representation(
    parent_set: SET OF representation;
    children_set: SET OF representation_item
      ): BOOLEAN;

    LOCAL
      x : SET OF representation_item;
      y : SET OF representation_item;
    END_LOCAL;
    x := QUERY ( z <* children_set | (
        'DIMENSIONAL_INSPECTION_SCHEMA.MAPPED_ITEM' IN TYPEOF(z)) );
    IF SIZEOF(x) > 0 THEN
      REPEAT i := 1 TO HIINDEX(x) BY 1;
        IF x[i]\mapped_item.mapping_source.mapped_representation IN 
 parent_set THEN
          RETURN(FALSE);
        END_IF;
        IF NOT acyclic_mapped_representation(parent_set + x[i]\mapped_item
 .mapping_source.mapped_representation,x[i]\mapped_item.
 mapping_source.mapped_representation.items) THEN
          RETURN(FALSE);
        END_IF;
      END_REPEAT;
    END_IF;
    x := children_set - x;
    IF SIZEOF(x) > 0 THEN
      REPEAT i := 1 TO HIINDEX(x) BY 1;
        y := QUERY ( z <* bag_to_set(USEDIN(x[i],'')) | (
 'DIMENSIONAL_INSPECTION_SCHEMA.REPRESENTATION_ITEM' IN TYPEOF(z)) );
        IF NOT acyclic_mapped_representation(parent_set,y) THEN
          RETURN(FALSE);
        END_IF;
      END_REPEAT;
    END_IF;
    RETURN(TRUE);

  END_FUNCTION; -- acyclic_mapped_representation

  FUNCTION associated_surface(
    arg: pcurve_or_surface
      ): surface;

    LOCAL
      surf : surface;
    END_LOCAL;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.PCURVE' IN TYPEOF(arg) THEN
      surf := arg.basis_surface;
    ELSE
      surf := arg;
    END_IF;
    RETURN(surf);

  END_FUNCTION; -- associated_surface

  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) BY 1;
        the_set := the_set + the_bag[i];
      END_REPEAT;
    END_IF;
    RETURN(the_set);

  END_FUNCTION; -- bag_to_set

  FUNCTION base_axis(
    dim: INTEGER;
    axis1, axis2, axis3: direction
      ): LIST [2:3] OF direction;

    LOCAL
      u      : LIST [2:3] OF direction;
      d1     : direction;
      d2     : direction;
      factor : REAL;
    END_LOCAL;
    IF dim = 3 THEN
      d1 := NVL(normalise(axis3),dummy_gri || direction([0,0,1]));
      d2 := first_proj_axis(d1,axis1);
      u := [d2,second_proj_axis(d1,d2,axis2),d1];
    ELSE
      IF EXISTS(axis1) THEN
        d1 := normalise(axis1);
        u := [d1,orthogonal_complement(d1)];
        IF EXISTS(axis2) THEN
          factor := dot_product(axis2,u[2]);
          IF factor < 0 THEN
 u[2].direction_ratios[1] := -u[2].direction_ratios[1];
 u[2].direction_ratios[2] := -u[2].direction_ratios[2];
          END_IF;
        END_IF;
      ELSE
        IF EXISTS(axis2) THEN
          d1 := normalise(axis2);
          u := [orthogonal_complement(d1),d1];
          u[1].direction_ratios[1] := -u[1].direction_ratios[1];
          u[1].direction_ratios[2] := -u[1].direction_ratios[2];
        ELSE
          u := [dummy_gri || direction([1,0]),dummy_gri || direction([0,1])];
        END_IF;
      END_IF;
    END_IF;
    RETURN(u);

  END_FUNCTION; -- base_axis

  FUNCTION boolean_choose(
    b: BOOLEAN;
    choice1, choice2: GENERIC:item
      ): GENERIC:item;
    IF b THEN
      RETURN(choice1);
    ELSE
      RETURN(choice2);
    END_IF;

  END_FUNCTION; -- boolean_choose

  FUNCTION build_2axes(
    ref_direction: direction
      ): LIST [2:2] OF direction;

    LOCAL
      d : direction := NVL(normalise(ref_direction),dummy_gri || 
direction([1,0]));
    END_LOCAL;
    RETURN([d,orthogonal_complement(d)]);

  END_FUNCTION; -- build_2axes

  FUNCTION build_axes(
    axis, ref_direction: direction
      ): LIST [3:3] OF direction;

    LOCAL
      d1 : direction;
      d2 : direction;
    END_LOCAL;
    d1 := NVL(normalise(axis),dummy_gri || direction([0,0,1]));
    d2 := first_proj_axis(d1,ref_direction);
    RETURN([d2,normalise(cross_product(d1,d2)).orientation,d1]);

  END_FUNCTION; -- build_axes

  FUNCTION closed_shell_reversed(
    a_shell: closed_shell
      ): oriented_closed_shell;

    LOCAL
      the_reverse : oriented_closed_shell;
    END_LOCAL;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.ORIENTED_CLOSED_SHELL' IN TYPEOF(
        a_shell) THEN
      the_reverse := ((dummy_tri || connected_face_set(a_shell\
          connected_face_set.cfs_faces)) || closed_shell()) || 
          oriented_closed_shell(a_shell\oriented_closed_shell.
          closed_shell_element,NOT a_shell\oriented_closed_shell.
          orientation);
    ELSE
      the_reverse := ((dummy_tri || connected_face_set(a_shell\
          connected_face_set.cfs_faces)) || closed_shell()) || 
          oriented_closed_shell(a_shell,FALSE);
    END_IF;
    RETURN(the_reverse);

  END_FUNCTION; -- closed_shell_reversed

  FUNCTION conditional_reverse(
    p: BOOLEAN;
    an_item: reversible_topology
      ): reversible_topology;
    IF p THEN
      RETURN(an_item);
    ELSE
      RETURN(topology_reversed(an_item));
    END_IF;

  END_FUNCTION; -- conditional_reverse

  FUNCTION constraints_composite_curve_on_surface(
    c: composite_curve_on_surface
      ): BOOLEAN;

    LOCAL
      n_segments : INTEGER := SIZEOF(c.segments);
    END_LOCAL;
    REPEAT k := 1 TO n_segments BY 1;
      IF ((NOT ('DIMENSIONAL_INSPECTION_SCHEMA.PCURVE' IN TYPEOF(c\
          composite_curve.segments[k].parent_curve))) AND (NOT (
          'DIMENSIONAL_INSPECTION_SCHEMA.SURFACE_CURVE' IN TYPEOF(c\
          composite_curve.segments[k].parent_curve)))) AND (NOT (
          'DIMENSIONAL_INSPECTION_SCHEMA.COMPOSITE_CURVE_ON_SURFACE' IN 
          TYPEOF(c\composite_curve.segments[k].parent_curve))) THEN
        RETURN(FALSE);
      END_IF;
    END_REPEAT;
    RETURN(TRUE);

  END_FUNCTION; -- constraints_composite_curve_on_surface

  FUNCTION constraints_param_b_spline(
    degree, up_knots, up_cp: INTEGER;
    knot_mult: LIST OF INTEGER;
    knots: LIST OF parameter_value
      ): BOOLEAN;

    LOCAL
      k      : INTEGER;
      sum    : INTEGER;
      result : BOOLEAN := TRUE;
    END_LOCAL;
    sum := knot_mult[1];
    REPEAT i := 2 TO up_knots BY 1;
      sum := sum + knot_mult[i];
    END_REPEAT;
    IF (((degree < 1) OR (up_knots < 2)) OR (up_cp < degree)) OR (sum <> (
        (degree + up_cp) + 2)) THEN
      result := FALSE;
      RETURN(result);
    END_IF;
    k := knot_mult[1];
    IF (k < 1) OR (k > (degree + 1)) THEN
      result := FALSE;
      RETURN(result);
    END_IF;
    REPEAT i := 2 TO up_knots BY 1;
      IF (knot_mult[i] < 1) OR (knots[i] <= knots[i - 1]) THEN
        result := FALSE;
        RETURN(result);
      END_IF;
      k := knot_mult[i];
      IF (i < up_knots) AND (k > degree) THEN
        result := FALSE;
        RETURN(result);
      END_IF;
      IF (i = up_knots) AND (k > (degree + 1)) THEN
        result := FALSE;
        RETURN(result);
      END_IF;
    END_REPEAT;
    RETURN(result);

  END_FUNCTION; -- constraints_param_b_spline

  FUNCTION cross_product(
    arg1, arg2: direction
      ): vector;

    LOCAL
      v2     : LIST [3:3] OF REAL;
      v1     : LIST [3:3] OF REAL;
      mag    : REAL;
      res    : direction;
      result : vector;
    END_LOCAL;
    IF ((NOT EXISTS(arg1)) OR (arg1.dim = 2)) OR ((NOT EXISTS(arg2)) OR (
        arg2.dim = 2)) THEN
      RETURN(?);
    ELSE
      BEGIN
        v1 := normalise(arg1).direction_ratios;
        v2 := normalise(arg2).direction_ratios;
        res := dummy_gri || direction([(v1[2] * v2[3]) - (v1[3] * v2[2]),(
 v1[3] * v2[1]) - (v1[1] * v2[3]),(v1[1] * v2[2]) - (v1[2] * v2[
 1])]);
        mag := 0;
        REPEAT i := 1 TO 3 BY 1;
          mag := mag + (res.direction_ratios[i] * res.direction_ratios[i]);
        END_REPEAT;
        IF mag > 0 THEN
          result := dummy_gri || vector(res,SQRT(mag));
        ELSE
          result := dummy_gri || vector(arg1,0);
        END_IF;
        RETURN(result);
      END;
    END_IF;

  END_FUNCTION; -- cross_product

  FUNCTION curve_weights_positive(
    b: rational_b_spline_curve
      ): BOOLEAN;

    LOCAL
      result : BOOLEAN := TRUE;
    END_LOCAL;
    REPEAT i := 0 TO b.upper_index_on_control_points BY 1;
      IF b.weights[i] <= 0 THEN
        result := FALSE;
        RETURN(result);
      END_IF;
    END_REPEAT;
    RETURN(result);

  END_FUNCTION; -- curve_weights_positive

  FUNCTION derive_dimensional_exponents(
    x: unit
      ): dimensional_exponents;

    LOCAL
      result : dimensional_exponents := dimensional_exponents(0,0,0,0,0,0,
     0);
    END_LOCAL;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.DERIVED_UNIT' IN TYPEOF(x) THEN
      REPEAT i := LOINDEX(x.elements) TO HIINDEX(x.elements) BY 1;
        result.length_exponent := result.length_exponent + (x.elements[i].
        exponent * x.elements[i].unit.dimensions.length_exponent);
        result.mass_exponent := result.mass_exponent + (x.elements[i].
        exponent * x.elements[i].unit.dimensions.mass_exponent);
        result.time_exponent := result.time_exponent + (x.elements[i].
        exponent * x.elements[i].unit.dimensions.time_exponent);
        result.electric_current_exponent := result.
        electric_current_exponent + (x.elements[i].exponent * x.
        elements[i].unit.dimensions.electric_current_exponent);
        result.thermodynamic_temperature_exponent := result.
        thermodynamic_temperature_exponent + (x.elements[i].exponent * 
        x.elements[i].unit.dimensions.
        thermodynamic_temperature_exponent);
        result.amount_of_substance_exponent := result.
        amount_of_substance_exponent + (x.elements[i].exponent * x.
        elements[i].unit.dimensions.amount_of_substance_exponent);
        result.luminous_intensity_exponent := result.
        luminous_intensity_exponent + (x.elements[i].exponent * x.
        elements[i].unit.dimensions.luminous_intensity_exponent);
      END_REPEAT;
    ELSE
      result := x.dimensions;
    END_IF;
    RETURN(result);

  END_FUNCTION; -- derive_dimensional_exponents

  FUNCTION dimension_of(
    item: geometric_representation_item
      ): dimension_count;

    LOCAL
      x   : SET OF representation;
      y   : representation_context;
      dim : dimension_count;
    END_LOCAL;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.CARTESIAN_POINT' IN TYPEOF(item)
         THEN
      dim := SIZEOF(item\cartesian_point.coordinates);
      RETURN(dim);
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.DIRECTION' IN TYPEOF(item) THEN
      dim := SIZEOF(item\direction.direction_ratios);
      RETURN(dim);
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.VECTOR' IN TYPEOF(item) THEN
      dim := SIZEOF(item\vector.orientation\direction.direction_ratios);
      RETURN(dim);
    END_IF;
    x := using_representations(item);
    y := x[1].context_of_items;
    dim := y\geometric_representation_context.coordinate_space_dimension;
    RETURN(dim);

  END_FUNCTION; -- dimension_of

  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));
      gram          :         RETURN(dimensional_exponents(0,1,0,0,0,0,0));
      second        :         RETURN(dimensional_exponents(0,0,1,0,0,0,0));
      ampere        :         RETURN(dimensional_exponents(0,0,0,1,0,0,0));
      kelvin        :         RETURN(dimensional_exponents(0,0,0,0,1,0,0));
      mole          :         RETURN(dimensional_exponents(0,0,0,0,0,1,0));
      candela       :         RETURN(dimensional_exponents(0,0,0,0,0,0,1));
      radian        :         RETURN(dimensional_exponents(0,0,0,0,0,0,0));
      steradian     :         RETURN(dimensional_exponents(0,0,0,0,0,0,0));
      hertz         :         RETURN(dimensional_exponents(0,0,-1,0,0,0,0));
      newton        :         RETURN(dimensional_exponents(1,1,-2,0,0,0,0));
      pascal        :         RETURN(dimensional_exponents(-1,1,-2,0,0,0,0));
      joule         :         RETURN(dimensional_exponents(2,1,-2,0,0,0,0));
      watt          :         RETURN(dimensional_exponents(2,1,-3,0,0,0,0));
      coulomb       :         RETURN(dimensional_exponents(0,0,1,1,0,0,0));
      volt          :         RETURN(dimensional_exponents(2,1,-3,-1,0,0,0));
      farad         :         RETURN(dimensional_exponents(-2,-1,4,1,0,0,0));
      ohm:                    RETURN(dimensional_exponents(2,1,-3,-2,0,0,0));
      siemens       :         RETURN(dimensional_exponents(-2,-1,3,2,0,0,0));
      weber         :         RETURN(dimensional_exponents(2,1,-2,-1,0,0,0));
      tesla         :         RETURN(dimensional_exponents(0,1,-2,-1,0,0,0));
      henry         :         RETURN(dimensional_exponents(2,1,-2,-2,0,0,0));
      degree_celsius  :       RETURN(dimensional_exponents(0,0,0,0,1,0,0));
      lumen         :         RETURN(dimensional_exponents(0,0,0,0,0,0,1));
      lux:                    RETURN(dimensional_exponents(-2,0,0,0,0,0,1));
      becquerel     :         RETURN(dimensional_exponents(0,0,-1,0,0,0,0));
      gray          :         RETURN(dimensional_exponents(2,0,-2,0,0,0,0));
      sievert       :         RETURN(dimensional_exponents(2,0,-2,0,0,0,0));
      END_CASE;

  END_FUNCTION; -- dimensions_for_si_unit

  FUNCTION dot_product(
    arg1, arg2: direction
      ): REAL;

    LOCAL
      ndim   : INTEGER;
      scalar : REAL;
      vec1   : direction;
      vec2   : direction;
    END_LOCAL;
    IF (NOT EXISTS(arg1)) OR (NOT EXISTS(arg2)) THEN
      scalar := ?;
    ELSE
      IF arg1.dim <> arg2.dim THEN
        scalar := ?;
      ELSE
        BEGIN
          vec1 := normalise(arg1);
          vec2 := normalise(arg2);
          ndim := arg1.dim;
          scalar := 0;
          REPEAT i := 1 TO ndim BY 1;
 scalar := scalar + (vec1.direction_ratios[i] * vec2.
     direction_ratios[i]);
          END_REPEAT;
        END;
      END_IF;
    END_IF;
    RETURN(scalar);

  END_FUNCTION; -- dot_product

  FUNCTION edge_reversed(
    an_edge: edge
      ): oriented_edge;

    LOCAL
      the_reverse : oriented_edge;
    END_LOCAL;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.ORIENTED_EDGE' IN TYPEOF(an_edge)
         THEN
      the_reverse := (dummy_tri || edge(an_edge.edge_end,an_edge.
          edge_start)) || oriented_edge(an_edge\oriented_edge.edge_element,
          NOT an_edge\oriented_edge.orientation);
    ELSE
      the_reverse := (dummy_tri || edge(an_edge.edge_end,an_edge.
          edge_start)) || oriented_edge(an_edge,FALSE);
    END_IF;
    RETURN(the_reverse);

  END_FUNCTION; -- edge_reversed

  FUNCTION face_bound_reversed(
    a_face_bound: face_bound
      ): face_bound;

    LOCAL
      the_reverse : face_bound;
    END_LOCAL;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.FACE_OUTER_BOUND' IN TYPEOF(
        a_face_bound) THEN
      the_reverse := (dummy_tri || face_bound(a_face_bound\face_bound.
          bound,NOT a_face_bound\face_bound.orientation)) || 
          face_outer_bound();
    ELSE
      the_reverse := dummy_tri || face_bound(a_face_bound.bound,NOT 
          a_face_bound.orientation);
    END_IF;
    RETURN(the_reverse);

  END_FUNCTION; -- face_bound_reversed

  FUNCTION face_reversed(
    a_face: face
      ): oriented_face;

    LOCAL
      the_reverse : oriented_face;
    END_LOCAL;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.ORIENTED_FACE' IN TYPEOF(a_face)
         THEN
      the_reverse := (dummy_tri || face(set_of_topology_reversed(a_face.
          bounds))) || oriented_face(a_face\oriented_face.face_element,NOT 
          a_face\oriented_face.orientation);
    ELSE
      the_reverse := (dummy_tri || face(set_of_topology_reversed(a_face.
          bounds))) || oriented_face(a_face,FALSE);
    END_IF;
    RETURN(the_reverse);

  END_FUNCTION; -- face_reversed

  FUNCTION first_proj_axis(
    z_axis, arg: direction
      ): direction;

    LOCAL
      x_vec  : vector;
      v      : direction;
      z      : direction;
      x_axis : direction;
    END_LOCAL;
    IF NOT EXISTS(z_axis) THEN
      RETURN(?);
    ELSE
      z := normalise(z_axis);
      IF NOT EXISTS(arg) THEN
        IF z.direction_ratios <> [1,0,0] THEN
          v := dummy_gri || direction([1,0,0]);
        ELSE
          v := dummy_gri || direction([0,1,0]);
        END_IF;
      ELSE
        IF arg.dim <> 3 THEN
          RETURN(?);
        END_IF;
        IF cross_product(arg,z).magnitude = 0 THEN
          RETURN(?);
        ELSE
          v := normalise(arg);
        END_IF;
      END_IF;
      x_vec := scalar_times_vector(dot_product(v,z),z);
      x_axis := vector_difference(v,x_vec).orientation;
      x_axis := normalise(x_axis);
    END_IF;
    RETURN(x_axis);

  END_FUNCTION; -- first_proj_axis

  FUNCTION get_basis_surface(
    c: curve_on_surface
      ): SET [0:2] OF surface;

    LOCAL
      surfs : SET [0:2] OF surface;
      n     : INTEGER;
    END_LOCAL;
    surfs := [];
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.PCURVE' IN TYPEOF(c) THEN
      surfs := [c\pcurve.basis_surface];
    ELSE
      IF 'DIMENSIONAL_INSPECTION_SCHEMA.SURFACE_CURVE' IN TYPEOF(c) THEN
        n := SIZEOF(c\surface_curve.associated_geometry);
        REPEAT i := 1 TO n BY 1;
          surfs := surfs + associated_surface(c\surface_curve.
   associated_geometry[i]);
        END_REPEAT;
      END_IF;
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.COMPOSITE_CURVE_ON_SURFACE' IN 
        TYPEOF(c) THEN
      n := SIZEOF(c\composite_curve.segments);
      surfs := get_basis_surface(c\composite_curve.segments[1].
          parent_curve);
      IF n > 1 THEN
        REPEAT i := 2 TO n BY 1;
          surfs := surfs * get_basis_surface(c\composite_curve.segments[i]
   .parent_curve);
        END_REPEAT;
      END_IF;
    END_IF;
    RETURN(surfs);

  END_FUNCTION; -- get_basis_surface

  FUNCTION get_description_value(
    obj: description_attribute_select
      ): text;

    LOCAL
      description_bag : BAG OF description_attribute := USEDIN(obj,(
   'DIMENSIONAL_INSPECTION_SCHEMA.' + 
   'DESCRIPTION_ATTRIBUTE.') + 'DESCRIBED_ITEM');
    END_LOCAL;
    IF SIZEOF(description_bag) = 1 THEN
      RETURN(description_bag[1].attribute_value);
    ELSE
      RETURN(?);
    END_IF;

  END_FUNCTION; -- get_description_value

  FUNCTION get_id_value(
    obj: id_attribute_select
      ): identifier;

    LOCAL
      id_bag : BAG OF id_attribute := USEDIN(obj,(
     'DIMENSIONAL_INSPECTION_SCHEMA.' + 'ID_ATTRIBUTE.') + 
     'IDENTIFIED_ITEM');
    END_LOCAL;
    IF SIZEOF(id_bag) = 1 THEN
      RETURN(id_bag[1].attribute_value);
    ELSE
      RETURN(?);
    END_IF;

  END_FUNCTION; -- get_id_value

  FUNCTION get_name_value(
    obj: name_attribute_select
      ): label;

    LOCAL
      name_bag : BAG OF name_attribute := USEDIN(obj,(
       'DIMENSIONAL_INSPECTION_SCHEMA.' + 'NAME_ATTRIBUTE.') + 
       'NAMED_ITEM');
    END_LOCAL;
    IF SIZEOF(name_bag) = 1 THEN
      RETURN(name_bag[1].attribute_value);
    ELSE
      RETURN(?);
    END_IF;

  END_FUNCTION; -- get_name_value

  FUNCTION get_property_definition_representations(
    c_def_instance: characterized_definition
      ): SET OF property_definition_representation;

    LOCAL
      pdr_set : SET OF property_definition_representation := [];
      pd_set  : SET OF property_definition := [];
    END_LOCAL;
    pd_set := bag_to_set(USEDIN(c_def_instance,
        'DIMENSIONAL_INSPECTION_SCHEMA.PROPERTY_DEFINITION.DEFINITION'));
    IF SIZEOF(pd_set) < 1 THEN
      RETURN(pdr_set);
    END_IF;
    REPEAT i := 1 TO HIINDEX(pd_set) BY 1;
      pdr_set := pdr_set + bag_to_set(USEDIN(pd_set[i],
      'DIMENSIONAL_INSPECTION_SCHEMA.'+
      'PROPERTY_DEFINITION_REPRESENTATION.DEFINITION'));
    END_REPEAT;
    RETURN(pdr_set);

  END_FUNCTION; -- get_property_definition_representations

  FUNCTION get_role(
    obj: role_select
      ): object_role;

    LOCAL
      role_bag : BAG OF role_association := USEDIN(obj,(
       'DIMENSIONAL_INSPECTION_SCHEMA.' + 'ROLE_ASSOCIATION.') +
        'ITEM_WITH_ROLE');
    END_LOCAL;
    IF SIZEOF(role_bag) = 1 THEN
      RETURN(role_bag[1].role);
    ELSE
      RETURN(?);
    END_IF;

  END_FUNCTION; -- get_role

  FUNCTION item_in_context(
    item: representation_item;
    cntxt: representation_context
      ): BOOLEAN;

    LOCAL
      y : BAG OF representation_item;
    END_LOCAL;
    IF SIZEOF(USEDIN(item,
        'DIMENSIONAL_INSPECTION_SCHEMA.REPRESENTATION.ITEMS') * 
        cntxt.representations_in_context) > 0 THEN
      RETURN(TRUE);
    ELSE
      y := QUERY ( z <* USEDIN(item,'') | (
          'DIMENSIONAL_INSPECTION_SCHEMA.REPRESENTATION_ITEM' 
          IN TYPEOF(z)) );
      IF SIZEOF(y) > 0 THEN
        REPEAT i := 1 TO HIINDEX(y) BY 1;
          IF item_in_context(y[i],cntxt) THEN
 RETURN(TRUE);
          END_IF;
        END_REPEAT;
      END_IF;
    END_IF;
    RETURN(FALSE);

  END_FUNCTION; -- item_in_context

  FUNCTION leap_year(
    year: year_number
      ): BOOLEAN;
    IF (((year MOD 4) = 0) AND ((year MOD 100) <> 0)) OR ((year MOD 400) =
         0) THEN
      RETURN(TRUE);
    ELSE
      RETURN(FALSE);
    END_IF;

  END_FUNCTION; -- leap_year

  FUNCTION list_face_loops(
    f: face
      ): LIST [0:?] OF loop;

    LOCAL
      loops : LIST [0:?] OF loop := [];
    END_LOCAL;
    REPEAT i := 1 TO SIZEOF(f.bounds) BY 1;
      loops := loops + f.bounds[i].bound;
    END_REPEAT;
    RETURN(loops);

  END_FUNCTION; -- list_face_loops

  FUNCTION list_of_topology_reversed(
    a_list: list_of_reversible_topology_item
      ): list_of_reversible_topology_item;

    LOCAL
      the_reverse : list_of_reversible_topology_item;
    END_LOCAL;
    the_reverse := [];
    REPEAT i := 1 TO SIZEOF(a_list) BY 1;
      the_reverse := topology_reversed(a_list[i]) + the_reverse;
    END_REPEAT;
    RETURN(the_reverse);

  END_FUNCTION; -- list_of_topology_reversed

  FUNCTION list_to_array(
    lis: LIST [0:?] OF GENERIC:t;
    low, u: INTEGER
      ): ARRAY OF GENERIC:t;

    LOCAL
      n   : INTEGER;
      res : ARRAY [low:u] OF GENERIC:t;
    END_LOCAL;
    n := SIZEOF(lis);
    IF n <> ((u - low) + 1) THEN
      RETURN(?);
    ELSE
      res := [lis[1],n];
      REPEAT i := 2 TO n BY 1;
        res[(low + i) - 1] := lis[i];
      END_REPEAT;
      RETURN(res);
    END_IF;

  END_FUNCTION; -- list_to_array

  FUNCTION list_to_set(
    l: LIST [0:?] OF GENERIC:t
      ): SET OF GENERIC:t;

    LOCAL
      s : SET OF GENERIC:t := [];
    END_LOCAL;
    REPEAT i := 1 TO SIZEOF(l) BY 1;
      s := s + l[i];
    END_REPEAT;
    RETURN(s);

  END_FUNCTION; -- list_to_set

  FUNCTION make_array_of_array(
    lis: LIST [1:?] OF LIST [1:?] OF GENERIC:t;
    low1, u1, low2, u2: INTEGER
      ): ARRAY OF ARRAY OF GENERIC:t;

    LOCAL
      res : ARRAY [low1:u1] OF ARRAY [low2:u2] OF GENERIC:t;
    END_LOCAL;
    IF ((u1 - low1) + 1) <> SIZEOF(lis) THEN
      RETURN(?);
    END_IF;
    IF ((u2 - low2) + 1) <> SIZEOF(lis[1]) THEN
      RETURN(?);
    END_IF;
    res := [list_to_array(lis[1],low2,u2),(u1 - low1) + 1];
    REPEAT i := 2 TO HIINDEX(lis) BY 1;
      IF ((u2 - low2) + 1) <> SIZEOF(lis[i]) THEN
        RETURN(?);
      END_IF;
      res[(low1 + i) - 1] := list_to_array(lis[i],low2,u2);
    END_REPEAT;
    RETURN(res);

  END_FUNCTION; -- make_array_of_array

  FUNCTION mixed_loop_type_set(
    l: SET [0:?] OF loop
      ): LOGICAL;

    LOCAL
      poly_loop_type : LOGICAL;
    END_LOCAL;
    IF SIZEOF(l) <= 1 THEN
      RETURN(FALSE);
    END_IF;
    poly_loop_type := 'DIMENSIONAL_INSPECTION_SCHEMA.POLY_LOOP' 
         IN TYPEOF(l[1]);
    REPEAT i := 2 TO SIZEOF(l) BY 1;
      IF ('DIMENSIONAL_INSPECTION_SCHEMA.POLY_LOOP' IN TYPEOF(l[i])) <> 
          poly_loop_type THEN
        RETURN(TRUE);
      END_IF;
    END_REPEAT;
    RETURN(FALSE);

  END_FUNCTION; -- mixed_loop_type_set

  FUNCTION msb_shells(
    brep: manifold_solid_brep
      ): SET [1:?] OF closed_shell;
    IF SIZEOF(QUERY ( msbtype <* TYPEOF(brep) | (msbtype LIKE 
        '*BREP_WITH_VOIDS') )) >= 1 THEN
      RETURN(brep\brep_with_voids.voids + brep.outer);
    ELSE
      RETURN([brep.outer]);
    END_IF;

  END_FUNCTION; -- msb_shells

  FUNCTION normalise(
    arg: vector_or_direction
      ): vector_or_direction;

    LOCAL
      ndim   : INTEGER;
      v      : direction;
      vec    : vector;
      mag    : REAL;
      result : vector_or_direction;
    END_LOCAL;
    IF NOT EXISTS(arg) THEN
      result := ?;
    ELSE
      ndim := arg.dim;
      IF 'DIMENSIONAL_INSPECTION_SCHEMA.VECTOR' IN TYPEOF(arg) THEN
        BEGIN
          v := dummy_gri || direction(arg.orientation.direction_ratios);
          IF arg.magnitude = 0 THEN
 RETURN(?);
          ELSE
 vec := dummy_gri || vector(v,1);
          END_IF;
        END;
      ELSE
        v := dummy_gri || direction(arg.direction_ratios);
      END_IF;
      mag := 0;
      REPEAT i := 1 TO ndim BY 1;
        mag := mag + (v.direction_ratios[i] * v.direction_ratios[i]);
      END_REPEAT;
      IF mag > 0 THEN
        mag := SQRT(mag);
        REPEAT i := 1 TO ndim BY 1;
          v.direction_ratios[i] := v.direction_ratios[i] / mag;
        END_REPEAT;
        IF 'DIMENSIONAL_INSPECTION_SCHEMA.VECTOR' IN TYPEOF(arg) THEN
          vec.orientation := v;
          result := vec;
        ELSE
          result := v;
        END_IF;
      ELSE
        RETURN(?);
      END_IF;
    END_IF;
    RETURN(result);

  END_FUNCTION; -- normalise

  FUNCTION open_shell_reversed(
    a_shell: open_shell
      ): oriented_open_shell;

    LOCAL
      the_reverse : oriented_open_shell;
    END_LOCAL;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.ORIENTED_OPEN_SHELL' IN TYPEOF(
        a_shell) THEN
      the_reverse := ((dummy_tri || connected_face_set(a_shell\
          connected_face_set.cfs_faces)) || open_shell()) || 
          oriented_open_shell(a_shell\oriented_open_shell.
          open_shell_element,NOT a_shell\oriented_open_shell.orientation);
    ELSE
      the_reverse := ((dummy_tri || connected_face_set(a_shell\
          connected_face_set.cfs_faces)) || open_shell()) || 
          oriented_open_shell(a_shell,FALSE);
    END_IF;
    RETURN(the_reverse);

  END_FUNCTION; -- open_shell_reversed

  FUNCTION orthogonal_complement(
    vec: direction
      ): direction;

    LOCAL
      result : direction;
    END_LOCAL;
    IF (vec.dim <> 2) OR (NOT EXISTS(vec)) THEN
      RETURN(?);
    ELSE
      result := dummy_gri || direction([-vec.direction_ratios[2],vec.
          direction_ratios[1]]);
      RETURN(result);
    END_IF;

  END_FUNCTION; -- orthogonal_complement

  FUNCTION path_head_to_tail(
    a_path: path
      ): BOOLEAN;

    LOCAL
      n : INTEGER;
      p : BOOLEAN := TRUE;
    END_LOCAL;
    n := SIZEOF(a_path.edge_list);
    REPEAT i := 2 TO n BY 1;
      p := p AND (a_path.edge_list[i - 1].edge_end :=: a_path.edge_list[i]
          .edge_start);
    END_REPEAT;
    RETURN(p);

  END_FUNCTION; -- path_head_to_tail

  FUNCTION path_reversed(
    a_path: path
      ): oriented_path;

    LOCAL
      the_reverse : oriented_path;
    END_LOCAL;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.ORIENTED_PATH' IN TYPEOF(a_path)
         THEN
      the_reverse := (dummy_tri || path(list_of_topology_reversed(a_path.
          edge_list))) || oriented_path(a_path\oriented_path.path_element,
          NOT a_path\oriented_path.orientation);
    ELSE
      the_reverse := (dummy_tri || path(list_of_topology_reversed(a_path.
          edge_list))) || oriented_path(a_path,FALSE);
    END_IF;
    RETURN(the_reverse);

  END_FUNCTION; -- path_reversed

  FUNCTION scalar_times_vector(
    scalar: REAL;
    vec: vector_or_direction
      ): vector;

    LOCAL
      v      : direction;
      mag    : REAL;
      result : vector;
    END_LOCAL;
    IF (NOT EXISTS(scalar)) OR (NOT EXISTS(vec)) THEN
      RETURN(?);
    ELSE
      IF 'DIMENSIONAL_INSPECTION_SCHEMA.VECTOR' IN TYPEOF(vec) THEN
        v := dummy_gri || direction(vec.orientation.direction_ratios);
        mag := scalar * vec.magnitude;
      ELSE
        v := dummy_gri || direction(vec.direction_ratios);
        mag := scalar;
      END_IF;
      IF mag < 0 THEN
        REPEAT i := 1 TO SIZEOF(v.direction_ratios) BY 1;
          v.direction_ratios[i] := -v.direction_ratios[i];
        END_REPEAT;
        mag := -mag;
      END_IF;
      result := dummy_gri || vector(normalise(v),mag);
    END_IF;
    RETURN(result);

  END_FUNCTION; -- scalar_times_vector

  FUNCTION second_proj_axis(
    z_axis, x_axis, arg: direction
      ): direction;

    LOCAL
      temp   : vector;
      v      : direction;
      y_axis : vector;
    END_LOCAL;
    IF NOT EXISTS(arg) THEN
      v := dummy_gri || direction([0,1,0]);
    ELSE
      v := arg;
    END_IF;
    temp := scalar_times_vector(dot_product(v,z_axis),z_axis);
    y_axis := vector_difference(v,temp);
    temp := scalar_times_vector(dot_product(v,x_axis),x_axis);
    y_axis := vector_difference(y_axis,temp);
    y_axis := normalise(y_axis);
    RETURN(y_axis.orientation);

  END_FUNCTION; -- second_proj_axis

  FUNCTION set_of_topology_reversed(
    a_set: set_of_reversible_topology_item
      ): set_of_reversible_topology_item;

    LOCAL
      the_reverse : set_of_reversible_topology_item;
    END_LOCAL;
    the_reverse := [];
    REPEAT i := 1 TO SIZEOF(a_set) BY 1;
      the_reverse := the_reverse + topology_reversed(a_set[i]);
    END_REPEAT;
    RETURN(the_reverse);

  END_FUNCTION; -- set_of_topology_reversed

  FUNCTION shell_reversed(
    a_shell: shell
      ): shell;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.OPEN_SHELL' IN TYPEOF(a_shell) THEN
      RETURN(open_shell_reversed(a_shell));
    ELSE
      IF 'DIMENSIONAL_INSPECTION_SCHEMA.CLOSED_SHELL' IN TYPEOF(a_shell)
THEN
        RETURN(closed_shell_reversed(a_shell));
      ELSE
        RETURN(?);
      END_IF;
    END_IF;

  END_FUNCTION; -- shell_reversed

  FUNCTION surface_weights_positive(
    b: rational_b_spline_surface
      ): BOOLEAN;

    LOCAL
      result : BOOLEAN := TRUE;
    END_LOCAL;
    REPEAT i := 0 TO b.u_upper BY 1;
      REPEAT j := 0 TO b.v_upper BY 1;
        IF b.weights[i][j] <= 0 THEN
          result := FALSE;
          RETURN(result);
        END_IF;
      END_REPEAT;
    END_REPEAT;
    RETURN(result);

  END_FUNCTION; -- surface_weights_positive

  FUNCTION topology_reversed(
    an_item: reversible_topology
      ): reversible_topology;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.EDGE' IN TYPEOF(an_item) THEN
      RETURN(edge_reversed(an_item));
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.PATH' IN TYPEOF(an_item) THEN
      RETURN(path_reversed(an_item));
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.FACE_BOUND' IN TYPEOF(an_item) THEN
      RETURN(face_bound_reversed(an_item));
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.FACE' IN TYPEOF(an_item) THEN
      RETURN(face_reversed(an_item));
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.SHELL' IN TYPEOF(an_item) THEN
      RETURN(shell_reversed(an_item));
    END_IF;
    IF 'SET' IN TYPEOF(an_item) THEN
      RETURN(set_of_topology_reversed(an_item));
    END_IF;
    IF 'LIST' IN TYPEOF(an_item) THEN
      RETURN(list_of_topology_reversed(an_item));
    END_IF;
    RETURN(?);

  END_FUNCTION; -- topology_reversed

  FUNCTION using_items(
    item: founded_item_select;
    checked_items: SET OF founded_item_select
      ): SET OF founded_item_select;

    LOCAL
      next_items      : SET OF founded_item_select;
      new_check_items : SET OF founded_item_select;
      result_items    : SET OF founded_item_select;
    END_LOCAL;
    result_items := [];
    new_check_items := checked_items + item;
    next_items := QUERY ( z <* bag_to_set(USEDIN(item,'')) | ((
        'DIMENSIONAL_INSPECTION_SCHEMA.REPRESENTATION_ITEM' IN TYPEOF(z)) 
        OR ('DIMENSIONAL_INSPECTION_SCHEMA.FOUNDED_ITEM' IN TYPEOF(z))) );
    IF SIZEOF(next_items) > 0 THEN
      REPEAT i := 1 TO HIINDEX(next_items) BY 1;
        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(result_items);

  END_FUNCTION; -- using_items

  FUNCTION using_representations(
    item: founded_item_select
      ): SET OF representation;

    LOCAL
      results : SET OF representation;
      intermediate_items : SET OF founded_item_select;
      result_bag         : BAG OF representation;
    END_LOCAL;
    results := [];
    result_bag := USEDIN(item,
        'DIMENSIONAL_INSPECTION_SCHEMA.REPRESENTATION.ITEMS');
    IF SIZEOF(result_bag) > 0 THEN
      REPEAT i := 1 TO HIINDEX(result_bag) BY 1;
        results := results + result_bag[i];
      END_REPEAT;
    END_IF;
    intermediate_items := using_items(item,[]);
    IF SIZEOF(intermediate_items) > 0 THEN
      REPEAT i := 1 TO HIINDEX(intermediate_items) BY 1;
        result_bag := USEDIN(intermediate_items[i],
 'DIMENSIONAL_INSPECTION_SCHEMA.REPRESENTATION.ITEMS');
        IF SIZEOF(result_bag) > 0 THEN
          REPEAT j := 1 TO HIINDEX(result_bag) BY 1;
 results := results + result_bag[j];
          END_REPEAT;
        END_IF;
      END_REPEAT;
    END_IF;
    RETURN(results);

  END_FUNCTION; -- using_representations

  FUNCTION valid_calendar_date(
    date: calendar_date
      ): LOGICAL;
    CASE date.month_component OF
      1 :         RETURN((1 <= date.day_component) AND (date.day_component 
 <= 31));
      2 :         BEGIN
          IF leap_year(date.year_component) THEN
 RETURN((1 <= date.day_component) AND (date.day_component <= 29));
          ELSE
 RETURN((1 <= date.day_component) AND (date.day_component <= 28));
          END_IF;
        END;
      3 :         RETURN((1 <= date.day_component) AND (date.day_component 
 <= 31));
      4 :         RETURN((1 <= date.day_component) AND (date.day_component 
 <= 30));
      5 :         RETURN((1 <= date.day_component) AND (date.day_component 
 <= 31));
      6 :         RETURN((1 <= date.day_component) AND (date.day_component 
 <= 30));
      7 :         RETURN((1 <= date.day_component) AND (date.day_component 
 <= 31));
      8 :         RETURN((1 <= date.day_component) AND (date.day_component 
 <= 31));
      9 :         RETURN((1 <= date.day_component) AND (date.day_component 
 <= 30));
      10  :         RETURN((1 <= date.day_component) AND (date.
 day_component <= 31));
      11  :         RETURN((1 <= date.day_component) AND (date.
 day_component <= 30));
      12  :         RETURN((1 <= date.day_component) AND (date.
 day_component <= 31));
      END_CASE;
    RETURN(FALSE);

  END_FUNCTION; -- valid_calendar_date

  FUNCTION valid_measure_value(
    m: measure_value
      ): BOOLEAN;
    IF 'REAL' IN TYPEOF(m) THEN
      RETURN(m > 0);
    ELSE
      IF 'INTEGER' IN TYPEOF(m) THEN
        RETURN(m > 0);
      ELSE
        RETURN(TRUE);
      END_IF;
    END_IF;

  END_FUNCTION; -- valid_measure_value

  FUNCTION valid_time(
    time: local_time
      ): BOOLEAN;
    IF EXISTS(time.second_component) THEN
      RETURN(EXISTS(time.minute_component));
    ELSE
      RETURN(TRUE);
    END_IF;

  END_FUNCTION; -- valid_time

  FUNCTION valid_units(
    m: measure_with_unit
      ): BOOLEAN;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.LENGTH_MEASURE' IN TYPEOF(m.
        value_component) THEN
      IF derive_dimensional_exponents(m.unit_component) <> 
          dimensional_exponents(1,0,0,0,0,0,0) THEN
        RETURN(FALSE);
      END_IF;
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.MASS_MEASURE' IN TYPEOF(m.
        value_component) THEN
      IF derive_dimensional_exponents(m.unit_component) <> 
          dimensional_exponents(0,1,0,0,0,0,0) THEN
        RETURN(FALSE);
      END_IF;
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.TIME_MEASURE' IN TYPEOF(m.
        value_component) THEN
      IF derive_dimensional_exponents(m.unit_component) <> 
          dimensional_exponents(0,0,1,0,0,0,0) THEN
        RETURN(FALSE);
      END_IF;
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.ELECTRIC_CURRENT_MEASURE' IN TYPEOF(
        m.value_component) THEN
      IF derive_dimensional_exponents(m.unit_component) <> 
          dimensional_exponents(0,0,0,1,0,0,0) THEN
        RETURN(FALSE);
      END_IF;
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.THERMODYNAMIC_TEMPERATURE_MEASURE' 
        IN TYPEOF(m.value_component) THEN
      IF derive_dimensional_exponents(m.unit_component) <> 
          dimensional_exponents(0,0,0,0,1,0,0) THEN
        RETURN(FALSE);
      END_IF;
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.CELSIUS_TEMPERATURE_MEASURE' IN 
        TYPEOF(m.value_component) THEN
      IF derive_dimensional_exponents(m.unit_component) <> 
          dimensional_exponents(0,0,0,0,1,0,0) THEN
        RETURN(FALSE);
      END_IF;
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.AMOUNT_OF_SUBSTANCE_MEASURE' IN 
        TYPEOF(m.value_component) THEN
      IF derive_dimensional_exponents(m.unit_component) <> 
          dimensional_exponents(0,0,0,0,0,1,0) THEN
        RETURN(FALSE);
      END_IF;
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.LUMINOUS_INTENSITY_MEASURE' IN 
        TYPEOF(m.value_component) THEN
      IF derive_dimensional_exponents(m.unit_component) <> 
          dimensional_exponents(0,0,0,0,0,0,1) THEN
        RETURN(FALSE);
      END_IF;
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.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) THEN
        RETURN(FALSE);
      END_IF;
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.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) THEN
        RETURN(FALSE);
      END_IF;
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.AREA_MEASURE' IN TYPEOF(m.
        value_component) THEN
      IF derive_dimensional_exponents(m.unit_component) <> 
          dimensional_exponents(2,0,0,0,0,0,0) THEN
        RETURN(FALSE);
      END_IF;
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.VOLUME_MEASURE' IN TYPEOF(m.
        value_component) THEN
      IF derive_dimensional_exponents(m.unit_component) <> 
          dimensional_exponents(3,0,0,0,0,0,0) THEN
        RETURN(FALSE);
      END_IF;
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.RATIO_MEASURE' IN TYPEOF(m.
        value_component) THEN
      IF derive_dimensional_exponents(m.unit_component) <> 
          dimensional_exponents(0,0,0,0,0,0,0) THEN
        RETURN(FALSE);
      END_IF;
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.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) THEN
        RETURN(FALSE);
      END_IF;
    END_IF;
    IF 'DIMENSIONAL_INSPECTION_SCHEMA.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) THEN
        RETURN(FALSE);
      END_IF;
    END_IF;
    RETURN(TRUE);

  END_FUNCTION; -- valid_units

  FUNCTION vector_difference(
    arg1, arg2: vector_or_direction
      ): vector;

    LOCAL
      ndim   : INTEGER;
      mag2   : REAL;
      mag1   : REAL;
      mag    : REAL;
      res    : direction;
      vec1   : direction;
      vec2   : direction;
      result : vector;
    END_LOCAL;
    IF ((NOT EXISTS(arg1)) OR (NOT EXISTS(arg2))) OR (arg1.dim <> arg2.dim)
         THEN
      RETURN(?);
    ELSE
      BEGIN
        IF 'DIMENSIONAL_INSPECTION_SCHEMA.VECTOR' IN TYPEOF(arg1) THEN
          mag1 := arg1.magnitude;
          vec1 := arg1.orientation;
        ELSE
          mag1 := 1;
          vec1 := arg1;
        END_IF;
        IF 'DIMENSIONAL_INSPECTION_SCHEMA.VECTOR' IN TYPEOF(arg2) THEN
          mag2 := arg2.magnitude;
          vec2 := arg2.orientation;
        ELSE
          mag2 := 1;
          vec2 := arg2;
        END_IF;
        vec1 := normalise(vec1);
        vec2 := normalise(vec2);
        ndim := SIZEOF(vec1.direction_ratios);
        mag := 0;
        res := dummy_gri || direction(vec1.direction_ratios);
        REPEAT i := 1 TO ndim BY 1;
          res.direction_ratios[i] := (mag1 * vec1.direction_ratios[i]) + (
   mag2 * vec2.direction_ratios[i]);
          mag := mag + (res.direction_ratios[i] * res.direction_ratios[i]);
        END_REPEAT;
        IF mag > 0 THEN
          result := dummy_gri || vector(res,SQRT(mag));
        ELSE
          result := dummy_gri || vector(vec1,0);
        END_IF;
      END;
    END_IF;
    RETURN(result);

  END_FUNCTION; -- vector_difference

END_SCHEMA; -- dimensional_inspection_schema
