Computing the Zariski closure of morphic images of context-free languages

Develop an algorithm that, given a context-free language L ⊆ Σ* and a monoid morphism φ: Σ* → M_d(ℚ), computes the Zariski closure of the set φ(L) ⊆ M_d(ℚ), equivalently producing a finite basis for the vanishing ideal of φ(L).

Background

For regular languages and for finitely generated matrix monoids, there exist procedures to compute Zariski closures of morphic images. The paper extends decidability to one-counter languages (1-VASS) and shows undecidability for indexed languages, but leaves the context-free case unresolved.

This problem is the mathematical core behind computing all polynomial invariants for recursive affine programs: execution paths of such programs are modeled by context-free languages, and computing the Zariski closure of φ(L) would yield the full set of polynomial relations among matrix entries arising from all valid interprocedural paths.

References

The existence of a procedure for computing the Zariski closure of \varphi(L), given a context-free language L and a morphism \varphi, remains open.

Algebraic Closure of Matrix Sets Recognized by 1-VASS  (2507.09373 - Manssour et al., 12 Jul 2025) in Section 1.4 Discussion