Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #3559 > unrolled thread
| Started by | DrMajorBob <btreat1@austin.rr.com> |
|---|---|
| First post | 2011-07-07 11:48 +0000 |
| Last post | 2011-07-08 08:58 +0000 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Unwanted Recursion DrMajorBob <btreat1@austin.rr.com> - 2011-07-07 11:48 +0000
Re: Unwanted Recursion Kambis Veschgini <k.veschgini@thphys.uni-heidelberg.de> - 2011-07-08 08:58 +0000
| From | DrMajorBob <btreat1@austin.rr.com> |
|---|---|
| Date | 2011-07-07 11:48 +0000 |
| Subject | Re: Unwanted Recursion |
| Message-ID | <iv46dn$fc9$1@smc.vnet.net> |
ClearAll@p
SetAttributes[p, {Flat, OneIdentity}]
p[a_] := a
p[a]
a
Bobby
On Wed, 06 Jul 2011 04:39:33 -0500, Casorati <casorati@f-m.fm> wrote:
> 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?
>
>
--
DrMajorBob@yahoo.com
[toc] | [next] | [standalone]
| From | Kambis Veschgini <k.veschgini@thphys.uni-heidelberg.de> |
|---|---|
| Date | 2011-07-08 08:58 +0000 |
| Message-ID | <iv6grn$s5v$1@smc.vnet.net> |
| In reply to | #3559 |
On 2011-07-07 13:48:07 +0200, DrMajorBob said:
> ClearAll@p
> SetAttributes[p, {Flat, OneIdentity}]
> p[a_] := a
> p[a]
>
> a
>
> Bobby
>
> On Wed, 06 Jul 2011 04:39:33 -0500, Casorati <casorati@f-m.fm> wrote:
>
>> 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?
SetAttributes[p, {Flat, OneIdentity}]
p[a_] := a
p[] := 1
p[a]
$IterationLimit::itlim : "Iteration limit of 4096 exceeded. \
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web