5 def affine_derivative_closure(T
, x0s
, xs
):
7 dxs
= [x0
.asdummy() for x0
in x0s
]
16 for i
, x0
in enumerate(x0s
):
20 T2
= T1
.project_out(T0
.symbols
)
24 for T2_eq
in T2
.equalities
:
26 T3_eq
= T2_eq
+ (k
- 1) * c
28 for T2_in
in T2
.inequalities
:
30 T3_in
= T2_in
+ (k
- 1) * c
32 T3
= Polyhedron(T3_eqs
, T3_ins
)
35 T4
= T3
.project_out([k
])
36 for i
, dx
in enumerate(dxs
):
39 T4
= T4
.project_out(dxs
)
43 i0
, j0
, i
, j
= symbols(['i', 'j', "i'", "j'"])
44 T
= Eq(i
, i0
+ 2) & Eq(j
, j0
+ 1)
47 Tstar
= affine_derivative_closure(T
, [i0
, j0
], [i
, j
])