MathGroup Archive 2004

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

Search the Archive

Re: finite domains

  • To: mathgroup at
  • Subject: [mg53053] Re: finite domains
  • From: Paul Abbott <paul at>
  • Date: Wed, 22 Dec 2004 04:52:43 -0500 (EST)
  • Organization: The University of Western Australia
  • References: <cp3t2v$9ai$> <> <cq8u48$h47$>
  • Sender: owner-wri-mathgroup at

In article <cq8u48$h47$1 at>, János <janos.lobb at> 

> I looked at the article and I understand that for that particular case. 
> However that case fell back in the definition on an already existing 
> infinite domain of the same order namely Z. There is also a similar 
> definition in the Book for Odd numbers.
> In my case I cannot fall back on an existing finite domain, or I do not 
> know how to explore/exploite it with Boolean.
> I am thinking of a domain named Irany having elements 
> {North,East,South,West}. How can I do that without a reference to a 
> more basic domain as foundation and expect that 
> Element[NorthWest,Irany] will give me False?

The following code does what _you_ want:

 Irany /: Element[x_, Irany]:= MemberQ[{North,East,South,West}, #]& /@ x

  Element[{North, West}, Irany]
  Element[NorthWest, Irany]

However, this violates the "spirit" of Mathematica because, for an 
arbitrary symbol, the definition should return the unevaluated 
expression -- but if you try

  Element[y, Irany]

you get false, rather than the unevaluated expression. Now, y could be 
North, or it could be NorthWest ...


Paul Abbott                                   Phone: +61 8 6488 2734
School of Physics, M013                         Fax: +61 8 6488 1014
The University of Western Australia      (CRICOS Provider No 00126G)         
35 Stirling Highway
Crawley WA 6009                      mailto:paul at 

  • Prev by Date: Machine date and Mathematica Date
  • Next by Date: Re: Information about subscripted function
  • Previous by thread: Re: Re: finite domains
  • Next by thread: Re: Re: finite domains