<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Teaching materials on Kovacsics Robert</title><link>https://kovirobi.uk/blog/teaching-material/</link><description>Recent content in Teaching materials on Kovacsics Robert</description><generator>Hugo</generator><language>en-gb</language><lastBuildDate>Sun, 22 Dec 2024 00:13:44 +0000</lastBuildDate><atom:link href="https://kovirobi.uk/blog/teaching-material/index.xml" rel="self" type="application/rss+xml"/><item><title>Foundations of Computer Science</title><link>https://kovirobi.uk/blog/teaching-material/focs/</link><pubDate>Sun, 22 Dec 2024 00:13:44 +0000</pubDate><guid>https://kovirobi.uk/blog/teaching-material/focs/</guid><description>&lt;p&gt;This is my Foundations of Computer Science course supervision notes.&lt;/p&gt;
&lt;p&gt;Supervision 1 &lt;a href="https://kovirobi.uk/pdfs/supervision1-questions.pdf"&gt;questions only&lt;/a&gt;, &lt;a href="https://kovirobi.uk/pdfs/supervision1.pdf"&gt;questions and answers&lt;/a&gt;;&lt;/p&gt;
&lt;p&gt;Supervision 2 &lt;a href="https://kovirobi.uk/pdfs/supervision2-questions.pdf"&gt;questions only&lt;/a&gt;, &lt;a href="https://kovirobi.uk/pdfs/supervision2.pdf"&gt;questions and answers&lt;/a&gt;;&lt;/p&gt;
&lt;p&gt;Supervision 3 &lt;a href="https://kovirobi.uk/pdfs/supervision3-questions.pdf"&gt;questions only&lt;/a&gt;, &lt;a href="https://kovirobi.uk/pdfs/supervision3.pdf"&gt;questions and answers&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Register machine visualiser &amp; emulator</title><link>https://kovirobi.uk/blog/teaching-material/register-machine/</link><pubDate>Sat, 09 Feb 2019 20:52:24 +0000</pubDate><guid>https://kovirobi.uk/blog/teaching-material/register-machine/</guid><description>&lt;script type="module" src="https://kovirobi.uk/tangle/register-machine.js"&gt;&lt;/script&gt;
&lt;p&gt;This is a visualiser and evaluator for register machines (the theoretical kind,
not a specific CPU). The model is the Lambek/Minsky register machine from 1961
with increment and decrement-with-test instructions.&lt;/p&gt;
&lt;div id="register_machine_0"&gt;
 &lt;textarea cols=60 rows=8&gt;Init R1 3
Init R2 4

L0: R1- -&amp;gt; L1,L2
L1: R0&amp;#43; -&amp;gt; L0
L2: R2- -&amp;gt; L3, L4
L3: R0&amp;#43; -&amp;gt; L2
L4: Halt&lt;/textarea&gt;
 &lt;div&gt;
 &lt;input type="button" value="Run"/&gt;
 &lt;input type="button" value="Plot"/&gt;
 &lt;/div&gt;
 &lt;blockquote&gt;&lt;p&gt;&lt;/p&gt;&lt;/blockquote&gt;
&lt;/div&gt;

&lt;script type="module"&gt;
import { plot, run } from "/tangle/register-machine.js"
let div = document.getElementById("register_machine_0")
let textarea = div.getElementsByTagName("textarea")[0]
let output = div.getElementsByTagName("blockquote")[0]
let run_button = div.getElementsByTagName("input")[0]
run_button.addEventListener("click", e =&gt; run(textarea, output))
let plot_button = div.getElementsByTagName("input")[1]
plot_button.addEventListener("click", e =&gt; plot(textarea, output, '600px'))
plot(textarea, output, '600px');&lt;/script&gt;
&lt;p&gt;The example is the same as on slide 30 of the Cambridge Computer
Science course, Computation Theory lecture notes.&lt;/p&gt;</description></item><item><title>Lambda-Calculus Evaluator</title><link>https://kovirobi.uk/blog/teaching-material/lambda-calc/</link><pubDate>Fri, 04 Jan 2019 22:57:40 +0000</pubDate><guid>https://kovirobi.uk/blog/teaching-material/lambda-calc/</guid><description>&lt;p&gt;&lt;script src="https://kovirobi.uk/blog/teaching-material/lambda-calc/lambda-calc.js"&gt;&lt;/script&gt;
&lt;link href="https://kovirobi.uk/blog/teaching-material/lambda-calc/lambda-calc.css" rel="stylesheet"&gt;&lt;/link&gt;&lt;/p&gt;
&lt;p&gt;Type an expression into the following text area (using the &lt;code&gt;fn x =&amp;gt; body&lt;/code&gt;
syntax), click parse, then click on applications to evaluate them. Also have a
look at the &lt;a href="#examples"&gt;examples&lt;/a&gt; section below, where you can
click on an application to reduce it (e.g. click on &lt;code&gt;pow 2 3&lt;/code&gt; to get &lt;code&gt;3 2&lt;/code&gt;,
then &lt;code&gt;fn x =&amp;gt; 2 (2 (2 x))&lt;/code&gt;).&lt;/p&gt;
&lt;style&gt;
.lambda-form &gt; * {
 margin: 0.2rem;
 width: 100%;
}
&lt;/style&gt;
&lt;div class="lambda-form"&gt;

 &lt;div style="grid-area: input;"&gt;
 &lt;textarea class="code" style="width: 100%;" rows="5" id="input_textarea"&gt;
(fn n m f x =&amp;gt; n f (m f x)) 2 3
&lt;/textarea&gt;
 &lt;button style="width: 100%;" onclick="tie('input_textarea', 'output_div')"&gt;Parse&lt;/button&gt;
 &lt;/div&gt;

 &lt;div style="grid-area: output;" class="lambda" id="output_div"&gt;&lt;/div&gt;

 &lt;fieldset style="grid-area: display;"&gt;&lt;legend&gt;Display type&lt;/legend&gt;
 &lt;input type="radio" name="display" onclick="setDisplay('&amp;lambda;', '&lt;b&gt;.&lt;/b&gt;')"/&gt;
 &lt;label&gt;&amp;lambda; &lt;var&gt;x&lt;/var&gt; &lt;b&gt;.&lt;/b&gt; &lt;var&gt;x&lt;/var&gt;&lt;/label&gt;
 &lt;input type="radio" name="display" onclick="setDisplay('fn', '=&amp;gt;')" checked="checked"/&gt;
 &lt;label&gt;fn &lt;var&gt;x&lt;/var&gt; =&gt; &lt;var&gt;x&lt;/var&gt;&lt;/label&gt;
 &lt;/fieldset&gt;

 &lt;fieldset style="grid-area: steps;"&gt;
 &lt;legend&gt;Maximum single steps&lt;/legend&gt;
 &lt;input type="number" id="maxSteps" value="10" style="width: 4em;"/&gt;
 &lt;/fieldset&gt;

 &lt;fieldset style="grid-area: strategy;"&gt;&lt;legend&gt;Evaluation strategy&lt;/legend&gt;
 &lt;div&gt;
 &lt;input type="radio" name="strategy" id="eagerStrategy"/&gt;
 &lt;label&gt;Strict/Eager&lt;/label&gt;
 &lt;/div&gt;
 &lt;div&gt;
 &lt;input type="radio" name="strategy" checked="checked"/&gt;
 &lt;label&gt;Non-strict/Call-by-name&lt;/label&gt;
 &lt;/div&gt;
 &lt;/fieldset&gt;
&lt;/div&gt;

&lt;script type="text/javascript"&gt;
max_steps = Number(document.getElementById("maxSteps").value);
eager_strategy = document.getElementById("eagerStrategy").checked
setDisplay('fn', '=&amp;gt;')
tie('input_textarea', 'output_div')
&lt;/script&gt;

&lt;p&gt;This is ported from my original one at &lt;a href="https://www.cl.cam.ac.uk/~rmk35/lambda_calculus/lambda_calculus.html"&gt;my alma mater
webpage&lt;/a&gt;,
somewhat updated with better diagrams and more modern code.&lt;/p&gt;</description></item></channel></rss>