I'm wondering if it is possible to axiomatize associativity using a set of equations in only two variables.
Suppose we have a signature consisting of one binary operation $\cdot$. Is it possible to find a set $\Sigma$ of equations containing only variables $x$ and $y$, such that the equational theory generated by axioms $\Sigma$ is equal to the equational theory generated by axiom $(x\cdot y)\cdot z = x\cdot (y\cdot z)$?
Or in other words, such that the variety defined by equations $\Sigma$ is equal to the variety defined by equation $(x\cdot y)\cdot z = x\cdot (y\cdot z)$?
EDIT: We can take as $\Sigma$ the set of all equations in variables $x$ and $y$ that are entailed by equation $(x\cdot y)\cdot z = x\cdot (y\cdot z)$. For example $(x\cdot y)\cdot x = x\cdot (y\cdot x)$ is one of the many equations contained in $\Sigma$. The question is whether $\Sigma$ in turn entails $(x\cdot y)\cdot z = x\cdot (y\cdot z)$.
EDIT2: As per Milo Brandt's comment, for any three terms $p(x,y)$, $q(x,y)$, $r(x,y)$ containing at most variables $x, y$, equation $p\cdot (q\cdot r)=(p\cdot q)\cdot r$ is in $\Sigma$. Thus, for any algebra $A$ in the variety defined by equations $\Sigma$, every subalgebra of $A$ generated by two elements is associative. So, in a sense, $A$ is "locally associative".
To answer the question negatively, it suffices to find an algebra $(A, \cdot)$ such that each subalgebra generated by two elements is associative, but such that $A$ itself is non-associative.
Let $A=\{a,b,c\}$, and let $\cdot$ be defined by $$ab=ba=bb=b\\ bc=cb=cc=c\\ ca=ac=aa=a.$$
Every subset of $A$ of size $2$ is the domain of a subalgebra, isomorphic to $(\{0,1\},\max)$, which is associative. But $A$ is not associative, since $(ab)c = bc = c$, but $a(bc) = ac = a$.