+
Skip to content

Anonymous component array inputs don't permit tagging #380

@TheFrozenFire

Description

@TheFrozenFire

Let's say that I have a template like this:

template MUXOR(n) {
    signal input {binary} in[n];
    signal output {binary} out;

    signal {binary} intermediate[n - 1];
    for (var i = 0; i < n - 1; i++) {
        intermediate[i] <== XOR() ([in[i], in[i + 1]]);
    }
    out <== intermediate[n - 2];
}

I might use it as an anonymous component like this:

signal {binary} result <== MUXOR(3) ([signal_one, signal_two, signal_three]);

However, I get error[T3001]: Invalid assignment: missing tags required by input signal., because the signal array is being instantiated without a {binary} tag. In order to make this work, I would need to first create a signal array tagged binary, and then as that as the input. But, that largely defeats the brevity gained by using an anonymous component.

Input signals to an anonymous component should support tagging, such as MUXOR(3) ({binary} [...]), or MUXOR(3) ({binary} in <== [...]). Alternatively, where an array is used, the array should automatically inherit the tagging of the parameter it corresponds to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载