mangle icon indicating copy to clipboard operation
mangle copied to clipboard

Stratification during analysis

Open vlad-arista opened this issue 2 years ago • 2 comments

Is there a reason why stratification is done during evaluation rather than analysis? It seems redundant to stratify every time given that analysis.ProgramInfo is most commonly produced by Analyze* calls.

vlad-arista avatar Oct 25 '23 10:10 vlad-arista

I agree that needless work is done when one has does multiple evaluation phases with the same program. I will add entry points that let clients call evaluation with a previously stratified program.

Also, stratification can be considered a form of semantic analysis, although it seems different from name resolution and type checking.

Are you suggesting that analysis should always perform stratification and include the result in analysis.ProgramInfo?

burakemir avatar Nov 12 '23 15:11 burakemir

It would seem convenient to have stratification as part of some preprocessing step, because like name resolution and type checking, it also detects invalid programs and it's also required for all evaluation strategies I can think of, so it's not optional. Additionally, I don't know if stratification by itself (outside of evaluation) is useful, so probably shouldn't necessarily be part of the public API. But we can deal with calling Stratify after Analyze.

vlad-arista avatar Nov 14 '23 17:11 vlad-arista