Search code examples
specman

List generation in specman


I have type my_type : [a,b,c,d,e,f]; I have my_list : list of my_type;

I want to gen my_list, but there is restriction that c,d,f should come together. If there is c,d, or f in the generated list there MUST be all 3 of them. (I can have none of them in the list).


Solution

  • Here you go:

    type my_type : [a,b,c,d,e,f]; 
    
    {
      my_list: list of my_type;
      keep my_list.has(it in [c,d,f]) => ( ( c in my_list ) && ( d in my_list ) && ( f in my_list) );
    }