In the current implementation of flatcode_to_r1cs, reusing the same variable results in an error. To prevent such issues, it is necessary to check if a variable has already been used within the same scope and raise an error or warning if there is an attempt to redeclare or reuse the variable.
Example
qeval(x, y):
y = x**3
Enforce function definition on the first Line or provide a warning in the frontend
An error occurs if the function definition is not the first line of the code. The system should enforce that the function definition always appears as the first line or provide a clear warning message when this rule is violated.
Prevent variable Reuse in code
In the current implementation of flatcode_to_r1cs, reusing the same variable results in an error. To prevent such issues, it is necessary to check if a variable has already been used within the same scope and raise an error or warning if there is an attempt to redeclare or reuse the variable.
Example
Enforce function definition on the first Line or provide a warning in the frontend
An error occurs if the function definition is not the first line of the code. The system should enforce that the function definition always appears as the first line or provide a clear warning message when this rule is violated.
Example