Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support statements in ITE #248

Open
katat opened this issue Dec 30, 2024 · 1 comment
Open

Support statements in ITE #248

katat opened this issue Dec 30, 2024 · 1 comment
Labels
enhancement New feature or request medium

Comments

@katat
Copy link
Collaborator

katat commented Dec 30, 2024

In order to support the following calculation:

// 1 if true, 0 if false
function long_gt(n, k, a, b) {
    for (var i = k - 1; i >= 0; i--) {
        if (a[i] > b[i]) {
            return 1;
        }
        if (a[i] < b[i]) {
            return 0;
        }
    }
    return 0;
}

The compiler should support statements and early returns in the ITE block, otherwise it is too tricky to implement the logic like this. Perhaps at least we should enhance this feature in the hint functions.

@katat katat added enhancement New feature or request medium labels Dec 30, 2024
@mimoo
Copy link
Contributor

mimoo commented Dec 30, 2024

agree that in the hint functions we should allow anything (early return, early break, large if-then-else statements, etc.)

in the rest IMO we should not for now, as it would be hard to support other backends than r1cs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request medium
Projects
None yet
Development

No branches or pull requests

2 participants