UBC-Stat-ML / blangDSL

Blang core (parsing, generation, eclipse plug-in)
https://www.stat.ubc.ca/~bouchard/blang/
BSD 2-Clause "Simplified" License
2 stars 0 forks source link

Autoboxing can create faulty initializers #61

Open alexandrebouchard opened 7 years ago

alexandrebouchard commented 7 years ago

Eg:

random RealVar Y 
random RealVar N          ?: Y + 1.0

will generate for the latter:

double _plus = BlangExtensions.operator_plus(Y, () -> (1.0));
return () -> (_plus);

and therefore view it as a fixed constant.

Workaround: document and make a check that all random's are in fact writeable (should be subsumed by sampling coverage checks.

alexandrebouchard commented 7 years ago

Or maybe re-implement using an implementation for fixed stuff and then easy to detect that a random is not actually random. Might be useful for other reasons too.