ProvableHQ / leo

🦁 The Leo Programming Language. A Programming Language for Formally Verified, Zero-Knowledge Applications
https://leo-lang.org/
GNU General Public License v3.0
4.79k stars 635 forks source link

[Feature] Short circuiting `&&` and `||` #1008

Open Protryon opened 3 years ago

Protryon commented 3 years ago

Right now, we don't pass indicators around for expression eval. This will be changing soon with a related change, and for enforced constraints emitted from expressions, we can have psuedo-short circuiting for boolean and/or.

gluax commented 3 years ago

The interpreter can short circuit here, but the constraints still have to be generated. This can be done once we have a solution to do the latter for cases like this where the constraints aren't equivalent to what the interpreter is doing.