zksecurity / noname

Noname: a programming language to write zkapps
https://zksecurity.github.io/noname/
181 stars 47 forks source link

warn on unconstrained values #72

Open mimoo opened 4 months ago

mimoo commented 4 months ago

the compiler should warn us that yy is not constrained to anything and that it's useless:

fn main(private_input: Field, x2: Field, pub public_input: Field) {
    let xx = private_input + public_input;
    assert_eq(xx, 2);
    let yy = x2 + 1;
}

to run:

cargo run test --backend kimchi-vesta --path examples/arithmetic.no --private-inputs '{"private_input": "1", "x2": "3"}' --public-inputs '{"public_input": "1"}' --debug
mimoo commented 4 months ago

there's different ways to tackle that...