Questions?
- First exercise is online:
http://www.win.tue.nl/~mvdbrand/courses/GLT/1112/
Deadline 17th of October
- Next week on Wednesday (5th of October) no
lectures!!! lectures!!!
/ Faculteit Wiskunde en Informatica
PAGE 0 28-9-2011
Static Semantics
- Primitive types
- Primitive value can not be decomposed into simpler
values
- Primitive type is a type of which the values are primitive
− Booleans = {‘true’, ‘false’} − Integer = { 2 1 0 1 2 } − Integer = {…, -2, -1, 0, 1, 2, …}
/ Faculteit Wiskunde en Informatica
PAGE 1 28-9-2011
Static Semantics
- Defining primitive types
- It is possible to define new types via enumeration of values,
so-called enumeration type
− example: type Month is (jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec); − signature: enum(Name Values) -> Type signature: enum(Name, Values) > Type
/ Faculteit Wiskunde en Informatica
PAGE 2 28-9-2011
Static Semantics
- Composite types:
y
- Composite value is composed of simpler values
- Composite type is a type of which the values are composite
- Restricted number of structuring concepts:
− Cartesian products (tuples, records) − mappings (arrays, functions) − recursive types (lists, trees)
/ Faculteit Wiskunde en Informatica
PAGE 3 28-9-2011