0
$\begingroup$

On a homework assignment, we were given

$x \lt 5y \leftrightarrow x \gt z \rightarrow x + z \geq yw \wedge -x \lt z$

I broke it up into

$1~~~x <5y$ $2~~~~~x > z$ $3~~~x + z \geq yw \wedge -x \lt z$

The difficulty comes in which order to parse the sections. I don't know how to draw a tree in Latex, but I argued that $\leftrightarrow$ should be a the root and the $\rightarrow$ should be at the first right node. My friends argue that the $\rightarrow$ should be at the root, and the $\leftrightarrow$ should be at the first left node.

My reasoning is that with operators of equal precedence and lack of initial parenthesization, left associativity comes into play, thus rendering $\leftrightarrow$ as the root. My friends argue that parenthesizing the formula results in sections 2 and 3 together, thus making $\rightarrow$ the root.

Who's correct?

  • 0
    I second @Tunococ's suggestion. Even with some small amount of internal information (the clauses x>z\text{ and }-x, for instance), the only way I'd ask this on a homework was if I knew my students had seen enough precedence rules to make this unambiguous. As it stands, there's simply not enough background information to permit a unique answer (and I for one generally *hate* giving problems with more than one interpretation).2012-09-18

0 Answers 0