Using Combinations in a Let Statement

As shown in Parameter Expansion Points, it is technically possible to use the combination API in model code. It can be also used inside of the Let statement of Cord machines, as shown in the following code example.

config Let
{
   action abstract static void SUT.A(int x);
   action abstract static void SUT.B(int x);
   action abstract static void SUT.C(int x);
}

machine Let() : Let
{
   let int x, int y, int z 
      where
      {.
         Condition.In(x, 1, 2);
         Condition.In(y, 2, 3);
         Condition.In(z, 4, 5);
         Combination.Pairwise(x,y,z);
         Combination.Expand(x,y,z);
      .}
   in
   A(x); B(y); C(z)
}

The following illustration shows the graph generated from the Let machine.

f8677c0b-89e3-49c6-b925-50221e090a05

Each path represents one pairwise combination of the let-bound variables x, y, and z.

See Also

Concepts

Parameter Generation