Value definitions that infer the type of a variable rather, than being given it explicitly, incorrectly infer the type as nat1 if the expression is a product with left or right being a nat1. For example:
functions
f: () -> nat
f() ==
let N1:nat1 = 1, N0:nat = 0 in
let p = N1 * N0 in
p;
This fails with Error 4064: Value 0 is not a nat1 in 'DEFAULT' (Test.vdmsl) at line 5:8.
The workaround is to give the explicit type of p as (in this case) p:nat.
Value definitions that infer the type of a variable rather, than being given it explicitly, incorrectly infer the type as nat1 if the expression is a product with left or right being a nat1. For example:
functions f: () -> nat f() == let N1:nat1 = 1, N0:nat = 0 in let p = N1 * N0 in p;
This fails with Error 4064: Value 0 is not a nat1 in 'DEFAULT' (Test.vdmsl) at line 5:8.
The workaround is to give the explicit type of p as (in this case) p:nat.