projects
/
linpy.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Support for dummy symbols
[linpy.git]
/
examples
/
nsad2010.py
diff --git
a/examples/nsad2010.py
b/examples/nsad2010.py
index
e2cacc7
..
1bf97d8
100755
(executable)
--- a/
examples/nsad2010.py
+++ b/
examples/nsad2010.py
@@
-2,17
+2,13
@@
from pypol import *
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 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
T0 = T
@@
-48,5
+44,5
@@
i0, j0, i, j = symbols(['i', 'j', "i'", "j'"])
T = Eq(i, i0 + 2) & Eq(j, j0 + 1)
print('T =', 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)
print('T* =', Tstar)