Debian Codegraph @

tests/spec/unit/globals/regular/globals_regular_regex_6.mzn

raw
1 /***
2 !Test
3 expected: !Result
4 solution: !Solution
5 x: [A, B, A, C, A, D, A]
6 ***/
7
8 include "regular_regexp.mzn";
9
10 int: n = 7;
11 enum Letter = {A, B, C, D};
12 array [1..n] of var Letter: x :: add_to_output;
13
14 constraint regular(x, "A ((B|C|D) A)*");
15
16 constraint forall (i in 1..n-2 where i mod 2 = 0) (x[i] < x[i+2]);