download 2021 site

This commit is contained in:
Jana Dönszelmann 2025-09-29 16:03:30 +02:00
commit dd6e4afb13
No known key found for this signature in database
138 changed files with 37730 additions and 0 deletions

402
milestone/2.html Normal file
View file

@ -0,0 +1,402 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="Eelco Visser">
<meta name="generator" content="Jekyll v3.8.5">
<title>Milestone 2: Front-End Complete</title>
<!-- <base href="/2021"> -->
<!--link rel="canonical" href="https://getbootstrap.com/docs/4.3/examples/starter-template/"-->
<link rel="icon" href="../img/logo/pl_ico2_2B3_icon.ico" type="image/x-icon">
<!-- Bootstrap core CSS -->
<!--link href="https://getbootstrap.com/docs/4.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"-->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<style>
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
</style>
<!-- Custom styles for this template -->
<link href="../css/main.css" rel="stylesheet">
<link href="../css/borders-responsive.css" rel="stylesheet">
<link rel="stylesheet" href="../css/pl.css">
</head>
<body>
<nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
<a class="navbar-brand" href="../index.html">
TU Delft | CS4200
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarsExampleDefault">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="../lectures/index.html" tabindex="-1" aria-disabled="true">Lectures</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="../homework/index.html" tabindex="-1" aria-disabled="true">Homework</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="../project/index.html" tabindex="-1" aria-disabled="true">Project</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="../news/index.html" tabindex="-1" aria-disabled="true">News</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="../blog/index.html" tabindex="-1" aria-disabled="true">Blog</a>
</li>
</ul>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-12 col-xl-12">
<div class="mt-3 mb-3 pt-3 pb-3 text-dark border-top border-bottom border-grey">
<div class="text-dark font-weight-bold">
<h1>
Milestone 2: Front-End Complete
</h1>
</div>
<div>
</div>
<div>
Project
</div>
<div>
October 24, 2021
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 col-md-12 col-lg-9 border-lg-right border-grey">
<p>In this milestone you re-submit your syntax definition and submit your static semantic definition.</p>
<h3 id="submission">Submission</h3>
<p>You need to submit your ChocoPy project with a merge request on GitLab.
The <a href="../lab/1d.html">Git and Submissions documentation</a> explains how to file such a request.</p>
<p>The deadline for submission is October 24 2021, 23:59.</p>
<h3 id="grading">Grading</h3>
<p>We grade your submission based on compliance with the ChocoPy syntax and static semantics as defined in the reference manual. During the course of the project, you therefore get another chance to improve your score for your syntax definition.</p>
<p>Your parser and static semantics should be defined in the same Spoofax project. The grader will search for your language definition in the <code class="language-plaintext highlighter-rouge">chocopy.types</code>, <code class="language-plaintext highlighter-rouge">chocopy</code>, and <code class="language-plaintext highlighter-rouge">chocopy.syntax</code> folders (in-order), using the first valid project it finds.</p>
<h3 id="early-feedback">Early Feedback</h3>
<p>We provide early feedback for the correctness of your syntax definition.
This feedback gives you an indication which parts of your syntax definition might still be wrong.
It includes a summary of how many tests you pass and how many points you earn by passing them.
You have <strong>15</strong> early feedback attempts. Please make your submissions to the <code class="language-plaintext highlighter-rouge">milestone-2-submission</code> branch.</p>
<p>We also provide you with the opportunity to improve your Syntax Definition once again, by providing Early Feedback for the <code class="language-plaintext highlighter-rouge">milestone-1-feedback</code> branch again. You can choose to improve your Syntax Definition before the deadline of milestone 2, as we <strong>will</strong> include it in the grading for milestone 2. If you choose to not make a new submission, the current state of the branch will be used for the grading process. You also have <strong>15</strong> Early Feedback attempts for this part of the assignment.</p>
<h3 id="use-the-latest-spoofax">Use the latest Spoofax</h3>
<p>Please make sure that your project works on the latest Spoofax version (<a href="https://www.spoofax.dev/spoofax-pie/develop/release/download/">Spoofax 3 releases</a>). The grader will be using the most recent version to grade your project.</p>
<h3 id="general-development-procedures">General development procedures</h3>
<p>Here are some general tips you can apply when creating your static semantics definition:</p>
<ul>
<li>Do the homework exercises in WebLab and go through the slides and relevant literature, as they serve as an introduction to Statix.</li>
<li>Read the ChocoPy reference thoroughly. It helps to revisit it later to discover some edge cases.</li>
<li>Make use of the compiler on the ChocoPy website. If it compiles, it is valid semantics even if the program itself can crash (for example: <code class="language-plaintext highlighter-rouge">print(None)</code> is valid according to the type checker, but trying to execute this program will still result in an error).</li>
<li><strong>Write tests!</strong> We expect you to write tests for valid and invalid static semantics, as well as name resolution and type checking. A more detailed tutorial on how to write tests for your static semantics can be found in <a href="https://tudelft-cs4200.github.io/2021/lab/3b/">Lab 3B</a>.</li>
<li>Start with small examples, and work your way up.</li>
<li>Make sure to assign proper <code class="language-plaintext highlighter-rouge">ref</code> and <code class="language-plaintext highlighter-rouge">type</code> properties to your AST nodes (See homework/slides).</li>
</ul>
<h4 id="debugging-statix">Debugging Statix</h4>
<p>Here are some things you can try when you are witnessing unexpected behavior in your editor:</p>
<ul>
<li>Temporarily comment out irrelevant rules/lines in Statix in order to narrow down the problem.</li>
<li>Write test cases to reproduce the problem you are facing</li>
<li>You can force the failure of a rule by using <code class="language-plaintext highlighter-rouge">false</code> as a constraint. For example: <code class="language-plaintext highlighter-rouge">programOk(_) :- false.</code></li>
<li>You can (temporarily) log some information or variables by using the <code class="language-plaintext highlighter-rouge">try { &lt;constraint&gt; } | &lt;error&gt; &lt;message&gt; &lt;location&gt;</code> constraint. For example: <code class="language-plaintext highlighter-rouge">programOk(program) :- try { false } | note $[Error message for [program]]@program.</code> . Here <code class="language-plaintext highlighter-rouge">&lt;error&gt;</code> takes the form of <code class="language-plaintext highlighter-rouge">note</code>, <code class="language-plaintext highlighter-rouge">warning</code> or <code class="language-plaintext highlighter-rouge">error</code> (which will cause the analysis to fail), and <code class="language-plaintext highlighter-rouge">&lt;location&gt;</code> is optional.</li>
<li>Draw out scope graphs on paper. Are there differences between the scope graph that is defined by your rules, and the one you expect?</li>
</ul>
<h3 id="static-semantics">Static Semantics</h3>
<p>We expect your static semantic definition to perform valid name resolution and type checking. Some things to pay extra attention to are:</p>
<ul>
<li>Inheritance</li>
<li>Nested functions</li>
<li>Global/nonlocal declarations</li>
<li>Shadowing variables, fields and function names</li>
<li>Built-in/native functions and constructors</li>
<li>List types (least upper bound)</li>
<li>Return Statements</li>
<li>Method overriding</li>
<li>Return type of void functions</li>
<li>Usage/resolution before the definition</li>
</ul>
<h4 id="a-small-note-on-types">A small note on types</h4>
<p>It is highly recommended you directly use the following types in your Statix rules:</p>
<ul>
<li>Integer: <code class="language-plaintext highlighter-rouge">Int()</code></li>
<li>Boolean: <code class="language-plaintext highlighter-rouge">Bool()</code></li>
<li>String: <code class="language-plaintext highlighter-rouge">String()</code></li>
<li>List of Type T: <code class="language-plaintext highlighter-rouge">List(T)</code></li>
<li>Empty list type: <code class="language-plaintext highlighter-rouge">EmptyList()</code></li>
<li>None type: <code class="language-plaintext highlighter-rouge">NoneType()</code></li>
<li>Class with name Foo and scope s: <code class="language-plaintext highlighter-rouge">ClassType(s, "Foo")</code></li>
<li>Function with return Type RT and a list of parameter types PTs: <code class="language-plaintext highlighter-rouge">FunType(RT, PTs)</code></li>
<li>Object: <code class="language-plaintext highlighter-rouge">Object()</code></li>
</ul>
<p>These are the types we test for in our early feedback/grading pipeline.</p>
<p>If you use different types in your Statix rules, you need to transform (i.e. map) your types to our types. For this purpose, transformation rules in the Stratego language are given in <a href="https://tudelft-cs4200.github.io/2021/lab/3b/">Lab 3B</a>, which you have to extend/implement/test yourself to make them suitable for your type checker.</p>
<p>Write your own tests for type checking to confirm that your transformation rules work. Please include these rules in your submission, as we need them in our tests. Make sure to define a sort and the different constructors of your custom types in this file as well, so Stratego can recognize them, and match on them.</p>
<h3 id="when-all-else-fails">When all else fails…</h3>
<p>Should you run into any issues regarding Statix or the assignment, please contact us during the labs (Tuesday Lab or Wednesday Shared Study Lab) or on Mattermost.</p>
</div>
<div class="col-sm-12 col-md-12 col-lg-3 col-xl-3 " >
<div class="sticky-top top70 d-none d-lg-block d-xl-block">
<div class="pb4 mb3 border-bottom border-grey ">
<nav>
<ul class="pagination justify-content-left">
<li class="page-item">
<a class="page-link" href="../lab/7.html">
&laquo;
</a>
</li>
<li class="page-item">
<a class="page-link" href="../project/index.html">
^
</a>
</li>
<li class="page-item">
<a class="page-link" href="../lab/8.html">&raquo;</a>
</li>
</ul>
</nav>
</div>
<ul id="my_toc" class="toc list-group list-group-flush d-none d-lg-block d-xl-block p-0 ml-0 mt-3">
<li class="list-group-item pl-0 ml-0 border-0 pl-0 pt-0 pb-1 pr-0 m-0 mr-3"><a href="2.html#submission">Submission</a></li>
<li class="list-group-item pl-0 ml-0 border-0 pl-0 pt-0 pb-1 pr-0 m-0 mr-3"><a href="2.html#grading">Grading</a></li>
<li class="list-group-item pl-0 ml-0 border-0 pl-0 pt-0 pb-1 pr-0 m-0 mr-3"><a href="2.html#early-feedback">Early Feedback</a></li>
<li class="list-group-item pl-0 ml-0 border-0 pl-0 pt-0 pb-1 pr-0 m-0 mr-3"><a href="2.html#use-the-latest-spoofax">Use the latest Spoofax</a></li>
<li class="list-group-item pl-0 ml-0 border-0 pl-0 pt-0 pb-1 pr-0 m-0 mr-3"><a href="2.html#general-development-procedures">General development procedures</a>
<ul class="toc-sub pl-0">
<li class="list-group-item pl-0 ml-0 border-0 pl-0 pt-0 pb-1 pr-0 m-0 mr-3"><a href="2.html#debugging-statix">Debugging Statix</a></li>
</ul>
</li>
<li class="list-group-item pl-0 ml-0 border-0 pl-0 pt-0 pb-1 pr-0 m-0 mr-3"><a href="2.html#static-semantics">Static Semantics</a>
<ul class="toc-sub pl-0">
<li class="list-group-item pl-0 ml-0 border-0 pl-0 pt-0 pb-1 pr-0 m-0 mr-3"><a href="2.html#a-small-note-on-types">A small note on types</a></li>
</ul>
</li>
<li class="list-group-item pl-0 ml-0 border-0 pl-0 pt-0 pb-1 pr-0 m-0 mr-3"><a href="2.html#when-all-else-fails">When all else fails…</a></li>
</ul>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="border-top border-bottom border-grey mt-3 pt-3">
<nav>
<ul class="pagination justify-content-center">
<li class="page-item">
<a class="page-link" href="../lab/7.html">
Previous
</a>
</li>
<li class="page-item">
<a class="page-link" href="../lab/8.html">Next</a>
</li>
<li class="page-item">
<a class="page-link" href="../project/index.html">
Index
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>