Skip to content

Commit

Permalink
deploy: 99f4cf2
Browse files Browse the repository at this point in the history
  • Loading branch information
lmoss committed Jan 24, 2025
1 parent 585fc4b commit 5424f20
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 11 deletions.
6 changes: 3 additions & 3 deletions _sources/introOneSharp/functions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
" \n",
"\n",
" \n",
"A *program* of $\\one\\hash$ is just a sequence of\n",
"A *program* of ```1#``` is just a sequence of\n",
"instructions, \n",
"run together to make a big word.\n",
"An instruction counts as a program, \n",
Expand Down Expand Up @@ -384,8 +384,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"```{admonition}\n",
"\n",
"```{admonition} Definition\n",
":class: tip\n",
"$$\n",
"\\phifn^0_p (\\ ) \\simeq y\n",
"$$\n",
Expand Down
6 changes: 3 additions & 3 deletions _sources/introOneSharp/haltDef.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@
"\n",
"```{admonition} Definition\n",
":class: tip\n",
"We (informally) say that a program $p$ *halts* on some inputs if at some point during the execution of $p$ on the inputs, the control transfers to right below the last instruction of $p$. In more detail, suppose that $p$ has n instructions. The formal definition is given below, after we discuss the remaining types of instructions.\n",
"We (informally) say that a program $p$ *halts* on some inputs if at some point during the execution of $p$ on those inputs, the control transfers to right below the last instruction of $p$. In more detail, suppose that $p$ has n instructions. The formal definition is given below, after we discuss the remaining types of instructions.\n",
"\n",
"In contrast, we say that p *halts improperly* if at some point during the execution of $p$, the control tranfers either to a point before the beginning of $p$ or to points more than one instruction beyond the last instruction of $p$.\n",
"```\n",
"\n",
"To see the difference, consider the following two programs: \n",
"```11###``` and ```1#111. Suppose we run them with some fixed but arbitrary word $x$ in R1.\n",
"```11###1#``` and ```1#11###```. Suppose we run them with some fixed but arbitrary word $x$ in R1.\n",
"\n",
"\n",
"The first says \"Go forward 2,\" and the second \"Add ```1``` to R1.\"\n",
"The first says \"Go forward 2,\" and the second \"Add ```1``` to R1, and then advance two instructions.\"\n",
"\n",
"The first halts, while the second halts improperly."
]
Expand Down
19 changes: 18 additions & 1 deletion introOneSharp/functions.html
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ <h1>Functions defined by programs<a class="headerlink" href="#functions-defined-
<em>instructions</em> and <em>programs</em>:</p>
<p><em>Instructions</em> are single steps
in programs.</p>
<p>A <em>program</em> of <span class="math notranslate nohighlight">\(\one\hash\)</span> is just a sequence of
<p>A <em>program</em> of <code class="docutils literal notranslate"><span class="pre">1#</span></code> is just a sequence of
instructions,
run together to make a big word.
An instruction counts as a program,
Expand Down Expand Up @@ -678,6 +678,23 @@ <h1>Functions of two or more arguments<a class="headerlink" href="#functions-of-
<section class="tex2jax_ignore mathjax_ignore" id="functions-of-zero-inputs">
<h1>Functions of zero inputs<a class="headerlink" href="#functions-of-zero-inputs" title="Link to this heading">#</a></h1>
<p>We started by associating to each program <span class="math notranslate nohighlight">\(p\)</span> a function <span class="math notranslate nohighlight">\(\phifn_p\)</span> of one argument, and then for each <span class="math notranslate nohighlight">\(n \geq 2\)</span> we associated a function <span class="math notranslate nohighlight">\(\phifn_p^n\)</span> of <span class="math notranslate nohighlight">\(n\)</span> arguments. This general definition works in case <span class="math notranslate nohighlight">\(n = 0\)</span> also.</p>
<div class="tip admonition">
<p class="admonition-title">Definition</p>
<div class="math notranslate nohighlight">
\[
\phifn^0_p (\ ) \simeq y
\]</div>
<p>means that
<span class="math notranslate nohighlight">\(p\)</span> is a program,
and
when we
run it
<span class="math notranslate nohighlight">\(p\)</span> with
all registers empty, the register machine
eventually halts with <span class="math notranslate nohighlight">\(y\)</span> in R1 and all other
registers
empty.</p>
</div>
</section>
<section class="tex2jax_ignore mathjax_ignore" id="characteristic-functions">
<h1>Characteristic functions<a class="headerlink" href="#characteristic-functions" title="Link to this heading">#</a></h1>
Expand Down
6 changes: 3 additions & 3 deletions introOneSharp/haltDef.html
Original file line number Diff line number Diff line change
Expand Up @@ -461,12 +461,12 @@ <h1>When does a program halt?<a class="headerlink" href="#when-does-a-program-ha
<p>This last example had nothing to do with the words in the input registers before we ran the program. But usually the input registers make a difference to whether the program halts or not.</p>
<div class="tip admonition">
<p class="admonition-title">Definition</p>
<p>We (informally) say that a program <span class="math notranslate nohighlight">\(p\)</span> <em>halts</em> on some inputs if at some point during the execution of <span class="math notranslate nohighlight">\(p\)</span> on the inputs, the control transfers to right below the last instruction of <span class="math notranslate nohighlight">\(p\)</span>. In more detail, suppose that <span class="math notranslate nohighlight">\(p\)</span> has n instructions. The formal definition is given below, after we discuss the remaining types of instructions.</p>
<p>We (informally) say that a program <span class="math notranslate nohighlight">\(p\)</span> <em>halts</em> on some inputs if at some point during the execution of <span class="math notranslate nohighlight">\(p\)</span> on those inputs, the control transfers to right below the last instruction of <span class="math notranslate nohighlight">\(p\)</span>. In more detail, suppose that <span class="math notranslate nohighlight">\(p\)</span> has n instructions. The formal definition is given below, after we discuss the remaining types of instructions.</p>
<p>In contrast, we say that p <em>halts improperly</em> if at some point during the execution of <span class="math notranslate nohighlight">\(p\)</span>, the control tranfers either to a point before the beginning of <span class="math notranslate nohighlight">\(p\)</span> or to points more than one instruction beyond the last instruction of <span class="math notranslate nohighlight">\(p\)</span>.</p>
</div>
<p>To see the difference, consider the following two programs:
<code class="docutils literal notranslate"><span class="pre">11###</span></code> and ```1#111. Suppose we run them with some fixed but arbitrary word <span class="math notranslate nohighlight">\(x\)</span> in R1.</p>
<p>The first says “Go forward 2,” and the second “Add <code class="docutils literal notranslate"><span class="pre">1</span></code> to R1.”</p>
<code class="docutils literal notranslate"><span class="pre">11###1#</span></code> and <code class="docutils literal notranslate"><span class="pre">1#11###</span></code>. Suppose we run them with some fixed but arbitrary word <span class="math notranslate nohighlight">\(x\)</span> in R1.</p>
<p>The first says “Go forward 2,” and the second “Add <code class="docutils literal notranslate"><span class="pre">1</span></code> to R1, and then advance two instructions.”</p>
<p>The first halts, while the second halts improperly.</p>
<div class="exercise admonition" id="on-halting">

Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 5424f20

Please sign in to comment.