(fix) bizarre mathematica replacement rule error

• To: mathgroup at smc.vnet.net
• Subject: [mg2497] (fix) bizarre mathematica replacement rule error
• From: kant at kathmandu.scicomp.com (Elaine Kant)
• Date: Wed, 15 Nov 1995 01:58:31 -0500

```I think I just figured out how to solve my previous problem,
namely to use
Literal[And][x_==y_, p_==q_] :> 6
(x_==y_ && p_ == q_) :> 6
But I still find it curious that the incorrect version (sometimes) crashes
the system.  Post the previous message or not as you wish.

Original message:

Can anyone explain the following behavior to me??  I cannot understand
why this statement crashes Mathematica, and especially why it doesn't
crash if you change the variable names used.

This is a simplified example of a behavior I got with a replacement
rule that does make more sense than this one (and also crashed
Mathematica), so just using variable names that don't cause the crash
will not solve my real problem.

We observed the same behavior on a PC version of 2.2 as well as under
Solaris Mma 2.2 as shown here.

==========================================================
> math
Mathematica 2.2 for Solaris

In[1]:= a == b /. (x_==y_ && p_ == q_) :> 6
Bus error (core dumped)
>

> math
Mathematica 2.2 for Solaris

In[1]:= m == n /. (x_==y_ && p_ == q_) :> 6

Out[1]= m == n

In[2]:= a == b /. (x_==y_ && p_ == q_) :> 6
Segmentation fault (core dumped)

==========================================================
[[[For the curious, the actual culprit was

if[resmax <= tol || ncnt >= ncntmax, return[], seq[]] /.
{... (x_==y_ && z_==x_) :> y==z ...}
]]]
==========================================================

Elaine Kant
SciComp Inc.
5806 Mesa Drive, Suite 250
Austin, TX 78731

email:	kant at scicomp.com
voice:  512-451-1430
fax:    512-451-1622
www:	http://www.sig.net/~scicomp/

```

• Prev by Date: Problems with high-dimensional lists
• Next by Date: Re: turn off symbols in MultipleListPlot?
• Previous by thread: (fix) bizarre mathematica replacement rule error
• Next by thread: Re: (fix) bizarre mathematica replacement rule error