130 likes | 234 Views
15-814 Type Refinements. Robert Harper Fall Semester, 2003. Type Refinements. Goal : increase expressive power of type systems. Languages, not tools. Checkable, live with the code. A little goes a long way. Methods : refinement checking, constraints, polymorphism, sub-structural logics.
E N D
15-814 Type Refinements Robert Harper Fall Semester, 2003
Type Refinements • Goal: increase expressive power of type systems. • Languages, not tools. • Checkable, live with the code. • A little goes a long way. • Methods: refinement checking, constraints, polymorphism, sub-structural logics. 15-814 Type Refinements
Course Structure • This is a graduate research seminar. • Must have taken PL core or equivalent. • This is not a lecture course! • Must actively participate. • I know only slightly more than you do (in most cases, even less in some cases). • You must present one or two lectures. • Scheduled as we go along. • Must prepare slides in advance. 15-814 Type Refinements
Readings, Schedule • Course page:http://www.cs.cmu.edu/~rwh/courses/refinements. • Reading list: • An attempt to find some interesting connected components. • I expect that you will have to chase down further references. 15-814 Type Refinements
Readings, Schedule • Schedule: • First cut allocation on web page. • Will adjust as we go along. • I need volunteers immediately for the next two lectures (after mine). • Expect the schedule to slip. • Hard to predict how long things will take. 15-814 Type Refinements
Background on Types • Ontological type discipline. • Aka Church-style, or endogenous, type theory. • Type structure determines the language and constrains the interpretation. • Eg, cbv or cbn for simple types. • Closely related to systems of logic and classes of categories. • E.g., implicational logic, CCC’s. 15-814 Type Refinements
Background on Types • Epistemological type discipline. • Aka Curry-style, or exogenous. • Types describe operational behavior of programs in a pre-existing language. • Classically, types are sets of lambda terms closed under beta-reduction. • Type structure closer to programming logics. • Eg, intersection and union types, sub-structural reasoning. 15-814 Type Refinements
Background on Types • These are not incompatible! • Church-style type system determines language. • D D! D for untyped -calculus • Curry-style type system provides an exogenous logic for this language • M 2 A! B Æ C! D 15-814 Type Refinements
Background on Types • Logical relations: each type determines a property possessed by all expressions of that type. • Intuitively, the universal property for that type. • Defined by induction on type structure. • Foundation for type safety: well-formed implies safe execution. 15-814 Type Refinements
Background on Types • Classically, Curry-style type systems are concerned with I/O behavior. • Types describe behavior under some interpretation. • Eg, succ 2 ev ! od Æ od ! ev • More recently, emphasis is placed on state change. • Eg, adherence to locking protocols 15-814 Type Refinements
Main Topics • Refinement types. • Starting with Freeman/Pfenning and Yardeni/Shapiro. • Continuing with Davies, Dunfield, others. • Regular tree grammars. • Central techniques for refinement checking. 15-814 Type Refinements
Main Topics • Dependent Refinements • Constraint-based value range invariants. • eg, x in {0,…,10} • Type checking reduces to constraint solving. • Constraint Domains • Best developed: integers. 15-814 Type Refinements
Main Topics • Soft Typing • Related to type refinements. • Start with a un(i)typed language. • Consider types as predicates over untyped domain. • Effects Systems • Extend type systems to reason about state change. 15-814 Type Refinements