This is a simple constraint. Based on type of packet (ETHERNET/VLAN), I need to set the size of PayLoad array, which is sparse. I 'm able to realize the desired functionality using if-else which is not very elegant, as below.
=> is not a valid implication operator for constraints, the syntax for constraints is different from the syntax for assertions.
The two constraint specifications are not the same. In the version using implication operators there is a two way implication going on - i.e. payload.size will determine which PacketType is selected, as well as the other way round.
If you add the constraint solve PacketType before Payload.size; then you will get behaviour consistent with the if-else constraint definition.
The difference in a property is that A->B is overlapping implication (A implies B at the same time) while A=>B is non overlapping (A implies B follows the next cycle). Constraints are not temporal, so only → is allowed. An if constraint is the same as an implication, just different syntax.
When you say your constraint doesn’t work, you need to be explicit about what is happening. Are your solutions valid, but not getting what you wanted? Then as was posted, you need to work on the distributions.