MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: hung for good?

  • To: mathgroup at
  • Subject: [mg23602] Re: [mg23592] hung for good?
  • From: Andrzej Kozlowski <andrzej at>
  • Date: Wed, 24 May 2000 02:16:04 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

on 5/22/00 7:12 AM, Matt Enlow at matt at wrote:

> Is it possible to give Mathematica (4.0) an expression to evaluate that will
> send it into an infinite loop? (The evaluation itself does not contain any
> loops.) Or does it have some way of knowing when it's "stuck"? I realize
> some evaluations may take a very long time... but is there some way of
> knowing whether any progress is being made while I'm waiting?
> Thanks in advance,
> Matt Enlow
> Bridgeport, CT
It is difficult to enter an infinite loop in in the ordinary sense in
Mathematica because of the $IterationLimit global variable, which is by
default set to the value



This stops you from getting into infinite loops like this one:

x := y; y := x;


$IterationLimit::"itlim" : "Iteration limit of 4096 exceeded."


(Of course you can set $IterationLimit to Infinity and then this
protection will be gone).

However there is nothing to prevent you from starting computations that run
for ever and which are not strictly infinite loops, for example, the
following trivial one:

FixedPoint[(x = # + 1) &, 1]

Once this starts running you can inspect the current value of x by choosing
Kernel>Evaluation>Enter Subsession and evaluating x:

(Dialog) In[18]:=

(Dialog) Out[18]=

You can continue the computation by choosing Kernel>Evaluation>Exit
Subsession and (usually) abort it by choosing next Kernel>Abort Evaluation.

Andrzej Kozlowski
Toyama International University, JAPAN

For Mathematica related links and resources try:

  • Prev by Date: AW: Reverse Axis
  • Next by Date: Re: BarChart Bug?
  • Previous by thread: hung for good?
  • Next by thread: long-time calculation