Wikipedia / Many-sorted logic
Wikipedia / Many-sorted logic
Many-sorted logic can reflect formally our intention not to handle the universe as a homogeneous collection of objects, but to partition it in a way that is similar to types in typeful programming. Both functional and assertive "parts of speech" in the language of the logic reflect this typeful partitioning of the universe, even on the syntax level: substitution and argument passing can be done only accordingly, respecting the "sorts".
There are various ways to formalize the intention mentioned above; a many-sorted logic is any package of information which fulfils it. In most cases, the following are given:
a set of sorts, S
an appropriate generalization of the notion of signature to be able to handle the additional information that comes with the sorts.
The domain of discourse of any structure of that signature is then fragmented into disjoint subsets, one for every sort.
Example
as syntactically ill-formed.
Algebraization
The algebraization of many-sorted logic is explained in an article 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
While many-sorted logic requires two distinct sorts to have disjoint universe sets, order-sorted or similar syntax. In the above biology example, it is desirable to declare
,
,
,
,
,
,
and so on; cf. picture.
may be supplied instead (Liskov substitution principle may be issued; this is called function overloading, similar to overloading in programming languages.
. The reverse approach was successful in automated theorem proving: in 1985, Christoph Walther could solve a then benchmark problem by translating it into order-sorted logic, thereby boiling it down an order of magnitude, as many unary predicates turned into sorts.
In order to incorporate order-sorted logic into a clause-based automated theorem prover, a corresponding order-sorted unification.
Smolka generalized order-sorted logic to allow for parametric polymorphism. being a type parameter as in a C++ template is automatically inferred, meaning that each list of integers is also a list of floats.
Schmidt-Schauß generalized order-sorted logic to allow for term declarations. allows to declare a property of integer addition that could not be expressed by ordinary overloading.
See also
References
Early papers on many-sorted logic include:
, collected in the author's Computation, Logic, Philosophy. A Collection of Essays, Beijing: Science Press; Dordrecht: Kluwer Academic, 1990.
External links
"Many-sorted Logic", the first chapter in by Calogero G. Zarba