You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying out the latest code in the development branch, using boost 1.57.0 on linux (Gentoo). When I run ex5_vec_constr, the produced output is (only the first 3 iterations are shown):
There seem to be a couple of issues with the generated values:
Values in src_addr_vec often repeat across consecutive randomizations. The constraints on src_addr_vec's values don't enforce this repetition. On the other hand, the generated values do seem to conform to the constraints, they're just not uniformly randomly distributed. Here's the constraints:
However, after randomizing the vector 100 times and inspecting the 1st element (index 0), it's clear that it's not uniformly randomly distributed between 0 & 14 at all. The only values assigned to it are 7, 8 and 11.
The constraint on data_vec's values don't seem to be upheld. Here's the constraint:
The 1st element (index 0) should be <= 10, which clearly isn't the case. For the 2nd element, the constraint matches, because static_cast(4294901760 ⋅ 4294901760) == 0. Then for all the next elements, there's no randomness at all anymore.
I haven't been able to figure out from the code why this is happening, but I haven't had much time to look into it.
The text was updated successfully, but these errors were encountered:
The last issue is indeed a bug: the solver treats if_then_else as a whole and thus, due to the presence of _i - 1, it implies that _i cannot be 0 and ignores the constraint on the first element. This can be fixed easily.
Vector constraints are mainly a proof-of-concept for the syntax, so the distribution of values is not yet optimized. This is more challenging, but not impossible to fix, at least for the example :) Are vector constraints important for your project?
I was wondering what would happen with 0 - 1, didn't realize the whole constraint would be ignored. Good to know!
I'm currently just checking how feasible it would be to use Crave for a project in the near future, so can't say for sure how important vector constraints/randomization is, but it's likely that it would be very useful. I've been playing around with "manually" randomizing objects in an std::vector, but this triggers other bugs (see #2).
I'm trying out the latest code in the development branch, using boost 1.57.0 on linux (Gentoo). When I run ex5_vec_constr, the produced output is (only the first 3 iterations are shown):
The printed elements have the following types:
There seem to be a couple of issues with the generated values:
However, after randomizing the vector 100 times and inspecting the 1st element (index 0), it's clear that it's not uniformly randomly distributed between 0 & 14 at all. The only values assigned to it are 7, 8 and 11.
The 1st element (index 0) should be <= 10, which clearly isn't the case. For the 2nd element, the constraint matches, because static_cast(4294901760 ⋅ 4294901760) == 0. Then for all the next elements, there's no randomness at all anymore.
I haven't been able to figure out from the code why this is happening, but I haven't had much time to look into it.
The text was updated successfully, but these errors were encountered: