I may have a very naive question on Constraint Based Analysis. (a technique of static program analysis).
I am reading an informal introduction from F. Nielson
He gives such an example,
let f = fn x => x 1;
g = fn y => y + 2;
h = fn z => z + 3
in (f g) + (f h)
The author explained that:
...the problem is that we cannot immediately point to the body of x: we need to know what parameters f will be called with. This is exactly the information that the Control Flow Analysis gives us:
For each function application, which functions may be applied.
However, in my naive point of view, this information can be obtained statically and exactly, at least seen from this example. It suffices to check the "in-" part of the instruction "let...in..." to decide the functions that may be applied, doesn't it?? Although I do see in OO programming, it would not be evident to decide what the virtual calls really calls at run-time, I find from this above example that this piece of information can be obtained in a trivial way by looking at its syntax.
So where am I wrong? Thank you for your ideas.