Assume that you have two properties
rand bit [7:0]a;
rand bit [2:0]b;
The range of values for b are 3,4,7
If b==3, the number of ones in the binary number must be 4.
If b==4, the number of ones in the binary number must be 5.
If b==7, the number of ones in the binary number must be 8.
Write constraints for above scenario.