FUNCTION acyclic

(* SCHEMA step_merged_ap_schema; *)
-- DIFF IN AP214
-- DIFF IN AP203e2
-- DIFF IN AP238 STEP-NC
-- IN AP203e2/AP214/AP238 STEP-NC/AP242
FUNCTION acyclic
      (arg1 : generic_expression;
       arg2 : SET OF generic_expression ) : BOOLEAN;
   LOCAL
      result : BOOLEAN := TRUE;
   END_LOCAL;
      IF 'STEP_MERGED_AP_SCHEMA.SIMPLE_GENERIC_EXPRESSION' IN TYPEOF(arg1) THEN
         RETURN (TRUE);
      END_IF;
      IF arg1 IN arg2 THEN
         RETURN (FALSE);
      END_IF;
      IF 'STEP_MERGED_AP_SCHEMA.UNARY_GENERIC_EXPRESSION' IN TYPEOF(arg1) THEN
         RETURN (acyclic(arg1\unary_generic_expression.operand, arg2 + [ arg1 ]));
      END_IF;
      IF 'STEP_MERGED_AP_SCHEMA.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 'STEP_MERGED_AP_SCHEMA.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;
      RETURN (result);
END_FUNCTION;

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
2017-01-19T11:17:24-05:00