{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nFix a standard [[Gödel numbering|MFJXPAF0R0]] of programs, and let $\\varphi_e$ be the partial [[computable function|KZSB5E471K]] of one argument computed by program $e$.\nLet $\\mathcal P$ be a set of partial computable functions $\\N \\rightharpoonup \\N$ that is neither empty nor the set of all partial computable functions.\nThen the index set $\\set{e \\in \\N : \\varphi_e \\in \\mathcal P}$ is not a [[computable set|PPGD5KW8JC]].\n\n## Remarks\n\nReplacing $\\mathcal P$ by its complement if needed, assume the empty function is not in $\\mathcal P$, and pick $\\psi \\in \\mathcal P$.\nFor each $e$, let $g(e)$ be a program that on input $y$ first runs program $e$ on input $e$, and then, if that halts, computes $\\psi(y)$.\nBy the [[smn theorem|YWX4FCFPAP]], $g$ is total computable.\nThen $\\varphi_{g(e)} = \\psi$ if program $e$ halts on $e$, and $\\varphi_{g(e)}$ is the empty function otherwise.\nSo a decision procedure for the index set would decide the [[halting problem|Z7TN2B35B0]].\n\nExample: the set of programs that compute a total function, and the set of programs that output $0$ on input $0$, are not computable.\n\nBoth conditions on $\\mathcal P$ are needed: if $\\mathcal P$ is empty or contains all partial computable functions, the index set is $\\emptyset$ or $\\N$, which are computable.\nThe theorem concerns properties of the computed function, not of the program text.\nA property such as \"the program has fewer than $10$ instructions\" is decidable.\n\n## Explanations\n\n### L1 human\n\nRice's theorem says that no algorithm can decide any interesting property of what programs do.\n\"Interesting\" means that some programs have the property and some do not, and that it depends only on the input-output behaviour.\nSo no tool can decide, for every program, whether it ever prints $0$ or whether it computes the squaring function.\n\n### L2 human\n\nThe theorem generalises the undecidability of the [[halting problem|Z7TN2B35B0]] to all non-trivial semantic properties.\nIts proof is a many-one reduction from the halting set, built with the smn theorem.\nThe Rice–Shapiro theorem goes further and describes which index sets are computably enumerable.\nIn practice, program analysis tools work around the theorem by giving approximate answers.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "about": [
      "KZSB5E471K",
      "PPGD5KW8JC"
    ],
    "kind": "statement",
    "msc": [
      "03D25",
      "03D20"
    ],
    "name": "Rice's theorem",
    "role": "theorem",
    "same_as": {
      "wikidata": "Q1893717",
      "wikipedia": "Rice's theorem"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Rice's_theorem"
      }
    ],
    "tag": "AKDR5YBBE2",
    "uses": [
      "KZSB5E471K",
      "PPGD5KW8JC",
      "MFJXPAF0R0"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/AKDR5YBBE2/",
  "links": [
    {
      "field": "about",
      "target": "KZSB5E471K"
    },
    {
      "field": "about",
      "target": "PPGD5KW8JC"
    },
    {
      "field": "uses",
      "target": "KZSB5E471K"
    },
    {
      "field": "uses",
      "target": "PPGD5KW8JC"
    },
    {
      "field": "uses",
      "target": "MFJXPAF0R0"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/AKDR5YBBE2.md",
  "msc": [
    "03D25",
    "03D20"
  ],
  "name": "Rice's theorem",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/AKD/AKDR5YBBE2.md",
  "status": null,
  "tag": "AKDR5YBBE2",
  "uri": "m2://AKDR5YBBE2",
  "url": "https://math2.tamnd.com/wiki/rices-theorem/",
  "writing": {
    "tag": "AKDR5YBBE2",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
