title: Specman On the Fly Generation: How to constrain a list whose values are differ from each other at least 2
body: <p>I need to generate a random list values with the next constrain:</p>
  
  <pre><code>my_list[i] not in [my_list[i-1] .. my_list[i-1] + 1]
  </code></pre>
  
  <p>i.e. all values in the list are different and with at least difference of 2 between each other. All code variations I've tried failed, e.g.:</p>
  
  <pre><code>   var prev_val : uint = 0;
     gen my_list keeping {
         it.size() == LIST_SIZE;
         it.all_different(it);
  
         for each (val) in it {
                  val not in [prev_val .. prev_val + 1];
                  prev_val = val;
          };
      };
  </code></pre>
  
  <p>How such list can be generated? Thank you for your help</p>