Open vlad-arista opened 10 months ago
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?
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.
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.