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
]
14 assert dx
.name
not in T
.symbols
15 assert k
.name
not in T
.symbols
20 for i
, x0
in enumerate(x0s
):
24 T2
= T1
.project_out(T0
.symbols
)
28 for T2_eq
in T2
.equalities
:
30 T3_eq
= T2_eq
+ (k
- 1) * c
32 for T2_in
in T2
.inequalities
:
34 T3_in
= T2_in
+ (k
- 1) * c
36 T3
= Polyhedron(T3_eqs
, T3_ins
)
39 T4
= T3
.project_out([k
])
40 for i
, dx
in enumerate(dxs
):
43 T4
= T4
.project_out(dxs
)
47 i0
, j0
, i
, j
= symbols(['i', 'j', "i'", "j'"])
48 T
= Eq(i
, i0
+ 2) & Eq(j
, j0
+ 1)
51 Tstar
= affine_derivative_closure(T
, [i0
, j0
])