|
FUNCTION acyclic (arg1 : generic_expression, arg2 : SET [0:?] OF generic_expression) : BOOLEAN; LOCAL result : BOOLEAN ; END_LOCAL ; IF ( 'iso13584_generic_expressions_schema.simple_generic_expression' IN TYPEOF ( arg1 ) ) THEN RETURN ( TRUE ) ; END_IF ; IF arg1 IN arg2 THEN RETURN ( FALSE ) ; END_IF ; IF 'iso13584_generic_expressions_schema.unary_generic_expression' IN TYPEOF ( arg1 ) THEN RETURN ( acyclic ( arg1 \ unary_generic_expression . operand , arg2 + [ arg1 ] ) ) ; END_IF ; IF 'iso13584_generic_expressions_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 'iso13584_generic_expressions_schema.multiple_arity_generic_expression' IN TYPEOF ( arg1 ) THEN result := TRUE ; REPEAT i := 1 TO SIZEOF ( arg1 \ multiple_arity_generic_expression . operands ) ; result := result AND acyclic ( arg1 \ multiple_arity_generic_expression . operands [ i ] , arg2 + [ arg1 ] ) ; END_REPEAT ; RETURN ( result ) ; END_IF ; END_FUNCTION; -- acyclic |
|
public class FAcyclic public static Value run(SdaiContext _context, Value arg1, Value arg2) |