Intuition for 'Higher-Order' Logic
In first-order logic formulas contain
- function symbols
- predicate symbols
First-order logic (FOL) is called 'first-order' because we can only quantify over variables, which are elements of the domain. We cannot quantify over interpretations of function symbols or relation symbols. In higher-order logic (HOL) we can quantify over functions and relations as well.
In FOL, we ask for satisfiability of a FOL formula, we are asking if there exist some interpretations of functions and relations for which formula evaluates to true. For example, formula
is satisfiable iff there exist a relation interpreting and a function interpreting such that for all the pair does not belong to interpretation. Informally, we could therefore describe satisfiability of the above formula as
Dually, validity of the formula would correspond to the statement
The last two formulas cannot be written in FOL, because they involve quantification over functions and relations. However, these formulas can be written in HOL. Moreover, in HOL we can write more complex conditions that cannot be described directly in terms of validity or satisfiability of FOL formulas, such as
Clearly, there are differences between functions, relations, and individuals in terms of how we can use them. For example, predicates return truth values, whereas functions return values of the domain. HOL uses a type system, similar to one in programming languages, to ensure that we construct only sensible formulas.
A related notion to FOL and HOL is multisorted FOL, which is a FOL where variables and terms have types. The most popular version has disjoint types, given by some set of types. These types are often called sorts. Each function symbol has arity, but the arity is not just a number, but a list of argument types and result types, that is, an expression of the form
where are types. Similarly, each predicate symbol of arguments has a type of the form
We build expressions using natural typing rules, allowing application only if the types match.
Interpretation of multisorted FOL, instead of having one domain has one domain for each type and we typically require sets for different to be disjoint. Interpretation function maps function symbol of arity into a function
and relation symbol of sort into a subset of
In multisorted FOL, we have disjoint countable sets of variables for each sort. We interpreted as bounded quantification .
Relation to standard FOL: Multisorted FOL can be represented as the standard FOL by using unary predicate for each sort , adding axioms that these predicate interpretations are disjoint, and replacing quantification such as with bounded quantification
In multisorted logic with equality, we can introduce one binary equality symbol for each sort , whose signature is .
In HOL we generalize the type system to have function types, and we use functions with different types to represent functions and predicates, allowing quantification over variables of arbitrary types. This starting point for such system is simply typed lambda calculus.