  A sequence of vertices in a graph is called a \emph{(total) legal dominating
sequence} if every vertex in the sequence (total) dominates at least one vertex
not dominated by those ones that precede it, and at the end all vertices of the
graph are (totally) dominated. The \emph{Grundy (total) domination number} of a
graph is the size of the largest (total) legal dominating sequence. In this
work, we address the problems of determining these two parameters by
introducing a generalized version of them. We explicitly calculate the
corresponding (general) parameter for paths and web graphs. We propose integer
programming formulations for the new problem and we study the polytope
associated to one of them. We find families of valid inequalities and derive
conditions under which they are facet-defining. Finally, we perform
computational experiments to compare the formulations as well as to test valid
inequalities as cuts in a B\&C framework.
