8. Type Systems Flashcards

1
Q

What is the purpose of a type system?

A

Reduce bugs by checking for logic errors. (e.g. adding an integer to a string)

In addition to being useful in and of itself, type systems also make possible dataflow analysis, symbolic execution, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a type?

A

A type is an abstraction that represents a set of concrete values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is an inference rule schema vs an axiom schema?

A

An inference rule schema has more than 0 hypotheses whereas an axiom schema does not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a free variable?

A

An environment gives a type for free variables.

A variable is free in an expression if not defined within the expression; otherwise it is bound.

An environment is a function from variables to types.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly