Hacker News new | ask | show | jobs
by pca006132 975 days ago
No, static analysis can also analyze multiple functions. What you are looking for is called interprocedural analysis and is more expensive than single function analysis (aka intraprocedural analysis). More generally what you want is context-sensitive (knows the calling context) and probably flow-sensitive (knows the control flow). The more precise the analysis, the more expensive they are. There are points-to analysis that can be pretty precise, e.g. https://arxiv.org/abs/1801.09189

> I am less concerned about that as computation resources exploded due to AI and solving SAT is getting faster and faster

Sadly we are usually very concerned about this. The complexity of these problems are usually NP-hard, so we usually have either heuristics (imprecise), exponential algorithms, or fixed-parameter tractable algorithms (practically speaking, O(2^c n) for a pretty large c), which are either imprecise or too slow. This is still an area with active research. The main problem is that, even if your computational power gets 2x faster, you cannot solve problems 2x larger within the same amount of time. It doesn't scale... (but of cause, usually we are dealing with sparse problems so the scaling is not in LOC for example)