Can I constrain a variable with hard constraints for valid values, and then add a dist constraint for distribution?
If so can that additional constraint be soft?
In reply to nshames:
It might help and should be easy to create a small example of what you want to do. A dist constraint has both a hard and soft parts to it. The selection of values/range can be hard or soft, but the weights are always soft.
In reply to dave_59:
Sorry, you’re right, of course.
Very simple:
int field;
constraint hard_vals{
field inside {0,256,512,1024};
}
constraint weights{
soft field dist { 0:=2,256:=4,512:=1,1024:=3};
}
Does constraint hard_vals enforce a uniform distribution or, barring any other constraints, will the weights constraint be enforced?
Thanks
In reply to nshames:
OK, that is much easier to understand. This is actually something that is currently being clarified as part of an enhancement to the P1800-2023 LRM. The inside operator does not imply any kind of uniform distribution with respect to other constraints. The constraint
weights will honor the dist regardless of being a hard or soft constraint.