In article <. com>,
Hemal <> wrote:
>Thanks for your help but i couldn't make out from what you mean by "odd
>perfect numbers".
http://en.wikipedia.org/wiki/Perfect_number
The exact meaning wasn't relevant to the discussion; the
point was that it was there was no known theoretical way to
solve the problem.
Recapping, the point was that there *cannot* be a program
which reliably predicts run-time memory usage of arbitrary programs,
even if full source (or executable) is available.
The proof that such programs *cannot* exist was a simple proof by
contradiction: assume that such a program, P, exists; now run P on
a program Q. Q is a program that finds a certain number by trial
(test each number in turn) when there is no analytic way
to find those kinds of numbers. Add a twist to the program Q such
that once it has found the number, it allocates an amount of memory
equal to the number it has found. Now, in order for P run on Q to
predict how much memory Q will allocate, P would have to be able to
analyze Q and solve what Q would find: only once P knows analytically
the answer to Q can P know how much memory Q would eventually allocate.
However, in order for P to know analytically what Q will do, P
would have to find an analytic way to calculate something that
our premises said does not *have* an analytic solution. Since P
cannot do the impossible, we conclude that program P does not exist.
There are, though -some- programs that can be analyzed for memory use;
there just isn't any way to analyze -every- program.
But you didn't ask for a tool to analyze the memory usage of a
-particular- program, you {implicitly} asked for a tool to analyze
the memory usage of whatever programs you happen to construct. You
were looking for a general analysis tool... and those CANNOT exist
(at least and give the correct answer

)
--
"No one has the right to destroy another person's belief by
demanding empirical evidence." -- Ann Landers