I created a list of structs and I like to sum the value of a field in each struct that satisfied a specific condition. For example:
struct packet {
val:int;
cond:bool;
};
l:list of packet;
When I write the following:
keep l.all(it.cond).sum(it.val) == 1000;
I get an error: GEN_NO_GENERATABLE_NOTIF.
When I define a result variable:
sum_val : int;
keep sum_val == 100;
and change the constraint to: keep l.all(it.cond).sum(it.val) == sum_val;
I get a contradiction!
How do I make it work?