let N: int = 4;

namespace std::prover(N);
    enum Query {
        Input(int, int),
        None,
    }

namespace Sum(N);
    let last_row = N - 1;

    pol fixed ISLAST(i) { if i == last_row { 1 } else { 0 } };
    pol fixed ISALMOSTLAST(i) { if i == last_row - 1 { 1 } else { 0 } };
    pol fixed ISFIRST = [ 1, 0 ] + [0]*;

    col witness input(i) query match i {
        // A non-exhaustive match statement is the only way to return "None"
        0 => std::prelude::Query::Input(0, 1),
        1 => std::prelude::Query::Input(0, 2),
        2 => std::prelude::Query::Input(0, 3),
        // No response in the case of i == 3
        _ => std::prelude::Query::None,
    };
    col witness sum;

    ISLAST * sum' = 0;
    sum' = (1 - ISLAST) * (sum + input);
    // This is just to see that a query is optional or can also
    // return "try to figure it out on your own"
    ISLAST * input = 0;
    public out = sum(N-1);
