You get a bonus - 1 coin for daily activity. Now you have 1 coin

Many-Sorted Logic

Lecture



Many-sorted logic can formally reflect our intention not to treat the universe as a homogeneous collection of objects, but to partition it in a way analogous to types in typed programming . Both the functional and the predicative « parts of speech » in the language of logic reflect this typed partitioning of the universe, even at the syntactic level: substitution and the passing of arguments can be carried out only in the corresponding way, taking «sorts» into account.

There are various ways of formalizing the above-mentioned intention; many-sorted logic is any package of information that implements it. In most cases, the following are provided:

  • a set of sorts, S
  • a corresponding generalization of the notion of a signature , allowing it to handle the additional information that comes with sorts.

The domain of discourse of any structure of this signature is then fragmented into disjoint subsets, one for each sort.

Example

When reasoning about biological organisms, it is useful to distinguish two sorts Many-Sorted Logicand Many-Sorted Logic. While the function Many-Sorted Logicmakes sense, a similar function Many-Sorted Logicusually does not. Many-sorted logic allows terms such as Many-Sorted Logic, but rejects terms of the form Many-Sorted Logicas syntactically ill-formed.

Algebraization

The algebraization of many-sorted logic is explained in the paper by Caleiro and Gonçalves , which generalizes abstract algebraic logic to the many-sorted case, but can also be used as introductory material.

Order-sorted logic

Many-Sorted Logic

Example of a sort hierarchy

While many-sorted logic requires two distinct sorts in order to have disjoint universe sets, order-sorted logic allows one sorts1Many-Sorted Logicto be declared a subsort of another sort Many-Sorted Logic, usually by writing Many-Sorted Logicor similar syntax. In the biology example above, it is desirable to declare

dog⊆carnivore Many-Sorted Logic,

dog⊆mammal Many-Sorted Logic,

carnivore⊆animal Many-Sorted Logic,

mammal⊆animal Many-Sorted Logic,

animal⊆organismMany-Sorted Logic,

plant⊆organismMany-Sorted Logic,

etc.; see figure.

Wherever a term of sortsMany-Sorted Logicis required, a term of any subsort ofsMany-Sorted Logiccan be used instead. This is the Liskov substitution principle . For example, if a function is declared Many-Sorted Logic, and a constant is declared Many-Sorted Logic, the term )Many-Sorted Logicis perfectly valid and has sort Many-Sorted LogicTo provide the information that the mother of a dog is, in turn, also a dog, one more declaration must be made. Many-Sorted Logiccan be issued; this is called function overloading , analogous to overloading in programming languages .

Order-sorted logic can be translated into unsorted logic by using a unary predicatep Many-Sorted Logicfor each sortsMany-Sorted Logic, and an axiom Many-Sorted Logicfor each subsort declaration Many-Sorted LogicThe converse approach has proved successful in automated theorem proving: in 1985 Christoph Walther was able to solve the then-benchmark problem by translating it into order-sorted logic, thereby reducing it by an order of magnitude, since many unary predicates turned into sorts.

To incorporate order-sorted logic into a clause-based automated theorem prover, a corresponding algorithm for order-sorted unification is needed, which requires that for any two declared sorts Many-Sorted Logictheir intersection Many-Sorted Logicmust also be declared: if Many-Sorted Logicand Many-Sorted Logicare variables of sort Many-Sorted Logicand Many-Sorted Logic, respectively, the equation Many-Sorted Logichas the solution Many-Sorted Logic, where Many-Sorted Logic.

Smolka generalized order-sorted logic to provide parametric polymorphism . In his framework, subsort declarations extend to expressions of complex types. As a programming example, one can cite a parametric sort Many-Sorted Logiccan be declared (with Many-Sorted Logicbeing a type parameter, as in a C++ template ), and from the subsort declaration Many-Sorted Logicthe relation Many-Sorted Logicis automatically derived, meaning every list of integers is also a list of floating-point numbers.

Schmidt-Schauß generalized order-sorted logic to allow term declarations. For example, suppose the subsort declarations Many-Sorted Logicand Many-Sorted Logic, a term declaration such as Many-Sorted Logicallows declaring a property of integer addition that cannot be expressed by ordinary overloading.

See also

  • Categorical logic
  • First-order logic § Many-sorted logic
  • [[b13701]]
  • [[b13702]]
created: 2025-12-05
updated: 2026-03-10
37



Was this answer useful?
Choose a quick rating so we can improve the next answer for you.
How satisfied are you?


Comments

To leave a comment

If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Lectures and tutorial on "Logics"

Terms: Logics