TITLE: What is a logical formula in the language of categories? How can we express basic model theoretic concepts categorically?
QUESTION [5 upvotes]: At the beginning of a course in Model Theory, one is introduced to the definition of signature, structure and homomorphism. It is then clear that the class of all structures over a fixed signature $L$ forms a category. Or that taking the reduction of a structure to a smaller signature gives raise to a functor.  
The fact is that as we go further, we build a lot of syntax from our signature: we introduce terms, atomic formulas and then a full, possibly infinitary laguage. We speak of theories, and most fundamentally of the Tarski truth relation "$\models$".
It is not clear to me how one can formalize these syntactic concepts and their interplay with semantics categorically, and I would be very curious to know about possible vocabularies between the two fields.
For instance: what is, categorically a formula? How can we express its truth in a structure? 
Any help or reference would be great, especially if introductory. 
Thanks in advance

REPLY [5 votes]: If you're talking about constructing the syntax of a language internal to a category, the best development I've seen of this is in this thesis by Shawn Henry, starting p.16. The setting for this construction is a topos $\mathcal{E}$ with a natural numbers object $N$.
The idea is that you define a (relational, in this case) signature with some data,

Objects $S,R,V$ of sorts, relation symbols, and variables,
A morphism $a:R\to \Sigma_N (N^*S)^{[n]}$ giving the arity of each relation symbol

A structure for this signature is given by

A morphism $d:D\to S$, which one thinks of as an indexed family of domains for each sort,
A subobject of $a^*\Sigma_N(N^*d)^{[n]}$ (as an object in the slice category $\mathcal{E}/R$)

The constructions of formulas, theories, and the notion of a structure being a model of a theory are very fiddly, but are essentially the straightforward category theoretic interpretation of the usual set theoretic manipulations of syntax trees and subsets.
It's worth noting that the notion of syntax you end up with here can be kind of weird. Your syntactic objects may have a sheaf structure (as an example) that is figuring in to how it relates to the structure that interprets it. But in some contexts this is a feature rather than a bug.