5 def affine_derivative_closure(T
, x0s
):
7 xs
= [Symbol("{}'".format(x0
.name
)) for x0
in x0s
]
8 dxs
= [Symbol('d{}'.format(x0
.name
)) for x0
in x0s
]
15 assert dx
.name
not in T
.symbols
16 assert k
.name
not in T
.symbols
21 for i
, x0
in enumerate(x0s
):
25 T2
= T1
.project_out(T0
.symbols
)
29 for T2_eq
in T2
.equalities
:
31 T3_eq
= T2_eq
+ (k
- 1) * c
33 for T2_in
in T2
.inequalities
:
35 T3_in
= T2_in
+ (k
- 1) * c
37 T3
= Polyhedron(T3_eqs
, T3_ins
)
40 T4
= T3
.project_out([k
])
41 for i
, dx
in enumerate(dxs
):
44 T4
= T4
.project_out(dxs
)
48 i0
, j0
, i
, j
= symbols(['i', 'j', "i'", "j'"])
49 T
= Eq(i
, i0
+ 2) & Eq(j
, j0
+ 1)
52 Tstar
= affine_derivative_closure(T
, [i0
, j0
])