Skip to content

Commit 1638779

Browse files
committed
Draft of assign 6.
1 parent 6a71981 commit 1638779

2 files changed

Lines changed: 44 additions & 65 deletions

File tree

www/assignments.scrbl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
@include-section{assignments/3.scrbl}
99
@include-section{assignments/4.scrbl}
1010
@include-section{assignments/5.scrbl}
11-
@;include-section{assignments/6.scrbl}
11+
@include-section{assignments/6.scrbl}
1212
@;;include-section{assignments/7.scrbl}
1313

1414
@;{assignment 8: quote in general, and quasiquote}

www/assignments/6.scrbl

Lines changed: 43 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,67 @@
11
#lang scribble/manual
2-
@title[#:tag "Assignment 6" #:style 'unnumbered]{Assignment 6: Syntax Checking}
2+
@title[#:tag "Assignment 6" #:style 'unnumbered]{Assignment 6: Squid Game}
33

44
@(require (for-label (except-in racket ...)))
55
@(require "../notes/ev.rkt"
66
"../notes/utils.rkt")
77

8-
@bold{Due: Thursday, May 5th, 11:59PM EDT}
8+
@bold{Due: Monday, Nov 13, 11:59PM EDT}
99

10-
The goal of this assignment is to add syntax checking to our compiler.
10+
The goal of this assignment is to hone your testing skills.
1111

12-
You are given a repository with a starter compiler similar to the
13-
@seclink["Mountebank"]{Mountebank} language we studied in class. You
14-
are tasked with:
12+
@section[#:tag-prefix "a6-" #:style 'unnumbered #:tag "game"]{The Game}
1513

16-
@itemlist[
14+
The autograder for this assignment includes a collection of compilers
15+
that implement @secref["Assignment 5"] and a reference interpreter.
1716

18-
@item{implementing compile-time syntax checking.}
17+
You must submit a list of programs that will be run on each compiler.
18+
If a compiler produces a result that is inconsistent with the
19+
reference interpreter, it is eliminated. Your goal is to construct
20+
a set of test programs that eliminate the largest number of compilers.
21+
The player that eliminates the largest number of compilers, wins.
1922

20-
]
23+
When you submit, choose a name to display on the leaderboard. It does
24+
not need to be your real name, but please keep it appropriate for this
25+
setting.
2126

22-
@section[#:tag-prefix "a6-" #:style 'unnumbered #:tag "checking"]{Syntax Checking}
27+
After submitting, click "Leaderboard" to see the latest standings.
2328

29+
Initially there will be around 30 compilers included, but more will be
30+
added before the deadline.
2431

25-
Up until now, we've written our compiler assuming that programs are
26-
well-formed, but there has never been any code that actually checks
27-
this assumption. The assumptions go beyond the properties checked
28-
during parsing. For example, our parser will happily accept a program
29-
like @racket[(lambda (x x) x)], and the compiler will emit code for it
30-
even though this is not a well-formed program.
32+
We reserve the right to update the reference interpreter.
3133

32-
The idea of this assignment is to implement a function, defined in
33-
@tt{check-syntax.rkt}:
34+
Submissions should be written using the following format:
3435

35-
@#reader scribble/comment-reader
36-
(racketblock
37-
;; Prog -> Prog
38-
(define (check-syntax p) ...)
39-
)
36+
@codeblock|{
37+
#lang info
38+
(define programs
39+
(list
40+
'[ (add1 1) ]
41+
'[ (write-byte 97) ]
42+
'[ (define (f x) (+ x x)) (f 5) ]))
43+
}|
4044

41-
If the program is well-formed, it should behave like the identity
42-
function, returning the same program it was given as input. On
43-
ill-formed programs, it should signal an error using @racket[error].
45+
If you'd like to include a program reads data from the standard input
46+
port, you can add an enties which are two-element lists, where the first
47+
element is a string that is used as the contents of the input port
48+
and the second element is the program, for example:
4449

45-
For the purposes of this assignment, the quality of the error messages
46-
doesn't matter, although in real programming language implementations,
47-
good error messages are crucial.
50+
@codeblock|{
51+
#lang info
52+
(define programs
53+
(list
54+
'[ (add1 1) ]
55+
'[ (write-byte 97) ]
56+
(list "abc" '[ (read-byte) ])
57+
'[ (define (f x) (+ x x)) (f 5) ]))
58+
}|
4859

49-
Here are the properties that should be checked of each program:
5060

51-
@itemlist[
61+
You may add as many programs as you'd like to the file.
5262

53-
@item{Programs are @emph{closed}; there are no unbound variables in
54-
the program.}
55-
56-
@item{Every @racket[define]d function should have a distinct name.}
57-
58-
@item{Every function parameter should be distinct from the other
59-
parameters of that function.}
60-
61-
@item{Every function's name should be distinct from all of its
62-
parameters' names.}
63-
64-
@item{Every function name and variable should not clash with any of
65-
the keywords of our language, e.g. @racket[lambda], @racket[if], etc.
66-
(Note this is not a restriction Racket puts on programs; the following
67-
is a perfectly reasonable expression: @racket[(λ (λ) λ)], but we'll
68-
consider this a syntax error.)}
69-
70-
@item{Every pattern variable in a pattern should be distinct. (Racket
71-
also allows this, but it has a complicated run-time semantics which we
72-
don't implement so instead we just rule out these programs.)}
73-
74-
]
75-
76-
The starter code calls @racket[check-syntax] in both
77-
@tt{compile-file.rkt} and @tt{interp-file.rkt}. The definition of
78-
@racket[check-syntax] is stubbed out in @tt{check-syntax.rkt}.
79-
80-
There are tests included in @tt{test/check-syntax.rkt}. You can also use this file
81-
to write your own tests for debugging.
8263

8364
@section[#:tag-prefix "a6-" #:style 'unnumbered]{Submitting}
8465

85-
You should submit on Gradescope. You should submit a zip file that has
86-
exactly the same structure that the stub contains. We will only use
87-
the @tt{check-syntax.rkt} files for grading, so make sure all your
88-
work is contained there!
66+
You should submit on Gradescope. You should a single file named
67+
@tt{info.rkt} that conforms to the format shown above.

0 commit comments

Comments
 (0)