Let $X$ be a set with a partial operation $\cdot$ which is associative in the sense that if $x, y, z \in X$ and $x \cdot y$ and $y \cdot z$ are both defined, then $(x \cdot y) \cdot z$ and $x \cdot (y \cdot z)$ are both defined and $(x \cdot y) \cdot z = x \cdot (y \cdot z)$.
Under what conditions can $\cdot$ be extended to a (total) associative operation on $X$, creating a semigroup? There is a similar question that shows it is always possible if we add one more element to the set $X$, but I am looking for conditions under which there exists such an extension on $X$ itself - ideally, conditions that are able to be checked given a particular $(X, \cdot)$.
If there is at least one element of $X$ that $\cdot$ does not involve so far, or at least one element that "absorbs" every other where defined, then by the linked question we can use that element as the extra, and the linked construction can be used to extend $\cdot$ to all of $X$. So the "harder" question is, if we are assuming that $\cdot$ does involve every element of $X$ (that is, for all $x \in X$, there exists a $y \in X$ such that either $x \cdot y$ or $y \cdot x$ is defined), and there is no element that "absorbs" all others (that is, there is no $x \in X$ such that $x \cdot y = x$ for all $y$ where $x \cdot y$ is defined, and $y \cdot x = x$ for all $y$ where $y \cdot x$ is defined), then, when can $\cdot$ be extended?