MathGroup Archive 2005

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

Search the Archive

Notation Package Precedence?

  • To: mathgroup at
  • Subject: [mg62026] Notation Package Precedence?
  • From: "Steven T. Hatton" <hattons at>
  • Date: Wed, 9 Nov 2005 03:45:59 -0500 (EST)
  • Sender: owner-wri-mathgroup at

I've discovered that I can produce a "logical equals" like this:

Biconditional[p_, q_] := (LogicalExpand //@ p) == (LogicalExpand //@ q)

But if I infix it like so:

p_ \[DoubleLeftRightArrow] q_ := Biconditional[p, q]

it doesn't group correctly unless I force it with parentheses.  For example:

(a \[And] b) \[Or] c \[DoubleLeftRightArrow] (a \[Or] c) \[And] (b \[Or] c)


(a && b) || (c == (a || c) && (b || c))

This seems to work correctly.  At least it produces the expected results.
((a \[And] b) \[Or] 
      c) \[DoubleLeftRightArrow] ((a \[Or] c) \[And] (b \[Or] c))

I tried using the Utilitie`Notation` package, but when I passed the option
SyntaxForm to Notation, it seemed to ignore it.  Does anybody know how to
get the Notation package to change the precedence of an operator?

I'm not convinced that will solve the genearl case.  I still have a problem

((a \[And] b) \[Or] c) \[DoubleLeftRightArrow] (a \[Or] c) \[And] (b \[Or]

which groups correctly

(c || (a && b)) == (a || c) && (b || c)

But does not evaluate to True, as it should.

The Mathematica Wiki:
Math for Comp Sci
Math for the WWW:

  • Prev by Date: Re: Testing whether code is run in batch mode
  • Next by Date: Re: Following Help Links with the Keyboard
  • Previous by thread: Re: simplifying ^ fails, on exact numerical constants in Mathematica 5.0
  • Next by thread: Re: Notation Package Precedence?