AdvTPL12 - Redefining Classes Chapter 12 Improved Semantics...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1 W. Pelz 2003-09 1 Chapter 12 Improved Semantics for Classes W. Pelz 2003-09 2 Redefining Classes • Def. 12.1.1: Relations of the form t=T and t <: T, where t is a type identifier and T is a type expression, are said to be type definitions. A type constraint system is defined as 1. The empty set, φ , is a type constraint system 2. If C is a type constraint system and t is a type identifier not in C or T, then C {t=T} is a type constraint system W. Pelz 2003-09 3 Rest of Definition 3. If C is a type constraint system and t is a type identifier not in C or T, then C {t<:T} is a type constraint system #3 is in addition to definition 10.2.4, so we need an additional subtyping rule: Identifier<: C t<: C (T), if (t <:T) C W. Pelz 2003-09 4 Revised type-checking rules • Fig. 12.1 [page 227] – Word doc • SelfType VisObjectType(IV ref , M) • SelfType = VisObjectType(IV , M ) where IV , M are subtypes of IV ref , M • Therefore self has all the instance variables
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

AdvTPL12 - Redefining Classes Chapter 12 Improved Semantics...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online