Functions in Constraints
In some cases constraint can’t be expressed in a single line, in such cases function call can be used to constrain a random variable. calling the function inside the constraint is referred to as function in constraints.
- The function will be written outside the constraint block
- Constraint logic shall be written inside the function as function definition and function call shall be placed inside the constraint block
- Functions shall be called before constraints are solved, and their return values shall be treated as state variables.