MATH.5:5.1 - Evaluate expressions, then test an equation
Build expressions from x,y,0,1,+,*. Assign x=2 and y=3, and use ordinary integer addition and multiplication. Evaluation returns E((x*y)+1)=7. The same rules evaluate every finite expression and preserve its two operations.
Now let the source identify expressions using the usual commutative-semiring laws: associativity, the two identities, commutativity of both operations, distributivity, and multiplication by zero. Integer arithmetic satisfies those laws, so evaluation also defines a map from the identified expressions.
Change the assignment to matrices:
A=[[0,1],[0,0]], B=[[0,0],[1,0]].
Use matrix addition and multiplication, the zero matrix and identity matrix. This still evaluates freely formed expressions. But:
A*B=[[1,0],[0,0]]
B*A=[[0,0],[0,1]].
The source’s equation x*y=y*x therefore fails under this assignment. A substitution into the commutative quotient would give two answers for one source element.
If ordered multiplication is needed, use expressions whose equations retain its order. Matrix addition, multiplication, zero and identity support the remaining semiring laws. If commutative multiplication is essential to the original question, retain a target and assignment that satisfy it instead. The failed equation identifies the mathematical change required.