Dynamic Constant Normalization
Implements #18 (closed). A few notes on the actual implementation
- Any object that can be used to add dynamic constants should implement the
DynamicConstantViewtrait (inhercules_ir/ir/dc_normalization.rs), in particular this just requires implementingget_dynconstwhich can be used to retrieve dynamic constant values from their IDs andadd_dynconstwhich takes a (normalized) dynamic constant object and interns it and produces its ID. An object that implements that trait can then be used to normalize and intern dynamic constants via the variousdc_*methods. - Not described in the original issue,
minandmaxactually track their fields in a set since duplicates don't matter. Also,minignores 0 if it is one of the elements, since dynamic constants are non-negative somin {0, ...} = min {...}. - The trait implements a
dc_normalizewhich can take a dynamic constant and normalize it (unlike most of the other functions which take the arguments and normalize them). - Re-wrote Juno's dynamic constant generation (again) mainly to use the new APIs that handle adding/multiplying lists of dynamic constants but also to fix some issues with division.