eth-sri / silq

Boost Software License 1.0
611 stars 52 forks source link

AssertError occured using the phase function and vector #5

Closed eccyan closed 4 years ago

eccyan commented 4 years ago

I guess this is an issue of type, but I can't isolate the problem between phase and vector.

Environments

https://github.com/eccyan/silq-example/blob/master/tools/Dockerfile

Test codes

def R (q:B, const k:!N) {
    if q { phase(k * π) }
    return q;
}

def main(){
  qs := vector(2, 0:B);
  qs[0] := H(qs[0]);
  qs[1] := R(qs[1], 1);
  return qs;
}

Error messages

core.exception.AssertError@qsim.d(442): Assertion failure
----------------
??:? _d_assert [0x7fada01fa73c]
??:? [0x5d3202]
??:? [0x5cd6b0]
??:? [0x5cdc6c]
??:? [0x5cdcf9]
??:? [0x5cef0b]
??:? [0x60d692]
??:? [0x5cc202]
??:? [0x5f01c1]
??:? [0x5f9fc6]
??:? [0x5fd3a6]
??:? [0x60c890]
??:? [0x5cc202]
??:? [0x5ac4ae]
??:? [0x5abedc]
??:? [0x5ac8ce]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll() [0x7fada0224eef]
??:? _d_run_main [0x7fada0224d07]
??:? __libc_start_main [0x7fad9fe311a2]
??:? [0x4c3f7d]

Thanks.

tgehr commented 4 years ago

Oops. Thanks for reporting! Fixed in https://github.com/eth-sri/silq/commit/dec17bc48e7196fb5989125800ec4309f851dd96, works with vscode plugin 0.0.24.

eccyan commented 4 years ago

Oh, That was so fast!! Thank you for fixing :smiley: