)cl all

Word := OrderedFreeMonoid(Symbol)
poly:= XPR(Integer,Word)
p:poly := 2 * x - 3 * y + 1
q:poly := 2 * x + 1
p + q
p * q
(p +q)^2 -p^2 -q^2 - 2*p*q
M := SquareMatrix(2,Fraction Integer)
poly1:= XPR(M,Word)
m1:M := matrix [[i*j**2 for i in 1..2] for j in 1..2]
m2:M := m1 - 5/4
m3: M := m2**2
pm:poly1   := m1*x + m2*y + m3*z - 2/3
qm:poly1 := pm - m1*x
qm**3
