ERC 4th Workshop KAIST. Sukyoung Ryu KAIST. August 26, 2010

Similar documents
Project Fortress: A Multicore Language for Scientists and Engineers

Sukyoung Ryu. Member of Technical Staff Mailstop UBUR Sun Microsystems Laboratories 35 Network Dr. Burlington, Massachusetts

A New Formalization of Subtyping to Match Subclasses to Subtypes

Harvard School of Engineering and Applied Sciences Computer Science 152

Some instance messages and methods

Fortress: A New Programming Language for Scientific Computing

Adding Pattern Matching to Existing Object-Oriented Languages

ProjectFortress: Run your whiteboard, in parallel, on the JVM

CSE 505, Fall 2008, Final Examination 11 December Please do not turn the page until everyone is ready.

Runtime Behavior of Conversion Interpretation of Subtyping

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011

Featherweight Java (FJ)

3.Constructors and Destructors. Develop cpp program to implement constructor and destructor.

The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into

CS-XXX: Graduate Programming Languages. Lecture 9 Simply Typed Lambda Calculus. Dan Grossman 2012

Chapter 5 Object-Oriented Programming

Programming Languages (PL)

Intermediate Code Generation Part II

CSCI-GA Scripting Languages

Static Checking and Type Systems

CSE 505, Fall 2008, Final Examination 11 December Please do not turn the page until everyone is ready.

Compilation 2012 Static Type Checking

Programming with Types

Tradeoffs. CSE 505: Programming Languages. Lecture 15 Subtyping. Where shall we add useful completeness? Where shall we add completeness?

Typed Compilation Against Non-Manifest Base Classes

CS2110 Assignment 3 Inheritance and Trees, Summer 2008

Programming Languages Lecture 14: Sum, Product, Recursive Types

Less naive type theory

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages

Chapter 5: Procedural abstraction. Function procedures. Function procedures. Proper procedures and function procedures

Finite Model Generation for Isabelle/HOL Using a SAT Solver

Parametric Polymorphism for Java: A Reflective Approach

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Pierce Ch. 3, 8, 11, 15. Type Systems

CONTENTS. PART 1 Structured Programming 1. 1 Getting started 3. 2 Basic programming elements 17

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

Constrained Types and their Expressiveness

GADTs meet Subtyping

Resolving of Intersection Types in Java

Shared Subtypes. Subtyping Recursive Parameterized Algebraic Data Types

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language

type classes & locales

Advances in Programming Languages

BOSTON UNIVERSITY GRADUATE SCHOOL OF ARTS AND SCIENCE. Dissertation

College Board. AP CS A Labs Magpie, Elevens, and Picture Lab. New York: College Entrance Examination Board, 2013.

Core Java - SCJP. Q2Technologies, Rajajinagar. Course content

Introduction to Programming Using Java (98-388)

Jam: A Smooth Extension With Java Mixins

The Case for Simple Object-Orientation in VDM++ Erik Ernst Aarhus University, Denmark

Review. CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Let bindings (CBV) Adding Stuff. Booleans and Conditionals

Index. Index. More information. block statements 66 y 107 Boolean 107 break 55, 68 built-in types 107

Object Oriented Issues in VDM++

CSE 505, Fall 2009, Final Examination 14 December Please do not turn the page until everyone is ready.

Lambda Calculus and Type Inference

Al al-bayt University Prince Hussein Bin Abdullah College for Information Technology Computer Science Department

Conversion vs. Subtyping. Lecture #23: Conversion and Type Inference. Integer Conversions. Conversions: Implicit vs. Explicit. Object x = "Hello";

Lecture #23: Conversion and Type Inference

CSE 431S Type Checking. Washington University Spring 2013

Gradual Typing with Union and Intersection Types

Copyright c 2008 Sun Microsystems, Inc. ( Sun ). All rights are reserved by Sun except as expressly stated as follows. Permission to make digital or

CSE 505, Fall 2006, Final Examination 11 December Please do not turn the page until everyone is ready.

Compiler Construction 2009/2010 Polymorphic Types and Generics

The Design of Core C++ (Notes)

Haskell 98 in short! CPSC 449 Principles of Programming Languages

Paytm Programming Sample paper: 1) A copy constructor is called. a. when an object is returned by value

Polymorphism. Lecture 19 CS 565 4/17/08


Software Development & Education Center. Java Platform, Standard Edition 7 (JSE 7)

104. Intermediate Java Programming

arxiv:cs/ v1 [cs.pl] 7 Dec 2005

Outline. Object Oriented Programming. Course goals. Staff. Course resources. Assignments. Course organization Introduction Java overview Autumn 2003

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

Simplifying and Improving Qualified Types

CS 565: Programming Languages. Spring 2008 Tu, Th: 16:30-17:45 Room LWSN 1106

Programming Languages

Second-generation: Assembly language. Figure 6.1 Generations of programming languages. Assembly Language Characteristics.

Chapter 6: Programming Languages

JAVA MOCK TEST JAVA MOCK TEST II

Inheritance and Overloading in Agda

Data Types. Every program uses data, either explicitly or implicitly to arrive at a result.

First-Class Type Classes

MIT Semantic Analysis. Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology

SY nd Sem Syllabi-All Courses.xlsx - 2S-APCSA Page 1 of 5

Syllabus & Curriculum for Certificate Course in Java. CALL: , for Queries

Calculus of Inductive Constructions

Type-indexed functions in Generic Haskell

Note 3. Types. Yunheung Paek. Associate Professor Software Optimizations and Restructuring Lab. Seoul National University

CS4215 Programming Language Implementation. Martin Henz

Chapter 3. Describing Syntax and Semantics

CA Compiler Construction

Assistant for Language Theory. SASyLF: An Educational Proof. Corporation. Microsoft. Key Shin. Workshop on Mechanizing Metatheory

The Sun s Java Certification and its Possible Role in the Joint Teaching Material

Subtyping. Lecture 13 CS 565 3/27/06

Embedding logics in Dedukti

15CS45 : OBJECT ORIENTED CONCEPTS

CS-XXX: Graduate Programming Languages. Lecture 23 Types for OOP; Static Overloading and Multimethods. Dan Grossman 2012

COMP 181. Agenda. Midterm topics. Today: type checking. Purpose of types. Type errors. Type checking

Chapter 11 Object and Object- Relational Databases

Polymorphism and Type Inference

Atelier Java - J1. Marwan Burelle. EPITA Première Année Cycle Ingénieur.

Transcription:

ERC 4th Workshop Sukyoung Ryu August 26, 2010

: Members Coq Mechanization of Basic Core Fortress for Type Soundness Adding Pattern Matching to Existing Object- Oriented Languages FortressCheck: Automatic Testing for Implicit Parallelism and Generic Properties 1

: Undergraduates TeachScheme / Code-share / education for everyone Data Processing and 3D Visualization of High-Speed Medical Imaging System 2

: Collaborators 나현익: Binary Methods Support Using Self-Type Idiom in Fortress 김준범: Cloud Computing for Large-Scale Scientific Data Analysis PLRG @ Sun Labs, Oracle: Type-checking Modular Multiple Dispatch with Parametric Polymorphism and Multiple Inheritance 3

Project Fortress A multicore language for scientists and engineers Run your whiteboard in parallel! v norm = v/ v a k x k k 1:n C = A B y = 3x sin x cos 2x log log x Growing a Language Guy L. Steele Jr., keynote talk, OOPSLA 1998 4

Formalism for Fortress Fortress calculi > Basic core Fortress > Core Fortress with where clauses > Core Fortress with overloading > Acyclic core Fortress with field definitions For each Fortress calculus > Syntax > Static semantics > Dynamic semantics > Type soundness proof 5

Fortress Type System Traits are like Java TM interfaces, but may contain code Objects are like Java TM classes, but may not be extended Multiple inheritance of code (but not fields) > Objects with fields are the leaves of the hierarchy Traits and objects may be parameterized > Parameters may be types or compile-time constants Primitive types are first-class > Booleans, integers, floats, characters are all objects 6

Example: Binary Tree in Fortress trait Tree getter item(): Z32 getter depth(): Z32 end object Node(left: Tree, item: Z32, right: Tree) extends Tree getter depth(): Z32 = 1 + (left.depth MAX right.depth) end object Leaf(item: Z32) extends Tree getter depth(): Z32 = 1 end 7

Basic Core Fortress (BCF) α, β type variables τ, τ, τ ::= α σ type σ ::= N O τ named type N, M, L ::= T τ Object trait type p ::= d e program d ::= td od definition td ::= trait T α extends N extends { N } fd end od ::= object O α extends N ( x:τ) extends { N } fd end fd ::= f α extends N ( x:τ):τ = e trait definition object definition method definition e ::= x expression self O τ ( e) e.x e.f τ ( e) 8

Core Fortress with Overloading BCF + overloading Overloading > Multiple declarations for the same functional name > Several of the overloaded declarations may be applicable to any particular functional call 9

Functionals in Fortress Functionals > Functions Top-level functions Local functions > Methods Dotted methods Functional methods Special functionals > Operators > Coercions 10

Functionals in Fortress Functionals > Functions first-class values Top-level functions top-level in components or APIs Local functions within blocks > Methods have owners (traits or objects) Dotted methods implicit self Functional methods explicit self Special functionals > Operators top-level functions or functional methods > Coercions special dotted methods 11

Why Functional Methods? For data extensibility and encapsulation For function extensibility even with top-level functions For mathematical syntax with overloaded operators trait Matrix excludes Vector opr (self, other: Vector): Matrix opr (other: Vector, self): Matrix end v M + M v 12

Fortress Overloading Goal No ambiguous nor undefined calls at run time Challenges Modular Multiple dispatch & Multiple inheritance a Solution Static overloading rules to guarantee the goal a Modular Multiple Dispatch with Multiple Inheritance, Eric Allen, J.J. Hallett, Victor Luchangco, Sukyoung Ryu, and Guy L. Steele Jr. SAC 2007: 22nd Annual ACM Symposium on Applied Computing 13

Overloading Rules Compare overloaded declarations pairwise. If any rule holds then a valid overloading: > Exclusion Rule Parameter types exclude each other. > Subtype Rule Parameter type of one declaration is a subtype of the other. Return types must also be in subtype relation. > Meet Rule Exists a declaration that is more specific than both. 14

Overloading Resolution Proof Theorem 1. If all the overloaded declarations satisfy the static overloading rules, there are no ambiguous nor undefined calls at run time. 15

How about Generic Functionals? size α extends Any ( l: ArrayList α ) : Z size β extends Z ( l: List β ) : Z where ArrayList T <: List T for all types T 16

How about Generic Functionals? size α extends Any ( l: ArrayList α ) : Z size β extends Z ( l: List β ) : Z where ArrayList T <: List T for all types T size γ extends Z ( l: ArrayList γ ) : Z 17

How about Generic Functionals? size α extends Any ( l: ArrayList α ) : Z size β extends Z ( l: List β ) : Z where ArrayList T <: List T for all types T size γ extends Z ( l: ArrayList γ ) : Z BadList <: { ArrayList String, List Z } The first two are applicable to BadList but not the third. 18

Generic Overloading Rules a No Duplicates Rule Meet Rule Return Type Rule Polymorphic Exclusion A type (other than BottomType) must not be a subtype of multiple distinct instantiations of a type constructor. a Type-checking Modular Multiple Dispatch with Parametric Polymorphism and Multiple Inheritance, Eric Allen, Justin Hilburn, Scott Kilpatrick, Sukyoung Ryu, David Chase, Victor Luchangco, and Guy L. Steele Jr. (submitted) 19

More Features to Prove Pattern matching ( 박창희 & Guy Steele) Self-type idiom ( 나현익 & Victor Luchangco) Generic overloaded functionals (Sun Labs, Oracle) Where clauses Coercions Type inferene... 20

More Fun to Do Fortress > Static checks and analyses > FortressCheck > Fortress calculi mechanization in Coq And beyond > Program analyses for medical imaging systems > Teaching material for KSA (Korea Science Academy) & education for everyone 21

Sukyoung Ryu sryu@cs.kaist.ac.kr http://plrg.kaist.ac.kr