from pypol import *
-def affine_derivative_closure(T, x0s):
+def affine_derivative_closure(T, x0s, xs):
- xs = [Symbol("{}'".format(x0.name)) for x0 in x0s]
- dxs = [Symbol('d{}'.format(x0.name)) for x0 in x0s]
- k = Symbol('k')
+ dxs = [x0.asdummy() for x0 in x0s]
+ k = Dummy('k')
for x in T.symbols:
assert x in x0s + xs
- for dx in dxs:
- assert dx.name not in T.symbols
- assert k.name not in T.symbols
T0 = T
T = Eq(i, i0 + 2) & Eq(j, j0 + 1)
print('T =', T)
-Tstar = affine_derivative_closure(T, [i0, j0])
+Tstar = affine_derivative_closure(T, [i0, j0], [i, j])
print('T* =', Tstar)