Respectful Type Converters

Slides:



Advertisements
Similar presentations
CS 355 – Programming Languages
Advertisements

8 November Forms and JavaScript. Types of Inputs Radio Buttons (select one of a list) Checkbox (select as many as wanted) Text inputs (user types text)
Feb. 23, 2004CS WPI1 CS 509 Design of Software Systems Lecture #5 Monday, Feb. 23, 2004.
1 Abstraction  Identify important aspects and ignore the details  Permeates software development programming languages are abstractions built on hardware.
Web Programming : Building Internet Applications Chris Bates CSE :
CS551 - Lecture 11 1 CS551 Object Oriented Middleware (III) (Chap. 5 of EDO) Yugi Lee STB #555 (816)
1 Software Design Lecture What’s Design It’s a representation of something that is to be built. i.e. design  implementation.
D. WijesekeraSWE 699/IT 823: Precise Modeling1 Typing A Behavioral Notion of Subtyping By Barbara Liskov and Jeannette M. Wing in ACM Trans. Of Prog. Languages.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
Transparent Format Migration of Preserved Web Content D. S. H. Rosenthal, T. Lipkis, T. S. Robertson, S. Morabito Lib Magazine, 11(1), 2005
Topic: Binary Encoding – Part 2
Logical Database Design and the Rational Model
NUMBER SYSTEMS.
Lec 3: Data Representation
Arithmetic Shifts and Character Representation
Design by Contract Jim Fawcett CSE784 – Software Studio
Design by Contract Jim Fawcett CSE784 – Software Studio
Chapter 2 Database Environment.
3.1 Denary, Binary and Hexadecimal Number Systems
Java Coding – part 2 David Davenport Computer Eng. Dept.,
HTTP and Abstraction on the Internet
Compiler Construction (CS-636)
6.001 SICP Variations on a Scheme
OCR Computing for GCSE © Hodder Education 2011
XML QUESTIONS AND ANSWERS
CS 326 Programming Languages, Concepts and Implementation
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
Web Ontology Language for Service (OWL-S)
Introduction to JavaScript
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
UML to XSD.
Introduction to data converters
Introduction to data converters
Chapter 2 Database Environment.
Chapter 2: Database System Concepts and Architecture
Lecture 23 Polymorphism Richard Gesick.
Syntax Questions 6. Define a left recursive grammar rule.
Chapter 2 Database Environment Pearson Education © 2009.
Chapter 2 Database Environment.
Data Base System Lecture : Database Environment
Semantic Web: Commercial Opportunities and Prospects
Functions, Procedures, and Abstraction
ELECTRONIC MAIL SECURITY
Subtraction The arithmetic we did so far was limited to unsigned (positive) integers. Today we’ll consider negative numbers and subtraction. The main problem.
ece 627 intelligent web: ontology and beyond
ELECTRONIC MAIL SECURITY
Dynamic Scoping Lazy Evaluation
INFO/CSE 100, Spring 2005 Fluency in Information Technology
An Introduction to Software Architecture
Number Representation
Modular design of domain-specific languages
Graph Coverage for Specifications CS 4501 / 6501 Software Testing
The Metacircular Evaluator (Continued)
Storing Negative Integers
Fundamentals of Python: First Programs
Chapter 11 user support.
Learning VB2005 language (basics)
Interaction Modeling Extracted from textbook:
A Test Automation Language for Behavioral Models
Introduction to Computer Systems
OCR GCSE Computing © Hodder Education 2013 Slide 1
Chapter 2 Database Environment Pearson Education © 2009.
Chapter 2 Database Environment Pearson Education © 2009.
SECTION 4: OO METHODOLOGIES
OBJECTIVES After reading this chapter, the reader should be able to :
Web Programming : Building Internet Applications Chris Bates CSE :
Functions, Procedures, and Abstraction
COMPONENT – BASED SOFTWARE ENGINEERING MODULE 2 – SECOND SEMESTER MKHIZE, BSC HONS COMPUTER SCIENCES, DIP IT, ICDL.
Abstract Types Defined as Classes of Variables
Presentation transcript:

Respectful Type Converters Written By: Jeannette M. Wing & John Ockerbloom Presenter: Srinivas Nutulapathi

Presentation Outline Introduction Behavioral Subtyping Respects The TOM Conversion Service Incorporating Concrete Types Applications of the Respects Relation TOM Status Summary and Future Work

Introduction Tremendous growth of the Internet and the World Wide Web gives millions of people access to vast quantities of data. Users may be able to retrieve data easily, they may not be able to interpret or display retrieved data intelligibly. Users and programs cope with this problem by converting data from one type to another.

Type Converters Type converters are applied on data objects to transform an object of one type to an object of different type. Respectful Type Converters: A converter C : A -> B respects type T if the original object of type A and the converted object of type B have the same behavior when both objects are viewed as type T object.

Example The PNG to GIF converter respects bitmap, but not pixel_map.

Behavioral Subtyping Programming language has come up with many definitions of subtype relation. Goal is to determine when this assignment x :T := E is legal. x will be used according to its “apparent” type T , with the expectation that if the program performs correctly when the actual type of x’ s objects is T, it will also work correctly if the actual type of the object denoted by x is a subtype of T.

Model of Objects, Types and Computation Assume a set of all potentially existing objects , Obj, partitioned into disjoint typed sets. Type: defines a set of values for an object and a set of methods that provide the only means to manipulate or observe that object. State: defines a value for each existing object and it is a pair of mappings, an environment and a store. State = Env x Store Env = Var -> Obj Store = Obj -> Val

A type specification implicitly defines the type’s set of objects contains information like type’s name, description of set of values over which objects of type ranges. Each of type’s methods contain its name, its signature ,i.e., the types of its arguments (in order), result, and signaled exceptions and also its behavior in terms of pre-conditions and post-conditions.

Example

Subtype Relation Abstraction Function: This function relates the different value spaces for objects of different types. Renaming Map: This defines the correspondence between the methods of two types.

Respects Fig :Two compositions of Abstraction Functions from the paper

Definition of Respects Relation Definition from the paper

The first condition in the definition requires that , from T’s view point, if m is defined for A’s values, it should be defined for B’s values and vice versa. (precondition) The second condition in the definition requires that ,if given that m is defined, then its behavior must be the same for A’s values and B’s values from T’s view point. Thus both conditions together guarantee that T cannot perceive a difference between the original A object and the converted B object; thus C respects T.

An Application :TOM Conversion Service TOM involves objects, types, and their associated metadata. The kinds of types TOM supports today are different kinds of document types (e.g., Word, PowerPoint, HTML) and packages of document types (e.g., a mail message that has an embedded postscript file, a tar file, or a zip file) The kinds of conversions TOM supports are off-the-shelf converters like postscript2pdf(i.e., Adobe Distiller), off-the-web ones like latex2html, and some home-grown ones like powerpoint2html. Users can compose available converters to produce an object of a desired target type.

TOM is a connected network of type brokers. TOM can compose converters to do conversions. TOM can tell a user when a requested conversion is unsupported or meaningless.

Part of TOMs type hierarchy The critical design decision of TOM is all objects are immutable. TOM type hierarchy is carefully designed so that each subtype either only adds new methods or changes old methods in a constrained way.

Subtype conditions that hold between types in TOM hierarchy If no changes to old methods are made then the invariants are preserved and the behavior of old methods is preserved i.e., the subtype object has more extra state information. If changes to old methods are made, then part2 of subtype definition applies: the contra/covariant rules, the exception rule, and, most importantly the precondition and post condition rules must be satisfied. In general, a subtype might both extend and constrain its supertype.

Incorporating Concrete Types Respects relation can be considered interms of concrete types too. In TOM context ,integers may be represented in terms of a 32-bit sign extension byte sequence or a two’s complement, or even ASCII strings. These are all plausible concrete representations of integers and conversions between them should respect the abstract integer type.

Extending the Definition of Respects Definiton taken from the paper

Two Other Application Of the Respects Relation Type Evolution - Respects relation helps characterize what information should be preserved when types evolve. Reuse for Interoperability – Resolving mismatches among heterogeneous components. In general for n heterogeneous components, each of which is to have the same m methods defined, if all n components are subtypes of some type T, then we need only m+(n-1) functions rather than m*n functions.

Summary Converters can be characterized into three most common kinds: Those mapping from one abstract type to another abstract type. Those mapping from a super type to a subtype or vice versa. Those mapping from a concrete type to a concrete type.

Future Work Definition of respects can be extended to accommodate mutable types. Type specifications would include a predicate called type constraints, which captures what behavior may not change from state to state. Definition of respects additionally considers the preservation of type constraints and the behavior of mutator methods.

Thank You