  In this paper we show how to compute algorithmically the full set of
algebraically independent constraints for singular mechanical and
field-theoretical models with polynomial Lagrangians. If a model under
consideration is not singular as a whole but has domains of dynamical (field)
variables where its Lagrangian becomes singular, then our approach allows to
detect such domains and compute the relevant constraints. In doing so, we
assume that the Lagrangian of a model is a differential polynomial and apply
the differential Thomas decomposition algorithm to the Euler-Lagrange
equations.
