  A systematic theory of structural limits for finite models has been developed
by Nesetril and Ossona de Mendez. It is based on the insight that the
collection of finite structures can be embedded, via a map they call the Stone
pairing, in a space of measures, where the desired limits can be computed. We
show that a closely related but finer grained space of measures arises --- via
Stone-Priestley duality and the notion of types from model theory --- by
enriching the expressive power of first-order logic with certain
``probabilistic operators''. We provide a sound and complete calculus for this
extended logic and expose the functorial nature of this construction.
  The consequences are two-fold. On the one hand, we identify the logical gist
of the theory of structural limits. On the other hand, our construction shows
that the duality-theoretic variant of the Stone pairing captures the adding of
a layer of quantifiers, thus making a strong link to recent work on semiring
quantifiers in logic on words. In the process, we identify the model theoretic
notion of types as the unifying concept behind this link. These results
contribute to bridging the strands of logic in computer science which focus on
semantics and on more algorithmic and complexity related areas, respectively.
