Questions

Hi all
I have two questions.
the operators with side effects (ex:++ and --) are not allowed on the constraint
expressions. I am a bit confused. What is the meaning of the side effects in this statement? Also,
using a==3 in the constraint block will work, where a is rand var. But, why using constraint c{a=3} will be error? why the operator “=” can’t be used in constraint expression?
Thanks a lot!

In reply to peter:

Constraints need to be read-only expressions. You can think of the constraint solver as randomly generating values for variables, and then evaluating the expressions to see if the expressions are true or false. If true, then those values are chosen. If false, the solver needs to try another set of value and evaluate the expressions again until it the expression in true. There is no way to predict how many times the expressions get evaluated. An expression with side-effects would throw of predictability.