  Monadic second order logic can be used to express many classical notions of
sets of vertices of a graph as for instance: dominating sets, induced
matchings, perfect codes, independent sets or irredundant sets. Bounds on the
number of sets of any such family of sets are interesting from a combinatorial
point of view and have algorithmic applications. Many such bounds on different
families of sets over different classes of graphs are already provided in the
literature. In particular, Rote recently showed that the number of minimal
dominating sets in trees of order $n$ is at most $95^{\frac{n}{13}}$ and that
this bound is asymptotically sharp up to a multiplicative constant. We build on
his work to show that what he did for minimal dominating sets can be done for
any family of sets definable by a monadic second order formula.
  We first show that, for any monadic second order formula over graphs that
characterizes a given kind of subset of its vertices, the maximal number of
such sets in a tree can be expressed as the \textit{growth rate of a bilinear
system}. This mostly relies on well known links between monadic second order
logic over trees and tree automata and basic tree automata manipulations. Then
we show that this "growth rate" of a bilinear system can be approximated from
above.We then use our implementation of this result to provide bounds on the
number of independent dominating sets, total perfect dominating sets, induced
matchings, maximal induced matchings, minimal perfect dominating sets, perfect
codes and maximal irredundant sets on trees. We also solve a question from D.
Y. Kang et al. regarding $r$-matchings and improve a bound from G\'orska and
Skupie\'n on the number of maximal matchings on trees. Remark that this
approach is easily generalizable to graphs of bounded tree width or clique
width (or any similar class of graphs where tree automata are meaningful).
