819 lines
227 KiB
HTML
819 lines
227 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en"><head>
|
||
<meta charset="utf-8">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>Exam: TSPL Mock Exam file | Programming Language Foundations in Agda
|
||
</title><!-- Begin Jekyll SEO tag v2.6.1 -->
|
||
<meta name="generator" content="Jekyll v3.9.0" />
|
||
<meta property="og:title" content="Exam: TSPL Mock Exam file" />
|
||
<meta property="og:locale" content="en_US" />
|
||
<meta name="description" content="Programming Language Foundations in Agda" />
|
||
<meta property="og:description" content="Programming Language Foundations in Agda" />
|
||
<link rel="canonical" href="https://plfa.github.io/20.07/PUC/2019/Exam/" />
|
||
<meta property="og:url" content="https://plfa.github.io/20.07/PUC/2019/Exam/" />
|
||
<meta property="og:site_name" content="Programming Language Foundations in Agda" />
|
||
<script type="application/ld+json">
|
||
{"url":"https://plfa.github.io/20.07/PUC/2019/Exam/","headline":"Exam: TSPL Mock Exam file","description":"Programming Language Foundations in Agda","@type":"WebPage","@context":"https://schema.org"}</script>
|
||
<!-- End Jekyll SEO tag -->
|
||
<link rel="stylesheet" href="/20.07/assets/main.css"></head>
|
||
<body><header class="site-header" role="banner">
|
||
|
||
<div class="wrapper">
|
||
|
||
<a class="site-title" href="/20.07/">Programming Language Foundations in Agda
|
||
</a>
|
||
|
||
<nav class="site-nav">
|
||
<span class="menu-icon">
|
||
<svg viewBox="0 0 18 15" width="18px" height="15px">
|
||
<path fill="#424242" d="M18,1.484c0,0.82-0.665,1.484-1.484,1.484H1.484C0.665,2.969,0,2.304,0,1.484l0,0C0,0.665,0.665,0,1.484,0 h15.031C17.335,0,18,0.665,18,1.484L18,1.484z"/>
|
||
<path fill="#424242" d="M18,7.516C18,8.335,17.335,9,16.516,9H1.484C0.665,9,0,8.335,0,7.516l0,0c0-0.82,0.665-1.484,1.484-1.484 h15.031C17.335,6.031,18,6.696,18,7.516L18,7.516z"/>
|
||
<path fill="#424242" d="M18,13.516C18,14.335,17.335,15,16.516,15H1.484C0.665,15,0,14.335,0,13.516l0,0 c0-0.82,0.665-1.484,1.484-1.484h15.031C17.335,12.031,18,12.696,18,13.516L18,13.516z"/>
|
||
</svg>
|
||
</span>
|
||
|
||
<div class="trigger">
|
||
<a class="page-link" href="/20.07/">The Book</a>
|
||
<a class="page-link" href="/20.07/Announcements/">Announcements</a>
|
||
<a class="page-link" href="/20.07/GettingStarted/">Getting Started</a>
|
||
<a class="page-link" href="/20.07/Citing/">Citing</a>
|
||
<a class="page-link" href="https://agda-zh.github.io/PLFA-zh/">中文</a>
|
||
</div>
|
||
</nav>
|
||
|
||
</div>
|
||
|
||
</header>
|
||
<main class="page-content" aria-label="Content">
|
||
<div class="wrapper">
|
||
<article class="post">
|
||
|
||
<header class="post-header">
|
||
<h1 class="post-title">Exam: TSPL Mock Exam file</h1>
|
||
</header>
|
||
|
||
<p style="text-align:center;">
|
||
|
||
|
||
|
||
<a alt="Source code" href="https://github.com/plfa/plfa.github.io/blob/dev-20.07/courses/puc/2019/Exam.lagda.md">Source</a>
|
||
|
||
|
||
|
||
</p>
|
||
|
||
|
||
<div class="post-content">
|
||
<pre class="Agda"><a id="100" class="Keyword">module</a> <a id="107" href="/20.07/PUC/2019/Exam/" class="Module">Exam</a> <a id="112" class="Keyword">where</a>
|
||
</pre>
|
||
<p><strong>IMPORTANT</strong> For ease of marking, when modifying the given code please write</p>
|
||
|
||
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>-- begin
|
||
-- end
|
||
</code></pre></div></div>
|
||
|
||
<p>before and after code you add, to indicate your changes.</p>
|
||
|
||
<h2 id="imports">Imports</h2>
|
||
|
||
<pre class="Agda"><a id="301" class="Keyword">import</a> <a id="308" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.PropositionalEquality.html" class="Module">Relation.Binary.PropositionalEquality</a> <a id="346" class="Symbol">as</a> <a id="349" class="Module">Eq</a>
|
||
<a id="352" class="Keyword">open</a> <a id="357" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.PropositionalEquality.html" class="Module">Eq</a> <a id="360" class="Keyword">using</a> <a id="366" class="Symbol">(</a><a id="367" href="Agda.Builtin.Equality.html#125" class="Datatype Operator">_≡_</a><a id="370" class="Symbol">;</a> <a id="372" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a><a id="376" class="Symbol">;</a> <a id="378" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.PropositionalEquality.Core.html#939" class="Function">sym</a><a id="381" class="Symbol">;</a> <a id="383" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.PropositionalEquality.Core.html#984" class="Function">trans</a><a id="388" class="Symbol">;</a> <a id="390" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.PropositionalEquality.Core.html#1090" class="Function">cong</a><a id="394" class="Symbol">;</a> <a id="396" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.PropositionalEquality.Core.html#799" class="Function Operator">_≢_</a><a id="399" class="Symbol">)</a>
|
||
<a id="401" class="Keyword">open</a> <a id="406" class="Keyword">import</a> <a id="413" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html" class="Module">Data.Empty</a> <a id="424" class="Keyword">using</a> <a id="430" class="Symbol">(</a><a id="431" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#279" class="Datatype">⊥</a><a id="432" class="Symbol">;</a> <a id="434" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#294" class="Function">⊥-elim</a><a id="440" class="Symbol">)</a>
|
||
<a id="442" class="Keyword">open</a> <a id="447" class="Keyword">import</a> <a id="454" href="https://agda.github.io/agda-stdlib/v1.1/Data.Nat.html" class="Module">Data.Nat</a> <a id="463" class="Keyword">using</a> <a id="469" class="Symbol">(</a><a id="470" href="Agda.Builtin.Nat.html#165" class="Datatype">ℕ</a><a id="471" class="Symbol">;</a> <a id="473" href="Agda.Builtin.Nat.html#183" class="InductiveConstructor">zero</a><a id="477" class="Symbol">;</a> <a id="479" href="Agda.Builtin.Nat.html#196" class="InductiveConstructor">suc</a><a id="482" class="Symbol">)</a>
|
||
<a id="484" class="Keyword">open</a> <a id="489" class="Keyword">import</a> <a id="496" href="https://agda.github.io/agda-stdlib/v1.1/Data.List.html" class="Module">Data.List</a> <a id="506" class="Keyword">using</a> <a id="512" class="Symbol">(</a><a id="513" href="Agda.Builtin.List.html#121" class="Datatype">List</a><a id="517" class="Symbol">;</a> <a id="519" href="https://agda.github.io/agda-stdlib/v1.1/Data.List.Base.html#8786" class="InductiveConstructor">[]</a><a id="521" class="Symbol">;</a> <a id="523" href="Agda.Builtin.List.html#173" class="InductiveConstructor Operator">_∷_</a><a id="526" class="Symbol">;</a> <a id="528" href="https://agda.github.io/agda-stdlib/v1.1/Data.List.Base.html#1570" class="Function Operator">_++_</a><a id="532" class="Symbol">)</a>
|
||
<a id="534" class="Keyword">open</a> <a id="539" class="Keyword">import</a> <a id="546" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html" class="Module">Data.Product</a> <a id="559" class="Keyword">using</a> <a id="565" class="Symbol">(</a><a id="566" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1364" class="Function">∃</a><a id="567" class="Symbol">;</a> <a id="569" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1783" class="Function">∃-syntax</a><a id="577" class="Symbol">)</a> <a id="579" class="Keyword">renaming</a> <a id="588" class="Symbol">(</a><a id="589" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">_,_</a> <a id="593" class="Symbol">to</a> <a id="596" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨_,_⟩</a><a id="601" class="Symbol">)</a>
|
||
<a id="603" class="Keyword">open</a> <a id="608" class="Keyword">import</a> <a id="615" href="https://agda.github.io/agda-stdlib/v1.1/Data.String.html" class="Module">Data.String</a> <a id="627" class="Keyword">using</a> <a id="633" class="Symbol">(</a><a id="634" href="Agda.Builtin.String.html#206" class="Postulate">String</a><a id="640" class="Symbol">;</a> <a id="642" href="https://agda.github.io/agda-stdlib/v1.1/Data.String.Properties.html#2569" class="Function Operator">_≟_</a><a id="645" class="Symbol">)</a>
|
||
<a id="647" class="Keyword">open</a> <a id="652" class="Keyword">import</a> <a id="659" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html" class="Module">Relation.Nullary</a> <a id="676" class="Keyword">using</a> <a id="682" class="Symbol">(</a><a id="683" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬_</a><a id="685" class="Symbol">;</a> <a id="687" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#605" class="Datatype">Dec</a><a id="690" class="Symbol">;</a> <a id="692" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a><a id="695" class="Symbol">;</a> <a id="697" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a><a id="699" class="Symbol">)</a>
|
||
<a id="701" class="Keyword">open</a> <a id="706" class="Keyword">import</a> <a id="713" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.html" class="Module">Relation.Binary</a> <a id="729" class="Keyword">using</a> <a id="735" class="Symbol">(</a><a id="736" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.Core.html#5557" class="Function">Decidable</a><a id="745" class="Symbol">)</a>
|
||
</pre>
|
||
<h2 id="problem-1">Problem 1</h2>
|
||
|
||
<pre class="Agda"><a id="770" class="Keyword">module</a> <a id="Problem1"></a><a id="777" href="/20.07/PUC/2019/Exam/#777" class="Module">Problem1</a> <a id="786" class="Keyword">where</a>
|
||
|
||
<a id="795" class="Keyword">open</a> <a id="800" class="Keyword">import</a> <a id="807" href="https://agda.github.io/agda-stdlib/v1.1/Function.html" class="Module">Function</a> <a id="816" class="Keyword">using</a> <a id="822" class="Symbol">(</a><a id="823" href="https://agda.github.io/agda-stdlib/v1.1/Function.html#1099" class="Function Operator">_∘_</a><a id="826" class="Symbol">)</a>
|
||
</pre>
|
||
<p>Remember to indent all code by two spaces.</p>
|
||
|
||
<h3 id="a">(a)</h3>
|
||
|
||
<h3 id="b">(b)</h3>
|
||
|
||
<h3 id="c">(c)</h3>
|
||
|
||
<h2 id="problem-2">Problem 2</h2>
|
||
|
||
<p>Remember to indent all code by two spaces.</p>
|
||
|
||
<pre class="Agda"><a id="967" class="Keyword">module</a> <a id="Problem2"></a><a id="974" href="/20.07/PUC/2019/Exam/#974" class="Module">Problem2</a> <a id="983" class="Keyword">where</a>
|
||
</pre>
|
||
<h3 id="infix-declarations">Infix declarations</h3>
|
||
|
||
<pre class="Agda"> <a id="1024" class="Keyword">infix</a> <a id="1031" class="Number">4</a> <a id="1033" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">_⊢_</a>
|
||
<a id="1039" class="Keyword">infix</a> <a id="1046" class="Number">4</a> <a id="1048" href="/20.07/PUC/2019/Exam/#1427" class="Datatype Operator">_∋_</a>
|
||
<a id="1054" class="Keyword">infixl</a> <a id="1061" class="Number">5</a> <a id="1063" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">_,_</a>
|
||
|
||
<a id="1070" class="Keyword">infixr</a> <a id="1077" class="Number">7</a> <a id="1079" href="/20.07/PUC/2019/Exam/#1247" class="InductiveConstructor Operator">_⇒_</a>
|
||
|
||
<a id="1086" class="Keyword">infix</a> <a id="1093" class="Number">5</a> <a id="1095" href="/20.07/PUC/2019/Exam/#1736" class="InductiveConstructor Operator">ƛ_</a>
|
||
<a id="1100" class="Keyword">infix</a> <a id="1107" class="Number">5</a> <a id="1109" href="/20.07/PUC/2019/Exam/#2123" class="InductiveConstructor Operator">μ_</a>
|
||
<a id="1114" class="Keyword">infixl</a> <a id="1121" class="Number">7</a> <a id="1123" href="/20.07/PUC/2019/Exam/#1815" class="InductiveConstructor Operator">_·_</a>
|
||
<a id="1129" class="Keyword">infix</a> <a id="1136" class="Number">8</a> <a id="1138" href="/20.07/PUC/2019/Exam/#1956" class="InductiveConstructor Operator">`suc_</a>
|
||
<a id="1146" class="Keyword">infix</a> <a id="1153" class="Number">9</a> <a id="1155" href="/20.07/PUC/2019/Exam/#1673" class="InductiveConstructor Operator">`_</a>
|
||
<a id="1160" class="Keyword">infix</a> <a id="1167" class="Number">9</a> <a id="1169" href="/20.07/PUC/2019/Exam/#1519" class="InductiveConstructor Operator">S_</a>
|
||
<a id="1174" class="Keyword">infix</a> <a id="1181" class="Number">9</a> <a id="1183" href="/20.07/PUC/2019/Exam/#2613" class="Function Operator">#_</a>
|
||
</pre>
|
||
<h3 id="types-and-contexts">Types and contexts</h3>
|
||
|
||
<pre class="Agda"> <a id="1221" class="Keyword">data</a> <a id="Problem2.Type"></a><a id="1226" href="/20.07/PUC/2019/Exam/#1226" class="Datatype">Type</a> <a id="1231" class="Symbol">:</a> <a id="1233" class="PrimitiveType">Set</a> <a id="1237" class="Keyword">where</a>
|
||
<a id="Problem2.Type._⇒_"></a><a id="1247" href="/20.07/PUC/2019/Exam/#1247" class="InductiveConstructor Operator">_⇒_</a> <a id="1253" class="Symbol">:</a> <a id="1255" href="/20.07/PUC/2019/Exam/#1226" class="Datatype">Type</a> <a id="1260" class="Symbol">→</a> <a id="1262" href="/20.07/PUC/2019/Exam/#1226" class="Datatype">Type</a> <a id="1267" class="Symbol">→</a> <a id="1269" href="/20.07/PUC/2019/Exam/#1226" class="Datatype">Type</a>
|
||
<a id="Problem2.Type.`ℕ"></a><a id="1278" href="/20.07/PUC/2019/Exam/#1278" class="InductiveConstructor">`ℕ</a> <a id="1284" class="Symbol">:</a> <a id="1286" href="/20.07/PUC/2019/Exam/#1226" class="Datatype">Type</a>
|
||
|
||
<a id="1294" class="Keyword">data</a> <a id="Problem2.Context"></a><a id="1299" href="/20.07/PUC/2019/Exam/#1299" class="Datatype">Context</a> <a id="1307" class="Symbol">:</a> <a id="1309" class="PrimitiveType">Set</a> <a id="1313" class="Keyword">where</a>
|
||
<a id="Problem2.Context.∅"></a><a id="1323" href="/20.07/PUC/2019/Exam/#1323" class="InductiveConstructor">∅</a> <a id="1327" class="Symbol">:</a> <a id="1329" href="/20.07/PUC/2019/Exam/#1299" class="Datatype">Context</a>
|
||
<a id="Problem2.Context._,_"></a><a id="1341" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">_,_</a> <a id="1345" class="Symbol">:</a> <a id="1347" href="/20.07/PUC/2019/Exam/#1299" class="Datatype">Context</a> <a id="1355" class="Symbol">→</a> <a id="1357" href="/20.07/PUC/2019/Exam/#1226" class="Datatype">Type</a> <a id="1362" class="Symbol">→</a> <a id="1364" href="/20.07/PUC/2019/Exam/#1299" class="Datatype">Context</a>
|
||
</pre>
|
||
<h3 id="variables-and-the-lookup-judgment">Variables and the lookup judgment</h3>
|
||
|
||
<pre class="Agda"> <a id="1422" class="Keyword">data</a> <a id="Problem2._∋_"></a><a id="1427" href="/20.07/PUC/2019/Exam/#1427" class="Datatype Operator">_∋_</a> <a id="1431" class="Symbol">:</a> <a id="1433" href="/20.07/PUC/2019/Exam/#1299" class="Datatype">Context</a> <a id="1441" class="Symbol">→</a> <a id="1443" href="/20.07/PUC/2019/Exam/#1226" class="Datatype">Type</a> <a id="1448" class="Symbol">→</a> <a id="1450" class="PrimitiveType">Set</a> <a id="1454" class="Keyword">where</a>
|
||
|
||
<a id="Problem2._∋_.Z"></a><a id="1465" href="/20.07/PUC/2019/Exam/#1465" class="InductiveConstructor">Z</a> <a id="1467" class="Symbol">:</a> <a id="1469" class="Symbol">∀</a> <a id="1471" class="Symbol">{</a><a id="1472" href="/20.07/PUC/2019/Exam/#1472" class="Bound">Γ</a> <a id="1474" href="/20.07/PUC/2019/Exam/#1474" class="Bound">A</a><a id="1475" class="Symbol">}</a>
|
||
<a id="1485" class="Comment">----------</a>
|
||
<a id="1502" class="Symbol">→</a> <a id="1504" href="/20.07/PUC/2019/Exam/#1472" class="Bound">Γ</a> <a id="1506" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="1508" href="/20.07/PUC/2019/Exam/#1474" class="Bound">A</a> <a id="1510" href="/20.07/PUC/2019/Exam/#1427" class="Datatype Operator">∋</a> <a id="1512" href="/20.07/PUC/2019/Exam/#1474" class="Bound">A</a>
|
||
|
||
<a id="Problem2._∋_.S_"></a><a id="1519" href="/20.07/PUC/2019/Exam/#1519" class="InductiveConstructor Operator">S_</a> <a id="1522" class="Symbol">:</a> <a id="1524" class="Symbol">∀</a> <a id="1526" class="Symbol">{</a><a id="1527" href="/20.07/PUC/2019/Exam/#1527" class="Bound">Γ</a> <a id="1529" href="/20.07/PUC/2019/Exam/#1529" class="Bound">A</a> <a id="1531" href="/20.07/PUC/2019/Exam/#1531" class="Bound">B</a><a id="1532" class="Symbol">}</a>
|
||
<a id="1540" class="Symbol">→</a> <a id="1542" href="/20.07/PUC/2019/Exam/#1527" class="Bound">Γ</a> <a id="1544" href="/20.07/PUC/2019/Exam/#1427" class="Datatype Operator">∋</a> <a id="1546" href="/20.07/PUC/2019/Exam/#1529" class="Bound">A</a>
|
||
<a id="1556" class="Comment">---------</a>
|
||
<a id="1572" class="Symbol">→</a> <a id="1574" href="/20.07/PUC/2019/Exam/#1527" class="Bound">Γ</a> <a id="1576" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="1578" href="/20.07/PUC/2019/Exam/#1531" class="Bound">B</a> <a id="1580" href="/20.07/PUC/2019/Exam/#1427" class="Datatype Operator">∋</a> <a id="1582" href="/20.07/PUC/2019/Exam/#1529" class="Bound">A</a>
|
||
</pre>
|
||
<h3 id="terms-and-the-typing-judgment">Terms and the typing judgment</h3>
|
||
|
||
<pre class="Agda"> <a id="1630" class="Keyword">data</a> <a id="Problem2._⊢_"></a><a id="1635" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">_⊢_</a> <a id="1639" class="Symbol">:</a> <a id="1641" href="/20.07/PUC/2019/Exam/#1299" class="Datatype">Context</a> <a id="1649" class="Symbol">→</a> <a id="1651" href="/20.07/PUC/2019/Exam/#1226" class="Datatype">Type</a> <a id="1656" class="Symbol">→</a> <a id="1658" class="PrimitiveType">Set</a> <a id="1662" class="Keyword">where</a>
|
||
|
||
<a id="Problem2._⊢_.`_"></a><a id="1673" href="/20.07/PUC/2019/Exam/#1673" class="InductiveConstructor Operator">`_</a> <a id="1676" class="Symbol">:</a> <a id="1678" class="Symbol">∀</a> <a id="1680" class="Symbol">{</a><a id="1681" href="/20.07/PUC/2019/Exam/#1681" class="Bound">Γ</a><a id="1682" class="Symbol">}</a> <a id="1684" class="Symbol">{</a><a id="1685" href="/20.07/PUC/2019/Exam/#1685" class="Bound">A</a><a id="1686" class="Symbol">}</a>
|
||
<a id="1694" class="Symbol">→</a> <a id="1696" href="/20.07/PUC/2019/Exam/#1681" class="Bound">Γ</a> <a id="1698" href="/20.07/PUC/2019/Exam/#1427" class="Datatype Operator">∋</a> <a id="1700" href="/20.07/PUC/2019/Exam/#1685" class="Bound">A</a>
|
||
<a id="1710" class="Comment">------</a>
|
||
<a id="1723" class="Symbol">→</a> <a id="1725" href="/20.07/PUC/2019/Exam/#1681" class="Bound">Γ</a> <a id="1727" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="1729" href="/20.07/PUC/2019/Exam/#1685" class="Bound">A</a>
|
||
|
||
<a id="Problem2._⊢_.ƛ_"></a><a id="1736" href="/20.07/PUC/2019/Exam/#1736" class="InductiveConstructor Operator">ƛ_</a> <a id="1740" class="Symbol">:</a> <a id="1743" class="Symbol">∀</a> <a id="1745" class="Symbol">{</a><a id="1746" href="/20.07/PUC/2019/Exam/#1746" class="Bound">Γ</a><a id="1747" class="Symbol">}</a> <a id="1749" class="Symbol">{</a><a id="1750" href="/20.07/PUC/2019/Exam/#1750" class="Bound">A</a> <a id="1752" href="/20.07/PUC/2019/Exam/#1752" class="Bound">B</a><a id="1753" class="Symbol">}</a>
|
||
<a id="1761" class="Symbol">→</a> <a id="1763" href="/20.07/PUC/2019/Exam/#1746" class="Bound">Γ</a> <a id="1765" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="1767" href="/20.07/PUC/2019/Exam/#1750" class="Bound">A</a> <a id="1769" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="1771" href="/20.07/PUC/2019/Exam/#1752" class="Bound">B</a>
|
||
<a id="1781" class="Comment">----------</a>
|
||
<a id="1798" class="Symbol">→</a> <a id="1800" href="/20.07/PUC/2019/Exam/#1746" class="Bound">Γ</a> <a id="1802" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="1804" href="/20.07/PUC/2019/Exam/#1750" class="Bound">A</a> <a id="1806" href="/20.07/PUC/2019/Exam/#1247" class="InductiveConstructor Operator">⇒</a> <a id="1808" href="/20.07/PUC/2019/Exam/#1752" class="Bound">B</a>
|
||
|
||
<a id="Problem2._⊢_._·_"></a><a id="1815" href="/20.07/PUC/2019/Exam/#1815" class="InductiveConstructor Operator">_·_</a> <a id="1819" class="Symbol">:</a> <a id="1821" class="Symbol">∀</a> <a id="1823" class="Symbol">{</a><a id="1824" href="/20.07/PUC/2019/Exam/#1824" class="Bound">Γ</a><a id="1825" class="Symbol">}</a> <a id="1827" class="Symbol">{</a><a id="1828" href="/20.07/PUC/2019/Exam/#1828" class="Bound">A</a> <a id="1830" href="/20.07/PUC/2019/Exam/#1830" class="Bound">B</a><a id="1831" class="Symbol">}</a>
|
||
<a id="1839" class="Symbol">→</a> <a id="1841" href="/20.07/PUC/2019/Exam/#1824" class="Bound">Γ</a> <a id="1843" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="1845" href="/20.07/PUC/2019/Exam/#1828" class="Bound">A</a> <a id="1847" href="/20.07/PUC/2019/Exam/#1247" class="InductiveConstructor Operator">⇒</a> <a id="1849" href="/20.07/PUC/2019/Exam/#1830" class="Bound">B</a>
|
||
<a id="1857" class="Symbol">→</a> <a id="1859" href="/20.07/PUC/2019/Exam/#1824" class="Bound">Γ</a> <a id="1861" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="1863" href="/20.07/PUC/2019/Exam/#1828" class="Bound">A</a>
|
||
<a id="1873" class="Comment">----------</a>
|
||
<a id="1890" class="Symbol">→</a> <a id="1892" href="/20.07/PUC/2019/Exam/#1824" class="Bound">Γ</a> <a id="1894" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="1896" href="/20.07/PUC/2019/Exam/#1830" class="Bound">B</a>
|
||
|
||
<a id="Problem2._⊢_.`zero"></a><a id="1903" href="/20.07/PUC/2019/Exam/#1903" class="InductiveConstructor">`zero</a> <a id="1909" class="Symbol">:</a> <a id="1911" class="Symbol">∀</a> <a id="1913" class="Symbol">{</a><a id="1914" href="/20.07/PUC/2019/Exam/#1914" class="Bound">Γ</a><a id="1915" class="Symbol">}</a>
|
||
<a id="1925" class="Comment">----------</a>
|
||
<a id="1942" class="Symbol">→</a> <a id="1944" href="/20.07/PUC/2019/Exam/#1914" class="Bound">Γ</a> <a id="1946" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="1948" href="/20.07/PUC/2019/Exam/#1278" class="InductiveConstructor">`ℕ</a>
|
||
|
||
<a id="Problem2._⊢_.`suc_"></a><a id="1956" href="/20.07/PUC/2019/Exam/#1956" class="InductiveConstructor Operator">`suc_</a> <a id="1962" class="Symbol">:</a> <a id="1964" class="Symbol">∀</a> <a id="1966" class="Symbol">{</a><a id="1967" href="/20.07/PUC/2019/Exam/#1967" class="Bound">Γ</a><a id="1968" class="Symbol">}</a>
|
||
<a id="1976" class="Symbol">→</a> <a id="1978" href="/20.07/PUC/2019/Exam/#1967" class="Bound">Γ</a> <a id="1980" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="1982" href="/20.07/PUC/2019/Exam/#1278" class="InductiveConstructor">`ℕ</a>
|
||
<a id="1993" class="Comment">-------</a>
|
||
<a id="2007" class="Symbol">→</a> <a id="2009" href="/20.07/PUC/2019/Exam/#1967" class="Bound">Γ</a> <a id="2011" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="2013" href="/20.07/PUC/2019/Exam/#1278" class="InductiveConstructor">`ℕ</a>
|
||
|
||
<a id="Problem2._⊢_.case"></a><a id="2021" href="/20.07/PUC/2019/Exam/#2021" class="InductiveConstructor">case</a> <a id="2026" class="Symbol">:</a> <a id="2028" class="Symbol">∀</a> <a id="2030" class="Symbol">{</a><a id="2031" href="/20.07/PUC/2019/Exam/#2031" class="Bound">Γ</a> <a id="2033" href="/20.07/PUC/2019/Exam/#2033" class="Bound">A</a><a id="2034" class="Symbol">}</a>
|
||
<a id="2042" class="Symbol">→</a> <a id="2044" href="/20.07/PUC/2019/Exam/#2031" class="Bound">Γ</a> <a id="2046" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="2048" href="/20.07/PUC/2019/Exam/#1278" class="InductiveConstructor">`ℕ</a>
|
||
<a id="2057" class="Symbol">→</a> <a id="2059" href="/20.07/PUC/2019/Exam/#2031" class="Bound">Γ</a> <a id="2061" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="2063" href="/20.07/PUC/2019/Exam/#2033" class="Bound">A</a>
|
||
<a id="2071" class="Symbol">→</a> <a id="2073" href="/20.07/PUC/2019/Exam/#2031" class="Bound">Γ</a> <a id="2075" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="2077" href="/20.07/PUC/2019/Exam/#1278" class="InductiveConstructor">`ℕ</a> <a id="2080" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="2082" href="/20.07/PUC/2019/Exam/#2033" class="Bound">A</a>
|
||
<a id="2092" class="Comment">-----------</a>
|
||
<a id="2110" class="Symbol">→</a> <a id="2112" href="/20.07/PUC/2019/Exam/#2031" class="Bound">Γ</a> <a id="2114" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="2116" href="/20.07/PUC/2019/Exam/#2033" class="Bound">A</a>
|
||
|
||
<a id="Problem2._⊢_.μ_"></a><a id="2123" href="/20.07/PUC/2019/Exam/#2123" class="InductiveConstructor Operator">μ_</a> <a id="2126" class="Symbol">:</a> <a id="2128" class="Symbol">∀</a> <a id="2130" class="Symbol">{</a><a id="2131" href="/20.07/PUC/2019/Exam/#2131" class="Bound">Γ</a> <a id="2133" href="/20.07/PUC/2019/Exam/#2133" class="Bound">A</a><a id="2134" class="Symbol">}</a>
|
||
<a id="2142" class="Symbol">→</a> <a id="2144" href="/20.07/PUC/2019/Exam/#2131" class="Bound">Γ</a> <a id="2146" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="2148" href="/20.07/PUC/2019/Exam/#2133" class="Bound">A</a> <a id="2150" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="2152" href="/20.07/PUC/2019/Exam/#2133" class="Bound">A</a>
|
||
<a id="2162" class="Comment">----------</a>
|
||
<a id="2179" class="Symbol">→</a> <a id="2181" href="/20.07/PUC/2019/Exam/#2131" class="Bound">Γ</a> <a id="2183" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="2185" href="/20.07/PUC/2019/Exam/#2133" class="Bound">A</a>
|
||
</pre>
|
||
<h3 id="abbreviating-de-bruijn-indices">Abbreviating de Bruijn indices</h3>
|
||
|
||
<pre class="Agda"> <a id="Problem2.lookup"></a><a id="2234" href="/20.07/PUC/2019/Exam/#2234" class="Function">lookup</a> <a id="2241" class="Symbol">:</a> <a id="2243" href="/20.07/PUC/2019/Exam/#1299" class="Datatype">Context</a> <a id="2251" class="Symbol">→</a> <a id="2253" href="Agda.Builtin.Nat.html#165" class="Datatype">ℕ</a> <a id="2255" class="Symbol">→</a> <a id="2257" href="/20.07/PUC/2019/Exam/#1226" class="Datatype">Type</a>
|
||
<a id="2264" href="/20.07/PUC/2019/Exam/#2234" class="Function">lookup</a> <a id="2271" class="Symbol">(</a><a id="2272" href="/20.07/PUC/2019/Exam/#2272" class="Bound">Γ</a> <a id="2274" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="2276" href="/20.07/PUC/2019/Exam/#2276" class="Bound">A</a><a id="2277" class="Symbol">)</a> <a id="2279" href="Agda.Builtin.Nat.html#183" class="InductiveConstructor">zero</a> <a id="2288" class="Symbol">=</a> <a id="2291" href="/20.07/PUC/2019/Exam/#2276" class="Bound">A</a>
|
||
<a id="2295" href="/20.07/PUC/2019/Exam/#2234" class="Function">lookup</a> <a id="2302" class="Symbol">(</a><a id="2303" href="/20.07/PUC/2019/Exam/#2303" class="Bound">Γ</a> <a id="2305" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="2307" class="Symbol">_)</a> <a id="2310" class="Symbol">(</a><a id="2311" href="Agda.Builtin.Nat.html#196" class="InductiveConstructor">suc</a> <a id="2315" href="/20.07/PUC/2019/Exam/#2315" class="Bound">n</a><a id="2316" class="Symbol">)</a> <a id="2319" class="Symbol">=</a> <a id="2322" href="/20.07/PUC/2019/Exam/#2234" class="Function">lookup</a> <a id="2329" href="/20.07/PUC/2019/Exam/#2303" class="Bound">Γ</a> <a id="2331" href="/20.07/PUC/2019/Exam/#2315" class="Bound">n</a>
|
||
<a id="2335" href="/20.07/PUC/2019/Exam/#2234" class="Function">lookup</a> <a id="2342" href="/20.07/PUC/2019/Exam/#1323" class="InductiveConstructor">∅</a> <a id="2350" class="Symbol">_</a> <a id="2359" class="Symbol">=</a> <a id="2362" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#294" class="Function">⊥-elim</a> <a id="2369" href="/20.07/PUC/2019/Exam/#2400" class="Postulate">impossible</a>
|
||
<a id="2384" class="Keyword">where</a> <a id="2390" class="Keyword">postulate</a> <a id="2400" href="/20.07/PUC/2019/Exam/#2400" class="Postulate">impossible</a> <a id="2411" class="Symbol">:</a> <a id="2413" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#279" class="Datatype">⊥</a>
|
||
|
||
<a id="Problem2.count"></a><a id="2418" href="/20.07/PUC/2019/Exam/#2418" class="Function">count</a> <a id="2424" class="Symbol">:</a> <a id="2426" class="Symbol">∀</a> <a id="2428" class="Symbol">{</a><a id="2429" href="/20.07/PUC/2019/Exam/#2429" class="Bound">Γ</a><a id="2430" class="Symbol">}</a> <a id="2432" class="Symbol">→</a> <a id="2434" class="Symbol">(</a><a id="2435" href="/20.07/PUC/2019/Exam/#2435" class="Bound">n</a> <a id="2437" class="Symbol">:</a> <a id="2439" href="Agda.Builtin.Nat.html#165" class="Datatype">ℕ</a><a id="2440" class="Symbol">)</a> <a id="2442" class="Symbol">→</a> <a id="2444" href="/20.07/PUC/2019/Exam/#2429" class="Bound">Γ</a> <a id="2446" href="/20.07/PUC/2019/Exam/#1427" class="Datatype Operator">∋</a> <a id="2448" href="/20.07/PUC/2019/Exam/#2234" class="Function">lookup</a> <a id="2455" href="/20.07/PUC/2019/Exam/#2429" class="Bound">Γ</a> <a id="2457" href="/20.07/PUC/2019/Exam/#2435" class="Bound">n</a>
|
||
<a id="2461" href="/20.07/PUC/2019/Exam/#2418" class="Function">count</a> <a id="2467" class="Symbol">{</a><a id="2468" href="/20.07/PUC/2019/Exam/#2468" class="Bound">Γ</a> <a id="2470" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="2472" class="Symbol">_}</a> <a id="2475" href="Agda.Builtin.Nat.html#183" class="InductiveConstructor">zero</a> <a id="2484" class="Symbol">=</a> <a id="2487" href="/20.07/PUC/2019/Exam/#1465" class="InductiveConstructor">Z</a>
|
||
<a id="2491" href="/20.07/PUC/2019/Exam/#2418" class="Function">count</a> <a id="2497" class="Symbol">{</a><a id="2498" href="/20.07/PUC/2019/Exam/#2498" class="Bound">Γ</a> <a id="2500" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="2502" class="Symbol">_}</a> <a id="2505" class="Symbol">(</a><a id="2506" href="Agda.Builtin.Nat.html#196" class="InductiveConstructor">suc</a> <a id="2510" href="/20.07/PUC/2019/Exam/#2510" class="Bound">n</a><a id="2511" class="Symbol">)</a> <a id="2514" class="Symbol">=</a> <a id="2517" href="/20.07/PUC/2019/Exam/#1519" class="InductiveConstructor Operator">S</a> <a id="2519" class="Symbol">(</a><a id="2520" href="/20.07/PUC/2019/Exam/#2418" class="Function">count</a> <a id="2526" href="/20.07/PUC/2019/Exam/#2510" class="Bound">n</a><a id="2527" class="Symbol">)</a>
|
||
<a id="2531" href="/20.07/PUC/2019/Exam/#2418" class="Function">count</a> <a id="2537" class="Symbol">{</a><a id="2538" href="/20.07/PUC/2019/Exam/#1323" class="InductiveConstructor">∅</a><a id="2539" class="Symbol">}</a> <a id="2545" class="Symbol">_</a> <a id="2554" class="Symbol">=</a> <a id="2557" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#294" class="Function">⊥-elim</a> <a id="2564" href="/20.07/PUC/2019/Exam/#2595" class="Postulate">impossible</a>
|
||
<a id="2579" class="Keyword">where</a> <a id="2585" class="Keyword">postulate</a> <a id="2595" href="/20.07/PUC/2019/Exam/#2595" class="Postulate">impossible</a> <a id="2606" class="Symbol">:</a> <a id="2608" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#279" class="Datatype">⊥</a>
|
||
|
||
<a id="Problem2.#_"></a><a id="2613" href="/20.07/PUC/2019/Exam/#2613" class="Function Operator">#_</a> <a id="2616" class="Symbol">:</a> <a id="2618" class="Symbol">∀</a> <a id="2620" class="Symbol">{</a><a id="2621" href="/20.07/PUC/2019/Exam/#2621" class="Bound">Γ</a><a id="2622" class="Symbol">}</a> <a id="2624" class="Symbol">→</a> <a id="2626" class="Symbol">(</a><a id="2627" href="/20.07/PUC/2019/Exam/#2627" class="Bound">n</a> <a id="2629" class="Symbol">:</a> <a id="2631" href="Agda.Builtin.Nat.html#165" class="Datatype">ℕ</a><a id="2632" class="Symbol">)</a> <a id="2634" class="Symbol">→</a> <a id="2636" href="/20.07/PUC/2019/Exam/#2621" class="Bound">Γ</a> <a id="2638" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="2640" href="/20.07/PUC/2019/Exam/#2234" class="Function">lookup</a> <a id="2647" href="/20.07/PUC/2019/Exam/#2621" class="Bound">Γ</a> <a id="2649" href="/20.07/PUC/2019/Exam/#2627" class="Bound">n</a>
|
||
<a id="2653" href="/20.07/PUC/2019/Exam/#2613" class="Function Operator">#</a> <a id="2655" href="/20.07/PUC/2019/Exam/#2655" class="Bound">n</a> <a id="2658" class="Symbol">=</a> <a id="2661" href="/20.07/PUC/2019/Exam/#1673" class="InductiveConstructor Operator">`</a> <a id="2663" href="/20.07/PUC/2019/Exam/#2418" class="Function">count</a> <a id="2669" href="/20.07/PUC/2019/Exam/#2655" class="Bound">n</a>
|
||
</pre>
|
||
<h3 id="renaming">Renaming</h3>
|
||
|
||
<pre class="Agda"> <a id="Problem2.ext"></a><a id="2696" href="/20.07/PUC/2019/Exam/#2696" class="Function">ext</a> <a id="2700" class="Symbol">:</a> <a id="2702" class="Symbol">∀</a> <a id="2704" class="Symbol">{</a><a id="2705" href="/20.07/PUC/2019/Exam/#2705" class="Bound">Γ</a> <a id="2707" href="/20.07/PUC/2019/Exam/#2707" class="Bound">Δ</a><a id="2708" class="Symbol">}</a> <a id="2710" class="Symbol">→</a> <a id="2712" class="Symbol">(∀</a> <a id="2715" class="Symbol">{</a><a id="2716" href="/20.07/PUC/2019/Exam/#2716" class="Bound">A</a><a id="2717" class="Symbol">}</a> <a id="2719" class="Symbol">→</a> <a id="2721" href="/20.07/PUC/2019/Exam/#2705" class="Bound">Γ</a> <a id="2723" href="/20.07/PUC/2019/Exam/#1427" class="Datatype Operator">∋</a> <a id="2725" href="/20.07/PUC/2019/Exam/#2716" class="Bound">A</a> <a id="2727" class="Symbol">→</a> <a id="2729" href="/20.07/PUC/2019/Exam/#2707" class="Bound">Δ</a> <a id="2731" href="/20.07/PUC/2019/Exam/#1427" class="Datatype Operator">∋</a> <a id="2733" href="/20.07/PUC/2019/Exam/#2716" class="Bound">A</a><a id="2734" class="Symbol">)</a>
|
||
<a id="2742" class="Comment">-----------------------------------</a>
|
||
<a id="2782" class="Symbol">→</a> <a id="2784" class="Symbol">(∀</a> <a id="2787" class="Symbol">{</a><a id="2788" href="/20.07/PUC/2019/Exam/#2788" class="Bound">A</a> <a id="2790" href="/20.07/PUC/2019/Exam/#2790" class="Bound">B</a><a id="2791" class="Symbol">}</a> <a id="2793" class="Symbol">→</a> <a id="2795" href="/20.07/PUC/2019/Exam/#2705" class="Bound">Γ</a> <a id="2797" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="2799" href="/20.07/PUC/2019/Exam/#2790" class="Bound">B</a> <a id="2801" href="/20.07/PUC/2019/Exam/#1427" class="Datatype Operator">∋</a> <a id="2803" href="/20.07/PUC/2019/Exam/#2788" class="Bound">A</a> <a id="2805" class="Symbol">→</a> <a id="2807" href="/20.07/PUC/2019/Exam/#2707" class="Bound">Δ</a> <a id="2809" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="2811" href="/20.07/PUC/2019/Exam/#2790" class="Bound">B</a> <a id="2813" href="/20.07/PUC/2019/Exam/#1427" class="Datatype Operator">∋</a> <a id="2815" href="/20.07/PUC/2019/Exam/#2788" class="Bound">A</a><a id="2816" class="Symbol">)</a>
|
||
<a id="2820" href="/20.07/PUC/2019/Exam/#2696" class="Function">ext</a> <a id="2824" href="/20.07/PUC/2019/Exam/#2824" class="Bound">ρ</a> <a id="2826" href="/20.07/PUC/2019/Exam/#1465" class="InductiveConstructor">Z</a> <a id="2833" class="Symbol">=</a> <a id="2836" href="/20.07/PUC/2019/Exam/#1465" class="InductiveConstructor">Z</a>
|
||
<a id="2840" href="/20.07/PUC/2019/Exam/#2696" class="Function">ext</a> <a id="2844" href="/20.07/PUC/2019/Exam/#2844" class="Bound">ρ</a> <a id="2846" class="Symbol">(</a><a id="2847" href="/20.07/PUC/2019/Exam/#1519" class="InductiveConstructor Operator">S</a> <a id="2849" href="/20.07/PUC/2019/Exam/#2849" class="Bound">x</a><a id="2850" class="Symbol">)</a> <a id="2853" class="Symbol">=</a> <a id="2856" href="/20.07/PUC/2019/Exam/#1519" class="InductiveConstructor Operator">S</a> <a id="2858" class="Symbol">(</a><a id="2859" href="/20.07/PUC/2019/Exam/#2844" class="Bound">ρ</a> <a id="2861" href="/20.07/PUC/2019/Exam/#2849" class="Bound">x</a><a id="2862" class="Symbol">)</a>
|
||
|
||
<a id="Problem2.rename"></a><a id="2867" href="/20.07/PUC/2019/Exam/#2867" class="Function">rename</a> <a id="2874" class="Symbol">:</a> <a id="2876" class="Symbol">∀</a> <a id="2878" class="Symbol">{</a><a id="2879" href="/20.07/PUC/2019/Exam/#2879" class="Bound">Γ</a> <a id="2881" href="/20.07/PUC/2019/Exam/#2881" class="Bound">Δ</a><a id="2882" class="Symbol">}</a>
|
||
<a id="2888" class="Symbol">→</a> <a id="2890" class="Symbol">(∀</a> <a id="2893" class="Symbol">{</a><a id="2894" href="/20.07/PUC/2019/Exam/#2894" class="Bound">A</a><a id="2895" class="Symbol">}</a> <a id="2897" class="Symbol">→</a> <a id="2899" href="/20.07/PUC/2019/Exam/#2879" class="Bound">Γ</a> <a id="2901" href="/20.07/PUC/2019/Exam/#1427" class="Datatype Operator">∋</a> <a id="2903" href="/20.07/PUC/2019/Exam/#2894" class="Bound">A</a> <a id="2905" class="Symbol">→</a> <a id="2907" href="/20.07/PUC/2019/Exam/#2881" class="Bound">Δ</a> <a id="2909" href="/20.07/PUC/2019/Exam/#1427" class="Datatype Operator">∋</a> <a id="2911" href="/20.07/PUC/2019/Exam/#2894" class="Bound">A</a><a id="2912" class="Symbol">)</a>
|
||
<a id="2920" class="Comment">------------------------</a>
|
||
<a id="2949" class="Symbol">→</a> <a id="2951" class="Symbol">(∀</a> <a id="2954" class="Symbol">{</a><a id="2955" href="/20.07/PUC/2019/Exam/#2955" class="Bound">A</a><a id="2956" class="Symbol">}</a> <a id="2958" class="Symbol">→</a> <a id="2960" href="/20.07/PUC/2019/Exam/#2879" class="Bound">Γ</a> <a id="2962" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="2964" href="/20.07/PUC/2019/Exam/#2955" class="Bound">A</a> <a id="2966" class="Symbol">→</a> <a id="2968" href="/20.07/PUC/2019/Exam/#2881" class="Bound">Δ</a> <a id="2970" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="2972" href="/20.07/PUC/2019/Exam/#2955" class="Bound">A</a><a id="2973" class="Symbol">)</a>
|
||
<a id="2977" href="/20.07/PUC/2019/Exam/#2867" class="Function">rename</a> <a id="2984" href="/20.07/PUC/2019/Exam/#2984" class="Bound">ρ</a> <a id="2986" class="Symbol">(</a><a id="2987" href="/20.07/PUC/2019/Exam/#1673" class="InductiveConstructor Operator">`</a> <a id="2989" href="/20.07/PUC/2019/Exam/#2989" class="Bound">x</a><a id="2990" class="Symbol">)</a> <a id="3001" class="Symbol">=</a> <a id="3004" href="/20.07/PUC/2019/Exam/#1673" class="InductiveConstructor Operator">`</a> <a id="3006" class="Symbol">(</a><a id="3007" href="/20.07/PUC/2019/Exam/#2984" class="Bound">ρ</a> <a id="3009" href="/20.07/PUC/2019/Exam/#2989" class="Bound">x</a><a id="3010" class="Symbol">)</a>
|
||
<a id="3014" href="/20.07/PUC/2019/Exam/#2867" class="Function">rename</a> <a id="3021" href="/20.07/PUC/2019/Exam/#3021" class="Bound">ρ</a> <a id="3023" class="Symbol">(</a><a id="3024" href="/20.07/PUC/2019/Exam/#1736" class="InductiveConstructor Operator">ƛ</a> <a id="3026" href="/20.07/PUC/2019/Exam/#3026" class="Bound">N</a><a id="3027" class="Symbol">)</a> <a id="3038" class="Symbol">=</a> <a id="3041" href="/20.07/PUC/2019/Exam/#1736" class="InductiveConstructor Operator">ƛ</a> <a id="3043" class="Symbol">(</a><a id="3044" href="/20.07/PUC/2019/Exam/#2867" class="Function">rename</a> <a id="3051" class="Symbol">(</a><a id="3052" href="/20.07/PUC/2019/Exam/#2696" class="Function">ext</a> <a id="3056" href="/20.07/PUC/2019/Exam/#3021" class="Bound">ρ</a><a id="3057" class="Symbol">)</a> <a id="3059" href="/20.07/PUC/2019/Exam/#3026" class="Bound">N</a><a id="3060" class="Symbol">)</a>
|
||
<a id="3064" href="/20.07/PUC/2019/Exam/#2867" class="Function">rename</a> <a id="3071" href="/20.07/PUC/2019/Exam/#3071" class="Bound">ρ</a> <a id="3073" class="Symbol">(</a><a id="3074" href="/20.07/PUC/2019/Exam/#3074" class="Bound">L</a> <a id="3076" href="/20.07/PUC/2019/Exam/#1815" class="InductiveConstructor Operator">·</a> <a id="3078" href="/20.07/PUC/2019/Exam/#3078" class="Bound">M</a><a id="3079" class="Symbol">)</a> <a id="3088" class="Symbol">=</a> <a id="3091" class="Symbol">(</a><a id="3092" href="/20.07/PUC/2019/Exam/#2867" class="Function">rename</a> <a id="3099" href="/20.07/PUC/2019/Exam/#3071" class="Bound">ρ</a> <a id="3101" href="/20.07/PUC/2019/Exam/#3074" class="Bound">L</a><a id="3102" class="Symbol">)</a> <a id="3104" href="/20.07/PUC/2019/Exam/#1815" class="InductiveConstructor Operator">·</a> <a id="3106" class="Symbol">(</a><a id="3107" href="/20.07/PUC/2019/Exam/#2867" class="Function">rename</a> <a id="3114" href="/20.07/PUC/2019/Exam/#3071" class="Bound">ρ</a> <a id="3116" href="/20.07/PUC/2019/Exam/#3078" class="Bound">M</a><a id="3117" class="Symbol">)</a>
|
||
<a id="3121" href="/20.07/PUC/2019/Exam/#2867" class="Function">rename</a> <a id="3128" href="/20.07/PUC/2019/Exam/#3128" class="Bound">ρ</a> <a id="3130" class="Symbol">(</a><a id="3131" href="/20.07/PUC/2019/Exam/#1903" class="InductiveConstructor">`zero</a><a id="3136" class="Symbol">)</a> <a id="3145" class="Symbol">=</a> <a id="3148" href="/20.07/PUC/2019/Exam/#1903" class="InductiveConstructor">`zero</a>
|
||
<a id="3156" href="/20.07/PUC/2019/Exam/#2867" class="Function">rename</a> <a id="3163" href="/20.07/PUC/2019/Exam/#3163" class="Bound">ρ</a> <a id="3165" class="Symbol">(</a><a id="3166" href="/20.07/PUC/2019/Exam/#1956" class="InductiveConstructor Operator">`suc</a> <a id="3171" href="/20.07/PUC/2019/Exam/#3171" class="Bound">M</a><a id="3172" class="Symbol">)</a> <a id="3180" class="Symbol">=</a> <a id="3183" href="/20.07/PUC/2019/Exam/#1956" class="InductiveConstructor Operator">`suc</a> <a id="3188" class="Symbol">(</a><a id="3189" href="/20.07/PUC/2019/Exam/#2867" class="Function">rename</a> <a id="3196" href="/20.07/PUC/2019/Exam/#3163" class="Bound">ρ</a> <a id="3198" href="/20.07/PUC/2019/Exam/#3171" class="Bound">M</a><a id="3199" class="Symbol">)</a>
|
||
<a id="3203" href="/20.07/PUC/2019/Exam/#2867" class="Function">rename</a> <a id="3210" href="/20.07/PUC/2019/Exam/#3210" class="Bound">ρ</a> <a id="3212" class="Symbol">(</a><a id="3213" href="/20.07/PUC/2019/Exam/#2021" class="InductiveConstructor">case</a> <a id="3218" href="/20.07/PUC/2019/Exam/#3218" class="Bound">L</a> <a id="3220" href="/20.07/PUC/2019/Exam/#3220" class="Bound">M</a> <a id="3222" href="/20.07/PUC/2019/Exam/#3222" class="Bound">N</a><a id="3223" class="Symbol">)</a> <a id="3227" class="Symbol">=</a> <a id="3230" href="/20.07/PUC/2019/Exam/#2021" class="InductiveConstructor">case</a> <a id="3235" class="Symbol">(</a><a id="3236" href="/20.07/PUC/2019/Exam/#2867" class="Function">rename</a> <a id="3243" href="/20.07/PUC/2019/Exam/#3210" class="Bound">ρ</a> <a id="3245" href="/20.07/PUC/2019/Exam/#3218" class="Bound">L</a><a id="3246" class="Symbol">)</a> <a id="3248" class="Symbol">(</a><a id="3249" href="/20.07/PUC/2019/Exam/#2867" class="Function">rename</a> <a id="3256" href="/20.07/PUC/2019/Exam/#3210" class="Bound">ρ</a> <a id="3258" href="/20.07/PUC/2019/Exam/#3220" class="Bound">M</a><a id="3259" class="Symbol">)</a> <a id="3261" class="Symbol">(</a><a id="3262" href="/20.07/PUC/2019/Exam/#2867" class="Function">rename</a> <a id="3269" class="Symbol">(</a><a id="3270" href="/20.07/PUC/2019/Exam/#2696" class="Function">ext</a> <a id="3274" href="/20.07/PUC/2019/Exam/#3210" class="Bound">ρ</a><a id="3275" class="Symbol">)</a> <a id="3277" href="/20.07/PUC/2019/Exam/#3222" class="Bound">N</a><a id="3278" class="Symbol">)</a>
|
||
<a id="3282" href="/20.07/PUC/2019/Exam/#2867" class="Function">rename</a> <a id="3289" href="/20.07/PUC/2019/Exam/#3289" class="Bound">ρ</a> <a id="3291" class="Symbol">(</a><a id="3292" href="/20.07/PUC/2019/Exam/#2123" class="InductiveConstructor Operator">μ</a> <a id="3294" href="/20.07/PUC/2019/Exam/#3294" class="Bound">N</a><a id="3295" class="Symbol">)</a> <a id="3306" class="Symbol">=</a> <a id="3309" href="/20.07/PUC/2019/Exam/#2123" class="InductiveConstructor Operator">μ</a> <a id="3311" class="Symbol">(</a><a id="3312" href="/20.07/PUC/2019/Exam/#2867" class="Function">rename</a> <a id="3319" class="Symbol">(</a><a id="3320" href="/20.07/PUC/2019/Exam/#2696" class="Function">ext</a> <a id="3324" href="/20.07/PUC/2019/Exam/#3289" class="Bound">ρ</a><a id="3325" class="Symbol">)</a> <a id="3327" href="/20.07/PUC/2019/Exam/#3294" class="Bound">N</a><a id="3328" class="Symbol">)</a>
|
||
</pre>
|
||
<h3 id="simultaneous-substitution">Simultaneous Substitution</h3>
|
||
|
||
<pre class="Agda"> <a id="Problem2.exts"></a><a id="3372" href="/20.07/PUC/2019/Exam/#3372" class="Function">exts</a> <a id="3377" class="Symbol">:</a> <a id="3379" class="Symbol">∀</a> <a id="3381" class="Symbol">{</a><a id="3382" href="/20.07/PUC/2019/Exam/#3382" class="Bound">Γ</a> <a id="3384" href="/20.07/PUC/2019/Exam/#3384" class="Bound">Δ</a><a id="3385" class="Symbol">}</a> <a id="3387" class="Symbol">→</a> <a id="3389" class="Symbol">(∀</a> <a id="3392" class="Symbol">{</a><a id="3393" href="/20.07/PUC/2019/Exam/#3393" class="Bound">A</a><a id="3394" class="Symbol">}</a> <a id="3396" class="Symbol">→</a> <a id="3398" href="/20.07/PUC/2019/Exam/#3382" class="Bound">Γ</a> <a id="3400" href="/20.07/PUC/2019/Exam/#1427" class="Datatype Operator">∋</a> <a id="3402" href="/20.07/PUC/2019/Exam/#3393" class="Bound">A</a> <a id="3404" class="Symbol">→</a> <a id="3406" href="/20.07/PUC/2019/Exam/#3384" class="Bound">Δ</a> <a id="3408" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="3410" href="/20.07/PUC/2019/Exam/#3393" class="Bound">A</a><a id="3411" class="Symbol">)</a>
|
||
<a id="3419" class="Comment">----------------------------------</a>
|
||
<a id="3458" class="Symbol">→</a> <a id="3460" class="Symbol">(∀</a> <a id="3463" class="Symbol">{</a><a id="3464" href="/20.07/PUC/2019/Exam/#3464" class="Bound">A</a> <a id="3466" href="/20.07/PUC/2019/Exam/#3466" class="Bound">B</a><a id="3467" class="Symbol">}</a> <a id="3469" class="Symbol">→</a> <a id="3471" href="/20.07/PUC/2019/Exam/#3382" class="Bound">Γ</a> <a id="3473" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="3475" href="/20.07/PUC/2019/Exam/#3466" class="Bound">B</a> <a id="3477" href="/20.07/PUC/2019/Exam/#1427" class="Datatype Operator">∋</a> <a id="3479" href="/20.07/PUC/2019/Exam/#3464" class="Bound">A</a> <a id="3481" class="Symbol">→</a> <a id="3483" href="/20.07/PUC/2019/Exam/#3384" class="Bound">Δ</a> <a id="3485" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="3487" href="/20.07/PUC/2019/Exam/#3466" class="Bound">B</a> <a id="3489" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="3491" href="/20.07/PUC/2019/Exam/#3464" class="Bound">A</a><a id="3492" class="Symbol">)</a>
|
||
<a id="3496" href="/20.07/PUC/2019/Exam/#3372" class="Function">exts</a> <a id="3501" href="/20.07/PUC/2019/Exam/#3501" class="Bound">σ</a> <a id="3503" href="/20.07/PUC/2019/Exam/#1465" class="InductiveConstructor">Z</a> <a id="3510" class="Symbol">=</a> <a id="3513" href="/20.07/PUC/2019/Exam/#1673" class="InductiveConstructor Operator">`</a> <a id="3515" href="/20.07/PUC/2019/Exam/#1465" class="InductiveConstructor">Z</a>
|
||
<a id="3519" href="/20.07/PUC/2019/Exam/#3372" class="Function">exts</a> <a id="3524" href="/20.07/PUC/2019/Exam/#3524" class="Bound">σ</a> <a id="3526" class="Symbol">(</a><a id="3527" href="/20.07/PUC/2019/Exam/#1519" class="InductiveConstructor Operator">S</a> <a id="3529" href="/20.07/PUC/2019/Exam/#3529" class="Bound">x</a><a id="3530" class="Symbol">)</a> <a id="3533" class="Symbol">=</a> <a id="3536" href="/20.07/PUC/2019/Exam/#2867" class="Function">rename</a> <a id="3543" href="/20.07/PUC/2019/Exam/#1519" class="InductiveConstructor Operator">S_</a> <a id="3546" class="Symbol">(</a><a id="3547" href="/20.07/PUC/2019/Exam/#3524" class="Bound">σ</a> <a id="3549" href="/20.07/PUC/2019/Exam/#3529" class="Bound">x</a><a id="3550" class="Symbol">)</a>
|
||
|
||
<a id="Problem2.subst"></a><a id="3555" href="/20.07/PUC/2019/Exam/#3555" class="Function">subst</a> <a id="3561" class="Symbol">:</a> <a id="3563" class="Symbol">∀</a> <a id="3565" class="Symbol">{</a><a id="3566" href="/20.07/PUC/2019/Exam/#3566" class="Bound">Γ</a> <a id="3568" href="/20.07/PUC/2019/Exam/#3568" class="Bound">Δ</a><a id="3569" class="Symbol">}</a>
|
||
<a id="3575" class="Symbol">→</a> <a id="3577" class="Symbol">(∀</a> <a id="3580" class="Symbol">{</a><a id="3581" href="/20.07/PUC/2019/Exam/#3581" class="Bound">A</a><a id="3582" class="Symbol">}</a> <a id="3584" class="Symbol">→</a> <a id="3586" href="/20.07/PUC/2019/Exam/#3566" class="Bound">Γ</a> <a id="3588" href="/20.07/PUC/2019/Exam/#1427" class="Datatype Operator">∋</a> <a id="3590" href="/20.07/PUC/2019/Exam/#3581" class="Bound">A</a> <a id="3592" class="Symbol">→</a> <a id="3594" href="/20.07/PUC/2019/Exam/#3568" class="Bound">Δ</a> <a id="3596" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="3598" href="/20.07/PUC/2019/Exam/#3581" class="Bound">A</a><a id="3599" class="Symbol">)</a>
|
||
<a id="3607" class="Comment">------------------------</a>
|
||
<a id="3636" class="Symbol">→</a> <a id="3638" class="Symbol">(∀</a> <a id="3641" class="Symbol">{</a><a id="3642" href="/20.07/PUC/2019/Exam/#3642" class="Bound">A</a><a id="3643" class="Symbol">}</a> <a id="3645" class="Symbol">→</a> <a id="3647" href="/20.07/PUC/2019/Exam/#3566" class="Bound">Γ</a> <a id="3649" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="3651" href="/20.07/PUC/2019/Exam/#3642" class="Bound">A</a> <a id="3653" class="Symbol">→</a> <a id="3655" href="/20.07/PUC/2019/Exam/#3568" class="Bound">Δ</a> <a id="3657" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="3659" href="/20.07/PUC/2019/Exam/#3642" class="Bound">A</a><a id="3660" class="Symbol">)</a>
|
||
<a id="3664" href="/20.07/PUC/2019/Exam/#3555" class="Function">subst</a> <a id="3670" href="/20.07/PUC/2019/Exam/#3670" class="Bound">σ</a> <a id="3672" class="Symbol">(</a><a id="3673" href="/20.07/PUC/2019/Exam/#1673" class="InductiveConstructor Operator">`</a> <a id="3675" href="/20.07/PUC/2019/Exam/#3675" class="Bound">k</a><a id="3676" class="Symbol">)</a> <a id="3687" class="Symbol">=</a> <a id="3690" href="/20.07/PUC/2019/Exam/#3670" class="Bound">σ</a> <a id="3692" href="/20.07/PUC/2019/Exam/#3675" class="Bound">k</a>
|
||
<a id="3696" href="/20.07/PUC/2019/Exam/#3555" class="Function">subst</a> <a id="3702" href="/20.07/PUC/2019/Exam/#3702" class="Bound">σ</a> <a id="3704" class="Symbol">(</a><a id="3705" href="/20.07/PUC/2019/Exam/#1736" class="InductiveConstructor Operator">ƛ</a> <a id="3707" href="/20.07/PUC/2019/Exam/#3707" class="Bound">N</a><a id="3708" class="Symbol">)</a> <a id="3719" class="Symbol">=</a> <a id="3722" href="/20.07/PUC/2019/Exam/#1736" class="InductiveConstructor Operator">ƛ</a> <a id="3724" class="Symbol">(</a><a id="3725" href="/20.07/PUC/2019/Exam/#3555" class="Function">subst</a> <a id="3731" class="Symbol">(</a><a id="3732" href="/20.07/PUC/2019/Exam/#3372" class="Function">exts</a> <a id="3737" href="/20.07/PUC/2019/Exam/#3702" class="Bound">σ</a><a id="3738" class="Symbol">)</a> <a id="3740" href="/20.07/PUC/2019/Exam/#3707" class="Bound">N</a><a id="3741" class="Symbol">)</a>
|
||
<a id="3745" href="/20.07/PUC/2019/Exam/#3555" class="Function">subst</a> <a id="3751" href="/20.07/PUC/2019/Exam/#3751" class="Bound">σ</a> <a id="3753" class="Symbol">(</a><a id="3754" href="/20.07/PUC/2019/Exam/#3754" class="Bound">L</a> <a id="3756" href="/20.07/PUC/2019/Exam/#1815" class="InductiveConstructor Operator">·</a> <a id="3758" href="/20.07/PUC/2019/Exam/#3758" class="Bound">M</a><a id="3759" class="Symbol">)</a> <a id="3768" class="Symbol">=</a> <a id="3771" class="Symbol">(</a><a id="3772" href="/20.07/PUC/2019/Exam/#3555" class="Function">subst</a> <a id="3778" href="/20.07/PUC/2019/Exam/#3751" class="Bound">σ</a> <a id="3780" href="/20.07/PUC/2019/Exam/#3754" class="Bound">L</a><a id="3781" class="Symbol">)</a> <a id="3783" href="/20.07/PUC/2019/Exam/#1815" class="InductiveConstructor Operator">·</a> <a id="3785" class="Symbol">(</a><a id="3786" href="/20.07/PUC/2019/Exam/#3555" class="Function">subst</a> <a id="3792" href="/20.07/PUC/2019/Exam/#3751" class="Bound">σ</a> <a id="3794" href="/20.07/PUC/2019/Exam/#3758" class="Bound">M</a><a id="3795" class="Symbol">)</a>
|
||
<a id="3799" href="/20.07/PUC/2019/Exam/#3555" class="Function">subst</a> <a id="3805" href="/20.07/PUC/2019/Exam/#3805" class="Bound">σ</a> <a id="3807" class="Symbol">(</a><a id="3808" href="/20.07/PUC/2019/Exam/#1903" class="InductiveConstructor">`zero</a><a id="3813" class="Symbol">)</a> <a id="3822" class="Symbol">=</a> <a id="3825" href="/20.07/PUC/2019/Exam/#1903" class="InductiveConstructor">`zero</a>
|
||
<a id="3833" href="/20.07/PUC/2019/Exam/#3555" class="Function">subst</a> <a id="3839" href="/20.07/PUC/2019/Exam/#3839" class="Bound">σ</a> <a id="3841" class="Symbol">(</a><a id="3842" href="/20.07/PUC/2019/Exam/#1956" class="InductiveConstructor Operator">`suc</a> <a id="3847" href="/20.07/PUC/2019/Exam/#3847" class="Bound">M</a><a id="3848" class="Symbol">)</a> <a id="3856" class="Symbol">=</a> <a id="3859" href="/20.07/PUC/2019/Exam/#1956" class="InductiveConstructor Operator">`suc</a> <a id="3864" class="Symbol">(</a><a id="3865" href="/20.07/PUC/2019/Exam/#3555" class="Function">subst</a> <a id="3871" href="/20.07/PUC/2019/Exam/#3839" class="Bound">σ</a> <a id="3873" href="/20.07/PUC/2019/Exam/#3847" class="Bound">M</a><a id="3874" class="Symbol">)</a>
|
||
<a id="3878" href="/20.07/PUC/2019/Exam/#3555" class="Function">subst</a> <a id="3884" href="/20.07/PUC/2019/Exam/#3884" class="Bound">σ</a> <a id="3886" class="Symbol">(</a><a id="3887" href="/20.07/PUC/2019/Exam/#2021" class="InductiveConstructor">case</a> <a id="3892" href="/20.07/PUC/2019/Exam/#3892" class="Bound">L</a> <a id="3894" href="/20.07/PUC/2019/Exam/#3894" class="Bound">M</a> <a id="3896" href="/20.07/PUC/2019/Exam/#3896" class="Bound">N</a><a id="3897" class="Symbol">)</a> <a id="3901" class="Symbol">=</a> <a id="3904" href="/20.07/PUC/2019/Exam/#2021" class="InductiveConstructor">case</a> <a id="3909" class="Symbol">(</a><a id="3910" href="/20.07/PUC/2019/Exam/#3555" class="Function">subst</a> <a id="3916" href="/20.07/PUC/2019/Exam/#3884" class="Bound">σ</a> <a id="3918" href="/20.07/PUC/2019/Exam/#3892" class="Bound">L</a><a id="3919" class="Symbol">)</a> <a id="3921" class="Symbol">(</a><a id="3922" href="/20.07/PUC/2019/Exam/#3555" class="Function">subst</a> <a id="3928" href="/20.07/PUC/2019/Exam/#3884" class="Bound">σ</a> <a id="3930" href="/20.07/PUC/2019/Exam/#3894" class="Bound">M</a><a id="3931" class="Symbol">)</a> <a id="3933" class="Symbol">(</a><a id="3934" href="/20.07/PUC/2019/Exam/#3555" class="Function">subst</a> <a id="3940" class="Symbol">(</a><a id="3941" href="/20.07/PUC/2019/Exam/#3372" class="Function">exts</a> <a id="3946" href="/20.07/PUC/2019/Exam/#3884" class="Bound">σ</a><a id="3947" class="Symbol">)</a> <a id="3949" href="/20.07/PUC/2019/Exam/#3896" class="Bound">N</a><a id="3950" class="Symbol">)</a>
|
||
<a id="3954" href="/20.07/PUC/2019/Exam/#3555" class="Function">subst</a> <a id="3960" href="/20.07/PUC/2019/Exam/#3960" class="Bound">σ</a> <a id="3962" class="Symbol">(</a><a id="3963" href="/20.07/PUC/2019/Exam/#2123" class="InductiveConstructor Operator">μ</a> <a id="3965" href="/20.07/PUC/2019/Exam/#3965" class="Bound">N</a><a id="3966" class="Symbol">)</a> <a id="3977" class="Symbol">=</a> <a id="3980" href="/20.07/PUC/2019/Exam/#2123" class="InductiveConstructor Operator">μ</a> <a id="3982" class="Symbol">(</a><a id="3983" href="/20.07/PUC/2019/Exam/#3555" class="Function">subst</a> <a id="3989" class="Symbol">(</a><a id="3990" href="/20.07/PUC/2019/Exam/#3372" class="Function">exts</a> <a id="3995" href="/20.07/PUC/2019/Exam/#3960" class="Bound">σ</a><a id="3996" class="Symbol">)</a> <a id="3998" href="/20.07/PUC/2019/Exam/#3965" class="Bound">N</a><a id="3999" class="Symbol">)</a>
|
||
</pre>
|
||
<h3 id="single-substitution">Single substitution</h3>
|
||
|
||
<pre class="Agda"> <a id="Problem2._[_]"></a><a id="4037" href="/20.07/PUC/2019/Exam/#4037" class="Function Operator">_[_]</a> <a id="4042" class="Symbol">:</a> <a id="4044" class="Symbol">∀</a> <a id="4046" class="Symbol">{</a><a id="4047" href="/20.07/PUC/2019/Exam/#4047" class="Bound">Γ</a> <a id="4049" href="/20.07/PUC/2019/Exam/#4049" class="Bound">A</a> <a id="4051" href="/20.07/PUC/2019/Exam/#4051" class="Bound">B</a><a id="4052" class="Symbol">}</a>
|
||
<a id="4064" class="Symbol">→</a> <a id="4066" href="/20.07/PUC/2019/Exam/#4047" class="Bound">Γ</a> <a id="4068" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="4070" href="/20.07/PUC/2019/Exam/#4051" class="Bound">B</a> <a id="4072" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="4074" href="/20.07/PUC/2019/Exam/#4049" class="Bound">A</a>
|
||
<a id="4086" class="Symbol">→</a> <a id="4088" href="/20.07/PUC/2019/Exam/#4047" class="Bound">Γ</a> <a id="4090" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="4092" href="/20.07/PUC/2019/Exam/#4051" class="Bound">B</a>
|
||
<a id="4106" class="Comment">---------</a>
|
||
<a id="4126" class="Symbol">→</a> <a id="4128" href="/20.07/PUC/2019/Exam/#4047" class="Bound">Γ</a> <a id="4130" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="4132" href="/20.07/PUC/2019/Exam/#4049" class="Bound">A</a>
|
||
<a id="4136" href="/20.07/PUC/2019/Exam/#4037" class="Function Operator">_[_]</a> <a id="4141" class="Symbol">{</a><a id="4142" href="/20.07/PUC/2019/Exam/#4142" class="Bound">Γ</a><a id="4143" class="Symbol">}</a> <a id="4145" class="Symbol">{</a><a id="4146" href="/20.07/PUC/2019/Exam/#4146" class="Bound">A</a><a id="4147" class="Symbol">}</a> <a id="4149" class="Symbol">{</a><a id="4150" href="/20.07/PUC/2019/Exam/#4150" class="Bound">B</a><a id="4151" class="Symbol">}</a> <a id="4153" href="/20.07/PUC/2019/Exam/#4153" class="Bound">N</a> <a id="4155" href="/20.07/PUC/2019/Exam/#4155" class="Bound">M</a> <a id="4157" class="Symbol">=</a> <a id="4160" href="/20.07/PUC/2019/Exam/#3555" class="Function">subst</a> <a id="4166" class="Symbol">{</a><a id="4167" href="/20.07/PUC/2019/Exam/#4142" class="Bound">Γ</a> <a id="4169" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="4171" href="/20.07/PUC/2019/Exam/#4150" class="Bound">B</a><a id="4172" class="Symbol">}</a> <a id="4174" class="Symbol">{</a><a id="4175" href="/20.07/PUC/2019/Exam/#4142" class="Bound">Γ</a><a id="4176" class="Symbol">}</a> <a id="4178" href="/20.07/PUC/2019/Exam/#4200" class="Function">σ</a> <a id="4180" class="Symbol">{</a><a id="4181" href="/20.07/PUC/2019/Exam/#4146" class="Bound">A</a><a id="4182" class="Symbol">}</a> <a id="4184" href="/20.07/PUC/2019/Exam/#4153" class="Bound">N</a>
|
||
<a id="4190" class="Keyword">where</a>
|
||
<a id="4200" href="/20.07/PUC/2019/Exam/#4200" class="Function">σ</a> <a id="4202" class="Symbol">:</a> <a id="4204" class="Symbol">∀</a> <a id="4206" class="Symbol">{</a><a id="4207" href="/20.07/PUC/2019/Exam/#4207" class="Bound">A</a><a id="4208" class="Symbol">}</a> <a id="4210" class="Symbol">→</a> <a id="4212" href="/20.07/PUC/2019/Exam/#4142" class="Bound">Γ</a> <a id="4214" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="4216" href="/20.07/PUC/2019/Exam/#4150" class="Bound">B</a> <a id="4218" href="/20.07/PUC/2019/Exam/#1427" class="Datatype Operator">∋</a> <a id="4220" href="/20.07/PUC/2019/Exam/#4207" class="Bound">A</a> <a id="4222" class="Symbol">→</a> <a id="4224" href="/20.07/PUC/2019/Exam/#4142" class="Bound">Γ</a> <a id="4226" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="4228" href="/20.07/PUC/2019/Exam/#4207" class="Bound">A</a>
|
||
<a id="4234" href="/20.07/PUC/2019/Exam/#4200" class="Function">σ</a> <a id="4236" href="/20.07/PUC/2019/Exam/#1465" class="InductiveConstructor">Z</a> <a id="4243" class="Symbol">=</a> <a id="4246" href="/20.07/PUC/2019/Exam/#4155" class="Bound">M</a>
|
||
<a id="4252" href="/20.07/PUC/2019/Exam/#4200" class="Function">σ</a> <a id="4254" class="Symbol">(</a><a id="4255" href="/20.07/PUC/2019/Exam/#1519" class="InductiveConstructor Operator">S</a> <a id="4257" href="/20.07/PUC/2019/Exam/#4257" class="Bound">x</a><a id="4258" class="Symbol">)</a> <a id="4261" class="Symbol">=</a> <a id="4264" href="/20.07/PUC/2019/Exam/#1673" class="InductiveConstructor Operator">`</a> <a id="4266" href="/20.07/PUC/2019/Exam/#4257" class="Bound">x</a>
|
||
</pre>
|
||
<h3 id="values">Values</h3>
|
||
|
||
<pre class="Agda"> <a id="4291" class="Keyword">data</a> <a id="Problem2.Value"></a><a id="4296" href="/20.07/PUC/2019/Exam/#4296" class="Datatype">Value</a> <a id="4302" class="Symbol">:</a> <a id="4304" class="Symbol">∀</a> <a id="4306" class="Symbol">{</a><a id="4307" href="/20.07/PUC/2019/Exam/#4307" class="Bound">Γ</a> <a id="4309" href="/20.07/PUC/2019/Exam/#4309" class="Bound">A</a><a id="4310" class="Symbol">}</a> <a id="4312" class="Symbol">→</a> <a id="4314" href="/20.07/PUC/2019/Exam/#4307" class="Bound">Γ</a> <a id="4316" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="4318" href="/20.07/PUC/2019/Exam/#4309" class="Bound">A</a> <a id="4320" class="Symbol">→</a> <a id="4322" class="PrimitiveType">Set</a> <a id="4326" class="Keyword">where</a>
|
||
|
||
<a id="Problem2.Value.V-ƛ"></a><a id="4337" href="/20.07/PUC/2019/Exam/#4337" class="InductiveConstructor">V-ƛ</a> <a id="4341" class="Symbol">:</a> <a id="4343" class="Symbol">∀</a> <a id="4345" class="Symbol">{</a><a id="4346" href="/20.07/PUC/2019/Exam/#4346" class="Bound">Γ</a> <a id="4348" href="/20.07/PUC/2019/Exam/#4348" class="Bound">A</a> <a id="4350" href="/20.07/PUC/2019/Exam/#4350" class="Bound">B</a><a id="4351" class="Symbol">}</a> <a id="4353" class="Symbol">{</a><a id="4354" href="/20.07/PUC/2019/Exam/#4354" class="Bound">N</a> <a id="4356" class="Symbol">:</a> <a id="4358" href="/20.07/PUC/2019/Exam/#4346" class="Bound">Γ</a> <a id="4360" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="4362" href="/20.07/PUC/2019/Exam/#4348" class="Bound">A</a> <a id="4364" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="4366" href="/20.07/PUC/2019/Exam/#4350" class="Bound">B</a><a id="4367" class="Symbol">}</a>
|
||
<a id="4377" class="Comment">---------------------------</a>
|
||
<a id="4411" class="Symbol">→</a> <a id="4413" href="/20.07/PUC/2019/Exam/#4296" class="Datatype">Value</a> <a id="4419" class="Symbol">(</a><a id="4420" href="/20.07/PUC/2019/Exam/#1736" class="InductiveConstructor Operator">ƛ</a> <a id="4422" href="/20.07/PUC/2019/Exam/#4354" class="Bound">N</a><a id="4423" class="Symbol">)</a>
|
||
|
||
<a id="Problem2.Value.V-zero"></a><a id="4430" href="/20.07/PUC/2019/Exam/#4430" class="InductiveConstructor">V-zero</a> <a id="4437" class="Symbol">:</a> <a id="4439" class="Symbol">∀</a> <a id="4441" class="Symbol">{</a><a id="4442" href="/20.07/PUC/2019/Exam/#4442" class="Bound">Γ</a><a id="4443" class="Symbol">}</a>
|
||
<a id="4453" class="Comment">-----------------</a>
|
||
<a id="4477" class="Symbol">→</a> <a id="4479" href="/20.07/PUC/2019/Exam/#4296" class="Datatype">Value</a> <a id="4485" class="Symbol">(</a><a id="4486" href="/20.07/PUC/2019/Exam/#1903" class="InductiveConstructor">`zero</a> <a id="4492" class="Symbol">{</a><a id="4493" href="/20.07/PUC/2019/Exam/#4442" class="Bound">Γ</a><a id="4494" class="Symbol">})</a>
|
||
|
||
<a id="Problem2.Value.V-suc"></a><a id="4502" href="/20.07/PUC/2019/Exam/#4502" class="InductiveConstructor">V-suc</a> <a id="4508" class="Symbol">:</a> <a id="4510" class="Symbol">∀</a> <a id="4512" class="Symbol">{</a><a id="4513" href="/20.07/PUC/2019/Exam/#4513" class="Bound">Γ</a><a id="4514" class="Symbol">}</a> <a id="4516" class="Symbol">{</a><a id="4517" href="/20.07/PUC/2019/Exam/#4517" class="Bound">V</a> <a id="4519" class="Symbol">:</a> <a id="4521" href="/20.07/PUC/2019/Exam/#4513" class="Bound">Γ</a> <a id="4523" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="4525" href="/20.07/PUC/2019/Exam/#1278" class="InductiveConstructor">`ℕ</a><a id="4527" class="Symbol">}</a>
|
||
<a id="4535" class="Symbol">→</a> <a id="4537" href="/20.07/PUC/2019/Exam/#4296" class="Datatype">Value</a> <a id="4543" href="/20.07/PUC/2019/Exam/#4517" class="Bound">V</a>
|
||
<a id="4553" class="Comment">--------------</a>
|
||
<a id="4574" class="Symbol">→</a> <a id="4576" href="/20.07/PUC/2019/Exam/#4296" class="Datatype">Value</a> <a id="4582" class="Symbol">(</a><a id="4583" href="/20.07/PUC/2019/Exam/#1956" class="InductiveConstructor Operator">`suc</a> <a id="4588" href="/20.07/PUC/2019/Exam/#4517" class="Bound">V</a><a id="4589" class="Symbol">)</a>
|
||
</pre>
|
||
<h3 id="reduction">Reduction</h3>
|
||
|
||
<pre class="Agda"> <a id="4617" class="Keyword">infix</a> <a id="4623" class="Number">2</a> <a id="4625" href="/20.07/PUC/2019/Exam/#4638" class="Datatype Operator">_—→_</a>
|
||
|
||
<a id="4633" class="Keyword">data</a> <a id="Problem2._—→_"></a><a id="4638" href="/20.07/PUC/2019/Exam/#4638" class="Datatype Operator">_—→_</a> <a id="4643" class="Symbol">:</a> <a id="4645" class="Symbol">∀</a> <a id="4647" class="Symbol">{</a><a id="4648" href="/20.07/PUC/2019/Exam/#4648" class="Bound">Γ</a> <a id="4650" href="/20.07/PUC/2019/Exam/#4650" class="Bound">A</a><a id="4651" class="Symbol">}</a> <a id="4653" class="Symbol">→</a> <a id="4655" class="Symbol">(</a><a id="4656" href="/20.07/PUC/2019/Exam/#4648" class="Bound">Γ</a> <a id="4658" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="4660" href="/20.07/PUC/2019/Exam/#4650" class="Bound">A</a><a id="4661" class="Symbol">)</a> <a id="4663" class="Symbol">→</a> <a id="4665" class="Symbol">(</a><a id="4666" href="/20.07/PUC/2019/Exam/#4648" class="Bound">Γ</a> <a id="4668" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="4670" href="/20.07/PUC/2019/Exam/#4650" class="Bound">A</a><a id="4671" class="Symbol">)</a> <a id="4673" class="Symbol">→</a> <a id="4675" class="PrimitiveType">Set</a> <a id="4679" class="Keyword">where</a>
|
||
|
||
<a id="Problem2._—→_.ξ-·₁"></a><a id="4690" href="/20.07/PUC/2019/Exam/#4690" class="InductiveConstructor">ξ-·₁</a> <a id="4695" class="Symbol">:</a> <a id="4697" class="Symbol">∀</a> <a id="4699" class="Symbol">{</a><a id="4700" href="/20.07/PUC/2019/Exam/#4700" class="Bound">Γ</a> <a id="4702" href="/20.07/PUC/2019/Exam/#4702" class="Bound">A</a> <a id="4704" href="/20.07/PUC/2019/Exam/#4704" class="Bound">B</a><a id="4705" class="Symbol">}</a> <a id="4707" class="Symbol">{</a><a id="4708" href="/20.07/PUC/2019/Exam/#4708" class="Bound">L</a> <a id="4710" href="/20.07/PUC/2019/Exam/#4710" class="Bound">L′</a> <a id="4713" class="Symbol">:</a> <a id="4715" href="/20.07/PUC/2019/Exam/#4700" class="Bound">Γ</a> <a id="4717" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="4719" href="/20.07/PUC/2019/Exam/#4702" class="Bound">A</a> <a id="4721" href="/20.07/PUC/2019/Exam/#1247" class="InductiveConstructor Operator">⇒</a> <a id="4723" href="/20.07/PUC/2019/Exam/#4704" class="Bound">B</a><a id="4724" class="Symbol">}</a> <a id="4726" class="Symbol">{</a><a id="4727" href="/20.07/PUC/2019/Exam/#4727" class="Bound">M</a> <a id="4729" class="Symbol">:</a> <a id="4731" href="/20.07/PUC/2019/Exam/#4700" class="Bound">Γ</a> <a id="4733" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="4735" href="/20.07/PUC/2019/Exam/#4702" class="Bound">A</a><a id="4736" class="Symbol">}</a>
|
||
<a id="4744" class="Symbol">→</a> <a id="4746" href="/20.07/PUC/2019/Exam/#4708" class="Bound">L</a> <a id="4748" href="/20.07/PUC/2019/Exam/#4638" class="Datatype Operator">—→</a> <a id="4751" href="/20.07/PUC/2019/Exam/#4710" class="Bound">L′</a>
|
||
<a id="4762" class="Comment">-----------------</a>
|
||
<a id="4786" class="Symbol">→</a> <a id="4788" href="/20.07/PUC/2019/Exam/#4708" class="Bound">L</a> <a id="4790" href="/20.07/PUC/2019/Exam/#1815" class="InductiveConstructor Operator">·</a> <a id="4792" href="/20.07/PUC/2019/Exam/#4727" class="Bound">M</a> <a id="4794" href="/20.07/PUC/2019/Exam/#4638" class="Datatype Operator">—→</a> <a id="4797" href="/20.07/PUC/2019/Exam/#4710" class="Bound">L′</a> <a id="4800" href="/20.07/PUC/2019/Exam/#1815" class="InductiveConstructor Operator">·</a> <a id="4802" href="/20.07/PUC/2019/Exam/#4727" class="Bound">M</a>
|
||
|
||
<a id="Problem2._—→_.ξ-·₂"></a><a id="4809" href="/20.07/PUC/2019/Exam/#4809" class="InductiveConstructor">ξ-·₂</a> <a id="4814" class="Symbol">:</a> <a id="4816" class="Symbol">∀</a> <a id="4818" class="Symbol">{</a><a id="4819" href="/20.07/PUC/2019/Exam/#4819" class="Bound">Γ</a> <a id="4821" href="/20.07/PUC/2019/Exam/#4821" class="Bound">A</a> <a id="4823" href="/20.07/PUC/2019/Exam/#4823" class="Bound">B</a><a id="4824" class="Symbol">}</a> <a id="4826" class="Symbol">{</a><a id="4827" href="/20.07/PUC/2019/Exam/#4827" class="Bound">V</a> <a id="4829" class="Symbol">:</a> <a id="4831" href="/20.07/PUC/2019/Exam/#4819" class="Bound">Γ</a> <a id="4833" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="4835" href="/20.07/PUC/2019/Exam/#4821" class="Bound">A</a> <a id="4837" href="/20.07/PUC/2019/Exam/#1247" class="InductiveConstructor Operator">⇒</a> <a id="4839" href="/20.07/PUC/2019/Exam/#4823" class="Bound">B</a><a id="4840" class="Symbol">}</a> <a id="4842" class="Symbol">{</a><a id="4843" href="/20.07/PUC/2019/Exam/#4843" class="Bound">M</a> <a id="4845" href="/20.07/PUC/2019/Exam/#4845" class="Bound">M′</a> <a id="4848" class="Symbol">:</a> <a id="4850" href="/20.07/PUC/2019/Exam/#4819" class="Bound">Γ</a> <a id="4852" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="4854" href="/20.07/PUC/2019/Exam/#4821" class="Bound">A</a><a id="4855" class="Symbol">}</a>
|
||
<a id="4863" class="Symbol">→</a> <a id="4865" href="/20.07/PUC/2019/Exam/#4296" class="Datatype">Value</a> <a id="4871" href="/20.07/PUC/2019/Exam/#4827" class="Bound">V</a>
|
||
<a id="4879" class="Symbol">→</a> <a id="4881" href="/20.07/PUC/2019/Exam/#4843" class="Bound">M</a> <a id="4883" href="/20.07/PUC/2019/Exam/#4638" class="Datatype Operator">—→</a> <a id="4886" href="/20.07/PUC/2019/Exam/#4845" class="Bound">M′</a>
|
||
<a id="4897" class="Comment">--------------</a>
|
||
<a id="4918" class="Symbol">→</a> <a id="4920" href="/20.07/PUC/2019/Exam/#4827" class="Bound">V</a> <a id="4922" href="/20.07/PUC/2019/Exam/#1815" class="InductiveConstructor Operator">·</a> <a id="4924" href="/20.07/PUC/2019/Exam/#4843" class="Bound">M</a> <a id="4926" href="/20.07/PUC/2019/Exam/#4638" class="Datatype Operator">—→</a> <a id="4929" href="/20.07/PUC/2019/Exam/#4827" class="Bound">V</a> <a id="4931" href="/20.07/PUC/2019/Exam/#1815" class="InductiveConstructor Operator">·</a> <a id="4933" href="/20.07/PUC/2019/Exam/#4845" class="Bound">M′</a>
|
||
|
||
<a id="Problem2._—→_.β-ƛ"></a><a id="4941" href="/20.07/PUC/2019/Exam/#4941" class="InductiveConstructor">β-ƛ</a> <a id="4945" class="Symbol">:</a> <a id="4947" class="Symbol">∀</a> <a id="4949" class="Symbol">{</a><a id="4950" href="/20.07/PUC/2019/Exam/#4950" class="Bound">Γ</a> <a id="4952" href="/20.07/PUC/2019/Exam/#4952" class="Bound">A</a> <a id="4954" href="/20.07/PUC/2019/Exam/#4954" class="Bound">B</a><a id="4955" class="Symbol">}</a> <a id="4957" class="Symbol">{</a><a id="4958" href="/20.07/PUC/2019/Exam/#4958" class="Bound">N</a> <a id="4960" class="Symbol">:</a> <a id="4962" href="/20.07/PUC/2019/Exam/#4950" class="Bound">Γ</a> <a id="4964" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="4966" href="/20.07/PUC/2019/Exam/#4952" class="Bound">A</a> <a id="4968" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="4970" href="/20.07/PUC/2019/Exam/#4954" class="Bound">B</a><a id="4971" class="Symbol">}</a> <a id="4973" class="Symbol">{</a><a id="4974" href="/20.07/PUC/2019/Exam/#4974" class="Bound">W</a> <a id="4976" class="Symbol">:</a> <a id="4978" href="/20.07/PUC/2019/Exam/#4950" class="Bound">Γ</a> <a id="4980" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="4982" href="/20.07/PUC/2019/Exam/#4952" class="Bound">A</a><a id="4983" class="Symbol">}</a>
|
||
<a id="4991" class="Symbol">→</a> <a id="4993" href="/20.07/PUC/2019/Exam/#4296" class="Datatype">Value</a> <a id="4999" href="/20.07/PUC/2019/Exam/#4974" class="Bound">W</a>
|
||
<a id="5009" class="Comment">-------------------</a>
|
||
<a id="5035" class="Symbol">→</a> <a id="5037" class="Symbol">(</a><a id="5038" href="/20.07/PUC/2019/Exam/#1736" class="InductiveConstructor Operator">ƛ</a> <a id="5040" href="/20.07/PUC/2019/Exam/#4958" class="Bound">N</a><a id="5041" class="Symbol">)</a> <a id="5043" href="/20.07/PUC/2019/Exam/#1815" class="InductiveConstructor Operator">·</a> <a id="5045" href="/20.07/PUC/2019/Exam/#4974" class="Bound">W</a> <a id="5047" href="/20.07/PUC/2019/Exam/#4638" class="Datatype Operator">—→</a> <a id="5050" href="/20.07/PUC/2019/Exam/#4958" class="Bound">N</a> <a id="5052" href="/20.07/PUC/2019/Exam/#4037" class="Function Operator">[</a> <a id="5054" href="/20.07/PUC/2019/Exam/#4974" class="Bound">W</a> <a id="5056" href="/20.07/PUC/2019/Exam/#4037" class="Function Operator">]</a>
|
||
|
||
<a id="Problem2._—→_.ξ-suc"></a><a id="5063" href="/20.07/PUC/2019/Exam/#5063" class="InductiveConstructor">ξ-suc</a> <a id="5069" class="Symbol">:</a> <a id="5071" class="Symbol">∀</a> <a id="5073" class="Symbol">{</a><a id="5074" href="/20.07/PUC/2019/Exam/#5074" class="Bound">Γ</a><a id="5075" class="Symbol">}</a> <a id="5077" class="Symbol">{</a><a id="5078" href="/20.07/PUC/2019/Exam/#5078" class="Bound">M</a> <a id="5080" href="/20.07/PUC/2019/Exam/#5080" class="Bound">M′</a> <a id="5083" class="Symbol">:</a> <a id="5085" href="/20.07/PUC/2019/Exam/#5074" class="Bound">Γ</a> <a id="5087" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="5089" href="/20.07/PUC/2019/Exam/#1278" class="InductiveConstructor">`ℕ</a><a id="5091" class="Symbol">}</a>
|
||
<a id="5099" class="Symbol">→</a> <a id="5101" href="/20.07/PUC/2019/Exam/#5078" class="Bound">M</a> <a id="5103" href="/20.07/PUC/2019/Exam/#4638" class="Datatype Operator">—→</a> <a id="5106" href="/20.07/PUC/2019/Exam/#5080" class="Bound">M′</a>
|
||
<a id="5117" class="Comment">----------------</a>
|
||
<a id="5140" class="Symbol">→</a> <a id="5142" href="/20.07/PUC/2019/Exam/#1956" class="InductiveConstructor Operator">`suc</a> <a id="5147" href="/20.07/PUC/2019/Exam/#5078" class="Bound">M</a> <a id="5149" href="/20.07/PUC/2019/Exam/#4638" class="Datatype Operator">—→</a> <a id="5152" href="/20.07/PUC/2019/Exam/#1956" class="InductiveConstructor Operator">`suc</a> <a id="5157" href="/20.07/PUC/2019/Exam/#5080" class="Bound">M′</a>
|
||
|
||
<a id="Problem2._—→_.ξ-case"></a><a id="5165" href="/20.07/PUC/2019/Exam/#5165" class="InductiveConstructor">ξ-case</a> <a id="5172" class="Symbol">:</a> <a id="5174" class="Symbol">∀</a> <a id="5176" class="Symbol">{</a><a id="5177" href="/20.07/PUC/2019/Exam/#5177" class="Bound">Γ</a> <a id="5179" href="/20.07/PUC/2019/Exam/#5179" class="Bound">A</a><a id="5180" class="Symbol">}</a> <a id="5182" class="Symbol">{</a><a id="5183" href="/20.07/PUC/2019/Exam/#5183" class="Bound">L</a> <a id="5185" href="/20.07/PUC/2019/Exam/#5185" class="Bound">L′</a> <a id="5188" class="Symbol">:</a> <a id="5190" href="/20.07/PUC/2019/Exam/#5177" class="Bound">Γ</a> <a id="5192" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="5194" href="/20.07/PUC/2019/Exam/#1278" class="InductiveConstructor">`ℕ</a><a id="5196" class="Symbol">}</a> <a id="5198" class="Symbol">{</a><a id="5199" href="/20.07/PUC/2019/Exam/#5199" class="Bound">M</a> <a id="5201" class="Symbol">:</a> <a id="5203" href="/20.07/PUC/2019/Exam/#5177" class="Bound">Γ</a> <a id="5205" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="5207" href="/20.07/PUC/2019/Exam/#5179" class="Bound">A</a><a id="5208" class="Symbol">}</a> <a id="5210" class="Symbol">{</a><a id="5211" href="/20.07/PUC/2019/Exam/#5211" class="Bound">N</a> <a id="5213" class="Symbol">:</a> <a id="5215" href="/20.07/PUC/2019/Exam/#5177" class="Bound">Γ</a> <a id="5217" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="5219" href="/20.07/PUC/2019/Exam/#1278" class="InductiveConstructor">`ℕ</a> <a id="5222" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="5224" href="/20.07/PUC/2019/Exam/#5179" class="Bound">A</a><a id="5225" class="Symbol">}</a>
|
||
<a id="5233" class="Symbol">→</a> <a id="5235" href="/20.07/PUC/2019/Exam/#5183" class="Bound">L</a> <a id="5237" href="/20.07/PUC/2019/Exam/#4638" class="Datatype Operator">—→</a> <a id="5240" href="/20.07/PUC/2019/Exam/#5185" class="Bound">L′</a>
|
||
<a id="5251" class="Comment">--------------------------</a>
|
||
<a id="5284" class="Symbol">→</a> <a id="5286" href="/20.07/PUC/2019/Exam/#2021" class="InductiveConstructor">case</a> <a id="5291" href="/20.07/PUC/2019/Exam/#5183" class="Bound">L</a> <a id="5293" href="/20.07/PUC/2019/Exam/#5199" class="Bound">M</a> <a id="5295" href="/20.07/PUC/2019/Exam/#5211" class="Bound">N</a> <a id="5297" href="/20.07/PUC/2019/Exam/#4638" class="Datatype Operator">—→</a> <a id="5300" href="/20.07/PUC/2019/Exam/#2021" class="InductiveConstructor">case</a> <a id="5305" href="/20.07/PUC/2019/Exam/#5185" class="Bound">L′</a> <a id="5308" href="/20.07/PUC/2019/Exam/#5199" class="Bound">M</a> <a id="5310" href="/20.07/PUC/2019/Exam/#5211" class="Bound">N</a>
|
||
|
||
<a id="Problem2._—→_.β-zero"></a><a id="5317" href="/20.07/PUC/2019/Exam/#5317" class="InductiveConstructor">β-zero</a> <a id="5324" class="Symbol">:</a> <a id="5327" class="Symbol">∀</a> <a id="5329" class="Symbol">{</a><a id="5330" href="/20.07/PUC/2019/Exam/#5330" class="Bound">Γ</a> <a id="5332" href="/20.07/PUC/2019/Exam/#5332" class="Bound">A</a><a id="5333" class="Symbol">}</a> <a id="5335" class="Symbol">{</a><a id="5336" href="/20.07/PUC/2019/Exam/#5336" class="Bound">M</a> <a id="5338" class="Symbol">:</a> <a id="5340" href="/20.07/PUC/2019/Exam/#5330" class="Bound">Γ</a> <a id="5342" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="5344" href="/20.07/PUC/2019/Exam/#5332" class="Bound">A</a><a id="5345" class="Symbol">}</a> <a id="5347" class="Symbol">{</a><a id="5348" href="/20.07/PUC/2019/Exam/#5348" class="Bound">N</a> <a id="5350" class="Symbol">:</a> <a id="5352" href="/20.07/PUC/2019/Exam/#5330" class="Bound">Γ</a> <a id="5354" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="5356" href="/20.07/PUC/2019/Exam/#1278" class="InductiveConstructor">`ℕ</a> <a id="5359" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="5361" href="/20.07/PUC/2019/Exam/#5332" class="Bound">A</a><a id="5362" class="Symbol">}</a>
|
||
<a id="5372" class="Comment">-------------------</a>
|
||
<a id="5398" class="Symbol">→</a> <a id="5400" href="/20.07/PUC/2019/Exam/#2021" class="InductiveConstructor">case</a> <a id="5405" href="/20.07/PUC/2019/Exam/#1903" class="InductiveConstructor">`zero</a> <a id="5411" href="/20.07/PUC/2019/Exam/#5336" class="Bound">M</a> <a id="5413" href="/20.07/PUC/2019/Exam/#5348" class="Bound">N</a> <a id="5415" href="/20.07/PUC/2019/Exam/#4638" class="Datatype Operator">—→</a> <a id="5418" href="/20.07/PUC/2019/Exam/#5336" class="Bound">M</a>
|
||
|
||
<a id="Problem2._—→_.β-suc"></a><a id="5425" href="/20.07/PUC/2019/Exam/#5425" class="InductiveConstructor">β-suc</a> <a id="5431" class="Symbol">:</a> <a id="5433" class="Symbol">∀</a> <a id="5435" class="Symbol">{</a><a id="5436" href="/20.07/PUC/2019/Exam/#5436" class="Bound">Γ</a> <a id="5438" href="/20.07/PUC/2019/Exam/#5438" class="Bound">A</a><a id="5439" class="Symbol">}</a> <a id="5441" class="Symbol">{</a><a id="5442" href="/20.07/PUC/2019/Exam/#5442" class="Bound">V</a> <a id="5444" class="Symbol">:</a> <a id="5446" href="/20.07/PUC/2019/Exam/#5436" class="Bound">Γ</a> <a id="5448" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="5450" href="/20.07/PUC/2019/Exam/#1278" class="InductiveConstructor">`ℕ</a><a id="5452" class="Symbol">}</a> <a id="5454" class="Symbol">{</a><a id="5455" href="/20.07/PUC/2019/Exam/#5455" class="Bound">M</a> <a id="5457" class="Symbol">:</a> <a id="5459" href="/20.07/PUC/2019/Exam/#5436" class="Bound">Γ</a> <a id="5461" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="5463" href="/20.07/PUC/2019/Exam/#5438" class="Bound">A</a><a id="5464" class="Symbol">}</a> <a id="5466" class="Symbol">{</a><a id="5467" href="/20.07/PUC/2019/Exam/#5467" class="Bound">N</a> <a id="5469" class="Symbol">:</a> <a id="5471" href="/20.07/PUC/2019/Exam/#5436" class="Bound">Γ</a> <a id="5473" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="5475" href="/20.07/PUC/2019/Exam/#1278" class="InductiveConstructor">`ℕ</a> <a id="5478" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="5480" href="/20.07/PUC/2019/Exam/#5438" class="Bound">A</a><a id="5481" class="Symbol">}</a>
|
||
<a id="5489" class="Symbol">→</a> <a id="5491" href="/20.07/PUC/2019/Exam/#4296" class="Datatype">Value</a> <a id="5497" href="/20.07/PUC/2019/Exam/#5442" class="Bound">V</a>
|
||
<a id="5507" class="Comment">-----------------------------</a>
|
||
<a id="5543" class="Symbol">→</a> <a id="5545" href="/20.07/PUC/2019/Exam/#2021" class="InductiveConstructor">case</a> <a id="5550" class="Symbol">(</a><a id="5551" href="/20.07/PUC/2019/Exam/#1956" class="InductiveConstructor Operator">`suc</a> <a id="5556" href="/20.07/PUC/2019/Exam/#5442" class="Bound">V</a><a id="5557" class="Symbol">)</a> <a id="5559" href="/20.07/PUC/2019/Exam/#5455" class="Bound">M</a> <a id="5561" href="/20.07/PUC/2019/Exam/#5467" class="Bound">N</a> <a id="5563" href="/20.07/PUC/2019/Exam/#4638" class="Datatype Operator">—→</a> <a id="5566" href="/20.07/PUC/2019/Exam/#5467" class="Bound">N</a> <a id="5568" href="/20.07/PUC/2019/Exam/#4037" class="Function Operator">[</a> <a id="5570" href="/20.07/PUC/2019/Exam/#5442" class="Bound">V</a> <a id="5572" href="/20.07/PUC/2019/Exam/#4037" class="Function Operator">]</a>
|
||
|
||
<a id="Problem2._—→_.β-μ"></a><a id="5579" href="/20.07/PUC/2019/Exam/#5579" class="InductiveConstructor">β-μ</a> <a id="5583" class="Symbol">:</a> <a id="5585" class="Symbol">∀</a> <a id="5587" class="Symbol">{</a><a id="5588" href="/20.07/PUC/2019/Exam/#5588" class="Bound">Γ</a> <a id="5590" href="/20.07/PUC/2019/Exam/#5590" class="Bound">A</a><a id="5591" class="Symbol">}</a> <a id="5593" class="Symbol">{</a><a id="5594" href="/20.07/PUC/2019/Exam/#5594" class="Bound">N</a> <a id="5596" class="Symbol">:</a> <a id="5598" href="/20.07/PUC/2019/Exam/#5588" class="Bound">Γ</a> <a id="5600" href="/20.07/PUC/2019/Exam/#1341" class="InductiveConstructor Operator">,</a> <a id="5602" href="/20.07/PUC/2019/Exam/#5590" class="Bound">A</a> <a id="5604" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="5606" href="/20.07/PUC/2019/Exam/#5590" class="Bound">A</a><a id="5607" class="Symbol">}</a>
|
||
<a id="5617" class="Comment">---------------</a>
|
||
<a id="5639" class="Symbol">→</a> <a id="5641" href="/20.07/PUC/2019/Exam/#2123" class="InductiveConstructor Operator">μ</a> <a id="5643" href="/20.07/PUC/2019/Exam/#5594" class="Bound">N</a> <a id="5645" href="/20.07/PUC/2019/Exam/#4638" class="Datatype Operator">—→</a> <a id="5648" href="/20.07/PUC/2019/Exam/#5594" class="Bound">N</a> <a id="5650" href="/20.07/PUC/2019/Exam/#4037" class="Function Operator">[</a> <a id="5652" href="/20.07/PUC/2019/Exam/#2123" class="InductiveConstructor Operator">μ</a> <a id="5654" href="/20.07/PUC/2019/Exam/#5594" class="Bound">N</a> <a id="5656" href="/20.07/PUC/2019/Exam/#4037" class="Function Operator">]</a>
|
||
</pre>
|
||
|
||
<h3 id="reflexive-and-transitive-closure">Reflexive and transitive closure</h3>
|
||
|
||
<pre class="Agda"> <a id="5708" class="Keyword">infix</a> <a id="5715" class="Number">2</a> <a id="5717" href="/20.07/PUC/2019/Exam/#5781" class="Datatype Operator">_—↠_</a>
|
||
<a id="5724" class="Keyword">infix</a> <a id="5731" class="Number">1</a> <a id="5733" href="/20.07/PUC/2019/Exam/#6005" class="Function Operator">begin_</a>
|
||
<a id="5742" class="Keyword">infixr</a> <a id="5749" class="Number">2</a> <a id="5751" href="/20.07/PUC/2019/Exam/#5895" class="InductiveConstructor Operator">_—→⟨_⟩_</a>
|
||
<a id="5761" class="Keyword">infix</a> <a id="5768" class="Number">3</a> <a id="5770" href="/20.07/PUC/2019/Exam/#5833" class="InductiveConstructor Operator">_∎</a>
|
||
|
||
<a id="5776" class="Keyword">data</a> <a id="Problem2._—↠_"></a><a id="5781" href="/20.07/PUC/2019/Exam/#5781" class="Datatype Operator">_—↠_</a> <a id="5786" class="Symbol">:</a> <a id="5788" class="Symbol">∀</a> <a id="5790" class="Symbol">{</a><a id="5791" href="/20.07/PUC/2019/Exam/#5791" class="Bound">Γ</a> <a id="5793" href="/20.07/PUC/2019/Exam/#5793" class="Bound">A</a><a id="5794" class="Symbol">}</a> <a id="5796" class="Symbol">→</a> <a id="5798" class="Symbol">(</a><a id="5799" href="/20.07/PUC/2019/Exam/#5791" class="Bound">Γ</a> <a id="5801" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="5803" href="/20.07/PUC/2019/Exam/#5793" class="Bound">A</a><a id="5804" class="Symbol">)</a> <a id="5806" class="Symbol">→</a> <a id="5808" class="Symbol">(</a><a id="5809" href="/20.07/PUC/2019/Exam/#5791" class="Bound">Γ</a> <a id="5811" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="5813" href="/20.07/PUC/2019/Exam/#5793" class="Bound">A</a><a id="5814" class="Symbol">)</a> <a id="5816" class="Symbol">→</a> <a id="5818" class="PrimitiveType">Set</a> <a id="5822" class="Keyword">where</a>
|
||
|
||
<a id="Problem2._—↠_._∎"></a><a id="5833" href="/20.07/PUC/2019/Exam/#5833" class="InductiveConstructor Operator">_∎</a> <a id="5836" class="Symbol">:</a> <a id="5838" class="Symbol">∀</a> <a id="5840" class="Symbol">{</a><a id="5841" href="/20.07/PUC/2019/Exam/#5841" class="Bound">Γ</a> <a id="5843" href="/20.07/PUC/2019/Exam/#5843" class="Bound">A</a><a id="5844" class="Symbol">}</a> <a id="5846" class="Symbol">(</a><a id="5847" href="/20.07/PUC/2019/Exam/#5847" class="Bound">M</a> <a id="5849" class="Symbol">:</a> <a id="5851" href="/20.07/PUC/2019/Exam/#5841" class="Bound">Γ</a> <a id="5853" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="5855" href="/20.07/PUC/2019/Exam/#5843" class="Bound">A</a><a id="5856" class="Symbol">)</a>
|
||
<a id="5866" class="Comment">--------</a>
|
||
<a id="5881" class="Symbol">→</a> <a id="5883" href="/20.07/PUC/2019/Exam/#5847" class="Bound">M</a> <a id="5885" href="/20.07/PUC/2019/Exam/#5781" class="Datatype Operator">—↠</a> <a id="5888" href="/20.07/PUC/2019/Exam/#5847" class="Bound">M</a>
|
||
|
||
<a id="Problem2._—↠_._—→⟨_⟩_"></a><a id="5895" href="/20.07/PUC/2019/Exam/#5895" class="InductiveConstructor Operator">_—→⟨_⟩_</a> <a id="5903" class="Symbol">:</a> <a id="5905" class="Symbol">∀</a> <a id="5907" class="Symbol">{</a><a id="5908" href="/20.07/PUC/2019/Exam/#5908" class="Bound">Γ</a> <a id="5910" href="/20.07/PUC/2019/Exam/#5910" class="Bound">A</a><a id="5911" class="Symbol">}</a> <a id="5913" class="Symbol">(</a><a id="5914" href="/20.07/PUC/2019/Exam/#5914" class="Bound">L</a> <a id="5916" class="Symbol">:</a> <a id="5918" href="/20.07/PUC/2019/Exam/#5908" class="Bound">Γ</a> <a id="5920" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="5922" href="/20.07/PUC/2019/Exam/#5910" class="Bound">A</a><a id="5923" class="Symbol">)</a> <a id="5925" class="Symbol">{</a><a id="5926" href="/20.07/PUC/2019/Exam/#5926" class="Bound">M</a> <a id="5928" href="/20.07/PUC/2019/Exam/#5928" class="Bound">N</a> <a id="5930" class="Symbol">:</a> <a id="5932" href="/20.07/PUC/2019/Exam/#5908" class="Bound">Γ</a> <a id="5934" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="5936" href="/20.07/PUC/2019/Exam/#5910" class="Bound">A</a><a id="5937" class="Symbol">}</a>
|
||
<a id="5945" class="Symbol">→</a> <a id="5947" href="/20.07/PUC/2019/Exam/#5914" class="Bound">L</a> <a id="5949" href="/20.07/PUC/2019/Exam/#4638" class="Datatype Operator">—→</a> <a id="5952" href="/20.07/PUC/2019/Exam/#5926" class="Bound">M</a>
|
||
<a id="5960" class="Symbol">→</a> <a id="5962" href="/20.07/PUC/2019/Exam/#5926" class="Bound">M</a> <a id="5964" href="/20.07/PUC/2019/Exam/#5781" class="Datatype Operator">—↠</a> <a id="5967" href="/20.07/PUC/2019/Exam/#5928" class="Bound">N</a>
|
||
<a id="5977" class="Comment">---------</a>
|
||
<a id="5993" class="Symbol">→</a> <a id="5995" href="/20.07/PUC/2019/Exam/#5914" class="Bound">L</a> <a id="5997" href="/20.07/PUC/2019/Exam/#5781" class="Datatype Operator">—↠</a> <a id="6000" href="/20.07/PUC/2019/Exam/#5928" class="Bound">N</a>
|
||
|
||
<a id="Problem2.begin_"></a><a id="6005" href="/20.07/PUC/2019/Exam/#6005" class="Function Operator">begin_</a> <a id="6012" class="Symbol">:</a> <a id="6014" class="Symbol">∀</a> <a id="6016" class="Symbol">{</a><a id="6017" href="/20.07/PUC/2019/Exam/#6017" class="Bound">Γ</a><a id="6018" class="Symbol">}</a> <a id="6020" class="Symbol">{</a><a id="6021" href="/20.07/PUC/2019/Exam/#6021" class="Bound">A</a><a id="6022" class="Symbol">}</a> <a id="6024" class="Symbol">{</a><a id="6025" href="/20.07/PUC/2019/Exam/#6025" class="Bound">M</a> <a id="6027" href="/20.07/PUC/2019/Exam/#6027" class="Bound">N</a> <a id="6029" class="Symbol">:</a> <a id="6031" href="/20.07/PUC/2019/Exam/#6017" class="Bound">Γ</a> <a id="6033" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="6035" href="/20.07/PUC/2019/Exam/#6021" class="Bound">A</a><a id="6036" class="Symbol">}</a>
|
||
<a id="6042" class="Symbol">→</a> <a id="6044" href="/20.07/PUC/2019/Exam/#6025" class="Bound">M</a> <a id="6046" href="/20.07/PUC/2019/Exam/#5781" class="Datatype Operator">—↠</a> <a id="6049" href="/20.07/PUC/2019/Exam/#6027" class="Bound">N</a>
|
||
<a id="6057" class="Comment">------</a>
|
||
<a id="6068" class="Symbol">→</a> <a id="6070" href="/20.07/PUC/2019/Exam/#6025" class="Bound">M</a> <a id="6072" href="/20.07/PUC/2019/Exam/#5781" class="Datatype Operator">—↠</a> <a id="6075" href="/20.07/PUC/2019/Exam/#6027" class="Bound">N</a>
|
||
<a id="6079" href="/20.07/PUC/2019/Exam/#6005" class="Function Operator">begin</a> <a id="6085" href="/20.07/PUC/2019/Exam/#6085" class="Bound">M—↠N</a> <a id="6090" class="Symbol">=</a> <a id="6092" href="/20.07/PUC/2019/Exam/#6085" class="Bound">M—↠N</a>
|
||
</pre>
|
||
|
||
<h3 id="progress">Progress</h3>
|
||
|
||
<pre class="Agda"> <a id="6123" class="Keyword">data</a> <a id="Problem2.Progress"></a><a id="6128" href="/20.07/PUC/2019/Exam/#6128" class="Datatype">Progress</a> <a id="6137" class="Symbol">{</a><a id="6138" href="/20.07/PUC/2019/Exam/#6138" class="Bound">A</a><a id="6139" class="Symbol">}</a> <a id="6141" class="Symbol">(</a><a id="6142" href="/20.07/PUC/2019/Exam/#6142" class="Bound">M</a> <a id="6144" class="Symbol">:</a> <a id="6146" href="/20.07/PUC/2019/Exam/#1323" class="InductiveConstructor">∅</a> <a id="6148" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="6150" href="/20.07/PUC/2019/Exam/#6138" class="Bound">A</a><a id="6151" class="Symbol">)</a> <a id="6153" class="Symbol">:</a> <a id="6155" class="PrimitiveType">Set</a> <a id="6159" class="Keyword">where</a>
|
||
|
||
<a id="Problem2.Progress.step"></a><a id="6170" href="/20.07/PUC/2019/Exam/#6170" class="InductiveConstructor">step</a> <a id="6175" class="Symbol">:</a> <a id="6177" class="Symbol">∀</a> <a id="6179" class="Symbol">{</a><a id="6180" href="/20.07/PUC/2019/Exam/#6180" class="Bound">N</a> <a id="6182" class="Symbol">:</a> <a id="6184" href="/20.07/PUC/2019/Exam/#1323" class="InductiveConstructor">∅</a> <a id="6186" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="6188" href="/20.07/PUC/2019/Exam/#6138" class="Bound">A</a><a id="6189" class="Symbol">}</a>
|
||
<a id="6197" class="Symbol">→</a> <a id="6199" href="/20.07/PUC/2019/Exam/#6142" class="Bound">M</a> <a id="6201" href="/20.07/PUC/2019/Exam/#4638" class="Datatype Operator">—→</a> <a id="6204" href="/20.07/PUC/2019/Exam/#6180" class="Bound">N</a>
|
||
<a id="6214" class="Comment">-------------</a>
|
||
<a id="6234" class="Symbol">→</a> <a id="6236" href="/20.07/PUC/2019/Exam/#6128" class="Datatype">Progress</a> <a id="6245" href="/20.07/PUC/2019/Exam/#6142" class="Bound">M</a>
|
||
|
||
<a id="Problem2.Progress.done"></a><a id="6252" href="/20.07/PUC/2019/Exam/#6252" class="InductiveConstructor">done</a> <a id="6257" class="Symbol">:</a>
|
||
<a id="6267" href="/20.07/PUC/2019/Exam/#4296" class="Datatype">Value</a> <a id="6273" href="/20.07/PUC/2019/Exam/#6142" class="Bound">M</a>
|
||
<a id="6283" class="Comment">----------</a>
|
||
<a id="6300" class="Symbol">→</a> <a id="6302" href="/20.07/PUC/2019/Exam/#6128" class="Datatype">Progress</a> <a id="6311" href="/20.07/PUC/2019/Exam/#6142" class="Bound">M</a>
|
||
|
||
<a id="Problem2.progress"></a><a id="6316" href="/20.07/PUC/2019/Exam/#6316" class="Function">progress</a> <a id="6325" class="Symbol">:</a> <a id="6327" class="Symbol">∀</a> <a id="6329" class="Symbol">{</a><a id="6330" href="/20.07/PUC/2019/Exam/#6330" class="Bound">A</a><a id="6331" class="Symbol">}</a> <a id="6333" class="Symbol">→</a> <a id="6335" class="Symbol">(</a><a id="6336" href="/20.07/PUC/2019/Exam/#6336" class="Bound">M</a> <a id="6338" class="Symbol">:</a> <a id="6340" href="/20.07/PUC/2019/Exam/#1323" class="InductiveConstructor">∅</a> <a id="6342" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="6344" href="/20.07/PUC/2019/Exam/#6330" class="Bound">A</a><a id="6345" class="Symbol">)</a> <a id="6347" class="Symbol">→</a> <a id="6349" href="/20.07/PUC/2019/Exam/#6128" class="Datatype">Progress</a> <a id="6358" href="/20.07/PUC/2019/Exam/#6336" class="Bound">M</a>
|
||
<a id="6362" href="/20.07/PUC/2019/Exam/#6316" class="Function">progress</a> <a id="6371" class="Symbol">(</a><a id="6372" href="/20.07/PUC/2019/Exam/#1673" class="InductiveConstructor Operator">`</a> <a id="6374" class="Symbol">())</a>
|
||
<a id="6380" href="/20.07/PUC/2019/Exam/#6316" class="Function">progress</a> <a id="6389" class="Symbol">(</a><a id="6390" href="/20.07/PUC/2019/Exam/#1736" class="InductiveConstructor Operator">ƛ</a> <a id="6392" href="/20.07/PUC/2019/Exam/#6392" class="Bound">N</a><a id="6393" class="Symbol">)</a> <a id="6420" class="Symbol">=</a> <a id="6423" href="/20.07/PUC/2019/Exam/#6252" class="InductiveConstructor">done</a> <a id="6428" href="/20.07/PUC/2019/Exam/#4337" class="InductiveConstructor">V-ƛ</a>
|
||
<a id="6434" href="/20.07/PUC/2019/Exam/#6316" class="Function">progress</a> <a id="6443" class="Symbol">(</a><a id="6444" href="/20.07/PUC/2019/Exam/#6444" class="Bound">L</a> <a id="6446" href="/20.07/PUC/2019/Exam/#1815" class="InductiveConstructor Operator">·</a> <a id="6448" href="/20.07/PUC/2019/Exam/#6448" class="Bound">M</a><a id="6449" class="Symbol">)</a> <a id="6451" class="Keyword">with</a> <a id="6456" href="/20.07/PUC/2019/Exam/#6316" class="Function">progress</a> <a id="6465" href="/20.07/PUC/2019/Exam/#6444" class="Bound">L</a>
|
||
<a id="6469" class="Symbol">...</a> <a id="6476" class="Symbol">|</a> <a id="6478" href="/20.07/PUC/2019/Exam/#6170" class="InductiveConstructor">step</a> <a id="6483" href="/20.07/PUC/2019/Exam/#6483" class="Bound">L—→L′</a> <a id="6509" class="Symbol">=</a> <a id="6512" href="/20.07/PUC/2019/Exam/#6170" class="InductiveConstructor">step</a> <a id="6517" class="Symbol">(</a><a id="6518" href="/20.07/PUC/2019/Exam/#4690" class="InductiveConstructor">ξ-·₁</a> <a id="6523" href="/20.07/PUC/2019/Exam/#6483" class="Bound">L—→L′</a><a id="6528" class="Symbol">)</a>
|
||
<a id="6532" class="Symbol">...</a> <a id="6539" class="Symbol">|</a> <a id="6541" href="/20.07/PUC/2019/Exam/#6252" class="InductiveConstructor">done</a> <a id="6546" href="/20.07/PUC/2019/Exam/#4337" class="InductiveConstructor">V-ƛ</a> <a id="6550" class="Keyword">with</a> <a id="6555" href="/20.07/PUC/2019/Exam/#6316" class="Function">progress</a> <a id="6564" class="Bound">M</a>
|
||
<a id="6568" class="Symbol">...</a> <a id="6579" class="Symbol">|</a> <a id="6581" href="/20.07/PUC/2019/Exam/#6170" class="InductiveConstructor">step</a> <a id="6586" href="/20.07/PUC/2019/Exam/#6586" class="Bound">M—→M′</a> <a id="6608" class="Symbol">=</a> <a id="6611" href="/20.07/PUC/2019/Exam/#6170" class="InductiveConstructor">step</a> <a id="6616" class="Symbol">(</a><a id="6617" href="/20.07/PUC/2019/Exam/#4809" class="InductiveConstructor">ξ-·₂</a> <a id="6622" href="/20.07/PUC/2019/Exam/#4337" class="InductiveConstructor">V-ƛ</a> <a id="6626" href="/20.07/PUC/2019/Exam/#6586" class="Bound">M—→M′</a><a id="6631" class="Symbol">)</a>
|
||
<a id="6635" class="Symbol">...</a> <a id="6646" class="Symbol">|</a> <a id="6648" href="/20.07/PUC/2019/Exam/#6252" class="InductiveConstructor">done</a> <a id="6653" href="/20.07/PUC/2019/Exam/#6653" class="Bound">VM</a> <a id="6675" class="Symbol">=</a> <a id="6678" href="/20.07/PUC/2019/Exam/#6170" class="InductiveConstructor">step</a> <a id="6683" class="Symbol">(</a><a id="6684" href="/20.07/PUC/2019/Exam/#4941" class="InductiveConstructor">β-ƛ</a> <a id="6688" href="/20.07/PUC/2019/Exam/#6653" class="Bound">VM</a><a id="6690" class="Symbol">)</a>
|
||
<a id="6694" href="/20.07/PUC/2019/Exam/#6316" class="Function">progress</a> <a id="6703" class="Symbol">(</a><a id="6704" href="/20.07/PUC/2019/Exam/#1903" class="InductiveConstructor">`zero</a><a id="6709" class="Symbol">)</a> <a id="6734" class="Symbol">=</a> <a id="6737" href="/20.07/PUC/2019/Exam/#6252" class="InductiveConstructor">done</a> <a id="6742" href="/20.07/PUC/2019/Exam/#4430" class="InductiveConstructor">V-zero</a>
|
||
<a id="6751" href="/20.07/PUC/2019/Exam/#6316" class="Function">progress</a> <a id="6760" class="Symbol">(</a><a id="6761" href="/20.07/PUC/2019/Exam/#1956" class="InductiveConstructor Operator">`suc</a> <a id="6766" href="/20.07/PUC/2019/Exam/#6766" class="Bound">M</a><a id="6767" class="Symbol">)</a> <a id="6769" class="Keyword">with</a> <a id="6774" href="/20.07/PUC/2019/Exam/#6316" class="Function">progress</a> <a id="6783" href="/20.07/PUC/2019/Exam/#6766" class="Bound">M</a>
|
||
<a id="6787" class="Symbol">...</a> <a id="6794" class="Symbol">|</a> <a id="6796" href="/20.07/PUC/2019/Exam/#6170" class="InductiveConstructor">step</a> <a id="6801" href="/20.07/PUC/2019/Exam/#6801" class="Bound">M—→M′</a> <a id="6827" class="Symbol">=</a> <a id="6830" href="/20.07/PUC/2019/Exam/#6170" class="InductiveConstructor">step</a> <a id="6835" class="Symbol">(</a><a id="6836" href="/20.07/PUC/2019/Exam/#5063" class="InductiveConstructor">ξ-suc</a> <a id="6842" href="/20.07/PUC/2019/Exam/#6801" class="Bound">M—→M′</a><a id="6847" class="Symbol">)</a>
|
||
<a id="6851" class="Symbol">...</a> <a id="6858" class="Symbol">|</a> <a id="6860" href="/20.07/PUC/2019/Exam/#6252" class="InductiveConstructor">done</a> <a id="6865" href="/20.07/PUC/2019/Exam/#6865" class="Bound">VM</a> <a id="6891" class="Symbol">=</a> <a id="6894" href="/20.07/PUC/2019/Exam/#6252" class="InductiveConstructor">done</a> <a id="6899" class="Symbol">(</a><a id="6900" href="/20.07/PUC/2019/Exam/#4502" class="InductiveConstructor">V-suc</a> <a id="6906" href="/20.07/PUC/2019/Exam/#6865" class="Bound">VM</a><a id="6908" class="Symbol">)</a>
|
||
<a id="6912" href="/20.07/PUC/2019/Exam/#6316" class="Function">progress</a> <a id="6921" class="Symbol">(</a><a id="6922" href="/20.07/PUC/2019/Exam/#2021" class="InductiveConstructor">case</a> <a id="6927" href="/20.07/PUC/2019/Exam/#6927" class="Bound">L</a> <a id="6929" href="/20.07/PUC/2019/Exam/#6929" class="Bound">M</a> <a id="6931" href="/20.07/PUC/2019/Exam/#6931" class="Bound">N</a><a id="6932" class="Symbol">)</a> <a id="6934" class="Keyword">with</a> <a id="6939" href="/20.07/PUC/2019/Exam/#6316" class="Function">progress</a> <a id="6948" href="/20.07/PUC/2019/Exam/#6927" class="Bound">L</a>
|
||
<a id="6952" class="Symbol">...</a> <a id="6959" class="Symbol">|</a> <a id="6961" href="/20.07/PUC/2019/Exam/#6170" class="InductiveConstructor">step</a> <a id="6966" href="/20.07/PUC/2019/Exam/#6966" class="Bound">L—→L′</a> <a id="6992" class="Symbol">=</a> <a id="6995" href="/20.07/PUC/2019/Exam/#6170" class="InductiveConstructor">step</a> <a id="7000" class="Symbol">(</a><a id="7001" href="/20.07/PUC/2019/Exam/#5165" class="InductiveConstructor">ξ-case</a> <a id="7008" href="/20.07/PUC/2019/Exam/#6966" class="Bound">L—→L′</a><a id="7013" class="Symbol">)</a>
|
||
<a id="7017" class="Symbol">...</a> <a id="7024" class="Symbol">|</a> <a id="7026" href="/20.07/PUC/2019/Exam/#6252" class="InductiveConstructor">done</a> <a id="7031" href="/20.07/PUC/2019/Exam/#4430" class="InductiveConstructor">V-zero</a> <a id="7057" class="Symbol">=</a> <a id="7060" href="/20.07/PUC/2019/Exam/#6170" class="InductiveConstructor">step</a> <a id="7065" class="Symbol">(</a><a id="7066" href="/20.07/PUC/2019/Exam/#5317" class="InductiveConstructor">β-zero</a><a id="7072" class="Symbol">)</a>
|
||
<a id="7076" class="Symbol">...</a> <a id="7083" class="Symbol">|</a> <a id="7085" href="/20.07/PUC/2019/Exam/#6252" class="InductiveConstructor">done</a> <a id="7090" class="Symbol">(</a><a id="7091" href="/20.07/PUC/2019/Exam/#4502" class="InductiveConstructor">V-suc</a> <a id="7097" href="/20.07/PUC/2019/Exam/#7097" class="Bound">VL</a><a id="7099" class="Symbol">)</a> <a id="7116" class="Symbol">=</a> <a id="7119" href="/20.07/PUC/2019/Exam/#6170" class="InductiveConstructor">step</a> <a id="7124" class="Symbol">(</a><a id="7125" href="/20.07/PUC/2019/Exam/#5425" class="InductiveConstructor">β-suc</a> <a id="7131" href="/20.07/PUC/2019/Exam/#7097" class="Bound">VL</a><a id="7133" class="Symbol">)</a>
|
||
<a id="7137" href="/20.07/PUC/2019/Exam/#6316" class="Function">progress</a> <a id="7146" class="Symbol">(</a><a id="7147" href="/20.07/PUC/2019/Exam/#2123" class="InductiveConstructor Operator">μ</a> <a id="7149" href="/20.07/PUC/2019/Exam/#7149" class="Bound">N</a><a id="7150" class="Symbol">)</a> <a id="7177" class="Symbol">=</a> <a id="7180" href="/20.07/PUC/2019/Exam/#6170" class="InductiveConstructor">step</a> <a id="7185" class="Symbol">(</a><a id="7186" href="/20.07/PUC/2019/Exam/#5579" class="InductiveConstructor">β-μ</a><a id="7189" class="Symbol">)</a>
|
||
</pre>
|
||
<h3 id="evaluation">Evaluation</h3>
|
||
|
||
<pre class="Agda"> <a id="7218" class="Keyword">data</a> <a id="Problem2.Gas"></a><a id="7223" href="/20.07/PUC/2019/Exam/#7223" class="Datatype">Gas</a> <a id="7227" class="Symbol">:</a> <a id="7229" class="PrimitiveType">Set</a> <a id="7233" class="Keyword">where</a>
|
||
<a id="Problem2.Gas.gas"></a><a id="7243" href="/20.07/PUC/2019/Exam/#7243" class="InductiveConstructor">gas</a> <a id="7247" class="Symbol">:</a> <a id="7249" href="Agda.Builtin.Nat.html#165" class="Datatype">ℕ</a> <a id="7251" class="Symbol">→</a> <a id="7253" href="/20.07/PUC/2019/Exam/#7223" class="Datatype">Gas</a>
|
||
|
||
<a id="7260" class="Keyword">data</a> <a id="Problem2.Finished"></a><a id="7265" href="/20.07/PUC/2019/Exam/#7265" class="Datatype">Finished</a> <a id="7274" class="Symbol">{</a><a id="7275" href="/20.07/PUC/2019/Exam/#7275" class="Bound">Γ</a> <a id="7277" href="/20.07/PUC/2019/Exam/#7277" class="Bound">A</a><a id="7278" class="Symbol">}</a> <a id="7280" class="Symbol">(</a><a id="7281" href="/20.07/PUC/2019/Exam/#7281" class="Bound">N</a> <a id="7283" class="Symbol">:</a> <a id="7285" href="/20.07/PUC/2019/Exam/#7275" class="Bound">Γ</a> <a id="7287" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="7289" href="/20.07/PUC/2019/Exam/#7277" class="Bound">A</a><a id="7290" class="Symbol">)</a> <a id="7292" class="Symbol">:</a> <a id="7294" class="PrimitiveType">Set</a> <a id="7298" class="Keyword">where</a>
|
||
|
||
<a id="Problem2.Finished.done"></a><a id="7310" href="/20.07/PUC/2019/Exam/#7310" class="InductiveConstructor">done</a> <a id="7315" class="Symbol">:</a>
|
||
<a id="7326" href="/20.07/PUC/2019/Exam/#4296" class="Datatype">Value</a> <a id="7332" href="/20.07/PUC/2019/Exam/#7281" class="Bound">N</a>
|
||
<a id="7343" class="Comment">----------</a>
|
||
<a id="7361" class="Symbol">→</a> <a id="7363" href="/20.07/PUC/2019/Exam/#7265" class="Datatype">Finished</a> <a id="7372" href="/20.07/PUC/2019/Exam/#7281" class="Bound">N</a>
|
||
|
||
<a id="Problem2.Finished.out-of-gas"></a><a id="7380" href="/20.07/PUC/2019/Exam/#7380" class="InductiveConstructor">out-of-gas</a> <a id="7391" class="Symbol">:</a>
|
||
<a id="7402" class="Comment">----------</a>
|
||
<a id="7422" href="/20.07/PUC/2019/Exam/#7265" class="Datatype">Finished</a> <a id="7431" href="/20.07/PUC/2019/Exam/#7281" class="Bound">N</a>
|
||
|
||
<a id="7436" class="Keyword">data</a> <a id="Problem2.Steps"></a><a id="7441" href="/20.07/PUC/2019/Exam/#7441" class="Datatype">Steps</a> <a id="7447" class="Symbol">:</a> <a id="7449" class="Symbol">∀</a> <a id="7451" class="Symbol">{</a><a id="7452" href="/20.07/PUC/2019/Exam/#7452" class="Bound">A</a><a id="7453" class="Symbol">}</a> <a id="7455" class="Symbol">→</a> <a id="7457" href="/20.07/PUC/2019/Exam/#1323" class="InductiveConstructor">∅</a> <a id="7459" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="7461" href="/20.07/PUC/2019/Exam/#7452" class="Bound">A</a> <a id="7463" class="Symbol">→</a> <a id="7465" class="PrimitiveType">Set</a> <a id="7469" class="Keyword">where</a>
|
||
|
||
<a id="Problem2.Steps.steps"></a><a id="7480" href="/20.07/PUC/2019/Exam/#7480" class="InductiveConstructor">steps</a> <a id="7486" class="Symbol">:</a> <a id="7488" class="Symbol">∀</a> <a id="7490" class="Symbol">{</a><a id="7491" href="/20.07/PUC/2019/Exam/#7491" class="Bound">A</a><a id="7492" class="Symbol">}</a> <a id="7494" class="Symbol">{</a><a id="7495" href="/20.07/PUC/2019/Exam/#7495" class="Bound">L</a> <a id="7497" href="/20.07/PUC/2019/Exam/#7497" class="Bound">N</a> <a id="7499" class="Symbol">:</a> <a id="7501" href="/20.07/PUC/2019/Exam/#1323" class="InductiveConstructor">∅</a> <a id="7503" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="7505" href="/20.07/PUC/2019/Exam/#7491" class="Bound">A</a><a id="7506" class="Symbol">}</a>
|
||
<a id="7514" class="Symbol">→</a> <a id="7516" href="/20.07/PUC/2019/Exam/#7495" class="Bound">L</a> <a id="7518" href="/20.07/PUC/2019/Exam/#5781" class="Datatype Operator">—↠</a> <a id="7521" href="/20.07/PUC/2019/Exam/#7497" class="Bound">N</a>
|
||
<a id="7529" class="Symbol">→</a> <a id="7531" href="/20.07/PUC/2019/Exam/#7265" class="Datatype">Finished</a> <a id="7540" href="/20.07/PUC/2019/Exam/#7497" class="Bound">N</a>
|
||
<a id="7550" class="Comment">----------</a>
|
||
<a id="7567" class="Symbol">→</a> <a id="7569" href="/20.07/PUC/2019/Exam/#7441" class="Datatype">Steps</a> <a id="7575" href="/20.07/PUC/2019/Exam/#7495" class="Bound">L</a>
|
||
|
||
<a id="Problem2.eval"></a><a id="7580" href="/20.07/PUC/2019/Exam/#7580" class="Function">eval</a> <a id="7585" class="Symbol">:</a> <a id="7587" class="Symbol">∀</a> <a id="7589" class="Symbol">{</a><a id="7590" href="/20.07/PUC/2019/Exam/#7590" class="Bound">A</a><a id="7591" class="Symbol">}</a>
|
||
<a id="7597" class="Symbol">→</a> <a id="7599" href="/20.07/PUC/2019/Exam/#7223" class="Datatype">Gas</a>
|
||
<a id="7607" class="Symbol">→</a> <a id="7609" class="Symbol">(</a><a id="7610" href="/20.07/PUC/2019/Exam/#7610" class="Bound">L</a> <a id="7612" class="Symbol">:</a> <a id="7614" href="/20.07/PUC/2019/Exam/#1323" class="InductiveConstructor">∅</a> <a id="7616" href="/20.07/PUC/2019/Exam/#1635" class="Datatype Operator">⊢</a> <a id="7618" href="/20.07/PUC/2019/Exam/#7590" class="Bound">A</a><a id="7619" class="Symbol">)</a>
|
||
<a id="7627" class="Comment">-----------</a>
|
||
<a id="7643" class="Symbol">→</a> <a id="7645" href="/20.07/PUC/2019/Exam/#7441" class="Datatype">Steps</a> <a id="7651" href="/20.07/PUC/2019/Exam/#7610" class="Bound">L</a>
|
||
<a id="7655" href="/20.07/PUC/2019/Exam/#7580" class="Function">eval</a> <a id="7660" class="Symbol">(</a><a id="7661" href="/20.07/PUC/2019/Exam/#7243" class="InductiveConstructor">gas</a> <a id="7665" href="Agda.Builtin.Nat.html#183" class="InductiveConstructor">zero</a><a id="7669" class="Symbol">)</a> <a id="7674" href="/20.07/PUC/2019/Exam/#7674" class="Bound">L</a> <a id="7696" class="Symbol">=</a> <a id="7699" href="/20.07/PUC/2019/Exam/#7480" class="InductiveConstructor">steps</a> <a id="7705" class="Symbol">(</a><a id="7706" href="/20.07/PUC/2019/Exam/#7674" class="Bound">L</a> <a id="7708" href="/20.07/PUC/2019/Exam/#5833" class="InductiveConstructor Operator">∎</a><a id="7709" class="Symbol">)</a> <a id="7711" href="/20.07/PUC/2019/Exam/#7380" class="InductiveConstructor">out-of-gas</a>
|
||
<a id="7724" href="/20.07/PUC/2019/Exam/#7580" class="Function">eval</a> <a id="7729" class="Symbol">(</a><a id="7730" href="/20.07/PUC/2019/Exam/#7243" class="InductiveConstructor">gas</a> <a id="7734" class="Symbol">(</a><a id="7735" href="Agda.Builtin.Nat.html#196" class="InductiveConstructor">suc</a> <a id="7739" href="/20.07/PUC/2019/Exam/#7739" class="Bound">m</a><a id="7740" class="Symbol">))</a> <a id="7743" href="/20.07/PUC/2019/Exam/#7743" class="Bound">L</a> <a id="7745" class="Keyword">with</a> <a id="7750" href="/20.07/PUC/2019/Exam/#6316" class="Function">progress</a> <a id="7759" href="/20.07/PUC/2019/Exam/#7743" class="Bound">L</a>
|
||
<a id="7763" class="Symbol">...</a> <a id="7767" class="Symbol">|</a> <a id="7769" href="/20.07/PUC/2019/Exam/#6252" class="InductiveConstructor">done</a> <a id="7774" href="/20.07/PUC/2019/Exam/#7774" class="Bound">VL</a> <a id="7804" class="Symbol">=</a> <a id="7807" href="/20.07/PUC/2019/Exam/#7480" class="InductiveConstructor">steps</a> <a id="7813" class="Symbol">(</a><a id="7814" class="Bound">L</a> <a id="7816" href="/20.07/PUC/2019/Exam/#5833" class="InductiveConstructor Operator">∎</a><a id="7817" class="Symbol">)</a> <a id="7819" class="Symbol">(</a><a id="7820" href="/20.07/PUC/2019/Exam/#7310" class="InductiveConstructor">done</a> <a id="7825" href="/20.07/PUC/2019/Exam/#7774" class="Bound">VL</a><a id="7827" class="Symbol">)</a>
|
||
<a id="7831" class="Symbol">...</a> <a id="7835" class="Symbol">|</a> <a id="7837" href="/20.07/PUC/2019/Exam/#6170" class="InductiveConstructor">step</a> <a id="7842" class="Symbol">{</a><a id="7843" href="/20.07/PUC/2019/Exam/#7843" class="Bound">M</a><a id="7844" class="Symbol">}</a> <a id="7846" href="/20.07/PUC/2019/Exam/#7846" class="Bound">L—→M</a> <a id="7851" class="Keyword">with</a> <a id="7856" href="/20.07/PUC/2019/Exam/#7580" class="Function">eval</a> <a id="7861" class="Symbol">(</a><a id="7862" href="/20.07/PUC/2019/Exam/#7243" class="InductiveConstructor">gas</a> <a id="7866" class="Bound">m</a><a id="7867" class="Symbol">)</a> <a id="7869" href="/20.07/PUC/2019/Exam/#7843" class="Bound">M</a>
|
||
<a id="7873" class="Symbol">...</a> <a id="7880" class="Symbol">|</a> <a id="7882" href="/20.07/PUC/2019/Exam/#7480" class="InductiveConstructor">steps</a> <a id="7888" href="/20.07/PUC/2019/Exam/#7888" class="Bound">M—↠N</a> <a id="7893" href="/20.07/PUC/2019/Exam/#7893" class="Bound">fin</a> <a id="7914" class="Symbol">=</a> <a id="7917" href="/20.07/PUC/2019/Exam/#7480" class="InductiveConstructor">steps</a> <a id="7923" class="Symbol">(</a><a id="7924" class="Bound">L</a> <a id="7926" href="/20.07/PUC/2019/Exam/#5895" class="InductiveConstructor Operator">—→⟨</a> <a id="7930" class="Bound">L—→M</a> <a id="7935" href="/20.07/PUC/2019/Exam/#5895" class="InductiveConstructor Operator">⟩</a> <a id="7937" href="/20.07/PUC/2019/Exam/#7888" class="Bound">M—↠N</a><a id="7941" class="Symbol">)</a> <a id="7943" href="/20.07/PUC/2019/Exam/#7893" class="Bound">fin</a>
|
||
</pre>
|
||
<h2 id="problem-3">Problem 3</h2>
|
||
|
||
<p>Remember to indent all code by two spaces.</p>
|
||
|
||
<pre class="Agda"><a id="8014" class="Keyword">module</a> <a id="Problem3"></a><a id="8021" href="/20.07/PUC/2019/Exam/#8021" class="Module">Problem3</a> <a id="8030" class="Keyword">where</a>
|
||
</pre>
|
||
<h3 id="imports-1">Imports</h3>
|
||
|
||
<pre class="Agda"> <a id="8060" class="Keyword">import</a> <a id="8067" href="/20.07/DeBruijn/" class="Module">plfa.part2.DeBruijn</a> <a id="8087" class="Symbol">as</a> <a id="8090" class="Module">DB</a>
|
||
</pre>
|
||
<h3 id="syntax">Syntax</h3>
|
||
|
||
<pre class="Agda"> <a id="8116" class="Keyword">infix</a> <a id="8124" class="Number">4</a> <a id="8127" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">_∋_⦂_</a>
|
||
<a id="8135" class="Keyword">infix</a> <a id="8143" class="Number">4</a> <a id="8146" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">_⊢_↑_</a>
|
||
<a id="8154" class="Keyword">infix</a> <a id="8162" class="Number">4</a> <a id="8165" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">_⊢_↓_</a>
|
||
<a id="8173" class="Keyword">infixl</a> <a id="8181" class="Number">5</a> <a id="8184" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">_,_⦂_</a>
|
||
|
||
<a id="8193" class="Keyword">infix</a> <a id="8201" class="Number">5</a> <a id="8204" href="/20.07/PUC/2019/Exam/#8819" class="InductiveConstructor Operator">ƛ_⇒_</a>
|
||
<a id="8211" class="Keyword">infix</a> <a id="8219" class="Number">5</a> <a id="8222" href="/20.07/PUC/2019/Exam/#9017" class="InductiveConstructor Operator">μ_⇒_</a>
|
||
<a id="8229" class="Keyword">infix</a> <a id="8237" class="Number">6</a> <a id="8240" href="/20.07/PUC/2019/Exam/#9067" class="InductiveConstructor Operator">_↑</a>
|
||
<a id="8245" class="Keyword">infix</a> <a id="8253" class="Number">6</a> <a id="8256" href="/20.07/PUC/2019/Exam/#8746" class="InductiveConstructor Operator">_↓_</a>
|
||
<a id="8262" class="Keyword">infixl</a> <a id="8270" class="Number">7</a> <a id="8273" href="/20.07/PUC/2019/Exam/#9590" class="InductiveConstructor Operator">_·_</a>
|
||
<a id="8279" class="Keyword">infix</a> <a id="8287" class="Number">8</a> <a id="8290" href="/20.07/PUC/2019/Exam/#8906" class="InductiveConstructor Operator">`suc_</a>
|
||
<a id="8298" class="Keyword">infix</a> <a id="8306" class="Number">9</a> <a id="8309" href="/20.07/PUC/2019/Exam/#8649" class="InductiveConstructor Operator">`_</a>
|
||
</pre>
|
||
<h3 id="types">Types</h3>
|
||
|
||
<pre class="Agda"> <a id="8334" class="Keyword">data</a> <a id="Problem3.Type"></a><a id="8339" href="/20.07/PUC/2019/Exam/#8339" class="Datatype">Type</a> <a id="8344" class="Symbol">:</a> <a id="8346" class="PrimitiveType">Set</a> <a id="8350" class="Keyword">where</a>
|
||
<a id="Problem3.Type._⇒_"></a><a id="8360" href="/20.07/PUC/2019/Exam/#8360" class="InductiveConstructor Operator">_⇒_</a> <a id="8366" class="Symbol">:</a> <a id="8368" href="/20.07/PUC/2019/Exam/#8339" class="Datatype">Type</a> <a id="8373" class="Symbol">→</a> <a id="8375" href="/20.07/PUC/2019/Exam/#8339" class="Datatype">Type</a> <a id="8380" class="Symbol">→</a> <a id="8382" href="/20.07/PUC/2019/Exam/#8339" class="Datatype">Type</a>
|
||
<a id="Problem3.Type.`ℕ"></a><a id="8391" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a> <a id="8397" class="Symbol">:</a> <a id="8399" href="/20.07/PUC/2019/Exam/#8339" class="Datatype">Type</a>
|
||
</pre>
|
||
<h3 id="identifiers">Identifiers</h3>
|
||
|
||
<pre class="Agda"> <a id="Problem3.Id"></a><a id="8432" href="/20.07/PUC/2019/Exam/#8432" class="Function">Id</a> <a id="8435" class="Symbol">:</a> <a id="8437" class="PrimitiveType">Set</a>
|
||
<a id="8443" href="/20.07/PUC/2019/Exam/#8432" class="Function">Id</a> <a id="8446" class="Symbol">=</a> <a id="8448" href="Agda.Builtin.String.html#206" class="Postulate">String</a>
|
||
</pre>
|
||
<h3 id="contexts">Contexts</h3>
|
||
|
||
<pre class="Agda"> <a id="8480" class="Keyword">data</a> <a id="Problem3.Context"></a><a id="8485" href="/20.07/PUC/2019/Exam/#8485" class="Datatype">Context</a> <a id="8493" class="Symbol">:</a> <a id="8495" class="PrimitiveType">Set</a> <a id="8499" class="Keyword">where</a>
|
||
<a id="Problem3.Context.∅"></a><a id="8509" href="/20.07/PUC/2019/Exam/#8509" class="InductiveConstructor">∅</a> <a id="8515" class="Symbol">:</a> <a id="8517" href="/20.07/PUC/2019/Exam/#8485" class="Datatype">Context</a>
|
||
<a id="Problem3.Context._,_⦂_"></a><a id="8529" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">_,_⦂_</a> <a id="8535" class="Symbol">:</a> <a id="8537" href="/20.07/PUC/2019/Exam/#8485" class="Datatype">Context</a> <a id="8545" class="Symbol">→</a> <a id="8547" href="/20.07/PUC/2019/Exam/#8432" class="Function">Id</a> <a id="8550" class="Symbol">→</a> <a id="8552" href="/20.07/PUC/2019/Exam/#8339" class="Datatype">Type</a> <a id="8557" class="Symbol">→</a> <a id="8559" href="/20.07/PUC/2019/Exam/#8485" class="Datatype">Context</a>
|
||
</pre>
|
||
<h3 id="terms">Terms</h3>
|
||
|
||
<pre class="Agda"> <a id="8589" class="Keyword">data</a> <a id="Problem3.Term⁺"></a><a id="8594" href="/20.07/PUC/2019/Exam/#8594" class="Datatype">Term⁺</a> <a id="8600" class="Symbol">:</a> <a id="8602" class="PrimitiveType">Set</a>
|
||
<a id="8608" class="Keyword">data</a> <a id="Problem3.Term⁻"></a><a id="8613" href="/20.07/PUC/2019/Exam/#8613" class="Datatype">Term⁻</a> <a id="8619" class="Symbol">:</a> <a id="8621" class="PrimitiveType">Set</a>
|
||
|
||
<a id="8628" class="Keyword">data</a> <a id="8633" href="/20.07/PUC/2019/Exam/#8594" class="Datatype">Term⁺</a> <a id="8639" class="Keyword">where</a>
|
||
<a id="Problem3.Term⁺.`_"></a><a id="8649" href="/20.07/PUC/2019/Exam/#8649" class="InductiveConstructor Operator">`_</a> <a id="8675" class="Symbol">:</a> <a id="8677" href="/20.07/PUC/2019/Exam/#8432" class="Function">Id</a> <a id="8680" class="Symbol">→</a> <a id="8682" href="/20.07/PUC/2019/Exam/#8594" class="Datatype">Term⁺</a>
|
||
<a id="Problem3.Term⁺._·_"></a><a id="8692" href="/20.07/PUC/2019/Exam/#8692" class="InductiveConstructor Operator">_·_</a> <a id="8718" class="Symbol">:</a> <a id="8720" href="/20.07/PUC/2019/Exam/#8594" class="Datatype">Term⁺</a> <a id="8726" class="Symbol">→</a> <a id="8728" href="/20.07/PUC/2019/Exam/#8613" class="Datatype">Term⁻</a> <a id="8734" class="Symbol">→</a> <a id="8736" href="/20.07/PUC/2019/Exam/#8594" class="Datatype">Term⁺</a>
|
||
<a id="Problem3.Term⁺._↓_"></a><a id="8746" href="/20.07/PUC/2019/Exam/#8746" class="InductiveConstructor Operator">_↓_</a> <a id="8772" class="Symbol">:</a> <a id="8774" href="/20.07/PUC/2019/Exam/#8613" class="Datatype">Term⁻</a> <a id="8780" class="Symbol">→</a> <a id="8782" href="/20.07/PUC/2019/Exam/#8339" class="Datatype">Type</a> <a id="8787" class="Symbol">→</a> <a id="8789" href="/20.07/PUC/2019/Exam/#8594" class="Datatype">Term⁺</a>
|
||
|
||
<a id="8798" class="Keyword">data</a> <a id="8803" href="/20.07/PUC/2019/Exam/#8613" class="Datatype">Term⁻</a> <a id="8809" class="Keyword">where</a>
|
||
<a id="Problem3.Term⁻.ƛ_⇒_"></a><a id="8819" href="/20.07/PUC/2019/Exam/#8819" class="InductiveConstructor Operator">ƛ_⇒_</a> <a id="8844" class="Symbol">:</a> <a id="8846" href="/20.07/PUC/2019/Exam/#8432" class="Function">Id</a> <a id="8849" class="Symbol">→</a> <a id="8851" href="/20.07/PUC/2019/Exam/#8613" class="Datatype">Term⁻</a> <a id="8857" class="Symbol">→</a> <a id="8859" href="/20.07/PUC/2019/Exam/#8613" class="Datatype">Term⁻</a>
|
||
<a id="Problem3.Term⁻.`zero"></a><a id="8869" href="/20.07/PUC/2019/Exam/#8869" class="InductiveConstructor">`zero</a> <a id="8894" class="Symbol">:</a> <a id="8896" href="/20.07/PUC/2019/Exam/#8613" class="Datatype">Term⁻</a>
|
||
<a id="Problem3.Term⁻.`suc_"></a><a id="8906" href="/20.07/PUC/2019/Exam/#8906" class="InductiveConstructor Operator">`suc_</a> <a id="8931" class="Symbol">:</a> <a id="8933" href="/20.07/PUC/2019/Exam/#8613" class="Datatype">Term⁻</a> <a id="8939" class="Symbol">→</a> <a id="8941" href="/20.07/PUC/2019/Exam/#8613" class="Datatype">Term⁻</a>
|
||
<a id="Problem3.Term⁻.`case_[zero⇒_|suc_⇒_]"></a><a id="8951" href="/20.07/PUC/2019/Exam/#8951" class="InductiveConstructor Operator">`case_[zero⇒_|suc_⇒_]</a> <a id="8976" class="Symbol">:</a> <a id="8978" href="/20.07/PUC/2019/Exam/#8594" class="Datatype">Term⁺</a> <a id="8984" class="Symbol">→</a> <a id="8986" href="/20.07/PUC/2019/Exam/#8613" class="Datatype">Term⁻</a> <a id="8992" class="Symbol">→</a> <a id="8994" href="/20.07/PUC/2019/Exam/#8432" class="Function">Id</a> <a id="8997" class="Symbol">→</a> <a id="8999" href="/20.07/PUC/2019/Exam/#8613" class="Datatype">Term⁻</a> <a id="9005" class="Symbol">→</a> <a id="9007" href="/20.07/PUC/2019/Exam/#8613" class="Datatype">Term⁻</a>
|
||
<a id="Problem3.Term⁻.μ_⇒_"></a><a id="9017" href="/20.07/PUC/2019/Exam/#9017" class="InductiveConstructor Operator">μ_⇒_</a> <a id="9042" class="Symbol">:</a> <a id="9044" href="/20.07/PUC/2019/Exam/#8432" class="Function">Id</a> <a id="9047" class="Symbol">→</a> <a id="9049" href="/20.07/PUC/2019/Exam/#8613" class="Datatype">Term⁻</a> <a id="9055" class="Symbol">→</a> <a id="9057" href="/20.07/PUC/2019/Exam/#8613" class="Datatype">Term⁻</a>
|
||
<a id="Problem3.Term⁻._↑"></a><a id="9067" href="/20.07/PUC/2019/Exam/#9067" class="InductiveConstructor Operator">_↑</a> <a id="9092" class="Symbol">:</a> <a id="9094" href="/20.07/PUC/2019/Exam/#8594" class="Datatype">Term⁺</a> <a id="9100" class="Symbol">→</a> <a id="9102" href="/20.07/PUC/2019/Exam/#8613" class="Datatype">Term⁻</a>
|
||
</pre>
|
||
<h3 id="lookup">Lookup</h3>
|
||
|
||
<pre class="Agda"> <a id="9131" class="Keyword">data</a> <a id="Problem3._∋_⦂_"></a><a id="9136" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">_∋_⦂_</a> <a id="9142" class="Symbol">:</a> <a id="9144" href="/20.07/PUC/2019/Exam/#8485" class="Datatype">Context</a> <a id="9152" class="Symbol">→</a> <a id="9154" href="/20.07/PUC/2019/Exam/#8432" class="Function">Id</a> <a id="9157" class="Symbol">→</a> <a id="9159" href="/20.07/PUC/2019/Exam/#8339" class="Datatype">Type</a> <a id="9164" class="Symbol">→</a> <a id="9166" class="PrimitiveType">Set</a> <a id="9170" class="Keyword">where</a>
|
||
|
||
<a id="Problem3._∋_⦂_.Z"></a><a id="9181" href="/20.07/PUC/2019/Exam/#9181" class="InductiveConstructor">Z</a> <a id="9183" class="Symbol">:</a> <a id="9185" class="Symbol">∀</a> <a id="9187" class="Symbol">{</a><a id="9188" href="/20.07/PUC/2019/Exam/#9188" class="Bound">Γ</a> <a id="9190" href="/20.07/PUC/2019/Exam/#9190" class="Bound">x</a> <a id="9192" href="/20.07/PUC/2019/Exam/#9192" class="Bound">A</a><a id="9193" class="Symbol">}</a>
|
||
<a id="9203" class="Comment">--------------------</a>
|
||
<a id="9230" class="Symbol">→</a> <a id="9232" href="/20.07/PUC/2019/Exam/#9188" class="Bound">Γ</a> <a id="9234" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">,</a> <a id="9236" href="/20.07/PUC/2019/Exam/#9190" class="Bound">x</a> <a id="9238" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">⦂</a> <a id="9240" href="/20.07/PUC/2019/Exam/#9192" class="Bound">A</a> <a id="9242" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">∋</a> <a id="9244" href="/20.07/PUC/2019/Exam/#9190" class="Bound">x</a> <a id="9246" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">⦂</a> <a id="9248" href="/20.07/PUC/2019/Exam/#9192" class="Bound">A</a>
|
||
|
||
<a id="Problem3._∋_⦂_.S"></a><a id="9255" href="/20.07/PUC/2019/Exam/#9255" class="InductiveConstructor">S</a> <a id="9257" class="Symbol">:</a> <a id="9259" class="Symbol">∀</a> <a id="9261" class="Symbol">{</a><a id="9262" href="/20.07/PUC/2019/Exam/#9262" class="Bound">Γ</a> <a id="9264" href="/20.07/PUC/2019/Exam/#9264" class="Bound">x</a> <a id="9266" href="/20.07/PUC/2019/Exam/#9266" class="Bound">y</a> <a id="9268" href="/20.07/PUC/2019/Exam/#9268" class="Bound">A</a> <a id="9270" href="/20.07/PUC/2019/Exam/#9270" class="Bound">B</a><a id="9271" class="Symbol">}</a>
|
||
<a id="9279" class="Symbol">→</a> <a id="9281" href="/20.07/PUC/2019/Exam/#9264" class="Bound">x</a> <a id="9283" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.PropositionalEquality.Core.html#799" class="Function Operator">≢</a> <a id="9285" href="/20.07/PUC/2019/Exam/#9266" class="Bound">y</a>
|
||
<a id="9293" class="Symbol">→</a> <a id="9295" href="/20.07/PUC/2019/Exam/#9262" class="Bound">Γ</a> <a id="9297" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">∋</a> <a id="9299" href="/20.07/PUC/2019/Exam/#9264" class="Bound">x</a> <a id="9301" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">⦂</a> <a id="9303" href="/20.07/PUC/2019/Exam/#9268" class="Bound">A</a>
|
||
<a id="9313" class="Comment">-----------------</a>
|
||
<a id="9337" class="Symbol">→</a> <a id="9339" href="/20.07/PUC/2019/Exam/#9262" class="Bound">Γ</a> <a id="9341" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">,</a> <a id="9343" href="/20.07/PUC/2019/Exam/#9266" class="Bound">y</a> <a id="9345" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">⦂</a> <a id="9347" href="/20.07/PUC/2019/Exam/#9270" class="Bound">B</a> <a id="9349" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">∋</a> <a id="9351" href="/20.07/PUC/2019/Exam/#9264" class="Bound">x</a> <a id="9353" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">⦂</a> <a id="9355" href="/20.07/PUC/2019/Exam/#9268" class="Bound">A</a>
|
||
</pre>
|
||
<h3 id="bidirectional-type-checking">Bidirectional type checking</h3>
|
||
|
||
<pre class="Agda"> <a id="9401" class="Keyword">data</a> <a id="Problem3._⊢_↑_"></a><a id="9406" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">_⊢_↑_</a> <a id="9412" class="Symbol">:</a> <a id="9414" href="/20.07/PUC/2019/Exam/#8485" class="Datatype">Context</a> <a id="9422" class="Symbol">→</a> <a id="9424" href="/20.07/PUC/2019/Exam/#8594" class="Datatype">Term⁺</a> <a id="9430" class="Symbol">→</a> <a id="9432" href="/20.07/PUC/2019/Exam/#8339" class="Datatype">Type</a> <a id="9437" class="Symbol">→</a> <a id="9439" class="PrimitiveType">Set</a>
|
||
<a id="9445" class="Keyword">data</a> <a id="Problem3._⊢_↓_"></a><a id="9450" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">_⊢_↓_</a> <a id="9456" class="Symbol">:</a> <a id="9458" href="/20.07/PUC/2019/Exam/#8485" class="Datatype">Context</a> <a id="9466" class="Symbol">→</a> <a id="9468" href="/20.07/PUC/2019/Exam/#8613" class="Datatype">Term⁻</a> <a id="9474" class="Symbol">→</a> <a id="9476" href="/20.07/PUC/2019/Exam/#8339" class="Datatype">Type</a> <a id="9481" class="Symbol">→</a> <a id="9483" class="PrimitiveType">Set</a>
|
||
|
||
<a id="9490" class="Keyword">data</a> <a id="9495" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">_⊢_↑_</a> <a id="9501" class="Keyword">where</a>
|
||
|
||
<a id="Problem3._⊢_↑_.⊢`"></a><a id="9512" href="/20.07/PUC/2019/Exam/#9512" class="InductiveConstructor">⊢`</a> <a id="9515" class="Symbol">:</a> <a id="9517" class="Symbol">∀</a> <a id="9519" class="Symbol">{</a><a id="9520" href="/20.07/PUC/2019/Exam/#9520" class="Bound">Γ</a> <a id="9522" href="/20.07/PUC/2019/Exam/#9522" class="Bound">A</a> <a id="9524" href="/20.07/PUC/2019/Exam/#9524" class="Bound">x</a><a id="9525" class="Symbol">}</a>
|
||
<a id="9533" class="Symbol">→</a> <a id="9535" href="/20.07/PUC/2019/Exam/#9520" class="Bound">Γ</a> <a id="9537" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">∋</a> <a id="9539" href="/20.07/PUC/2019/Exam/#9524" class="Bound">x</a> <a id="9541" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">⦂</a> <a id="9543" href="/20.07/PUC/2019/Exam/#9522" class="Bound">A</a>
|
||
<a id="9553" class="Comment">-----------</a>
|
||
<a id="9571" class="Symbol">→</a> <a id="9573" href="/20.07/PUC/2019/Exam/#9520" class="Bound">Γ</a> <a id="9575" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">⊢</a> <a id="9577" href="/20.07/PUC/2019/Exam/#8649" class="InductiveConstructor Operator">`</a> <a id="9579" href="/20.07/PUC/2019/Exam/#9524" class="Bound">x</a> <a id="9581" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">↑</a> <a id="9583" href="/20.07/PUC/2019/Exam/#9522" class="Bound">A</a>
|
||
|
||
<a id="Problem3._⊢_↑_._·_"></a><a id="9590" href="/20.07/PUC/2019/Exam/#9590" class="InductiveConstructor Operator">_·_</a> <a id="9594" class="Symbol">:</a> <a id="9596" class="Symbol">∀</a> <a id="9598" class="Symbol">{</a><a id="9599" href="/20.07/PUC/2019/Exam/#9599" class="Bound">Γ</a> <a id="9601" href="/20.07/PUC/2019/Exam/#9601" class="Bound">L</a> <a id="9603" href="/20.07/PUC/2019/Exam/#9603" class="Bound">M</a> <a id="9605" href="/20.07/PUC/2019/Exam/#9605" class="Bound">A</a> <a id="9607" href="/20.07/PUC/2019/Exam/#9607" class="Bound">B</a><a id="9608" class="Symbol">}</a>
|
||
<a id="9616" class="Symbol">→</a> <a id="9618" href="/20.07/PUC/2019/Exam/#9599" class="Bound">Γ</a> <a id="9620" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">⊢</a> <a id="9622" href="/20.07/PUC/2019/Exam/#9601" class="Bound">L</a> <a id="9624" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">↑</a> <a id="9626" href="/20.07/PUC/2019/Exam/#9605" class="Bound">A</a> <a id="9628" href="/20.07/PUC/2019/Exam/#8360" class="InductiveConstructor Operator">⇒</a> <a id="9630" href="/20.07/PUC/2019/Exam/#9607" class="Bound">B</a>
|
||
<a id="9638" class="Symbol">→</a> <a id="9640" href="/20.07/PUC/2019/Exam/#9599" class="Bound">Γ</a> <a id="9642" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">⊢</a> <a id="9644" href="/20.07/PUC/2019/Exam/#9603" class="Bound">M</a> <a id="9646" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">↓</a> <a id="9648" href="/20.07/PUC/2019/Exam/#9605" class="Bound">A</a>
|
||
<a id="9658" class="Comment">-------------</a>
|
||
<a id="9678" class="Symbol">→</a> <a id="9680" href="/20.07/PUC/2019/Exam/#9599" class="Bound">Γ</a> <a id="9682" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">⊢</a> <a id="9684" href="/20.07/PUC/2019/Exam/#9601" class="Bound">L</a> <a id="9686" href="/20.07/PUC/2019/Exam/#8692" class="InductiveConstructor Operator">·</a> <a id="9688" href="/20.07/PUC/2019/Exam/#9603" class="Bound">M</a> <a id="9690" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">↑</a> <a id="9692" href="/20.07/PUC/2019/Exam/#9607" class="Bound">B</a>
|
||
|
||
<a id="Problem3._⊢_↑_.⊢↓"></a><a id="9699" href="/20.07/PUC/2019/Exam/#9699" class="InductiveConstructor">⊢↓</a> <a id="9702" class="Symbol">:</a> <a id="9704" class="Symbol">∀</a> <a id="9706" class="Symbol">{</a><a id="9707" href="/20.07/PUC/2019/Exam/#9707" class="Bound">Γ</a> <a id="9709" href="/20.07/PUC/2019/Exam/#9709" class="Bound">M</a> <a id="9711" href="/20.07/PUC/2019/Exam/#9711" class="Bound">A</a><a id="9712" class="Symbol">}</a>
|
||
<a id="9720" class="Symbol">→</a> <a id="9722" href="/20.07/PUC/2019/Exam/#9707" class="Bound">Γ</a> <a id="9724" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">⊢</a> <a id="9726" href="/20.07/PUC/2019/Exam/#9709" class="Bound">M</a> <a id="9728" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">↓</a> <a id="9730" href="/20.07/PUC/2019/Exam/#9711" class="Bound">A</a>
|
||
<a id="9740" class="Comment">---------------</a>
|
||
<a id="9762" class="Symbol">→</a> <a id="9764" href="/20.07/PUC/2019/Exam/#9707" class="Bound">Γ</a> <a id="9766" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">⊢</a> <a id="9768" class="Symbol">(</a><a id="9769" href="/20.07/PUC/2019/Exam/#9709" class="Bound">M</a> <a id="9771" href="/20.07/PUC/2019/Exam/#8746" class="InductiveConstructor Operator">↓</a> <a id="9773" href="/20.07/PUC/2019/Exam/#9711" class="Bound">A</a><a id="9774" class="Symbol">)</a> <a id="9776" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">↑</a> <a id="9778" href="/20.07/PUC/2019/Exam/#9711" class="Bound">A</a>
|
||
|
||
<a id="9783" class="Keyword">data</a> <a id="9788" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">_⊢_↓_</a> <a id="9794" class="Keyword">where</a>
|
||
|
||
<a id="Problem3._⊢_↓_.⊢ƛ"></a><a id="9805" href="/20.07/PUC/2019/Exam/#9805" class="InductiveConstructor">⊢ƛ</a> <a id="9808" class="Symbol">:</a> <a id="9810" class="Symbol">∀</a> <a id="9812" class="Symbol">{</a><a id="9813" href="/20.07/PUC/2019/Exam/#9813" class="Bound">Γ</a> <a id="9815" href="/20.07/PUC/2019/Exam/#9815" class="Bound">x</a> <a id="9817" href="/20.07/PUC/2019/Exam/#9817" class="Bound">N</a> <a id="9819" href="/20.07/PUC/2019/Exam/#9819" class="Bound">A</a> <a id="9821" href="/20.07/PUC/2019/Exam/#9821" class="Bound">B</a><a id="9822" class="Symbol">}</a>
|
||
<a id="9830" class="Symbol">→</a> <a id="9832" href="/20.07/PUC/2019/Exam/#9813" class="Bound">Γ</a> <a id="9834" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">,</a> <a id="9836" href="/20.07/PUC/2019/Exam/#9815" class="Bound">x</a> <a id="9838" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">⦂</a> <a id="9840" href="/20.07/PUC/2019/Exam/#9819" class="Bound">A</a> <a id="9842" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">⊢</a> <a id="9844" href="/20.07/PUC/2019/Exam/#9817" class="Bound">N</a> <a id="9846" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">↓</a> <a id="9848" href="/20.07/PUC/2019/Exam/#9821" class="Bound">B</a>
|
||
<a id="9858" class="Comment">-------------------</a>
|
||
<a id="9884" class="Symbol">→</a> <a id="9886" href="/20.07/PUC/2019/Exam/#9813" class="Bound">Γ</a> <a id="9888" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">⊢</a> <a id="9890" href="/20.07/PUC/2019/Exam/#8819" class="InductiveConstructor Operator">ƛ</a> <a id="9892" href="/20.07/PUC/2019/Exam/#9815" class="Bound">x</a> <a id="9894" href="/20.07/PUC/2019/Exam/#8819" class="InductiveConstructor Operator">⇒</a> <a id="9896" href="/20.07/PUC/2019/Exam/#9817" class="Bound">N</a> <a id="9898" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">↓</a> <a id="9900" href="/20.07/PUC/2019/Exam/#9819" class="Bound">A</a> <a id="9902" href="/20.07/PUC/2019/Exam/#8360" class="InductiveConstructor Operator">⇒</a> <a id="9904" href="/20.07/PUC/2019/Exam/#9821" class="Bound">B</a>
|
||
|
||
<a id="Problem3._⊢_↓_.⊢zero"></a><a id="9911" href="/20.07/PUC/2019/Exam/#9911" class="InductiveConstructor">⊢zero</a> <a id="9917" class="Symbol">:</a> <a id="9919" class="Symbol">∀</a> <a id="9921" class="Symbol">{</a><a id="9922" href="/20.07/PUC/2019/Exam/#9922" class="Bound">Γ</a><a id="9923" class="Symbol">}</a>
|
||
<a id="9933" class="Comment">--------------</a>
|
||
<a id="9954" class="Symbol">→</a> <a id="9956" href="/20.07/PUC/2019/Exam/#9922" class="Bound">Γ</a> <a id="9958" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">⊢</a> <a id="9960" href="/20.07/PUC/2019/Exam/#8869" class="InductiveConstructor">`zero</a> <a id="9966" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">↓</a> <a id="9968" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a>
|
||
|
||
<a id="Problem3._⊢_↓_.⊢suc"></a><a id="9976" href="/20.07/PUC/2019/Exam/#9976" class="InductiveConstructor">⊢suc</a> <a id="9981" class="Symbol">:</a> <a id="9983" class="Symbol">∀</a> <a id="9985" class="Symbol">{</a><a id="9986" href="/20.07/PUC/2019/Exam/#9986" class="Bound">Γ</a> <a id="9988" href="/20.07/PUC/2019/Exam/#9988" class="Bound">M</a><a id="9989" class="Symbol">}</a>
|
||
<a id="9997" class="Symbol">→</a> <a id="9999" href="/20.07/PUC/2019/Exam/#9986" class="Bound">Γ</a> <a id="10001" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">⊢</a> <a id="10003" href="/20.07/PUC/2019/Exam/#9988" class="Bound">M</a> <a id="10005" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">↓</a> <a id="10007" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a>
|
||
<a id="10018" class="Comment">---------------</a>
|
||
<a id="10040" class="Symbol">→</a> <a id="10042" href="/20.07/PUC/2019/Exam/#9986" class="Bound">Γ</a> <a id="10044" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">⊢</a> <a id="10046" href="/20.07/PUC/2019/Exam/#8906" class="InductiveConstructor Operator">`suc</a> <a id="10051" href="/20.07/PUC/2019/Exam/#9988" class="Bound">M</a> <a id="10053" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">↓</a> <a id="10055" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a>
|
||
|
||
<a id="Problem3._⊢_↓_.⊢case"></a><a id="10063" href="/20.07/PUC/2019/Exam/#10063" class="InductiveConstructor">⊢case</a> <a id="10069" class="Symbol">:</a> <a id="10071" class="Symbol">∀</a> <a id="10073" class="Symbol">{</a><a id="10074" href="/20.07/PUC/2019/Exam/#10074" class="Bound">Γ</a> <a id="10076" href="/20.07/PUC/2019/Exam/#10076" class="Bound">L</a> <a id="10078" href="/20.07/PUC/2019/Exam/#10078" class="Bound">M</a> <a id="10080" href="/20.07/PUC/2019/Exam/#10080" class="Bound">x</a> <a id="10082" href="/20.07/PUC/2019/Exam/#10082" class="Bound">N</a> <a id="10084" href="/20.07/PUC/2019/Exam/#10084" class="Bound">A</a><a id="10085" class="Symbol">}</a>
|
||
<a id="10093" class="Symbol">→</a> <a id="10095" href="/20.07/PUC/2019/Exam/#10074" class="Bound">Γ</a> <a id="10097" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">⊢</a> <a id="10099" href="/20.07/PUC/2019/Exam/#10076" class="Bound">L</a> <a id="10101" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">↑</a> <a id="10103" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a>
|
||
<a id="10112" class="Symbol">→</a> <a id="10114" href="/20.07/PUC/2019/Exam/#10074" class="Bound">Γ</a> <a id="10116" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">⊢</a> <a id="10118" href="/20.07/PUC/2019/Exam/#10078" class="Bound">M</a> <a id="10120" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">↓</a> <a id="10122" href="/20.07/PUC/2019/Exam/#10084" class="Bound">A</a>
|
||
<a id="10130" class="Symbol">→</a> <a id="10132" href="/20.07/PUC/2019/Exam/#10074" class="Bound">Γ</a> <a id="10134" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">,</a> <a id="10136" href="/20.07/PUC/2019/Exam/#10080" class="Bound">x</a> <a id="10138" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">⦂</a> <a id="10140" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a> <a id="10143" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">⊢</a> <a id="10145" href="/20.07/PUC/2019/Exam/#10082" class="Bound">N</a> <a id="10147" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">↓</a> <a id="10149" href="/20.07/PUC/2019/Exam/#10084" class="Bound">A</a>
|
||
<a id="10159" class="Comment">-------------------------------------</a>
|
||
<a id="10203" class="Symbol">→</a> <a id="10205" href="/20.07/PUC/2019/Exam/#10074" class="Bound">Γ</a> <a id="10207" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">⊢</a> <a id="10209" href="/20.07/PUC/2019/Exam/#8951" class="InductiveConstructor Operator">`case</a> <a id="10215" href="/20.07/PUC/2019/Exam/#10076" class="Bound">L</a> <a id="10217" href="/20.07/PUC/2019/Exam/#8951" class="InductiveConstructor Operator">[zero⇒</a> <a id="10224" href="/20.07/PUC/2019/Exam/#10078" class="Bound">M</a> <a id="10226" href="/20.07/PUC/2019/Exam/#8951" class="InductiveConstructor Operator">|suc</a> <a id="10231" href="/20.07/PUC/2019/Exam/#10080" class="Bound">x</a> <a id="10233" href="/20.07/PUC/2019/Exam/#8951" class="InductiveConstructor Operator">⇒</a> <a id="10235" href="/20.07/PUC/2019/Exam/#10082" class="Bound">N</a> <a id="10237" href="/20.07/PUC/2019/Exam/#8951" class="InductiveConstructor Operator">]</a> <a id="10239" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">↓</a> <a id="10241" href="/20.07/PUC/2019/Exam/#10084" class="Bound">A</a>
|
||
|
||
<a id="Problem3._⊢_↓_.⊢μ"></a><a id="10248" href="/20.07/PUC/2019/Exam/#10248" class="InductiveConstructor">⊢μ</a> <a id="10251" class="Symbol">:</a> <a id="10253" class="Symbol">∀</a> <a id="10255" class="Symbol">{</a><a id="10256" href="/20.07/PUC/2019/Exam/#10256" class="Bound">Γ</a> <a id="10258" href="/20.07/PUC/2019/Exam/#10258" class="Bound">x</a> <a id="10260" href="/20.07/PUC/2019/Exam/#10260" class="Bound">N</a> <a id="10262" href="/20.07/PUC/2019/Exam/#10262" class="Bound">A</a><a id="10263" class="Symbol">}</a>
|
||
<a id="10271" class="Symbol">→</a> <a id="10273" href="/20.07/PUC/2019/Exam/#10256" class="Bound">Γ</a> <a id="10275" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">,</a> <a id="10277" href="/20.07/PUC/2019/Exam/#10258" class="Bound">x</a> <a id="10279" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">⦂</a> <a id="10281" href="/20.07/PUC/2019/Exam/#10262" class="Bound">A</a> <a id="10283" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">⊢</a> <a id="10285" href="/20.07/PUC/2019/Exam/#10260" class="Bound">N</a> <a id="10287" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">↓</a> <a id="10289" href="/20.07/PUC/2019/Exam/#10262" class="Bound">A</a>
|
||
<a id="10299" class="Comment">-----------------</a>
|
||
<a id="10323" class="Symbol">→</a> <a id="10325" href="/20.07/PUC/2019/Exam/#10256" class="Bound">Γ</a> <a id="10327" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">⊢</a> <a id="10329" href="/20.07/PUC/2019/Exam/#9017" class="InductiveConstructor Operator">μ</a> <a id="10331" href="/20.07/PUC/2019/Exam/#10258" class="Bound">x</a> <a id="10333" href="/20.07/PUC/2019/Exam/#9017" class="InductiveConstructor Operator">⇒</a> <a id="10335" href="/20.07/PUC/2019/Exam/#10260" class="Bound">N</a> <a id="10337" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">↓</a> <a id="10339" href="/20.07/PUC/2019/Exam/#10262" class="Bound">A</a>
|
||
|
||
<a id="Problem3._⊢_↓_.⊢↑"></a><a id="10346" href="/20.07/PUC/2019/Exam/#10346" class="InductiveConstructor">⊢↑</a> <a id="10349" class="Symbol">:</a> <a id="10351" class="Symbol">∀</a> <a id="10353" class="Symbol">{</a><a id="10354" href="/20.07/PUC/2019/Exam/#10354" class="Bound">Γ</a> <a id="10356" href="/20.07/PUC/2019/Exam/#10356" class="Bound">M</a> <a id="10358" href="/20.07/PUC/2019/Exam/#10358" class="Bound">A</a> <a id="10360" href="/20.07/PUC/2019/Exam/#10360" class="Bound">B</a><a id="10361" class="Symbol">}</a>
|
||
<a id="10369" class="Symbol">→</a> <a id="10371" href="/20.07/PUC/2019/Exam/#10354" class="Bound">Γ</a> <a id="10373" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">⊢</a> <a id="10375" href="/20.07/PUC/2019/Exam/#10356" class="Bound">M</a> <a id="10377" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">↑</a> <a id="10379" href="/20.07/PUC/2019/Exam/#10358" class="Bound">A</a>
|
||
<a id="10387" class="Symbol">→</a> <a id="10389" href="/20.07/PUC/2019/Exam/#10358" class="Bound">A</a> <a id="10391" href="Agda.Builtin.Equality.html#125" class="Datatype Operator">≡</a> <a id="10393" href="/20.07/PUC/2019/Exam/#10360" class="Bound">B</a>
|
||
<a id="10403" class="Comment">-------------</a>
|
||
<a id="10423" class="Symbol">→</a> <a id="10425" href="/20.07/PUC/2019/Exam/#10354" class="Bound">Γ</a> <a id="10427" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">⊢</a> <a id="10429" class="Symbol">(</a><a id="10430" href="/20.07/PUC/2019/Exam/#10356" class="Bound">M</a> <a id="10432" href="/20.07/PUC/2019/Exam/#9067" class="InductiveConstructor Operator">↑</a><a id="10433" class="Symbol">)</a> <a id="10435" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">↓</a> <a id="10437" href="/20.07/PUC/2019/Exam/#10360" class="Bound">B</a>
|
||
</pre>
|
||
|
||
<h3 id="type-equality">Type equality</h3>
|
||
|
||
<pre class="Agda"> <a id="Problem3._≟Tp_"></a><a id="10470" href="/20.07/PUC/2019/Exam/#10470" class="Function Operator">_≟Tp_</a> <a id="10476" class="Symbol">:</a> <a id="10478" class="Symbol">(</a><a id="10479" href="/20.07/PUC/2019/Exam/#10479" class="Bound">A</a> <a id="10481" href="/20.07/PUC/2019/Exam/#10481" class="Bound">B</a> <a id="10483" class="Symbol">:</a> <a id="10485" href="/20.07/PUC/2019/Exam/#8339" class="Datatype">Type</a><a id="10489" class="Symbol">)</a> <a id="10491" class="Symbol">→</a> <a id="10493" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#605" class="Datatype">Dec</a> <a id="10497" class="Symbol">(</a><a id="10498" href="/20.07/PUC/2019/Exam/#10479" class="Bound">A</a> <a id="10500" href="Agda.Builtin.Equality.html#125" class="Datatype Operator">≡</a> <a id="10502" href="/20.07/PUC/2019/Exam/#10481" class="Bound">B</a><a id="10503" class="Symbol">)</a>
|
||
<a id="10507" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a> <a id="10515" href="/20.07/PUC/2019/Exam/#10470" class="Function Operator">≟Tp</a> <a id="10519" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a> <a id="10535" class="Symbol">=</a> <a id="10538" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="10542" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a>
|
||
<a id="10549" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a> <a id="10557" href="/20.07/PUC/2019/Exam/#10470" class="Function Operator">≟Tp</a> <a id="10561" class="Symbol">(</a><a id="10562" href="/20.07/PUC/2019/Exam/#10562" class="Bound">A</a> <a id="10564" href="/20.07/PUC/2019/Exam/#8360" class="InductiveConstructor Operator">⇒</a> <a id="10566" href="/20.07/PUC/2019/Exam/#10566" class="Bound">B</a><a id="10567" class="Symbol">)</a> <a id="10577" class="Symbol">=</a> <a id="10580" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="10583" class="Symbol">λ()</a>
|
||
<a id="10589" class="Symbol">(</a><a id="10590" href="/20.07/PUC/2019/Exam/#10590" class="Bound">A</a> <a id="10592" href="/20.07/PUC/2019/Exam/#8360" class="InductiveConstructor Operator">⇒</a> <a id="10594" href="/20.07/PUC/2019/Exam/#10594" class="Bound">B</a><a id="10595" class="Symbol">)</a> <a id="10597" href="/20.07/PUC/2019/Exam/#10470" class="Function Operator">≟Tp</a> <a id="10601" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a> <a id="10617" class="Symbol">=</a> <a id="10620" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="10623" class="Symbol">λ()</a>
|
||
<a id="10629" class="Symbol">(</a><a id="10630" href="/20.07/PUC/2019/Exam/#10630" class="Bound">A</a> <a id="10632" href="/20.07/PUC/2019/Exam/#8360" class="InductiveConstructor Operator">⇒</a> <a id="10634" href="/20.07/PUC/2019/Exam/#10634" class="Bound">B</a><a id="10635" class="Symbol">)</a> <a id="10637" href="/20.07/PUC/2019/Exam/#10470" class="Function Operator">≟Tp</a> <a id="10641" class="Symbol">(</a><a id="10642" href="/20.07/PUC/2019/Exam/#10642" class="Bound">A′</a> <a id="10645" href="/20.07/PUC/2019/Exam/#8360" class="InductiveConstructor Operator">⇒</a> <a id="10647" href="/20.07/PUC/2019/Exam/#10647" class="Bound">B′</a><a id="10649" class="Symbol">)</a>
|
||
<a id="10655" class="Keyword">with</a> <a id="10660" href="/20.07/PUC/2019/Exam/#10630" class="Bound">A</a> <a id="10662" href="/20.07/PUC/2019/Exam/#10470" class="Function Operator">≟Tp</a> <a id="10666" href="/20.07/PUC/2019/Exam/#10642" class="Bound">A′</a> <a id="10669" class="Symbol">|</a> <a id="10671" href="/20.07/PUC/2019/Exam/#10634" class="Bound">B</a> <a id="10673" href="/20.07/PUC/2019/Exam/#10470" class="Function Operator">≟Tp</a> <a id="10677" href="/20.07/PUC/2019/Exam/#10647" class="Bound">B′</a>
|
||
<a id="10682" class="Symbol">...</a> <a id="10687" class="Symbol">|</a> <a id="10689" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="10692" href="/20.07/PUC/2019/Exam/#10692" class="Bound">A≢</a> <a id="10698" class="Symbol">|</a> <a id="10700" class="Symbol">_</a> <a id="10710" class="Symbol">=</a> <a id="10713" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="10716" class="Symbol">λ{</a><a id="10718" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a> <a id="10723" class="Symbol">→</a> <a id="10725" href="/20.07/PUC/2019/Exam/#10692" class="Bound">A≢</a> <a id="10728" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a><a id="10732" class="Symbol">}</a>
|
||
<a id="10736" class="Symbol">...</a> <a id="10741" class="Symbol">|</a> <a id="10743" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="10747" class="Symbol">_</a> <a id="10752" class="Symbol">|</a> <a id="10754" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="10757" href="/20.07/PUC/2019/Exam/#10757" class="Bound">B≢</a> <a id="10764" class="Symbol">=</a> <a id="10767" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="10770" class="Symbol">λ{</a><a id="10772" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a> <a id="10777" class="Symbol">→</a> <a id="10779" href="/20.07/PUC/2019/Exam/#10757" class="Bound">B≢</a> <a id="10782" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a><a id="10786" class="Symbol">}</a>
|
||
<a id="10790" class="Symbol">...</a> <a id="10795" class="Symbol">|</a> <a id="10797" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="10801" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a> <a id="10806" class="Symbol">|</a> <a id="10808" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="10812" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a> <a id="10818" class="Symbol">=</a> <a id="10821" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="10825" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a>
|
||
</pre>
|
||
<h3 id="prerequisites">Prerequisites</h3>
|
||
|
||
<pre class="Agda"> <a id="Problem3.dom≡"></a><a id="10860" href="/20.07/PUC/2019/Exam/#10860" class="Function">dom≡</a> <a id="10865" class="Symbol">:</a> <a id="10867" class="Symbol">∀</a> <a id="10869" class="Symbol">{</a><a id="10870" href="/20.07/PUC/2019/Exam/#10870" class="Bound">A</a> <a id="10872" href="/20.07/PUC/2019/Exam/#10872" class="Bound">A′</a> <a id="10875" href="/20.07/PUC/2019/Exam/#10875" class="Bound">B</a> <a id="10877" href="/20.07/PUC/2019/Exam/#10877" class="Bound">B′</a><a id="10879" class="Symbol">}</a> <a id="10881" class="Symbol">→</a> <a id="10883" href="/20.07/PUC/2019/Exam/#10870" class="Bound">A</a> <a id="10885" href="/20.07/PUC/2019/Exam/#8360" class="InductiveConstructor Operator">⇒</a> <a id="10887" href="/20.07/PUC/2019/Exam/#10875" class="Bound">B</a> <a id="10889" href="Agda.Builtin.Equality.html#125" class="Datatype Operator">≡</a> <a id="10891" href="/20.07/PUC/2019/Exam/#10872" class="Bound">A′</a> <a id="10894" href="/20.07/PUC/2019/Exam/#8360" class="InductiveConstructor Operator">⇒</a> <a id="10896" href="/20.07/PUC/2019/Exam/#10877" class="Bound">B′</a> <a id="10899" class="Symbol">→</a> <a id="10901" href="/20.07/PUC/2019/Exam/#10870" class="Bound">A</a> <a id="10903" href="Agda.Builtin.Equality.html#125" class="Datatype Operator">≡</a> <a id="10905" href="/20.07/PUC/2019/Exam/#10872" class="Bound">A′</a>
|
||
<a id="10910" href="/20.07/PUC/2019/Exam/#10860" class="Function">dom≡</a> <a id="10915" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a> <a id="10920" class="Symbol">=</a> <a id="10922" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a>
|
||
|
||
<a id="Problem3.rng≡"></a><a id="10930" href="/20.07/PUC/2019/Exam/#10930" class="Function">rng≡</a> <a id="10935" class="Symbol">:</a> <a id="10937" class="Symbol">∀</a> <a id="10939" class="Symbol">{</a><a id="10940" href="/20.07/PUC/2019/Exam/#10940" class="Bound">A</a> <a id="10942" href="/20.07/PUC/2019/Exam/#10942" class="Bound">A′</a> <a id="10945" href="/20.07/PUC/2019/Exam/#10945" class="Bound">B</a> <a id="10947" href="/20.07/PUC/2019/Exam/#10947" class="Bound">B′</a><a id="10949" class="Symbol">}</a> <a id="10951" class="Symbol">→</a> <a id="10953" href="/20.07/PUC/2019/Exam/#10940" class="Bound">A</a> <a id="10955" href="/20.07/PUC/2019/Exam/#8360" class="InductiveConstructor Operator">⇒</a> <a id="10957" href="/20.07/PUC/2019/Exam/#10945" class="Bound">B</a> <a id="10959" href="Agda.Builtin.Equality.html#125" class="Datatype Operator">≡</a> <a id="10961" href="/20.07/PUC/2019/Exam/#10942" class="Bound">A′</a> <a id="10964" href="/20.07/PUC/2019/Exam/#8360" class="InductiveConstructor Operator">⇒</a> <a id="10966" href="/20.07/PUC/2019/Exam/#10947" class="Bound">B′</a> <a id="10969" class="Symbol">→</a> <a id="10971" href="/20.07/PUC/2019/Exam/#10945" class="Bound">B</a> <a id="10973" href="Agda.Builtin.Equality.html#125" class="Datatype Operator">≡</a> <a id="10975" href="/20.07/PUC/2019/Exam/#10947" class="Bound">B′</a>
|
||
<a id="10980" href="/20.07/PUC/2019/Exam/#10930" class="Function">rng≡</a> <a id="10985" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a> <a id="10990" class="Symbol">=</a> <a id="10992" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a>
|
||
|
||
<a id="Problem3.ℕ≢⇒"></a><a id="11000" href="/20.07/PUC/2019/Exam/#11000" class="Function">ℕ≢⇒</a> <a id="11004" class="Symbol">:</a> <a id="11006" class="Symbol">∀</a> <a id="11008" class="Symbol">{</a><a id="11009" href="/20.07/PUC/2019/Exam/#11009" class="Bound">A</a> <a id="11011" href="/20.07/PUC/2019/Exam/#11011" class="Bound">B</a><a id="11012" class="Symbol">}</a> <a id="11014" class="Symbol">→</a> <a id="11016" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a> <a id="11019" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.PropositionalEquality.Core.html#799" class="Function Operator">≢</a> <a id="11021" href="/20.07/PUC/2019/Exam/#11009" class="Bound">A</a> <a id="11023" href="/20.07/PUC/2019/Exam/#8360" class="InductiveConstructor Operator">⇒</a> <a id="11025" href="/20.07/PUC/2019/Exam/#11011" class="Bound">B</a>
|
||
<a id="11029" href="/20.07/PUC/2019/Exam/#11000" class="Function">ℕ≢⇒</a> <a id="11033" class="Symbol">()</a>
|
||
</pre>
|
||
|
||
<h3 id="unique-lookup">Unique lookup</h3>
|
||
|
||
<pre class="Agda"> <a id="Problem3.uniq-∋"></a><a id="11067" href="/20.07/PUC/2019/Exam/#11067" class="Function">uniq-∋</a> <a id="11074" class="Symbol">:</a> <a id="11076" class="Symbol">∀</a> <a id="11078" class="Symbol">{</a><a id="11079" href="/20.07/PUC/2019/Exam/#11079" class="Bound">Γ</a> <a id="11081" href="/20.07/PUC/2019/Exam/#11081" class="Bound">x</a> <a id="11083" href="/20.07/PUC/2019/Exam/#11083" class="Bound">A</a> <a id="11085" href="/20.07/PUC/2019/Exam/#11085" class="Bound">B</a><a id="11086" class="Symbol">}</a> <a id="11088" class="Symbol">→</a> <a id="11090" href="/20.07/PUC/2019/Exam/#11079" class="Bound">Γ</a> <a id="11092" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">∋</a> <a id="11094" href="/20.07/PUC/2019/Exam/#11081" class="Bound">x</a> <a id="11096" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">⦂</a> <a id="11098" href="/20.07/PUC/2019/Exam/#11083" class="Bound">A</a> <a id="11100" class="Symbol">→</a> <a id="11102" href="/20.07/PUC/2019/Exam/#11079" class="Bound">Γ</a> <a id="11104" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">∋</a> <a id="11106" href="/20.07/PUC/2019/Exam/#11081" class="Bound">x</a> <a id="11108" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">⦂</a> <a id="11110" href="/20.07/PUC/2019/Exam/#11085" class="Bound">B</a> <a id="11112" class="Symbol">→</a> <a id="11114" href="/20.07/PUC/2019/Exam/#11083" class="Bound">A</a> <a id="11116" href="Agda.Builtin.Equality.html#125" class="Datatype Operator">≡</a> <a id="11118" href="/20.07/PUC/2019/Exam/#11085" class="Bound">B</a>
|
||
<a id="11122" href="/20.07/PUC/2019/Exam/#11067" class="Function">uniq-∋</a> <a id="11129" href="/20.07/PUC/2019/Exam/#9181" class="InductiveConstructor">Z</a> <a id="11131" href="/20.07/PUC/2019/Exam/#9181" class="InductiveConstructor">Z</a> <a id="11149" class="Symbol">=</a> <a id="11152" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a>
|
||
<a id="11159" href="/20.07/PUC/2019/Exam/#11067" class="Function">uniq-∋</a> <a id="11166" href="/20.07/PUC/2019/Exam/#9181" class="InductiveConstructor">Z</a> <a id="11168" class="Symbol">(</a><a id="11169" href="/20.07/PUC/2019/Exam/#9255" class="InductiveConstructor">S</a> <a id="11171" href="/20.07/PUC/2019/Exam/#11171" class="Bound">x≢y</a> <a id="11175" class="Symbol">_)</a> <a id="11186" class="Symbol">=</a> <a id="11189" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#294" class="Function">⊥-elim</a> <a id="11196" class="Symbol">(</a><a id="11197" href="/20.07/PUC/2019/Exam/#11171" class="Bound">x≢y</a> <a id="11201" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a><a id="11205" class="Symbol">)</a>
|
||
<a id="11209" href="/20.07/PUC/2019/Exam/#11067" class="Function">uniq-∋</a> <a id="11216" class="Symbol">(</a><a id="11217" href="/20.07/PUC/2019/Exam/#9255" class="InductiveConstructor">S</a> <a id="11219" href="/20.07/PUC/2019/Exam/#11219" class="Bound">x≢y</a> <a id="11223" class="Symbol">_)</a> <a id="11226" href="/20.07/PUC/2019/Exam/#9181" class="InductiveConstructor">Z</a> <a id="11236" class="Symbol">=</a> <a id="11239" href="https://agda.github.io/agda-stdlib/v1.1/Data.Empty.html#294" class="Function">⊥-elim</a> <a id="11246" class="Symbol">(</a><a id="11247" href="/20.07/PUC/2019/Exam/#11219" class="Bound">x≢y</a> <a id="11251" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a><a id="11255" class="Symbol">)</a>
|
||
<a id="11259" href="/20.07/PUC/2019/Exam/#11067" class="Function">uniq-∋</a> <a id="11266" class="Symbol">(</a><a id="11267" href="/20.07/PUC/2019/Exam/#9255" class="InductiveConstructor">S</a> <a id="11269" class="Symbol">_</a> <a id="11271" href="/20.07/PUC/2019/Exam/#11271" class="Bound">∋x</a><a id="11273" class="Symbol">)</a> <a id="11275" class="Symbol">(</a><a id="11276" href="/20.07/PUC/2019/Exam/#9255" class="InductiveConstructor">S</a> <a id="11278" class="Symbol">_</a> <a id="11280" href="/20.07/PUC/2019/Exam/#11280" class="Bound">∋x′</a><a id="11283" class="Symbol">)</a> <a id="11286" class="Symbol">=</a> <a id="11289" href="/20.07/PUC/2019/Exam/#11067" class="Function">uniq-∋</a> <a id="11296" href="/20.07/PUC/2019/Exam/#11271" class="Bound">∋x</a> <a id="11299" href="/20.07/PUC/2019/Exam/#11280" class="Bound">∋x′</a>
|
||
</pre>
|
||
<h3 id="unique-synthesis">Unique synthesis</h3>
|
||
|
||
<pre class="Agda"> <a id="Problem3.uniq-↑"></a><a id="11336" href="/20.07/PUC/2019/Exam/#11336" class="Function">uniq-↑</a> <a id="11343" class="Symbol">:</a> <a id="11345" class="Symbol">∀</a> <a id="11347" class="Symbol">{</a><a id="11348" href="/20.07/PUC/2019/Exam/#11348" class="Bound">Γ</a> <a id="11350" href="/20.07/PUC/2019/Exam/#11350" class="Bound">M</a> <a id="11352" href="/20.07/PUC/2019/Exam/#11352" class="Bound">A</a> <a id="11354" href="/20.07/PUC/2019/Exam/#11354" class="Bound">B</a><a id="11355" class="Symbol">}</a> <a id="11357" class="Symbol">→</a> <a id="11359" href="/20.07/PUC/2019/Exam/#11348" class="Bound">Γ</a> <a id="11361" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">⊢</a> <a id="11363" href="/20.07/PUC/2019/Exam/#11350" class="Bound">M</a> <a id="11365" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">↑</a> <a id="11367" href="/20.07/PUC/2019/Exam/#11352" class="Bound">A</a> <a id="11369" class="Symbol">→</a> <a id="11371" href="/20.07/PUC/2019/Exam/#11348" class="Bound">Γ</a> <a id="11373" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">⊢</a> <a id="11375" href="/20.07/PUC/2019/Exam/#11350" class="Bound">M</a> <a id="11377" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">↑</a> <a id="11379" href="/20.07/PUC/2019/Exam/#11354" class="Bound">B</a> <a id="11381" class="Symbol">→</a> <a id="11383" href="/20.07/PUC/2019/Exam/#11352" class="Bound">A</a> <a id="11385" href="Agda.Builtin.Equality.html#125" class="Datatype Operator">≡</a> <a id="11387" href="/20.07/PUC/2019/Exam/#11354" class="Bound">B</a>
|
||
<a id="11391" href="/20.07/PUC/2019/Exam/#11336" class="Function">uniq-↑</a> <a id="11398" class="Symbol">(</a><a id="11399" href="/20.07/PUC/2019/Exam/#9512" class="InductiveConstructor">⊢`</a> <a id="11402" href="/20.07/PUC/2019/Exam/#11402" class="Bound">∋x</a><a id="11404" class="Symbol">)</a> <a id="11406" class="Symbol">(</a><a id="11407" href="/20.07/PUC/2019/Exam/#9512" class="InductiveConstructor">⊢`</a> <a id="11410" href="/20.07/PUC/2019/Exam/#11410" class="Bound">∋x′</a><a id="11413" class="Symbol">)</a> <a id="11421" class="Symbol">=</a> <a id="11424" href="/20.07/PUC/2019/Exam/#11067" class="Function">uniq-∋</a> <a id="11431" href="/20.07/PUC/2019/Exam/#11402" class="Bound">∋x</a> <a id="11434" href="/20.07/PUC/2019/Exam/#11410" class="Bound">∋x′</a>
|
||
<a id="11440" href="/20.07/PUC/2019/Exam/#11336" class="Function">uniq-↑</a> <a id="11447" class="Symbol">(</a><a id="11448" href="/20.07/PUC/2019/Exam/#11448" class="Bound">⊢L</a> <a id="11451" href="/20.07/PUC/2019/Exam/#9590" class="InductiveConstructor Operator">·</a> <a id="11453" href="/20.07/PUC/2019/Exam/#11453" class="Bound">⊢M</a><a id="11455" class="Symbol">)</a> <a id="11457" class="Symbol">(</a><a id="11458" href="/20.07/PUC/2019/Exam/#11458" class="Bound">⊢L′</a> <a id="11462" href="/20.07/PUC/2019/Exam/#9590" class="InductiveConstructor Operator">·</a> <a id="11464" href="/20.07/PUC/2019/Exam/#11464" class="Bound">⊢M′</a><a id="11467" class="Symbol">)</a> <a id="11470" class="Symbol">=</a> <a id="11473" href="/20.07/PUC/2019/Exam/#10930" class="Function">rng≡</a> <a id="11478" class="Symbol">(</a><a id="11479" href="/20.07/PUC/2019/Exam/#11336" class="Function">uniq-↑</a> <a id="11486" href="/20.07/PUC/2019/Exam/#11448" class="Bound">⊢L</a> <a id="11489" href="/20.07/PUC/2019/Exam/#11458" class="Bound">⊢L′</a><a id="11492" class="Symbol">)</a>
|
||
<a id="11496" href="/20.07/PUC/2019/Exam/#11336" class="Function">uniq-↑</a> <a id="11503" class="Symbol">(</a><a id="11504" href="/20.07/PUC/2019/Exam/#9699" class="InductiveConstructor">⊢↓</a> <a id="11507" href="/20.07/PUC/2019/Exam/#11507" class="Bound">⊢M</a><a id="11509" class="Symbol">)</a> <a id="11511" class="Symbol">(</a><a id="11512" href="/20.07/PUC/2019/Exam/#9699" class="InductiveConstructor">⊢↓</a> <a id="11515" href="/20.07/PUC/2019/Exam/#11515" class="Bound">⊢M′</a><a id="11518" class="Symbol">)</a> <a id="11526" class="Symbol">=</a> <a id="11529" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a>
|
||
</pre>
|
||
<h2 id="lookup-type-of-a-variable-in-the-context">Lookup type of a variable in the context</h2>
|
||
|
||
<pre class="Agda"> <a id="Problem3.ext∋"></a><a id="11590" href="/20.07/PUC/2019/Exam/#11590" class="Function">ext∋</a> <a id="11595" class="Symbol">:</a> <a id="11597" class="Symbol">∀</a> <a id="11599" class="Symbol">{</a><a id="11600" href="/20.07/PUC/2019/Exam/#11600" class="Bound">Γ</a> <a id="11602" href="/20.07/PUC/2019/Exam/#11602" class="Bound">B</a> <a id="11604" href="/20.07/PUC/2019/Exam/#11604" class="Bound">x</a> <a id="11606" href="/20.07/PUC/2019/Exam/#11606" class="Bound">y</a><a id="11607" class="Symbol">}</a>
|
||
<a id="11613" class="Symbol">→</a> <a id="11615" href="/20.07/PUC/2019/Exam/#11604" class="Bound">x</a> <a id="11617" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.PropositionalEquality.Core.html#799" class="Function Operator">≢</a> <a id="11619" href="/20.07/PUC/2019/Exam/#11606" class="Bound">y</a>
|
||
<a id="11625" class="Symbol">→</a> <a id="11627" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬</a> <a id="11629" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1783" class="Function">∃[</a> <a id="11632" href="/20.07/PUC/2019/Exam/#11632" class="Bound">A</a> <a id="11634" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1783" class="Function">]</a><a id="11635" class="Symbol">(</a> <a id="11637" href="/20.07/PUC/2019/Exam/#11600" class="Bound">Γ</a> <a id="11639" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">∋</a> <a id="11641" href="/20.07/PUC/2019/Exam/#11604" class="Bound">x</a> <a id="11643" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">⦂</a> <a id="11645" href="/20.07/PUC/2019/Exam/#11632" class="Bound">A</a> <a id="11647" class="Symbol">)</a>
|
||
<a id="11655" class="Comment">-----------------------------</a>
|
||
<a id="11689" class="Symbol">→</a> <a id="11691" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬</a> <a id="11693" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1783" class="Function">∃[</a> <a id="11696" href="/20.07/PUC/2019/Exam/#11696" class="Bound">A</a> <a id="11698" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1783" class="Function">]</a><a id="11699" class="Symbol">(</a> <a id="11701" href="/20.07/PUC/2019/Exam/#11600" class="Bound">Γ</a> <a id="11703" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">,</a> <a id="11705" href="/20.07/PUC/2019/Exam/#11606" class="Bound">y</a> <a id="11707" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">⦂</a> <a id="11709" href="/20.07/PUC/2019/Exam/#11602" class="Bound">B</a> <a id="11711" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">∋</a> <a id="11713" href="/20.07/PUC/2019/Exam/#11604" class="Bound">x</a> <a id="11715" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">⦂</a> <a id="11717" href="/20.07/PUC/2019/Exam/#11696" class="Bound">A</a> <a id="11719" class="Symbol">)</a>
|
||
<a id="11723" href="/20.07/PUC/2019/Exam/#11590" class="Function">ext∋</a> <a id="11728" href="/20.07/PUC/2019/Exam/#11728" class="Bound">x≢y</a> <a id="11732" class="Symbol">_</a> <a id="11735" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="11737" href="/20.07/PUC/2019/Exam/#11737" class="Bound">A</a> <a id="11739" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="11741" href="/20.07/PUC/2019/Exam/#9181" class="InductiveConstructor">Z</a> <a id="11743" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="11751" class="Symbol">=</a> <a id="11754" href="/20.07/PUC/2019/Exam/#11728" class="Bound">x≢y</a> <a id="11758" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a>
|
||
<a id="11765" href="/20.07/PUC/2019/Exam/#11590" class="Function">ext∋</a> <a id="11770" class="Symbol">_</a> <a id="11774" href="/20.07/PUC/2019/Exam/#11774" class="Bound">¬∃</a> <a id="11777" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="11779" href="/20.07/PUC/2019/Exam/#11779" class="Bound">A</a> <a id="11781" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="11783" href="/20.07/PUC/2019/Exam/#9255" class="InductiveConstructor">S</a> <a id="11785" class="Symbol">_</a> <a id="11787" href="/20.07/PUC/2019/Exam/#11787" class="Bound">⊢x</a> <a id="11790" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="11793" class="Symbol">=</a> <a id="11796" href="/20.07/PUC/2019/Exam/#11774" class="Bound">¬∃</a> <a id="11799" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="11801" href="/20.07/PUC/2019/Exam/#11779" class="Bound">A</a> <a id="11803" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="11805" href="/20.07/PUC/2019/Exam/#11787" class="Bound">⊢x</a> <a id="11808" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
|
||
<a id="Problem3.lookup"></a><a id="11813" href="/20.07/PUC/2019/Exam/#11813" class="Function">lookup</a> <a id="11820" class="Symbol">:</a> <a id="11822" class="Symbol">∀</a> <a id="11824" class="Symbol">(</a><a id="11825" href="/20.07/PUC/2019/Exam/#11825" class="Bound">Γ</a> <a id="11827" class="Symbol">:</a> <a id="11829" href="/20.07/PUC/2019/Exam/#8485" class="Datatype">Context</a><a id="11836" class="Symbol">)</a> <a id="11838" class="Symbol">(</a><a id="11839" href="/20.07/PUC/2019/Exam/#11839" class="Bound">x</a> <a id="11841" class="Symbol">:</a> <a id="11843" href="/20.07/PUC/2019/Exam/#8432" class="Function">Id</a><a id="11845" class="Symbol">)</a>
|
||
<a id="11853" class="Comment">-----------------------</a>
|
||
<a id="11881" class="Symbol">→</a> <a id="11883" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#605" class="Datatype">Dec</a> <a id="11887" class="Symbol">(</a><a id="11888" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1783" class="Function">∃[</a> <a id="11891" href="/20.07/PUC/2019/Exam/#11891" class="Bound">A</a> <a id="11893" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1783" class="Function">]</a><a id="11894" class="Symbol">(</a><a id="11895" href="/20.07/PUC/2019/Exam/#11825" class="Bound">Γ</a> <a id="11897" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">∋</a> <a id="11899" href="/20.07/PUC/2019/Exam/#11839" class="Bound">x</a> <a id="11901" href="/20.07/PUC/2019/Exam/#9136" class="Datatype Operator">⦂</a> <a id="11903" href="/20.07/PUC/2019/Exam/#11891" class="Bound">A</a><a id="11904" class="Symbol">))</a>
|
||
<a id="11909" href="/20.07/PUC/2019/Exam/#11813" class="Function">lookup</a> <a id="11916" href="/20.07/PUC/2019/Exam/#8509" class="InductiveConstructor">∅</a> <a id="11918" href="/20.07/PUC/2019/Exam/#11918" class="Bound">x</a> <a id="11943" class="Symbol">=</a> <a id="11946" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="11950" class="Symbol">(λ</a> <a id="11953" class="Symbol">())</a>
|
||
<a id="11959" href="/20.07/PUC/2019/Exam/#11813" class="Function">lookup</a> <a id="11966" class="Symbol">(</a><a id="11967" href="/20.07/PUC/2019/Exam/#11967" class="Bound">Γ</a> <a id="11969" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">,</a> <a id="11971" href="/20.07/PUC/2019/Exam/#11971" class="Bound">y</a> <a id="11973" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">⦂</a> <a id="11975" href="/20.07/PUC/2019/Exam/#11975" class="Bound">B</a><a id="11976" class="Symbol">)</a> <a id="11978" href="/20.07/PUC/2019/Exam/#11978" class="Bound">x</a> <a id="11980" class="Keyword">with</a> <a id="11985" href="/20.07/PUC/2019/Exam/#11978" class="Bound">x</a> <a id="11987" href="https://agda.github.io/agda-stdlib/v1.1/Data.String.Properties.html#2569" class="Function Operator">≟</a> <a id="11989" href="/20.07/PUC/2019/Exam/#11971" class="Bound">y</a>
|
||
<a id="11993" class="Symbol">...</a> <a id="11997" class="Symbol">|</a> <a id="11999" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="12003" href="Agda.Builtin.Equality.html#182" class="InductiveConstructor">refl</a> <a id="12027" class="Symbol">=</a> <a id="12030" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="12034" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12036" class="Bound">B</a> <a id="12038" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12040" href="/20.07/PUC/2019/Exam/#9181" class="InductiveConstructor">Z</a> <a id="12042" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="12046" class="Symbol">...</a> <a id="12050" class="Symbol">|</a> <a id="12052" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="12055" href="/20.07/PUC/2019/Exam/#12055" class="Bound">x≢y</a> <a id="12059" class="Keyword">with</a> <a id="12064" href="/20.07/PUC/2019/Exam/#11813" class="Function">lookup</a> <a id="12071" class="Bound">Γ</a> <a id="12073" class="Bound">x</a>
|
||
<a id="12077" class="Symbol">...</a> <a id="12093" class="Symbol">|</a> <a id="12095" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="12099" href="/20.07/PUC/2019/Exam/#12099" class="Bound">¬∃</a> <a id="12111" class="Symbol">=</a> <a id="12114" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="12118" class="Symbol">(</a><a id="12119" href="/20.07/PUC/2019/Exam/#11590" class="Function">ext∋</a> <a id="12124" class="Bound">x≢y</a> <a id="12128" href="/20.07/PUC/2019/Exam/#12099" class="Bound">¬∃</a><a id="12130" class="Symbol">)</a>
|
||
<a id="12134" class="Symbol">...</a> <a id="12150" class="Symbol">|</a> <a id="12152" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="12156" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12158" href="/20.07/PUC/2019/Exam/#12158" class="Bound">A</a> <a id="12160" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12162" href="/20.07/PUC/2019/Exam/#12162" class="Bound">⊢x</a> <a id="12165" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="12168" class="Symbol">=</a> <a id="12171" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="12175" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12177" href="/20.07/PUC/2019/Exam/#12158" class="Bound">A</a> <a id="12179" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12181" href="/20.07/PUC/2019/Exam/#9255" class="InductiveConstructor">S</a> <a id="12183" class="Bound">x≢y</a> <a id="12187" href="/20.07/PUC/2019/Exam/#12162" class="Bound">⊢x</a> <a id="12190" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
</pre>
|
||
<h3 id="promoting-negations">Promoting negations</h3>
|
||
|
||
<pre class="Agda"> <a id="Problem3.¬arg"></a><a id="12228" href="/20.07/PUC/2019/Exam/#12228" class="Function">¬arg</a> <a id="12233" class="Symbol">:</a> <a id="12235" class="Symbol">∀</a> <a id="12237" class="Symbol">{</a><a id="12238" href="/20.07/PUC/2019/Exam/#12238" class="Bound">Γ</a> <a id="12240" href="/20.07/PUC/2019/Exam/#12240" class="Bound">A</a> <a id="12242" href="/20.07/PUC/2019/Exam/#12242" class="Bound">B</a> <a id="12244" href="/20.07/PUC/2019/Exam/#12244" class="Bound">L</a> <a id="12246" href="/20.07/PUC/2019/Exam/#12246" class="Bound">M</a><a id="12247" class="Symbol">}</a>
|
||
<a id="12253" class="Symbol">→</a> <a id="12255" href="/20.07/PUC/2019/Exam/#12238" class="Bound">Γ</a> <a id="12257" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">⊢</a> <a id="12259" href="/20.07/PUC/2019/Exam/#12244" class="Bound">L</a> <a id="12261" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">↑</a> <a id="12263" href="/20.07/PUC/2019/Exam/#12240" class="Bound">A</a> <a id="12265" href="/20.07/PUC/2019/Exam/#8360" class="InductiveConstructor Operator">⇒</a> <a id="12267" href="/20.07/PUC/2019/Exam/#12242" class="Bound">B</a>
|
||
<a id="12273" class="Symbol">→</a> <a id="12275" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬</a> <a id="12277" href="/20.07/PUC/2019/Exam/#12238" class="Bound">Γ</a> <a id="12279" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">⊢</a> <a id="12281" href="/20.07/PUC/2019/Exam/#12246" class="Bound">M</a> <a id="12283" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">↓</a> <a id="12285" href="/20.07/PUC/2019/Exam/#12240" class="Bound">A</a>
|
||
<a id="12293" class="Comment">-------------------------</a>
|
||
<a id="12323" class="Symbol">→</a> <a id="12325" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬</a> <a id="12327" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1783" class="Function">∃[</a> <a id="12330" href="/20.07/PUC/2019/Exam/#12330" class="Bound">B′</a> <a id="12333" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1783" class="Function">]</a><a id="12334" class="Symbol">(</a><a id="12335" href="/20.07/PUC/2019/Exam/#12238" class="Bound">Γ</a> <a id="12337" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">⊢</a> <a id="12339" href="/20.07/PUC/2019/Exam/#12244" class="Bound">L</a> <a id="12341" href="/20.07/PUC/2019/Exam/#8692" class="InductiveConstructor Operator">·</a> <a id="12343" href="/20.07/PUC/2019/Exam/#12246" class="Bound">M</a> <a id="12345" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">↑</a> <a id="12347" href="/20.07/PUC/2019/Exam/#12330" class="Bound">B′</a><a id="12349" class="Symbol">)</a>
|
||
<a id="12353" href="/20.07/PUC/2019/Exam/#12228" class="Function">¬arg</a> <a id="12358" href="/20.07/PUC/2019/Exam/#12358" class="Bound">⊢L</a> <a id="12361" href="/20.07/PUC/2019/Exam/#12361" class="Bound">¬⊢M</a> <a id="12365" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12367" href="/20.07/PUC/2019/Exam/#12367" class="Bound">B′</a> <a id="12370" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12372" href="/20.07/PUC/2019/Exam/#12372" class="Bound">⊢L′</a> <a id="12376" href="/20.07/PUC/2019/Exam/#9590" class="InductiveConstructor Operator">·</a> <a id="12378" href="/20.07/PUC/2019/Exam/#12378" class="Bound">⊢M′</a> <a id="12382" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="12384" class="Keyword">rewrite</a> <a id="12392" href="/20.07/PUC/2019/Exam/#10860" class="Function">dom≡</a> <a id="12397" class="Symbol">(</a><a id="12398" href="/20.07/PUC/2019/Exam/#11336" class="Function">uniq-↑</a> <a id="12405" href="/20.07/PUC/2019/Exam/#12358" class="Bound">⊢L</a> <a id="12408" href="/20.07/PUC/2019/Exam/#12372" class="Bound">⊢L′</a><a id="12411" class="Symbol">)</a> <a id="12413" class="Symbol">=</a> <a id="12415" href="/20.07/PUC/2019/Exam/#12361" class="Bound">¬⊢M</a> <a id="12419" href="/20.07/PUC/2019/Exam/#12378" class="Bound">⊢M′</a>
|
||
|
||
<a id="Problem3.¬switch"></a><a id="12426" href="/20.07/PUC/2019/Exam/#12426" class="Function">¬switch</a> <a id="12434" class="Symbol">:</a> <a id="12436" class="Symbol">∀</a> <a id="12438" class="Symbol">{</a><a id="12439" href="/20.07/PUC/2019/Exam/#12439" class="Bound">Γ</a> <a id="12441" href="/20.07/PUC/2019/Exam/#12441" class="Bound">M</a> <a id="12443" href="/20.07/PUC/2019/Exam/#12443" class="Bound">A</a> <a id="12445" href="/20.07/PUC/2019/Exam/#12445" class="Bound">B</a><a id="12446" class="Symbol">}</a>
|
||
<a id="12452" class="Symbol">→</a> <a id="12454" href="/20.07/PUC/2019/Exam/#12439" class="Bound">Γ</a> <a id="12456" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">⊢</a> <a id="12458" href="/20.07/PUC/2019/Exam/#12441" class="Bound">M</a> <a id="12460" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">↑</a> <a id="12462" href="/20.07/PUC/2019/Exam/#12443" class="Bound">A</a>
|
||
<a id="12468" class="Symbol">→</a> <a id="12470" href="/20.07/PUC/2019/Exam/#12443" class="Bound">A</a> <a id="12472" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Binary.PropositionalEquality.Core.html#799" class="Function Operator">≢</a> <a id="12474" href="/20.07/PUC/2019/Exam/#12445" class="Bound">B</a>
|
||
<a id="12482" class="Comment">---------------</a>
|
||
<a id="12502" class="Symbol">→</a> <a id="12504" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#535" class="Function Operator">¬</a> <a id="12506" href="/20.07/PUC/2019/Exam/#12439" class="Bound">Γ</a> <a id="12508" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">⊢</a> <a id="12510" class="Symbol">(</a><a id="12511" href="/20.07/PUC/2019/Exam/#12441" class="Bound">M</a> <a id="12513" href="/20.07/PUC/2019/Exam/#9067" class="InductiveConstructor Operator">↑</a><a id="12514" class="Symbol">)</a> <a id="12516" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">↓</a> <a id="12518" href="/20.07/PUC/2019/Exam/#12445" class="Bound">B</a>
|
||
<a id="12522" href="/20.07/PUC/2019/Exam/#12426" class="Function">¬switch</a> <a id="12530" href="/20.07/PUC/2019/Exam/#12530" class="Bound">⊢M</a> <a id="12533" href="/20.07/PUC/2019/Exam/#12533" class="Bound">A≢B</a> <a id="12537" class="Symbol">(</a><a id="12538" href="/20.07/PUC/2019/Exam/#10346" class="InductiveConstructor">⊢↑</a> <a id="12541" href="/20.07/PUC/2019/Exam/#12541" class="Bound">⊢M′</a> <a id="12545" href="/20.07/PUC/2019/Exam/#12545" class="Bound">A′≡B</a><a id="12549" class="Symbol">)</a> <a id="12551" class="Keyword">rewrite</a> <a id="12559" href="/20.07/PUC/2019/Exam/#11336" class="Function">uniq-↑</a> <a id="12566" href="/20.07/PUC/2019/Exam/#12530" class="Bound">⊢M</a> <a id="12569" href="/20.07/PUC/2019/Exam/#12541" class="Bound">⊢M′</a> <a id="12573" class="Symbol">=</a> <a id="12575" href="/20.07/PUC/2019/Exam/#12533" class="Bound">A≢B</a> <a id="12579" href="/20.07/PUC/2019/Exam/#12545" class="Bound">A′≡B</a>
|
||
</pre>
|
||
|
||
<h2 id="synthesize-and-inherit-types">Synthesize and inherit types</h2>
|
||
|
||
<pre class="Agda"> <a id="Problem3.synthesize"></a><a id="12629" href="/20.07/PUC/2019/Exam/#12629" class="Function">synthesize</a> <a id="12640" class="Symbol">:</a> <a id="12642" class="Symbol">∀</a> <a id="12644" class="Symbol">(</a><a id="12645" href="/20.07/PUC/2019/Exam/#12645" class="Bound">Γ</a> <a id="12647" class="Symbol">:</a> <a id="12649" href="/20.07/PUC/2019/Exam/#8485" class="Datatype">Context</a><a id="12656" class="Symbol">)</a> <a id="12658" class="Symbol">(</a><a id="12659" href="/20.07/PUC/2019/Exam/#12659" class="Bound">M</a> <a id="12661" class="Symbol">:</a> <a id="12663" href="/20.07/PUC/2019/Exam/#8594" class="Datatype">Term⁺</a><a id="12668" class="Symbol">)</a>
|
||
<a id="12676" class="Comment">-----------------------</a>
|
||
<a id="12704" class="Symbol">→</a> <a id="12706" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#605" class="Datatype">Dec</a> <a id="12710" class="Symbol">(</a><a id="12711" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1783" class="Function">∃[</a> <a id="12714" href="/20.07/PUC/2019/Exam/#12714" class="Bound">A</a> <a id="12716" href="https://agda.github.io/agda-stdlib/v1.1/Data.Product.html#1783" class="Function">]</a><a id="12717" class="Symbol">(</a><a id="12718" href="/20.07/PUC/2019/Exam/#12645" class="Bound">Γ</a> <a id="12720" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">⊢</a> <a id="12722" href="/20.07/PUC/2019/Exam/#12659" class="Bound">M</a> <a id="12724" href="/20.07/PUC/2019/Exam/#9406" class="Datatype Operator">↑</a> <a id="12726" href="/20.07/PUC/2019/Exam/#12714" class="Bound">A</a><a id="12727" class="Symbol">))</a>
|
||
|
||
<a id="Problem3.inherit"></a><a id="12733" href="/20.07/PUC/2019/Exam/#12733" class="Function">inherit</a> <a id="12741" class="Symbol">:</a> <a id="12743" class="Symbol">∀</a> <a id="12745" class="Symbol">(</a><a id="12746" href="/20.07/PUC/2019/Exam/#12746" class="Bound">Γ</a> <a id="12748" class="Symbol">:</a> <a id="12750" href="/20.07/PUC/2019/Exam/#8485" class="Datatype">Context</a><a id="12757" class="Symbol">)</a> <a id="12759" class="Symbol">(</a><a id="12760" href="/20.07/PUC/2019/Exam/#12760" class="Bound">M</a> <a id="12762" class="Symbol">:</a> <a id="12764" href="/20.07/PUC/2019/Exam/#8613" class="Datatype">Term⁻</a><a id="12769" class="Symbol">)</a> <a id="12771" class="Symbol">(</a><a id="12772" href="/20.07/PUC/2019/Exam/#12772" class="Bound">A</a> <a id="12774" class="Symbol">:</a> <a id="12776" href="/20.07/PUC/2019/Exam/#8339" class="Datatype">Type</a><a id="12780" class="Symbol">)</a>
|
||
<a id="12788" class="Comment">---------------</a>
|
||
<a id="12808" class="Symbol">→</a> <a id="12810" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#605" class="Datatype">Dec</a> <a id="12814" class="Symbol">(</a><a id="12815" href="/20.07/PUC/2019/Exam/#12746" class="Bound">Γ</a> <a id="12817" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">⊢</a> <a id="12819" href="/20.07/PUC/2019/Exam/#12760" class="Bound">M</a> <a id="12821" href="/20.07/PUC/2019/Exam/#9450" class="Datatype Operator">↓</a> <a id="12823" href="/20.07/PUC/2019/Exam/#12772" class="Bound">A</a><a id="12824" class="Symbol">)</a>
|
||
|
||
<a id="12829" href="/20.07/PUC/2019/Exam/#12629" class="Function">synthesize</a> <a id="12840" href="/20.07/PUC/2019/Exam/#12840" class="Bound">Γ</a> <a id="12842" class="Symbol">(</a><a id="12843" href="/20.07/PUC/2019/Exam/#8649" class="InductiveConstructor Operator">`</a> <a id="12845" href="/20.07/PUC/2019/Exam/#12845" class="Bound">x</a><a id="12846" class="Symbol">)</a> <a id="12848" class="Keyword">with</a> <a id="12853" href="/20.07/PUC/2019/Exam/#11813" class="Function">lookup</a> <a id="12860" href="/20.07/PUC/2019/Exam/#12840" class="Bound">Γ</a> <a id="12862" href="/20.07/PUC/2019/Exam/#12845" class="Bound">x</a>
|
||
<a id="12866" class="Symbol">...</a> <a id="12870" class="Symbol">|</a> <a id="12872" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="12876" href="/20.07/PUC/2019/Exam/#12876" class="Bound">¬∃</a> <a id="12892" class="Symbol">=</a> <a id="12895" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="12899" class="Symbol">(λ{</a> <a id="12903" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12905" href="/20.07/PUC/2019/Exam/#12905" class="Bound">A</a> <a id="12907" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12909" href="/20.07/PUC/2019/Exam/#9512" class="InductiveConstructor">⊢`</a> <a id="12912" href="/20.07/PUC/2019/Exam/#12912" class="Bound">∋x</a> <a id="12915" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="12917" class="Symbol">→</a> <a id="12919" href="/20.07/PUC/2019/Exam/#12876" class="Bound">¬∃</a> <a id="12922" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12924" href="/20.07/PUC/2019/Exam/#12905" class="Bound">A</a> <a id="12926" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12928" href="/20.07/PUC/2019/Exam/#12912" class="Bound">∋x</a> <a id="12931" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="12933" class="Symbol">})</a>
|
||
<a id="12938" class="Symbol">...</a> <a id="12942" class="Symbol">|</a> <a id="12944" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="12948" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12950" href="/20.07/PUC/2019/Exam/#12950" class="Bound">A</a> <a id="12952" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12954" href="/20.07/PUC/2019/Exam/#12954" class="Bound">∋x</a> <a id="12957" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="12964" class="Symbol">=</a> <a id="12967" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="12971" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="12973" href="/20.07/PUC/2019/Exam/#12950" class="Bound">A</a> <a id="12975" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="12977" href="/20.07/PUC/2019/Exam/#9512" class="InductiveConstructor">⊢`</a> <a id="12980" href="/20.07/PUC/2019/Exam/#12954" class="Bound">∋x</a> <a id="12983" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="12987" href="/20.07/PUC/2019/Exam/#12629" class="Function">synthesize</a> <a id="12998" href="/20.07/PUC/2019/Exam/#12998" class="Bound">Γ</a> <a id="13000" class="Symbol">(</a><a id="13001" href="/20.07/PUC/2019/Exam/#13001" class="Bound">L</a> <a id="13003" href="/20.07/PUC/2019/Exam/#8692" class="InductiveConstructor Operator">·</a> <a id="13005" href="/20.07/PUC/2019/Exam/#13005" class="Bound">M</a><a id="13006" class="Symbol">)</a> <a id="13008" class="Keyword">with</a> <a id="13013" href="/20.07/PUC/2019/Exam/#12629" class="Function">synthesize</a> <a id="13024" href="/20.07/PUC/2019/Exam/#12998" class="Bound">Γ</a> <a id="13026" href="/20.07/PUC/2019/Exam/#13001" class="Bound">L</a>
|
||
<a id="13030" class="Symbol">...</a> <a id="13034" class="Symbol">|</a> <a id="13036" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="13040" href="/20.07/PUC/2019/Exam/#13040" class="Bound">¬∃</a> <a id="13056" class="Symbol">=</a> <a id="13059" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="13063" class="Symbol">(λ{</a> <a id="13067" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="13069" class="Symbol">_</a> <a id="13071" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="13073" href="/20.07/PUC/2019/Exam/#13073" class="Bound">⊢L</a> <a id="13077" href="/20.07/PUC/2019/Exam/#9590" class="InductiveConstructor Operator">·</a> <a id="13079" class="Symbol">_</a> <a id="13082" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="13085" class="Symbol">→</a> <a id="13088" href="/20.07/PUC/2019/Exam/#13040" class="Bound">¬∃</a> <a id="13091" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="13093" class="Symbol">_</a> <a id="13095" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="13097" href="/20.07/PUC/2019/Exam/#13073" class="Bound">⊢L</a> <a id="13100" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="13102" class="Symbol">})</a>
|
||
<a id="13107" class="Symbol">...</a> <a id="13111" class="Symbol">|</a> <a id="13113" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="13117" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="13119" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a> <a id="13122" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="13127" href="/20.07/PUC/2019/Exam/#13127" class="Bound">⊢L</a> <a id="13130" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="13133" class="Symbol">=</a> <a id="13136" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="13140" class="Symbol">(λ{</a> <a id="13144" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="13146" class="Symbol">_</a> <a id="13148" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="13150" href="/20.07/PUC/2019/Exam/#13150" class="Bound">⊢L′</a> <a id="13154" href="/20.07/PUC/2019/Exam/#9590" class="InductiveConstructor Operator">·</a> <a id="13156" class="Symbol">_</a> <a id="13159" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="13162" class="Symbol">→</a> <a id="13165" href="/20.07/PUC/2019/Exam/#11000" class="Function">ℕ≢⇒</a> <a id="13169" class="Symbol">(</a><a id="13170" href="/20.07/PUC/2019/Exam/#11336" class="Function">uniq-↑</a> <a id="13177" href="/20.07/PUC/2019/Exam/#13127" class="Bound">⊢L</a> <a id="13180" href="/20.07/PUC/2019/Exam/#13150" class="Bound">⊢L′</a><a id="13183" class="Symbol">)</a> <a id="13185" class="Symbol">})</a>
|
||
<a id="13190" class="Symbol">...</a> <a id="13194" class="Symbol">|</a> <a id="13196" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="13200" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="13202" href="/20.07/PUC/2019/Exam/#13202" class="Bound">A</a> <a id="13204" href="/20.07/PUC/2019/Exam/#8360" class="InductiveConstructor Operator">⇒</a> <a id="13206" href="/20.07/PUC/2019/Exam/#13206" class="Bound">B</a> <a id="13208" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="13210" href="/20.07/PUC/2019/Exam/#13210" class="Bound">⊢L</a> <a id="13213" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="13215" class="Keyword">with</a> <a id="13220" href="/20.07/PUC/2019/Exam/#12733" class="Function">inherit</a> <a id="13228" class="Bound">Γ</a> <a id="13230" class="Bound">M</a> <a id="13232" href="/20.07/PUC/2019/Exam/#13202" class="Bound">A</a>
|
||
<a id="13236" class="Symbol">...</a> <a id="13243" class="Symbol">|</a> <a id="13245" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="13249" href="/20.07/PUC/2019/Exam/#13249" class="Bound">¬⊢M</a> <a id="13262" class="Symbol">=</a> <a id="13265" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="13269" class="Symbol">(</a><a id="13270" href="/20.07/PUC/2019/Exam/#12228" class="Function">¬arg</a> <a id="13275" class="Bound">⊢L</a> <a id="13278" href="/20.07/PUC/2019/Exam/#13249" class="Bound">¬⊢M</a><a id="13281" class="Symbol">)</a>
|
||
<a id="13285" class="Symbol">...</a> <a id="13292" class="Symbol">|</a> <a id="13294" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="13298" href="/20.07/PUC/2019/Exam/#13298" class="Bound">⊢M</a> <a id="13311" class="Symbol">=</a> <a id="13314" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="13318" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="13320" class="Bound">B</a> <a id="13322" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="13324" class="Bound">⊢L</a> <a id="13327" href="/20.07/PUC/2019/Exam/#9590" class="InductiveConstructor Operator">·</a> <a id="13329" href="/20.07/PUC/2019/Exam/#13298" class="Bound">⊢M</a> <a id="13332" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
<a id="13336" href="/20.07/PUC/2019/Exam/#12629" class="Function">synthesize</a> <a id="13347" href="/20.07/PUC/2019/Exam/#13347" class="Bound">Γ</a> <a id="13349" class="Symbol">(</a><a id="13350" href="/20.07/PUC/2019/Exam/#13350" class="Bound">M</a> <a id="13352" href="/20.07/PUC/2019/Exam/#8746" class="InductiveConstructor Operator">↓</a> <a id="13354" href="/20.07/PUC/2019/Exam/#13354" class="Bound">A</a><a id="13355" class="Symbol">)</a> <a id="13357" class="Keyword">with</a> <a id="13362" href="/20.07/PUC/2019/Exam/#12733" class="Function">inherit</a> <a id="13370" href="/20.07/PUC/2019/Exam/#13347" class="Bound">Γ</a> <a id="13372" href="/20.07/PUC/2019/Exam/#13350" class="Bound">M</a> <a id="13374" href="/20.07/PUC/2019/Exam/#13354" class="Bound">A</a>
|
||
<a id="13378" class="Symbol">...</a> <a id="13382" class="Symbol">|</a> <a id="13384" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="13388" href="/20.07/PUC/2019/Exam/#13388" class="Bound">¬⊢M</a> <a id="13404" class="Symbol">=</a> <a id="13407" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="13411" class="Symbol">(λ{</a> <a id="13415" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="13417" class="Symbol">_</a> <a id="13419" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="13421" href="/20.07/PUC/2019/Exam/#9699" class="InductiveConstructor">⊢↓</a> <a id="13424" href="/20.07/PUC/2019/Exam/#13424" class="Bound">⊢M</a> <a id="13427" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="13430" class="Symbol">→</a> <a id="13433" href="/20.07/PUC/2019/Exam/#13388" class="Bound">¬⊢M</a> <a id="13437" href="/20.07/PUC/2019/Exam/#13424" class="Bound">⊢M</a> <a id="13440" class="Symbol">})</a>
|
||
<a id="13445" class="Symbol">...</a> <a id="13449" class="Symbol">|</a> <a id="13451" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="13455" href="/20.07/PUC/2019/Exam/#13455" class="Bound">⊢M</a> <a id="13471" class="Symbol">=</a> <a id="13474" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="13478" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="13480" class="Bound">A</a> <a id="13482" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="13484" href="/20.07/PUC/2019/Exam/#9699" class="InductiveConstructor">⊢↓</a> <a id="13487" href="/20.07/PUC/2019/Exam/#13455" class="Bound">⊢M</a> <a id="13490" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a>
|
||
|
||
<a id="13495" href="/20.07/PUC/2019/Exam/#12733" class="Function">inherit</a> <a id="13503" href="/20.07/PUC/2019/Exam/#13503" class="Bound">Γ</a> <a id="13505" class="Symbol">(</a><a id="13506" href="/20.07/PUC/2019/Exam/#8819" class="InductiveConstructor Operator">ƛ</a> <a id="13508" href="/20.07/PUC/2019/Exam/#13508" class="Bound">x</a> <a id="13510" href="/20.07/PUC/2019/Exam/#8819" class="InductiveConstructor Operator">⇒</a> <a id="13512" href="/20.07/PUC/2019/Exam/#13512" class="Bound">N</a><a id="13513" class="Symbol">)</a> <a id="13515" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a> <a id="13523" class="Symbol">=</a> <a id="13526" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="13530" class="Symbol">(λ())</a>
|
||
<a id="13538" href="/20.07/PUC/2019/Exam/#12733" class="Function">inherit</a> <a id="13546" href="/20.07/PUC/2019/Exam/#13546" class="Bound">Γ</a> <a id="13548" class="Symbol">(</a><a id="13549" href="/20.07/PUC/2019/Exam/#8819" class="InductiveConstructor Operator">ƛ</a> <a id="13551" href="/20.07/PUC/2019/Exam/#13551" class="Bound">x</a> <a id="13553" href="/20.07/PUC/2019/Exam/#8819" class="InductiveConstructor Operator">⇒</a> <a id="13555" href="/20.07/PUC/2019/Exam/#13555" class="Bound">N</a><a id="13556" class="Symbol">)</a> <a id="13558" class="Symbol">(</a><a id="13559" href="/20.07/PUC/2019/Exam/#13559" class="Bound">A</a> <a id="13561" href="/20.07/PUC/2019/Exam/#8360" class="InductiveConstructor Operator">⇒</a> <a id="13563" href="/20.07/PUC/2019/Exam/#13563" class="Bound">B</a><a id="13564" class="Symbol">)</a> <a id="13566" class="Keyword">with</a> <a id="13571" href="/20.07/PUC/2019/Exam/#12733" class="Function">inherit</a> <a id="13579" class="Symbol">(</a><a id="13580" href="/20.07/PUC/2019/Exam/#13546" class="Bound">Γ</a> <a id="13582" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">,</a> <a id="13584" href="/20.07/PUC/2019/Exam/#13551" class="Bound">x</a> <a id="13586" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">⦂</a> <a id="13588" href="/20.07/PUC/2019/Exam/#13559" class="Bound">A</a><a id="13589" class="Symbol">)</a> <a id="13591" href="/20.07/PUC/2019/Exam/#13555" class="Bound">N</a> <a id="13593" href="/20.07/PUC/2019/Exam/#13563" class="Bound">B</a>
|
||
<a id="13597" class="Symbol">...</a> <a id="13601" class="Symbol">|</a> <a id="13603" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="13606" href="/20.07/PUC/2019/Exam/#13606" class="Bound">¬⊢N</a> <a id="13625" class="Symbol">=</a> <a id="13628" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="13632" class="Symbol">(λ{</a> <a id="13636" class="Symbol">(</a><a id="13637" href="/20.07/PUC/2019/Exam/#9805" class="InductiveConstructor">⊢ƛ</a> <a id="13640" href="/20.07/PUC/2019/Exam/#13640" class="Bound">⊢N</a><a id="13642" class="Symbol">)</a> <a id="13645" class="Symbol">→</a> <a id="13648" href="/20.07/PUC/2019/Exam/#13606" class="Bound">¬⊢N</a> <a id="13652" href="/20.07/PUC/2019/Exam/#13640" class="Bound">⊢N</a> <a id="13655" class="Symbol">})</a>
|
||
<a id="13660" class="Symbol">...</a> <a id="13664" class="Symbol">|</a> <a id="13666" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="13670" href="/20.07/PUC/2019/Exam/#13670" class="Bound">⊢N</a> <a id="13688" class="Symbol">=</a> <a id="13691" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="13695" class="Symbol">(</a><a id="13696" href="/20.07/PUC/2019/Exam/#9805" class="InductiveConstructor">⊢ƛ</a> <a id="13699" href="/20.07/PUC/2019/Exam/#13670" class="Bound">⊢N</a><a id="13701" class="Symbol">)</a>
|
||
<a id="13705" href="/20.07/PUC/2019/Exam/#12733" class="Function">inherit</a> <a id="13713" href="/20.07/PUC/2019/Exam/#13713" class="Bound">Γ</a> <a id="13715" href="/20.07/PUC/2019/Exam/#8869" class="InductiveConstructor">`zero</a> <a id="13721" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a> <a id="13733" class="Symbol">=</a> <a id="13736" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="13740" href="/20.07/PUC/2019/Exam/#9911" class="InductiveConstructor">⊢zero</a>
|
||
<a id="13748" href="/20.07/PUC/2019/Exam/#12733" class="Function">inherit</a> <a id="13756" href="/20.07/PUC/2019/Exam/#13756" class="Bound">Γ</a> <a id="13758" href="/20.07/PUC/2019/Exam/#8869" class="InductiveConstructor">`zero</a> <a id="13764" class="Symbol">(</a><a id="13765" href="/20.07/PUC/2019/Exam/#13765" class="Bound">A</a> <a id="13767" href="/20.07/PUC/2019/Exam/#8360" class="InductiveConstructor Operator">⇒</a> <a id="13769" href="/20.07/PUC/2019/Exam/#13769" class="Bound">B</a><a id="13770" class="Symbol">)</a> <a id="13776" class="Symbol">=</a> <a id="13779" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="13783" class="Symbol">(λ())</a>
|
||
<a id="13791" href="/20.07/PUC/2019/Exam/#12733" class="Function">inherit</a> <a id="13799" href="/20.07/PUC/2019/Exam/#13799" class="Bound">Γ</a> <a id="13801" class="Symbol">(</a><a id="13802" href="/20.07/PUC/2019/Exam/#8906" class="InductiveConstructor Operator">`suc</a> <a id="13807" href="/20.07/PUC/2019/Exam/#13807" class="Bound">M</a><a id="13808" class="Symbol">)</a> <a id="13810" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a> <a id="13813" class="Keyword">with</a> <a id="13818" href="/20.07/PUC/2019/Exam/#12733" class="Function">inherit</a> <a id="13826" href="/20.07/PUC/2019/Exam/#13799" class="Bound">Γ</a> <a id="13828" href="/20.07/PUC/2019/Exam/#13807" class="Bound">M</a> <a id="13830" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a>
|
||
<a id="13835" class="Symbol">...</a> <a id="13839" class="Symbol">|</a> <a id="13841" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="13844" href="/20.07/PUC/2019/Exam/#13844" class="Bound">¬⊢M</a> <a id="13863" class="Symbol">=</a> <a id="13866" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="13870" class="Symbol">(λ{</a> <a id="13874" class="Symbol">(</a><a id="13875" href="/20.07/PUC/2019/Exam/#9976" class="InductiveConstructor">⊢suc</a> <a id="13880" href="/20.07/PUC/2019/Exam/#13880" class="Bound">⊢M</a><a id="13882" class="Symbol">)</a> <a id="13885" class="Symbol">→</a> <a id="13888" href="/20.07/PUC/2019/Exam/#13844" class="Bound">¬⊢M</a> <a id="13892" href="/20.07/PUC/2019/Exam/#13880" class="Bound">⊢M</a> <a id="13895" class="Symbol">})</a>
|
||
<a id="13900" class="Symbol">...</a> <a id="13904" class="Symbol">|</a> <a id="13906" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="13910" href="/20.07/PUC/2019/Exam/#13910" class="Bound">⊢M</a> <a id="13928" class="Symbol">=</a> <a id="13931" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="13935" class="Symbol">(</a><a id="13936" href="/20.07/PUC/2019/Exam/#9976" class="InductiveConstructor">⊢suc</a> <a id="13941" href="/20.07/PUC/2019/Exam/#13910" class="Bound">⊢M</a><a id="13943" class="Symbol">)</a>
|
||
<a id="13947" href="/20.07/PUC/2019/Exam/#12733" class="Function">inherit</a> <a id="13955" href="/20.07/PUC/2019/Exam/#13955" class="Bound">Γ</a> <a id="13957" class="Symbol">(</a><a id="13958" href="/20.07/PUC/2019/Exam/#8906" class="InductiveConstructor Operator">`suc</a> <a id="13963" href="/20.07/PUC/2019/Exam/#13963" class="Bound">M</a><a id="13964" class="Symbol">)</a> <a id="13966" class="Symbol">(</a><a id="13967" href="/20.07/PUC/2019/Exam/#13967" class="Bound">A</a> <a id="13969" href="/20.07/PUC/2019/Exam/#8360" class="InductiveConstructor Operator">⇒</a> <a id="13971" href="/20.07/PUC/2019/Exam/#13971" class="Bound">B</a><a id="13972" class="Symbol">)</a> <a id="13975" class="Symbol">=</a> <a id="13978" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="13982" class="Symbol">(λ())</a>
|
||
<a id="13990" href="/20.07/PUC/2019/Exam/#12733" class="Function">inherit</a> <a id="13998" href="/20.07/PUC/2019/Exam/#13998" class="Bound">Γ</a> <a id="14000" class="Symbol">(</a><a id="14001" href="/20.07/PUC/2019/Exam/#8951" class="InductiveConstructor Operator">`case</a> <a id="14007" href="/20.07/PUC/2019/Exam/#14007" class="Bound">L</a> <a id="14009" href="/20.07/PUC/2019/Exam/#8951" class="InductiveConstructor Operator">[zero⇒</a> <a id="14016" href="/20.07/PUC/2019/Exam/#14016" class="Bound">M</a> <a id="14018" href="/20.07/PUC/2019/Exam/#8951" class="InductiveConstructor Operator">|suc</a> <a id="14023" href="/20.07/PUC/2019/Exam/#14023" class="Bound">x</a> <a id="14025" href="/20.07/PUC/2019/Exam/#8951" class="InductiveConstructor Operator">⇒</a> <a id="14027" href="/20.07/PUC/2019/Exam/#14027" class="Bound">N</a> <a id="14029" href="/20.07/PUC/2019/Exam/#8951" class="InductiveConstructor Operator">]</a><a id="14030" class="Symbol">)</a> <a id="14032" href="/20.07/PUC/2019/Exam/#14032" class="Bound">A</a> <a id="14034" class="Keyword">with</a> <a id="14039" href="/20.07/PUC/2019/Exam/#12629" class="Function">synthesize</a> <a id="14050" href="/20.07/PUC/2019/Exam/#13998" class="Bound">Γ</a> <a id="14052" href="/20.07/PUC/2019/Exam/#14007" class="Bound">L</a>
|
||
<a id="14056" class="Symbol">...</a> <a id="14060" class="Symbol">|</a> <a id="14062" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="14065" href="/20.07/PUC/2019/Exam/#14065" class="Bound">¬∃</a> <a id="14084" class="Symbol">=</a> <a id="14087" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="14091" class="Symbol">(λ{</a> <a id="14095" class="Symbol">(</a><a id="14096" href="/20.07/PUC/2019/Exam/#10063" class="InductiveConstructor">⊢case</a> <a id="14102" href="/20.07/PUC/2019/Exam/#14102" class="Bound">⊢L</a> <a id="14106" class="Symbol">_</a> <a id="14108" class="Symbol">_)</a> <a id="14111" class="Symbol">→</a> <a id="14113" href="/20.07/PUC/2019/Exam/#14065" class="Bound">¬∃</a> <a id="14116" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="14118" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a> <a id="14121" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="14123" href="/20.07/PUC/2019/Exam/#14102" class="Bound">⊢L</a> <a id="14126" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a><a id="14127" class="Symbol">})</a>
|
||
<a id="14132" class="Symbol">...</a> <a id="14136" class="Symbol">|</a> <a id="14138" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="14142" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="14144" class="Symbol">_</a> <a id="14146" href="/20.07/PUC/2019/Exam/#8360" class="InductiveConstructor Operator">⇒</a> <a id="14148" class="Symbol">_</a> <a id="14150" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="14152" href="/20.07/PUC/2019/Exam/#14152" class="Bound">⊢L</a> <a id="14155" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="14160" class="Symbol">=</a> <a id="14163" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="14167" class="Symbol">(λ{</a> <a id="14171" class="Symbol">(</a><a id="14172" href="/20.07/PUC/2019/Exam/#10063" class="InductiveConstructor">⊢case</a> <a id="14178" href="/20.07/PUC/2019/Exam/#14178" class="Bound">⊢L′</a> <a id="14182" class="Symbol">_</a> <a id="14184" class="Symbol">_)</a> <a id="14187" class="Symbol">→</a> <a id="14189" href="/20.07/PUC/2019/Exam/#11000" class="Function">ℕ≢⇒</a> <a id="14193" class="Symbol">(</a><a id="14194" href="/20.07/PUC/2019/Exam/#11336" class="Function">uniq-↑</a> <a id="14201" href="/20.07/PUC/2019/Exam/#14178" class="Bound">⊢L′</a> <a id="14205" href="/20.07/PUC/2019/Exam/#14152" class="Bound">⊢L</a><a id="14207" class="Symbol">)</a> <a id="14209" class="Symbol">})</a>
|
||
<a id="14214" class="Symbol">...</a> <a id="14218" class="Symbol">|</a> <a id="14220" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="14224" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="14226" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a> <a id="14229" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="14234" href="/20.07/PUC/2019/Exam/#14234" class="Bound">⊢L</a> <a id="14237" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="14239" class="Keyword">with</a> <a id="14244" href="/20.07/PUC/2019/Exam/#12733" class="Function">inherit</a> <a id="14252" class="Bound">Γ</a> <a id="14254" class="Bound">M</a> <a id="14256" class="Bound">A</a>
|
||
<a id="14260" class="Symbol">...</a> <a id="14267" class="Symbol">|</a> <a id="14269" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="14272" href="/20.07/PUC/2019/Exam/#14272" class="Bound">¬⊢M</a> <a id="14288" class="Symbol">=</a> <a id="14291" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="14295" class="Symbol">(λ{</a> <a id="14299" class="Symbol">(</a><a id="14300" href="/20.07/PUC/2019/Exam/#10063" class="InductiveConstructor">⊢case</a> <a id="14306" class="Symbol">_</a> <a id="14308" href="/20.07/PUC/2019/Exam/#14308" class="Bound">⊢M</a> <a id="14311" class="Symbol">_)</a> <a id="14314" class="Symbol">→</a> <a id="14316" href="/20.07/PUC/2019/Exam/#14272" class="Bound">¬⊢M</a> <a id="14320" href="/20.07/PUC/2019/Exam/#14308" class="Bound">⊢M</a> <a id="14323" class="Symbol">})</a>
|
||
<a id="14328" class="Symbol">...</a> <a id="14335" class="Symbol">|</a> <a id="14337" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="14341" href="/20.07/PUC/2019/Exam/#14341" class="Bound">⊢M</a> <a id="14344" class="Keyword">with</a> <a id="14349" href="/20.07/PUC/2019/Exam/#12733" class="Function">inherit</a> <a id="14357" class="Symbol">(</a><a id="14358" class="Bound">Γ</a> <a id="14360" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">,</a> <a id="14362" class="Bound">x</a> <a id="14364" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">⦂</a> <a id="14366" href="/20.07/PUC/2019/Exam/#8391" class="InductiveConstructor">`ℕ</a><a id="14368" class="Symbol">)</a> <a id="14370" class="Bound">N</a> <a id="14372" class="Bound">A</a>
|
||
<a id="14376" class="Symbol">...</a> <a id="14386" class="Symbol">|</a> <a id="14388" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="14391" href="/20.07/PUC/2019/Exam/#14391" class="Bound">¬⊢N</a> <a id="14404" class="Symbol">=</a> <a id="14407" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="14411" class="Symbol">(λ{</a> <a id="14415" class="Symbol">(</a><a id="14416" href="/20.07/PUC/2019/Exam/#10063" class="InductiveConstructor">⊢case</a> <a id="14422" class="Symbol">_</a> <a id="14424" class="Symbol">_</a> <a id="14426" href="/20.07/PUC/2019/Exam/#14426" class="Bound">⊢N</a><a id="14428" class="Symbol">)</a> <a id="14430" class="Symbol">→</a> <a id="14432" href="/20.07/PUC/2019/Exam/#14391" class="Bound">¬⊢N</a> <a id="14436" href="/20.07/PUC/2019/Exam/#14426" class="Bound">⊢N</a> <a id="14439" class="Symbol">})</a>
|
||
<a id="14444" class="Symbol">...</a> <a id="14454" class="Symbol">|</a> <a id="14456" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="14460" href="/20.07/PUC/2019/Exam/#14460" class="Bound">⊢N</a> <a id="14472" class="Symbol">=</a> <a id="14475" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="14479" class="Symbol">(</a><a id="14480" href="/20.07/PUC/2019/Exam/#10063" class="InductiveConstructor">⊢case</a> <a id="14486" class="Bound">⊢L</a> <a id="14489" class="Bound">⊢M</a> <a id="14492" href="/20.07/PUC/2019/Exam/#14460" class="Bound">⊢N</a><a id="14494" class="Symbol">)</a>
|
||
<a id="14498" href="/20.07/PUC/2019/Exam/#12733" class="Function">inherit</a> <a id="14506" href="/20.07/PUC/2019/Exam/#14506" class="Bound">Γ</a> <a id="14508" class="Symbol">(</a><a id="14509" href="/20.07/PUC/2019/Exam/#9017" class="InductiveConstructor Operator">μ</a> <a id="14511" href="/20.07/PUC/2019/Exam/#14511" class="Bound">x</a> <a id="14513" href="/20.07/PUC/2019/Exam/#9017" class="InductiveConstructor Operator">⇒</a> <a id="14515" href="/20.07/PUC/2019/Exam/#14515" class="Bound">N</a><a id="14516" class="Symbol">)</a> <a id="14518" href="/20.07/PUC/2019/Exam/#14518" class="Bound">A</a> <a id="14520" class="Keyword">with</a> <a id="14525" href="/20.07/PUC/2019/Exam/#12733" class="Function">inherit</a> <a id="14533" class="Symbol">(</a><a id="14534" href="/20.07/PUC/2019/Exam/#14506" class="Bound">Γ</a> <a id="14536" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">,</a> <a id="14538" href="/20.07/PUC/2019/Exam/#14511" class="Bound">x</a> <a id="14540" href="/20.07/PUC/2019/Exam/#8529" class="InductiveConstructor Operator">⦂</a> <a id="14542" href="/20.07/PUC/2019/Exam/#14518" class="Bound">A</a><a id="14543" class="Symbol">)</a> <a id="14545" href="/20.07/PUC/2019/Exam/#14515" class="Bound">N</a> <a id="14547" href="/20.07/PUC/2019/Exam/#14518" class="Bound">A</a>
|
||
<a id="14551" class="Symbol">...</a> <a id="14555" class="Symbol">|</a> <a id="14557" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="14560" href="/20.07/PUC/2019/Exam/#14560" class="Bound">¬⊢N</a> <a id="14579" class="Symbol">=</a> <a id="14582" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="14586" class="Symbol">(λ{</a> <a id="14590" class="Symbol">(</a><a id="14591" href="/20.07/PUC/2019/Exam/#10248" class="InductiveConstructor">⊢μ</a> <a id="14594" href="/20.07/PUC/2019/Exam/#14594" class="Bound">⊢N</a><a id="14596" class="Symbol">)</a> <a id="14598" class="Symbol">→</a> <a id="14600" href="/20.07/PUC/2019/Exam/#14560" class="Bound">¬⊢N</a> <a id="14604" href="/20.07/PUC/2019/Exam/#14594" class="Bound">⊢N</a> <a id="14607" class="Symbol">})</a>
|
||
<a id="14612" class="Symbol">...</a> <a id="14616" class="Symbol">|</a> <a id="14618" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="14622" href="/20.07/PUC/2019/Exam/#14622" class="Bound">⊢N</a> <a id="14640" class="Symbol">=</a> <a id="14643" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="14647" class="Symbol">(</a><a id="14648" href="/20.07/PUC/2019/Exam/#10248" class="InductiveConstructor">⊢μ</a> <a id="14651" href="/20.07/PUC/2019/Exam/#14622" class="Bound">⊢N</a><a id="14653" class="Symbol">)</a>
|
||
<a id="14657" href="/20.07/PUC/2019/Exam/#12733" class="Function">inherit</a> <a id="14665" href="/20.07/PUC/2019/Exam/#14665" class="Bound">Γ</a> <a id="14667" class="Symbol">(</a><a id="14668" href="/20.07/PUC/2019/Exam/#14668" class="Bound">M</a> <a id="14670" href="/20.07/PUC/2019/Exam/#9067" class="InductiveConstructor Operator">↑</a><a id="14671" class="Symbol">)</a> <a id="14673" href="/20.07/PUC/2019/Exam/#14673" class="Bound">B</a> <a id="14675" class="Keyword">with</a> <a id="14680" href="/20.07/PUC/2019/Exam/#12629" class="Function">synthesize</a> <a id="14691" href="/20.07/PUC/2019/Exam/#14665" class="Bound">Γ</a> <a id="14693" href="/20.07/PUC/2019/Exam/#14668" class="Bound">M</a>
|
||
<a id="14697" class="Symbol">...</a> <a id="14701" class="Symbol">|</a> <a id="14703" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="14707" href="/20.07/PUC/2019/Exam/#14707" class="Bound">¬∃</a> <a id="14725" class="Symbol">=</a> <a id="14728" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="14732" class="Symbol">(λ{</a> <a id="14736" class="Symbol">(</a><a id="14737" href="/20.07/PUC/2019/Exam/#10346" class="InductiveConstructor">⊢↑</a> <a id="14740" href="/20.07/PUC/2019/Exam/#14740" class="Bound">⊢M</a> <a id="14743" class="Symbol">_)</a> <a id="14746" class="Symbol">→</a> <a id="14748" href="/20.07/PUC/2019/Exam/#14707" class="Bound">¬∃</a> <a id="14751" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="14753" class="Symbol">_</a> <a id="14755" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="14757" href="/20.07/PUC/2019/Exam/#14740" class="Bound">⊢M</a> <a id="14760" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="14762" class="Symbol">})</a>
|
||
<a id="14767" class="Symbol">...</a> <a id="14771" class="Symbol">|</a> <a id="14773" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="14777" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟨</a> <a id="14779" href="/20.07/PUC/2019/Exam/#14779" class="Bound">A</a> <a id="14781" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">,</a> <a id="14783" href="/20.07/PUC/2019/Exam/#14783" class="Bound">⊢M</a> <a id="14786" href="Agda.Builtin.Sigma.html#209" class="InductiveConstructor Operator">⟩</a> <a id="14788" class="Keyword">with</a> <a id="14793" href="/20.07/PUC/2019/Exam/#14779" class="Bound">A</a> <a id="14795" href="/20.07/PUC/2019/Exam/#10470" class="Function Operator">≟Tp</a> <a id="14799" class="Bound">B</a>
|
||
<a id="14803" class="Symbol">...</a> <a id="14809" class="Symbol">|</a> <a id="14811" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="14815" href="/20.07/PUC/2019/Exam/#14815" class="Bound">A≢B</a> <a id="14831" class="Symbol">=</a> <a id="14834" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#668" class="InductiveConstructor">no</a> <a id="14838" class="Symbol">(</a><a id="14839" href="/20.07/PUC/2019/Exam/#12426" class="Function">¬switch</a> <a id="14847" class="Bound">⊢M</a> <a id="14850" href="/20.07/PUC/2019/Exam/#14815" class="Bound">A≢B</a><a id="14853" class="Symbol">)</a>
|
||
<a id="14857" class="Symbol">...</a> <a id="14863" class="Symbol">|</a> <a id="14865" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="14869" href="/20.07/PUC/2019/Exam/#14869" class="Bound">A≡B</a> <a id="14885" class="Symbol">=</a> <a id="14888" href="https://agda.github.io/agda-stdlib/v1.1/Relation.Nullary.html#641" class="InductiveConstructor">yes</a> <a id="14892" class="Symbol">(</a><a id="14893" href="/20.07/PUC/2019/Exam/#10346" class="InductiveConstructor">⊢↑</a> <a id="14896" class="Bound">⊢M</a> <a id="14899" href="/20.07/PUC/2019/Exam/#14869" class="Bound">A≡B</a><a id="14902" class="Symbol">)</a>
|
||
</pre>
|
||
|
||
</div>
|
||
|
||
<p style="text-align:center;">
|
||
|
||
|
||
|
||
<a alt="Source code" href="https://github.com/plfa/plfa.github.io/blob/dev-20.07/courses/puc/2019/Exam.lagda.md">Source</a>
|
||
|
||
|
||
|
||
</p>
|
||
|
||
|
||
</article>
|
||
|
||
</div>
|
||
</main><footer class="site-footer h-card">
|
||
<data class="u-url" href="/20.07/"></data>
|
||
|
||
<div class="wrapper">
|
||
|
||
<h2 class="footer-heading">Programming Language Foundations in Agda
|
||
</h2><div class="footer-col-wrapper">
|
||
<div class="footer-col footer-col-1">
|
||
<ul class="contact-list">
|
||
<li class="p-name">Philip Wadler</li>
|
||
<li><a class="u-email" href="mailto:wadler@inf.ed.ac.uk">wadler@inf.ed.ac.uk</a></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="footer-col footer-col-2"><ul class="social-media-list"><li><a href="https://github.com/wadler"><svg class="svg-icon"><use xlink:href="/20.07/assets/minima-social-icons.svg#github"></use></svg> <span class="username">wadler</span></a></li></ul>
|
||
</div>
|
||
|
||
<div class="footer-col footer-col-3"></div>
|
||
</div><div class="footer-col-wrapper">
|
||
<div class="footer-col footer-col-1">
|
||
<ul class="contact-list">
|
||
<li class="p-name">Wen Kokke</li>
|
||
<li><a class="u-email" href="mailto:wen.kokke@ed.ac.uk">wen.kokke@ed.ac.uk</a></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="footer-col footer-col-2"><ul class="social-media-list"><li><a href="https://github.com/wenkokke"><svg class="svg-icon"><use xlink:href="/20.07/assets/minima-social-icons.svg#github"></use></svg> <span class="username">wenkokke</span></a></li><li><a href="https://www.twitter.com/wenkokke"><svg class="svg-icon"><use xlink:href="/20.07/assets/minima-social-icons.svg#twitter"></use></svg> <span class="username">wenkokke</span></a></li></ul>
|
||
</div>
|
||
|
||
<div class="footer-col footer-col-3"></div>
|
||
</div><div class="footer-col-wrapper">
|
||
<div class="footer-col footer-col-1">
|
||
<ul class="contact-list">
|
||
<li class="p-name">Jeremy G. Siek</li>
|
||
<li><a class="u-email" href="mailto:jsiek@indiana.edu">jsiek@indiana.edu</a></li>
|
||
</ul>
|
||
</div>
|
||
|
||
<div class="footer-col footer-col-2"><ul class="social-media-list"><li><a href="https://github.com/jsiek"><svg class="svg-icon"><use xlink:href="/20.07/assets/minima-social-icons.svg#github"></use></svg> <span class="username">jsiek</span></a></li><li><a href="https://www.twitter.com/jeremysiek"><svg class="svg-icon"><use xlink:href="/20.07/assets/minima-social-icons.svg#twitter"></use></svg> <span class="username">jeremysiek</span></a></li></ul>
|
||
</div>
|
||
|
||
<div class="footer-col footer-col-3"></div>
|
||
</div>This work is licensed under a <a rel="license" href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>
|
||
</div>
|
||
</footer>
|
||
<!-- Import jQuery -->
|
||
<script type="text/javascript" src="/20.07/assets/jquery.js"></script>
|
||
|
||
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.2.2/anchor.min.js" integrity="sha256-E4RlfxwyJVmkkk0szw7LYJxuPlp6evtPSBDlWHsYYL8=" crossorigin="anonymous"></script>
|
||
<script type="text/javascript">
|
||
anchors.add();
|
||
</script>
|
||
|
||
<script type="text/javascript">
|
||
|
||
// Makes sandwhich menu works
|
||
$('.menu-icon').click(function(){
|
||
$('.trigger').toggle();
|
||
});
|
||
|
||
// Script which allows for foldable code blocks
|
||
$('div.foldable pre').each(function(){
|
||
var autoHeight = $(this).height();
|
||
var lineHeight = parseFloat($(this).css('line-height'));
|
||
|
||
var plus = $("<div></div>");
|
||
var horLine = $("<div></div>");
|
||
var verLine = $("<div></div>");
|
||
$(this).prepend(plus);
|
||
plus.css({
|
||
'position' : 'relative',
|
||
'float' : 'right',
|
||
'right' : '-' + (0.5 * lineHeight - 1.5) + 'px',
|
||
'width' : lineHeight,
|
||
'height' : lineHeight});
|
||
verLine.css({
|
||
'position' : 'relative',
|
||
'height' : lineHeight,
|
||
'width' : '3px',
|
||
'background-color' : '#C1E0FF'});
|
||
horLine.css({
|
||
'position' : 'relative',
|
||
'top' : '-' + (0.5 * lineHeight + 1.5) + 'px',
|
||
'left' : '-' + (0.5 * lineHeight - 1.5) + 'px',
|
||
'height' : '3px',
|
||
'width' : lineHeight,
|
||
'background-color' : '#C1E0FF'});
|
||
plus.append(verLine);
|
||
plus.append(horLine);
|
||
|
||
$(this).height(2.0 * lineHeight);
|
||
$(this).css('overflow','hidden');
|
||
|
||
$(this).click(function(){
|
||
if ($(this).height() == autoHeight) {
|
||
$(this).height(2.0 * lineHeight);
|
||
plus.show();
|
||
}
|
||
else {
|
||
$(this).height('auto');
|
||
plus.hide();
|
||
}
|
||
});
|
||
});
|
||
</script>
|
||
|
||
<!-- Import KaTeX -->
|
||
<script type="text/javascript" src="/20.07/assets/katex.js"></script>
|
||
|
||
<!-- Script which renders TeX using KaTeX -->
|
||
<script type="text/javascript">
|
||
$("script[type='math/tex']").replaceWith(
|
||
function(){
|
||
var tex = $(this).text();
|
||
return "<span class=\"inline-equation\">" +
|
||
katex.renderToString(tex) +
|
||
"</span>";
|
||
});
|
||
$("script[type='math/tex; mode=display']").replaceWith(
|
||
function(){
|
||
var tex = $(this).text().replace(/%.*?(\n|$)/g,"");
|
||
return "<div class=\"equation\">" +
|
||
katex.renderToString("\\displaystyle "+tex) +
|
||
"</div>";
|
||
});
|
||
</script>
|
||
</body>
|
||
|
||
</html>
|