[CST-2] OptComp 93/9/6
Matthew Richards
mwr22@cam.ac.uk
Mon, 21 May 2001 17:50:19 +0100
> Has anyone done this (rather hard) question?
Not properly, but I have had a look at the second part...
> Second part: ???
> If f is strict in y it doesn't necessarily mean that y is very busy
> somewhere.
> If y is very busy somewhere it doesn't necessarily mean that f is
> strict in
> y.
> So what's the relation between strictness and very-busy-ness?
One way of looking at strictness is "f is strict in y if (whenever f
terminates) y has been evaluated". In other words, if all execution paths of
f involve the evaluation of y. That's basically the definition of
very-busy-ness, so I'd have thought that
y is in VB(start node of f) => f is strict in y
Very-busy-ness has conditions on modification of variables, which we can
presumably ignore in a functional language (assume no side-effects).
However, I don't think it's the case that
f strict in y => y in VB(start node of f)
This is because the dataflow equations earlier were working on the basis of
a single procedure (f), and didn't consider whether an expression was very
busy in a called function. So in case (b), where f(x,y) = g(x,y+1), y isn't
very busy because it never gets evaluated in f (since the language is lazy).
This seems to make sense, but I may have missed some vital point - anyone
got any better ideas? :-)
Matthew