I've defined the following struct :
struct my_struct {
var_a : bit;
var_b : bit;
};
In another struct, I've instantiated a list of this struct :
struct another_struct {
my_list : list of my_struct;
list_size : uint;
keep list_size >= 4;
};
What I want to do is to constraint my_list to have at least all the possible iterations of both var_a and var_b but not only, i.e. to combine both constraints :
extend another_struct {
keep my_list.is_all_iterations(.var_a, .var_b);
keep my_list.size() == list_size;
};
Is there any way to achieve that ?
Thanks
One approach is to first generate list which contains only variations, and then append desired number of other elements, in post_generate.
Afer this code, your list will have all variations you wanted, but also arbitrary number of other structures, defined by the "upper_limit".
Note that the first 10 elements (0-9) contain variations, and remaining list elements are random sturctures.