Math 2.0

Computer science Definition

Abstract data type as an algebra

Builds on Many-sorted algebraInitial algebra semanticsHomomorphismIdentity

Definition

Let SS be a set of sorts and let Σ\Sigma be an SS-sorted signature. An algebraic specification is a pair (Σ,E)(\Sigma, E), where EE is a set of equations between Σ\Sigma-terms with variables, each side of the same sort. A model of (Σ,E)(\Sigma, E) is a many-sorted Σ\Sigma-algebra that satisfies every equation of EE. A model II is initial if for every model AA there is exactly one homomorphism I→AI \to A. The abstract data type specified by (Σ,E)(\Sigma, E) is the class of initial models of (Σ,E)(\Sigma, E).

Remarks

Initial models exist, and any two of them are isomorphic, so the abstract data type is one isomorphism class of algebras; this is the initial algebra semantics of the specification. An initial model has two features. Every element is the value of a ground term ("no junk"), and two ground terms are equal in it only if EE proves them equal ("no confusion").

Example: sorts nat\mathrm{nat} and bool\mathrm{bool}; constants true,false ⁣:bool\mathrm{true}, \mathrm{false} \colon \mathrm{bool} and 0 ⁣:nat0 \colon \mathrm{nat}; operations s ⁣:nat→nats \colon \mathrm{nat} \to \mathrm{nat} and iszero ⁣:nat→bool\mathrm{iszero} \colon \mathrm{nat} \to \mathrm{bool}; equations iszero(0)=true\mathrm{iszero}(0) = \mathrm{true} and iszero(s(x))=false\mathrm{iszero}(s(x)) = \mathrm{false}. The model with carriers ℕ\N and {true,false}\set{\mathrm{true}, \mathrm{false}} is initial. Each element is the value of a ground term, and two ground terms with the same value are equal by the equations.

Non-example: the model with one element in each sort satisfies EE but is not initial. A homomorphism from it to the model above would send its single Boolean element to both true\mathrm{true} and false\mathrm{false}, which is impossible.

Reading path

To understand this page from the ground up, read these 5 pages in order. The foundations come first.

Show the path as a graph
Each page uses the pages above it. The colour of the bar on a box shows how strong the evidence is, and the box also gives it as text. The list has the same pages.
  • no evidence level
  1. Homomorphism concept
  2. Identity concept
  3. Initial algebra semantics concept
  4. Many-sorted algebra concept
  5. Abstract data type as an algebra definition

Further reading

  1. Web https://en.wikipedia.org/wiki/Abstract_data_type
About this page
TagQPT5H6MM99
URIm2://QPT5H6MM99
Kinddefinition
WritingW0 stub
MSC68Q65, 08A70
DefinesAbstract data type as an algebra
UsesMany-sorted algebra, Initial algebra semantics, Homomorphism, Identity

Markdown · JSON · Edit on GitHub

What this page needs for W1

  • an inventory row: the row of the inventory that the node accounts for (0 of 1)
  • a source with a locator (0 of 1)

The writing levels say how complete the text of a page is. They do not measure its truth.

What links here

No page links to this page yet.