FUNCTION dependently_instantiated

(* SCHEMA step_merged_ap_schema; *)
-- IN AP203e2
FUNCTION dependently_instantiated
      (set_of_input_instances : SET [0:?] OF GENERIC : igen;
       set_of_input_types : SET [0:?] OF STRING;
       previous_in_chain : LIST [0:?] 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 := FALSE;
      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;
            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;
                  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 := FALSE;
                           ESCAPE;
                        ELSE
                           SKIP;
                        END_IF;
                     END_IF;
                  ELSE
                     dependently_instantiated_flag := FALSE;
                     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 (FALSE);
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
2024-09-06T14:00:33-04:00