Is the term $$\forall x p(x) \rightarrow \forall x q(x)$$ equal to $$\forall x (p(x) \rightarrow \forall x q(x))$$ or $$(\forall x p(x)) \rightarrow (\forall x q(x))$$
In other words: What is the operator precedence of $\forall$ and $\exists$? Does it make a difference?
There is no "precedence" between quantifiers: in a formula like $\forall x \ \exists y \ \varphi$, the "inner" $\exists$ is in the scope of the "outer" $\forall$.
The recursive definition of formula for FOL is (having defined term) more or less this :
Then we can introduce abbreviations for readibility; see :
Thus, we have a "formal" specification for the syntax: it must be unambiguous, i.e. "processable" by a machine.