1

While there is no agreed upon convention on the order of precedence of connectives, there seems to be some consensus on right associativity, so that:

$$ \phi \rightarrow \psi \rightarrow \gamma $$

is syntactically equivalent to

$$ \phi \rightarrow (\psi \rightarrow \gamma)\; . $$

Is there a rationale to favour this over

$$ (\phi \rightarrow \psi) \rightarrow \gamma\;, $$

which is more resemblant of arithmetic?

Apart from this, I wonder if the constructs $\phi \rightarrow \psi \rightarrow \gamma$ are ever used in practice. I am far from an expert, but I never see them (at least not in the books advocating them) and parentheses are usually preferred.

antonio
  • 411

2 Answers2

5

In mathematical logic in general the consensus for right associativity is not so strong that I would feel safe in using it without warning when writing for a general audience.

On the other hand, in computer science, it is almost universal to interpret $\phi\to\psi\to\gamma$ as $\phi\to(\psi\to\gamma)$.

The reason for this (or at least the reason I know) is somewhat indirect. First, the Curry-Howard isomorphism gives a surprisingly precise technical correspondence between the uses of the symbol $\to$ as a logical connective and the use of the symbol $\to$ to form function types such as in the context $f:\mathbb R\to\mathbb R$.

In the context of function types, $A\to (B\to C)$ is a function that takes something for $A$ and gives us a new function that will take something from $B$ and eventually spit out something from $C$. This is effectively the same as a function that takes both something from $A$ and something from $B$ and then produces something from $C$: $$ A \to (B\to C) \quad\cong\quad (A\times B)\to C $$ In many situations it is technically convenient to have a system with as few primitive constructions as possible, so this trick of representing a function as $A\to(B\to C)$ instead of $(A\times B)\to C$ is very popular in theoretical computer science. It is known as currying and means that you can often do without a primitive definition of pairs (or functions of more than one argument).

For this reason computer scientists consider it much less "advanced" to consider functions that produce functions as output as it is to have functions as input to other function. The computer scientist will relatively often have to write chains of the shape $$ A\to(B\to(C\to(D\to E))$$ compared to how often we see $(A\to B)\to C$.

At least within computer science, this is generally considered enough of a reason to let $A\to B\to C$ mean the thing we use often, rather than the thing we use more rarely.


The convention transfers back to logic through the Curry-Howard correspondence because it would simply be dreadfully confusing to have a different convention for the connective than for the type constructor.

(In logic, currying is the logical equivalence between $\phi\to(\psi\to\gamma)$ and $(\phi\land\psi)\to\gamma$).

  • "(In logic, currying is the logical equivalence between ϕ→(ψ→γ) and (ϕ∧ψ)→γ)." I thought currying went one way. Now it sounds like it goes two ways. Which is it? – Doug Spoonwood Jun 24 '18 at 00:27
1

ϕ→ψ→γ is a complete quirk of putting an operator symbol between variables and constants. There is nothing like ϕ→ψ→γ in any prefix or postfix notation scheme. Including in arithmetic. ϕ→ψ→γ is not well-formed. Thus, it lies left up to the author as to how disambiguate it. If the author doesn't do that in any sort of extensive text, then they may well not understand the concept of a well-formed formula. Also consider, the following:

1) X→Y.

Let's say we substitute ϕ→ψ→γ for X. Then we have:

ϕ→ψ→γ→Y. If we assumed right-associativity, then ϕ→ψ→γ→Y means (ϕ→(ψ→(γ→Y))). But, ϕ→ψ→γ meant (ϕ→(ψ→γ)). So, we should have gotten ((ϕ→(ψ→γ))→Y).

Let's say we substitute ϕ→ψ→γ for Y, again in 1). Then we have:

X→ϕ→ψ→γ. If we assumed left-associativity, then X→ϕ→ψ→γ means (((X→ϕ)→ψ)→γ). But, ϕ→ψ→γ meant ((ϕ→ψ)→γ). So, we should have gotten (X→((ϕ→ψ)→γ)).

So, even if there exists some reason to prefer left-associativity over right-associativity they both end up with an issue if you want something like a rule of substitution or replacement. And, at this point in time, I don't see any reason to favor one over the other, since they both have the same sort of issue.