Make program act on itself by entering certain areas of code (as a string) which it must itself execute
My program must act on itself by entering certain areas of code (in the form of a string) which it must itself execute.
Take the ring K of polynomials with four unknowns x_00, x_10, x_01 and x_11.
K.<x_00, x_10, x_01, x_11> = QQ []
g = K.random_element()
for i in range(1):
for j in range(1):
2 + g.monomial_coefficient(x_ij)
The last command tries to add to 2 the coefficient of the monomial x_ij. This is where it blocks.