Questions: Linear Types

4 questions to test your understanding

Score: 0 / 4
Question 1 Multiple Choice

A value with a linear type must be used exactly once. What does 'used' mean in this context?

AThe value must appear exactly once in the source code text
BThe value must be consumed by exactly one operation at runtime — it cannot be passed to two different functions (duplication) or ignored without being consumed (discarding)
CThe value must be of a primitive type
DThe value must be immutable
Question 2 Short Answer

Rust's ownership system is based on affine types, not strictly linear types. What is the difference?

Think about your answer, then reveal below.
Question 3 Short Answer

How do linear types prevent data races in concurrent programs?

Think about your answer, then reveal below.
Question 4 True / False

Linear types are connected to Girard's linear logic through the Curry-Howard correspondence.

TTrue
FFalse