tokamak-network / interactive-zkp-study

4 stars 3 forks source link

Variable Reuse Prevention and Enforced Function Definition #9

Open jdhyun09 opened 3 weeks ago

jdhyun09 commented 3 weeks ago

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

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.

Example

my function

qeval(x):

ggs134 commented 3 weeks ago

move this issue to https://github.com/tokamak-network/py-zkp