FUNCTION acyclic

(* SCHEMA structural_analysis_design; *)
  FUNCTION acyclic(
               arg1: generic_expression;
               arg2: SET OF generic_expression
      ): BOOLEAN;

    LOCAL
      result : BOOLEAN;
    END_LOCAL;
    IF 'STRUCTURAL_ANALYSIS_DESIGN.SIMPLE_GENERIC_EXPRESSION' IN TYPEOF(
        arg1) THEN
      RETURN(TRUE);
    END_IF;
    IF arg1 IN arg2 THEN
      RETURN(FALSE);
    END_IF;
    IF 'STRUCTURAL_ANALYSIS_DESIGN.UNARY_GENERIC_EXPRESSION' IN TYPEOF(
        arg1) THEN
      RETURN(acyclic(arg1\unary_generic_expression.operand,arg2 + [arg1]));
    END_IF;
    IF 'STRUCTURAL_ANALYSIS_DESIGN.BINARY_GENERIC_EXPRESSION' IN TYPEOF(
        arg1) THEN
      RETURN(acyclic(arg1\binary_generic_expression.operands[1],arg2 + [
          arg1]) AND acyclic(arg1\binary_generic_expression.operands[2],
          arg2 + [arg1]));
    END_IF;
    IF 'STRUCTURAL_ANALYSIS_DESIGN.MULTIPLE_ARITY_GENERIC_EXPRESSION' IN 
        TYPEOF(arg1) THEN
      result := TRUE;
      REPEAT i := 1 TO SIZEOF(arg1\multiple_arity_generic_expression.
          operands) BY 1;
        result := result AND acyclic(arg1\
            multiple_arity_generic_expression.operands[i],arg2 + [arg1]);
      END_REPEAT;
      RETURN(result);
    END_IF;

  END_FUNCTION; -- acyclic

Referenced By

Defintion acyclic is references by the following definitions:
DefinitionType
 is_acyclic FUNCTION


[Top Level Definitions] [Exit]

Generated by STEP Tools® EXPRESS to HTML Converter
2012-03-27T17:15:08-04:00