MathGroup Archive 2011

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

Search the Archive

Unwanted Recursion

  • To: mathgroup at smc.vnet.net
  • Subject: [mg120021] Unwanted Recursion
  • From: Casorati <casorati at f-m.fm>
  • Date: Wed, 6 Jul 2011 05:39:33 -0400 (EDT)

I'm trying to define an anti-commutative algebra in Mathematica.
Here I will show only a minimal example to demonstrate my point.
The product of two elements a^b should be give by p[a,b] so I
make p flat:

SetAttributes[p, {Flat}]

But now I want p[a] to reduce to a.
Such a  rule would make other rules much simpler but when I define

p[a_] := a

the expression p[a] causes an infinite recursion. I get the message

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

I have similar problems with p[]:=1 which makes mathematica puts
ones into the p : p[a]=p[a,a]=p[1,1,...,a] .

How can I solve this problem?



  • Prev by Date: Re: Numerical accuracy/precision - this is a bug or a feature?
  • Next by Date: Symbolic replacement of scalar products
  • Previous by thread: Re: Bug 1+4/10
  • Next by thread: Re: Unwanted Recursion