{
  "slug": "uniquely-decodable-code",
  "term": "Uniquely decodable code",
  "aliases": [
    "Uniquely decipherable code"
  ],
  "definition": "A uniquely decodable code maps distinct finite sequences of source symbols to distinct concatenations of codewords.",
  "note": "Scope: The codebook and complete finite bitstring must be known. Prefix-free codes satisfy this property, but some nonprefix codes do too; the broader property does not promise immediate left-to-right decisions. [falucskai2011] [cassaigne-nicolas]\n\nDelay: The nonprefix codewords 0, 01 and 11 are uniquely decodable. Yet 0 followed by repeated 11 and 01 followed by repeated 11 share arbitrarily long prefixes. A uniform streaming decision bound does not follow from finite-message uniqueness. [hesela-unique]\n\nTesting: Sardinas-Patterson checks possible unmatched suffixes until ambiguity is found or their finite reachability search closes. Enumerating only short messages is not a general proof: 0, 0010 and 1001 first collide at ten bits in the supplied example. [falucskai2008] [hesela-unique]\n\nRecovery: Unique parsing does not establish the intended data, detect every changed bit, recover missing framing or prove object completeness. [hesela-unique]",
  "related": [
    "prefix-free-code"
  ],
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-18",
  "citations": [
    {
      "id": "falucskai2011",
      "title": "Janos Falucskai: A novel test for unique decipherability of codes, 2011, pp. 535-537",
      "url": "https://publi.math.unideb.hu/paper/1579/download/10_5486_PMD_2011_4716.pdf",
      "accessed": "2026-11-18"
    },
    {
      "id": "cassaigne-nicolas",
      "title": "Cassaigne and Nicolas: On the decidability of semigroup freeness, arXiv:0808.3112v4, definitions and examples in section 1.1",
      "url": "https://arxiv.org/pdf/0808.3112v4",
      "accessed": "2026-11-18"
    },
    {
      "id": "hesela-unique",
      "title": "Hesela: unique finite decoding versus streaming delay, exact constructed examples",
      "url": "https://hesela.com/analyses/compressed-archives-dictionary-dependencies/#unique-decoding",
      "accessed": "2026-11-18"
    },
    {
      "id": "falucskai2008",
      "title": "Janos Falucskai: On equivalence of two tests for codes, 2008, section 1, pp. 249-250",
      "url": "https://www.emis.de/journals/AMAPN/vol24_2/amapn24_25.pdf",
      "accessed": "2026-11-18"
    }
  ],
  "provenance": [
    "Primary-source synthesis with independent source review. Constructed examples are exact mathematical checks, not a native codec experiment, new theorem or measured error rate.",
    "The bounded checker throws on invalid input or resource exhaustion; it never treats exhaustion as a uniqueness proof."
  ]
}
