Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #11930

issues with expression manipulation functions

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!newspump.sol.net!posts.news.twtelecom.net!nnrp3.twtelecom.net!not-for-mail
From Alex Krasnov <akrasnov@eecs.berkeley.edu>
Newsgroups comp.soft-sys.math.mathematica
Subject issues with expression manipulation functions
Date Wed, 3 Oct 2012 07:12:55 +0000 (UTC)
Sender steve@smc.vnet.net
Approved Steven M. Christensen <steve@smc.vnet.net>, Moderator
Message-ID <k4gohn$39e$1@smc.vnet.net> (permalink)
Lines 41
Organization Time-Warner Telecom
NNTP-Posting-Date 03 Oct 2012 07:14:26 GMT
NNTP-Posting-Host d38094d1.news.twtelecom.net
X-Trace DXC=HB^LGK;D4oUP:Y0=`cYTT^C_A=>8kQj6]9BHNOcEA\@Y@^T4OlUocRUR`?7ATL[?e[3D:AQl7YKkP
X-Complaints-To abuse@twtelecom.net
X-Received-Bytes 2228
Xref csiph.com comp.soft-sys.math.mathematica:11930

Show key headers only | View raw


In the process of learning Mathematica, I discovered several items of 
unusual behavior. I would appreciate any clarification.

(0) Several expression manipulation functions behave correctly with 
HoldComplete subexpressions but not with Hold subexpressions. Example:

In:	Together[1/x+HoldComplete[1]/x]
Out:	(1 + HoldComplete[1])/x

In:	Together[1/x+Hold[1]/x]
Out:	x^(-1) + Hold[1]/x

Another example:

In:	Factor[3+3*HoldComplete[x]+HoldComplete[x]^2, Extension -> {Sqrt[3], I}]
Out:	((-3*I + Sqrt[3] - (2*I)*HoldComplete[x])*(3*I + Sqrt[3] + (2*I)*HoldComplete[x]))/4

In:	Factor[3+3*Hold[x]+Hold[x]^2, Extension -> {Sqrt[3], I}]
Out:	(kernel crash)

Although the last example is clearly a bug, is there some difference in 
behavior between HoldComplete and Hold that generally accounts for these 
issues? The documentation mentions differences with respect to Sequence, 
Unevaluated, Evaluate, and upvalues. Without knowing the internals of the 
expression manipulation functions, I fail to see how any of these are 
relevant here.

(1) FactorTerms behaves incorrectly if the independent form is more 
complex than a symbol and not contained in the expression. Example:

In:	FactorTerms[x, x^2]
Out:	Sqrt[x]

In my understanding, FactorTerms should always return an equivalent 
expression. Is this a bug or some sort of undocumented behavior? Does 
FactorTerms require the independent form to be a symbol?

I am using Mathematica 8.0.4 on Windows.

Alex

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

issues with expression manipulation functions Alex Krasnov <akrasnov@eecs.berkeley.edu> - 2012-10-03 07:12 +0000
  Re: issues with expression manipulation functions Daniel Lichtblau <danl@wolfram.com> - 2012-10-04 03:39 +0000

csiph-web