Associanize a magma This is a thing I have been thinking on and gotten a bit frustrated so I share my thoughts here in hope for clarification.
Let $M$ be a magma, that is a set with an underlying binary operation which we denote $\cdot$. The binary operation is not necessarily associative, that is we do not necessarily have 
$$a\cdot (b\cdot c)=(a\cdot b)\cdot c$$
Here is the issue at hand, in group theory we can "make" a group abelian by taking the quotient with its commutator subgrouop, $G/[G,G]$, which is abelian, I am wondering if there is something similar for magmas but for associativity.
Of course having dealt with universal algebra, semirings and semigroups (which is the target here in a way) what I need to work with is a relation, more specificly a congruence relation so I figured I would start defining it as such. So I started by saying that $e \mathrel{R} f$, or $(e,f)\in R$, if there exists some $a,b,c\in M$ such that $(a\cdot b)\cdot c = e$ and $a\cdot (b\cdot c) = f$, seemed like a good place to start for me in my quest, only that I realized that there is not necessarily a unit in a magma so we do not have $x \mathrel{R} x$ which is a requirement, well let's just throw those in too then I thought. Which is the reflexive closure of $R$, that is $\text{Cl}_\text{ref}(R)$ from before.
Next I thought about transitivity which is required and I got absolutely nowhere there in my attempts primarily because I could not find anyway to proceed after setting up the equalities with elements and all. I pretty much felt it was impossible so I figured "Let's just do the congruence closure and call it a day" $\text{Cl}_\text{cng}(R)$. Which would of course be a congruence by the very definition but I feel it's a bit "cheap" so to speak. And quite frankly I am not entirely certain that it will yield satisfactory results. So the question is more "is there a way to make a magma associative that is better than this?".
 A: Well, I think the way you do it is correct, but maybe you could describe it in a slightly simpler way. Just consider the semigroup presented by $\langle M \mid \{mn = m \cdot n \mid m, n \in M\}\rangle$ . In other words, take the quotient of the free semigroup on the alphabet $M$ by the relations induced by the multiplication in $M$. 
EDIT. Here is an example. Consider the following magma:
$$\begin{array}{c|ccc}
\ast &a&b&c \\ \hline
a & b&b&c \\
b & a&b&c \\
c & c&c&c
\end{array}$$
Now form the semigroup with generators $\{a, b, c\}$ and relations $\{aa = b, ab=b, ac=c, ba=a, bb=b, bc=c, ca=c, cb = c, cc=c\}$
Here is the corresponding GAP session:
gap> f := FreeSemigroup("a","b","c");; 
gap> a := GeneratorsOfSemigroup( g )[ 1 ];; 
gap> b := GeneratorsOfSemigroup( g )[ 2 ];; 
gap> c := GeneratorsOfSemigroup( g )[ 3 ];; 
gap> t := f / [[a*a,b], [a*b,b], [a*c,c], [b*a,a], [b*b,b], [b*c,c], [c*a,c], [c*b,c], [c*c,c]];
gap> Size( t );
2
gap> rws := ReducedConfluentRewritingSystem(t);
Rewriting System for Semigroup( [ a, b, c ] ) with rules
[ [ a^2, a ], [ a*c, c ], [ c*a, c ], [ c^2, c ], [ b, a ] ]

A: The congruence $R$ (which makes the magma $M/R$ associative) can be described as the transitive closure of the relation $S$ defined as follows: We have $(a,b) \in S$ if and only if there are elements $x_1,\dotsc,x_n$ in $M$ (which are not assumed to be distinct) such that both $a$ and $b$ can be written as nested products of these elements in this order. For example, the two elements
$$((x_1 x_2) x_3)  (x_4 (x_5 x_6))$$
$$x_1 (x_2 ((x_3 x_4) (x_5 x_6)))$$
are equivalent with respect to $S$.
The transitive closure means that $(a,b) \in R$ holds iff there are elements $y_1,\dotsc,y_n$ in $M$ such that $a=y_1$, $b=y_n$ and $(y_i,y_{i+1}) \in S$ for $1 \leq i < n$.
Since $S$ is reflexive and symmetric, $R$ is an equivalence relation. It is trivial to verify that $(a,b) \in S$ implies $(ca,cb) \in S$ and $(ac,bc) \in S$ for all $a,b,c \in M$. This property extends to $R$ (by induction on the length $n$ in the definition of $R$). Hence, $R$ is a congruence.
It is important to take the transitive closure here: It may happen that there are elements $x_1,x_2,x_3,x'_3$ in $M$ such that $(x_1 x_2) x_3 = (x_1 x_2) x'_3$ in $M$ but not $x_1 (x_2 x_3) = x_1 (x_2 x'_3)$ in $M$, and then $x_1 (x_2 x_3)$ and $x_1 (x_2 x'_3)$ will be equivalent with respect to $R$, but not necessarily with respect to $S$.
