Question 1 @ 2025-04-15 19:00
When we extended our Picky language with a recursive binder, the type judgment that we used was:
Γ[x:=τ₁] ⊢ E : τ₂ Γ[x:=τ₁] ⊢ V : τ₁
—————————————————————————————————————
Γ ⊢ {rec {x : τ₁ V} E} : τ₂
—————————————————————————————————————
Γ ⊢ {rec {x : τ₁ V} E} : τ₂
The difference from the previous plain binder (with
) is the use of an
extended Γ
:
Γ[x:=τ₁] ⊢ V : τ₁
How does this enable recursion?
-
It ensures that
V
typechecks with a function type -
It allows
V
to conatin a free occurrences ofx
-
It checks that
τ₁
is a valid type -
It guarentees that evaluating
V
will halt
Question 2 @ 2025-04-15 19:05
What properties of a typechecker did we discuss?
- Composability
- Completeness
- Openness
- Extensibility
- Soundness
Question 3 @ 2025-04-15 19:07
Of the two relevant typechecking properties, completenes and soundness, which one is more important?
- Completeness is more important, since it makes it possible to write any code.
- Completeness is more important, since it allows us to avoid infinite loops.
- Soundness is more important, since it means that the typechecker is correct.
- Soundness is more important, since it ensures that the typechecker implementation is itself typechecked.
Question 4 @ 2025-04-15 19:09
What is the main difference between the type system of Typed Racket (TR) and of Picky?
- TR is less advanced in that it cannot do full type inference.
- TR is strongly normalizing.
- TR is a Hindley-Milner type system.
- TR allows arbitrary type unions, not just disjoint ones.
- TR types are proper sets.
Question 5 @ 2025-04-15 19:10
Which of the following statements are true about a Hindley-Milner type system?
- All types are a subtype of a “top” type.
- Most types can be inferred.
- All toplevel types must be declared rather than inferred.
- Subtypes and supertypes can be created using unions and intersections.
- It is strongly normalizing.
- It is the underlying type system in Typed Racket (and TypeScript).