{
  "aliases": null,
  "backlinks": [
    {
      "field": "defines",
      "target": "QPT5H6MM99"
    }
  ],
  "body": "\n## Summary\n\nIn the algebraic approach to programming, an abstract data type is described by its operations and their equations.\nIt does not depend on a concrete memory layout.\nSuch a description is an algebraic specification: a [[many-sorted signature|WAQJJ5GX68]] together with a set of equations.\nThe data type itself is the [[initial algebra|R76EC56V9R]] of the specification, which is unique up to isomorphism.\nSo any two correct implementations behave in the same way.\nThis view, worked out in the 1970s, makes the correctness of an implementation a question about homomorphisms of algebras.\n\n## Explanations\n\n### L1 human\n\nA programmer who uses a stack only needs to know what push, pop and top do, not how the stack is stored.\nThe algebraic view writes down these operations and the rules between them, such as \"pop after push gives back the old stack\".\nMany different data structures obey these rules, and some obey extra rules by accident.\nThe intended data type is the one that obeys the rules and nothing more, and where every value is built by the operations.\nThis is the [[initial algebra|HVF403PQ4H]] of the rules, and it is the same up to renaming for every honest implementation.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "kind": "concept",
    "msc": [
      "68Q65",
      "08A70"
    ],
    "name": "Abstract data type as an algebra",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Abstract_data_type"
      }
    ],
    "tag": "86144NHH59"
  },
  "kind": "concept",
  "link": "https://tamnd.github.io/math2/node/86144NHH59/",
  "links": null,
  "markdown": "https://tamnd.github.io/math2/node/86144NHH59.md",
  "msc": [
    "68Q65",
    "08A70"
  ],
  "name": "Abstract data type as an algebra",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/861/86144NHH59.md",
  "status": null,
  "tag": "86144NHH59",
  "uri": "m2://86144NHH59",
  "url": "https://tamnd.github.io/math2/wiki/abstract-data-type-as-an-algebra/",
  "writing": {
    "tag": "86144NHH59",
    "kind": "concept",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
