Every function symbol, relation symbol, and connective is associated with an arity (the set of nnn-ary function symbols is denoted FnsubscriptFnF_{n}, and similarly for relation symbols and connectives). Each quantifier is a generalized quantifier associated with a quantifier type ⟨n1,…,nn⟩subscriptn1normal-…subscriptnn\langle n_{1},\ldots,n_{n}\rangle.

The underlying logic has a (possibly empty) set of types TTT. There is a functionType:F∪V→Tnormal-:Typenormal-→FVT\operatorname{Type}:F\cup V\rightarrow T which assignes a type to each function and variable. For each arity nnn is a function Inputsn:Fn∪Rn→Tnnormal-:subscriptInputsnnormal-→subscriptFnsubscriptRnsuperscriptTn\operatorname{Inputs}_{n}:F_{n}\cup R_{n}\rightarrow T^{n} which gives the types of each of the arguments to a function symbol or relation. In addition, for each quantifier type ⟨n1,…,nn⟩subscriptn1normal-…subscriptnn\langle n_{1},\ldots,n_{n}\rangle there is a function Inputs⟨n1,…,nn⟩subscriptInputssubscriptn1normal-…subscriptnn\operatorname{Inputs}_{{\langle n_{1},\ldots,n_{n}\rangle}} defined on Q⟨n1,…,nn⟩subscriptQsubscriptn1normal-…subscriptnnQ_{{\langle n_{1},\ldots,n_{n}\rangle}} (the set of quantifiers of that type) which gives an nnn-tuple of nisubscriptnin_{i}-tuples of types of the arguments taken by formulas the quantifier applies to.

The terms of ℒℒ\mathcal{L} of type t∈TtTt\in T are built as follows:

1.

If vvv is a variable such that Type⁡(v)=tTypevt\operatorname{Type}(v)=t then vvv is a term of type ttt

2.

If fff is an nnn-ary function symbol such that Type⁡(f)=tTypeft\operatorname{Type}(f)=t and t1,…,tnsubscriptt1normal-…subscripttnt_{1},\ldots,t_{n} are terms such that for each i<nini<nType⁡(ti)=(Inputsn⁡(f))iTypesubscripttisubscriptsubscriptInputsnfi\operatorname{Type}(t_{i})=(\operatorname{Inputs}_{n}(f))_{i} then f⁢t1,…,tnfsubscriptt1normal-…subscripttnft_{1},\ldots,t_{n} is a term of type ttt

The formulas of ℒℒ\mathcal{L} are built as follows:

1.

If rrr is an nnn-ary relation symbol and t1,…,tnsubscriptt1normal-…subscripttnt_{1},\ldots,t_{n} are terms such that Type⁡(ti)=(Inputsn⁡(r))iTypesubscripttisubscriptsubscriptInputsnri\operatorname{Type}(t_{i})=(\operatorname{Inputs}_{n}(r))_{i} then r⁢t1,…,tnrsubscriptt1normal-…subscripttnrt_{1},\ldots,t_{n} is a formula

2.

If ccc is an nnn-ary connective and f1,…,fnsubscriptf1normal-…subscriptfnf_{1},\ldots,f_{n} are formulas then c⁢f1,…,fncsubscriptf1normal-…subscriptfncf_{1},\ldots,f_{n} is a formula

3.

If qqq is a quantifier of type ⟨n1,…,nn⟩subscriptn1normal-…subscriptnn\langle n_{1},\ldots,n_{n}\rangle, v1,1,…,v1,n1,v2,1,…,vn,1,…,vn,nnsubscriptv11normal-…subscriptv1subscriptn1subscriptv21normal-…subscriptvn1normal-…subscriptvnsubscriptnnv_{{1,1}},\ldots,v_{{1,n_{1}}},v_{{2,1}},\ldots,v_{{n,1}},\ldots,v_{{n,n_{n}}} are a sequence of variables such that Type⁡(vi,j)=((Inputs⟨n1,…,nn⟩⁡(q))j)iTypesubscriptvijsubscriptsubscriptsubscriptInputssubscriptn1normal-…subscriptnnqji\operatorname{Type}(v_{{i,j}})=((\operatorname{Inputs}_{{\langle n_{1},\ldots,%
n_{n}\rangle}}(q))_{j})_{i} and f1,…,fnsubscriptf1normal-…subscriptfnf_{1},\ldots,f_{n} are formulas then q⁢v1,1,…,v1,n1,v2,1,…,vn,1,…,vn,nn⁢f1,…,fnqsubscriptv11normal-…subscriptv1subscriptn1subscriptv21normal-…subscriptvn1normal-…subscriptvnsubscriptnnsubscriptf1normal-…subscriptfnqv_{{1,1}},\ldots,v_{{1,n_{1}}},v_{{2,1}},\ldots,v_{{n,1}},\ldots,v_{{n,n_{n}}%
}f_{1},\ldots,f_{n} is a formula

Generally the connectives, quantifiers, and variables are specified by the appropriate logic, while the function and relation symbols are specified for particular languages. Note that 000-ary functions are usually called constants.

If there is only one type which is equated directly with truth values then this is essentially a propositional logic. If the standard quantifiers and connectives are used, there is only one type, and one of the relations is == (with its usual semantics), this produces first order logic. If the standard quantifiers and connectives are used, there are two types, and the relations include == and ∈\in with appropriate semantics, this is second order logic (a slightly different formulation replaces ∈\in with a 222-ary function which represents function application; this views second order objects as functions rather than sets).