Quantifier free randomness mapping - #360
Conversation
| pub count: usize, | ||
| pub positions: Vec<Position>, | ||
| // maximum offset of each sampling operation for each exported oracle | ||
| pub max_offset: Option<HashMap<Export, HashMap<Position, usize>>>, |
There was a problem hiding this comment.
shouldn't this be HashMap<Export, usize> as we are already looking at a concrete sample position?
There was a problem hiding this comment.
I think we have one SampleInfo for each game instance and not for each position. So the max_offset also computes the maximum possible counter for each sample position reachable from each exported oracle.
| .unwrap_or_else(|ResolutionError(failed_oracle_stmts)| { | ||
| panic!("error resolving oracles: {failed_oracle_stmts:?}") | ||
| }); | ||
| max_offset_extractor::Transformation(&comp, &mut samplinginfo).transform(); |
There was a problem hiding this comment.
would it make more sense to fold this into samplify?
then you also can get rid of the Option
There was a problem hiding this comment.
One issue is that max_offset_extractor needs to find all reachable sampling positions from an exported oracle so it needs oracle resolution. Samplify can be moved after oracle resolution. However, samplify and max_offset_extractor have different AST traversal order. Samplify linearly updates the code of oracles of all packages while max_offset_extractor DFS into each exported oracle. I think keeping them separate helps readability but we could move max_offset out of SampleInfo.
|
Ah one thing: it would be nice if we could keep the sample-infos in the order in which they appear in that export call. Then we can re-use the information also for a order-based randomness mapping! I.e. instead of accumulating into a |
|
Excellent point 👍 |
|
Closes #206 and #67