FUNCTION dependently_instantiated

(* SCHEMA step_merged_ap_schema; *)
-- DIFF IN AP203e2
-- IN AP203e2/AP242
FUNCTION dependently_instantiated
      (set_of_input_instances : SET OF GENERIC : igen;
       set_of_input_types : SET OF STRING;
       previous_in_chain : LIST OF GENERIC : cgen ) : BOOLEAN;
   LOCAL
      number_of_input_instances : INTEGER;
      number_of_referring_instances : INTEGER;
      bag_of_referring_instances : BAG OF GENERIC : igen := [];
      dependently_instantiated_flag : BOOLEAN;
      previous_in_chain_plus : LIST OF GENERIC : cgen := [];
      result : BOOLEAN := TRUE;
      set_of_types : SET OF STRING := [];
   END_LOCAL;
      IF EXISTS(set_of_input_instances) THEN
         number_of_input_instances := SIZEOF(set_of_input_instances);
         set_of_input_types := set_of_input_types + 'GENERIC';
         REPEAT i := 1 TO number_of_input_instances BY 1;
            bag_of_referring_instances := USEDIN(set_of_input_instances[i], '');
            IF EXISTS(bag_of_referring_instances) THEN
               number_of_referring_instances := SIZEOF(bag_of_referring_instances);
               dependently_instantiated_flag := FALSE;
               REPEAT j := 1 TO number_of_referring_instances BY 1;
                  set_of_types := TYPEOF(bag_of_referring_instances[j]);
                  IF set_of_types <= set_of_input_types THEN
                     IF NOT (bag_of_referring_instances[j] IN previous_in_chain) THEN
                        previous_in_chain_plus := previous_in_chain + set_of_input_instances[i];
                        IF dependently_instantiated([ bag_of_referring_instances[j] ], set_of_input_types, previous_in_chain_plus) THEN
                           dependently_instantiated_flag := TRUE;
                           ESCAPE;
                        ELSE
                           SKIP;
                        END_IF;
                     END_IF;
                  ELSE
                     dependently_instantiated_flag := TRUE;
                     ESCAPE;
                  END_IF;
               END_REPEAT;
               IF NOT dependently_instantiated_flag THEN
                  RETURN (FALSE);
               END_IF;
            ELSE
               RETURN (FALSE);
            END_IF;
         END_REPEAT;
      ELSE
         RETURN (FALSE);
      END_IF;
      RETURN (TRUE);
END_FUNCTION;

Referenced By

Defintion dependently_instantiated is references by the following definitions:
DefinitionType
 validate_dependently_instantiable_entity_data_types RULE


[Top Level Definitions] [Exit]

Generated by STEP Tools® EXPRESS to HTML Converter
2017-01-19T11:17:24-05:00