Simple question about how the optimizer works

Kragen Sitaker kragen at pobox.com
Tue May 14 12:56:08 EDT 2002


Tim Roberts <timr at probo.com> writes:
> Kragen Sitaker <kragen at pobox.com> wrote:
> >Simon Brunning <SBrunning at trisystems.co.uk> writes:
> >> I can't see how this optimisation could be automated - function f may or may
> >> not have side effects.
> >
> >Checking whether f has side effects can be automated.
> 
> Can it?  Isn't that a variant of the Turing stopping problem?

Yes, which is not insoluble if you're willing to accept some errors in
one direction or the other.  It is possible to prove that some
programs will terminate or have no side effects.




More information about the Python-list mailing list