I try to generate on-the-fly list of list of uint (my_list_of_list
) with all different values (I have a variable num_of_ms_in_each_g : list of uint
, that keeps lengths of every list inside my_list_of_list
):
var my_list_of_list : list of list of uint;
gen my_list_of_list keeping {
for each (g) using index (g_idx) in it {
g.size() == num_of_ms_in_each_g[g_idx];
for each (m) using index (m_idx) in g {
// Error in the next line:
m not in it[0..g_idx-1][0..num_of_ms_in_each_g[g_idx]-1];
m not in it[g_idx][0..max(0, m_idx-1)];
};
};
Explanation for the code algorithm: generate m
(the value) that was not yet in any list of uint (g
) before, and does not appear in current list for previous indexes.
I get compilation error:
*** Error: 'm' is of type 'uint', while expecting type 'list of uint' or
'list of list of uint'.
Do you have any idea how to solve the compilation error? (it[0..g_idx-1][0..num_of_ms_in_each_g[g_idx]-1]
is uint..) Or maybe another way to generate on-the-fly list of list of uint
with all different values?
Thank you for your help.