3.1. Code assertions

Code assertions are introduced the following way:


This statement introduces conditions to be checked at construction time only.

The assert expression cannot depend on unknowns and this will be checked at construction time. If the condition fails, the compilation is aborted and the error is reported and no constraint is generated.

template Translate(n) {

👉 When a constraint is introduced with the === operator, then an assert is automatically added in the witness generation code.