the power of abstraction barbara liskov november 2009
TRANSCRIPT
![Page 1: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/1.jpg)
The Power of Abstraction
Barbara LiskovNovember 2009
![Page 2: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/2.jpg)
Outline
Inventing abstract data types CLU Type hierarchy What next
![Page 3: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/3.jpg)
Data Abstraction Prehistory
The Venus machine
![Page 4: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/4.jpg)
The Interdata 3
![Page 5: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/5.jpg)
Data Abstraction Prehistory
The Venus machine The Venus operating system
![Page 6: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/6.jpg)
Data Abstraction Prehistory
The Venus machine The Venus operating system Programming methodology
![Page 7: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/7.jpg)
Programming Methodology
How should programs be designed?
How should programs be structured?
![Page 8: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/8.jpg)
The Landscape
E. W. Dijkstra. Go To Statement Considered Harmful. Cacm, Mar. 1968
![Page 9: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/9.jpg)
The Landscape
N. Wirth. Program Development by Stepwise Refinement. Cacm, April 1971
![Page 10: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/10.jpg)
The Landscape D. L. Parnas. Information
Distribution Aspects of Design Methodology. IFIP Congress, 1971
“The connections between modules are the assumptions which the modules make about each other.”
![Page 11: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/11.jpg)
Partitions
B. Liskov. A Design Methodology for Reliable Software Systems. FJCC, Dec. 1972
![Page 12: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/12.jpg)
Partitions
Partition state
op1 op2 op3
![Page 13: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/13.jpg)
From Partitions to ADTs
How can these ideas be applied to building programs?
![Page 14: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/14.jpg)
Idea
Connect partitions to data types
![Page 15: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/15.jpg)
Meeting in Savanah
ACM Sigplan-Sigops interface meeting. April 1973. (Sigplan Notices, Sept. 1973)
Started to work with Steve Zilles
![Page 16: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/16.jpg)
The Landscape
Extensible Languages S. Schuman and P. Jourrand.
Definition Mechanisms in Extensible Programming Languages. AFIPS. 1967
R. Balzer. Dataless Programming. FJCC 1967
![Page 17: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/17.jpg)
The Landscape
O-J. Dahl and C.A.R. Hoare. Hierarchical Program Structures. Structured Programming, Academic Press, 1972
![Page 18: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/18.jpg)
The Landscape
J. H. Morris. Protection in Programming Languages. Cacm. Jan. 1973
![Page 19: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/19.jpg)
The Landscape
W. Wulf and M. Shaw. Global Variable Considered Harmful. Sigplan Notices. Feb. 1973.
![Page 20: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/20.jpg)
Abstract Data Types B. Liskov and S. Zilles.
Programming with Abstract Data Types. ACM Sigplan Conference on Very High Level Languages. April 1974
![Page 21: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/21.jpg)
What that paper proposed
Abstract data types A set of operations And a set of objects The operations provide the only way
to use the objects
![Page 22: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/22.jpg)
What that paper proposed
Abstract data types Clusters with encapsulation
Polymorphism Static type checking (we hoped) Exception handling
![Page 23: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/23.jpg)
From ADTs to CLU
Participants Russ Atkinson Craig Schaffert Alan Snyder
![Page 24: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/24.jpg)
![Page 25: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/25.jpg)
Why a Programming Language?
Communicating to programmers Do ADTs work in practice? Getting a precise definition Achieving reasonable performance
![Page 26: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/26.jpg)
Language Design
Goals Expressive power, simplicity,
performance, ease of use
Minimality Uniformity Safety
![Page 27: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/27.jpg)
Language Design
Restrictions No concurrency No go tos No inheritance
![Page 28: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/28.jpg)
Some Assumptions/Decisions
Heap-based with garbage collection!
No block structure! Separate compilation Static type checking
![Page 29: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/29.jpg)
CLU Mechanisms
Clusters Polymorphism Exception handling Iterators
![Page 30: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/30.jpg)
Clusters
IntSet = cluster is create, insert, delete, isIn, …
end IntSet
![Page 31: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/31.jpg)
Clusters
IntSet = cluster is create, insert, delete, …end IntSet
IntSet s := IntSet$create( )IntSet$insert(s, 3)
![Page 32: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/32.jpg)
Clusters
IntSet = cluster is create, insert, delete, …
rep = array[int]
![Page 33: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/33.jpg)
Clusters
IntSet = cluster is create, insert, delete, …
rep = array[int]
create = proc ( ) returns (cvt) return (rep$create( )) end create
![Page 34: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/34.jpg)
Polymorphism
Set = cluster[T: type] is create, insert, …
end Set
Set[int] s := Set[int]$create( )Set[int]$insert(s, 3)
![Page 35: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/35.jpg)
Polymorphism
Set = cluster[T: type] is create, insert, … where T has equal: proctype(T, T) returns (bool)
![Page 36: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/36.jpg)
Polymorphism
Set = cluster[T: type] is create, insert, … where T has equal: proctype(T, T) returns (bool)
rep = array[T]
insert = proc (x: cvt, e: T) … if e = x[i] then …
![Page 37: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/37.jpg)
Exception Handling
J. Goodenough. Exception Handling: Issues and a Proposed Notation. Cacm, Dec. 1975 Termination vs. resumption How to specify handlers
![Page 38: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/38.jpg)
Exception Handling
choose = proc (x: cvt) returns (T)
signals (empty) if rep$size() = 0 then signal empty …
![Page 39: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/39.jpg)
Exception Handling
choose = proc (x: cvt) returns (T)
signals (empty) if rep$size() = 0 then signal empty …
set[T]$ choose(s) except when empty: …
![Page 40: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/40.jpg)
Exception Handling
Handling Propagating Shouldn’t happen
The failure exception Principles
Accurate interfaces Avoid useless code
![Page 41: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/41.jpg)
Iterators
For all x in C do S
![Page 42: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/42.jpg)
Iterators
For all x in C do S Destroy the collection? Complicate the abstraction?
![Page 43: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/43.jpg)
Visit to CMU
Bill Wulf and Mary Shaw, Alphard Generators
![Page 44: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/44.jpg)
Iterators
sum: int := 0for e: int in Set[int]$members(s) do sum := sum + e end
![Page 45: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/45.jpg)
Iterators
Set = cluster[T] is create, …, members, …
rep = array[T]
members = iter (x: cvt) yields (T) for z: T in rep$elements(x) do yield (z) end
![Page 46: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/46.jpg)
After CLU
Argus and distributed computing Type Hierarchy
![Page 47: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/47.jpg)
The Landscape
Inheritance was used for: Implementation Type hierarchy
![Page 48: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/48.jpg)
Implementation Inheritance
Violated encapsulation!
![Page 49: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/49.jpg)
Type hierarchy
Wasn’t well understood E.g., stacks vs. queues
![Page 50: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/50.jpg)
The Liskov Substitution Principle (LSP)
Objects of subtypes should behave like those of supertypes if used via supertype methods
B. Liskov. Data abstraction and hierarchy. Sigplan notices, May 1988
![Page 51: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/51.jpg)
Polymorphism
where T has … vs. where T subtype of S
Proofs happen at different times!
![Page 52: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/52.jpg)
What Next?
Modularity based on abstraction is the way things are done
![Page 53: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/53.jpg)
Challenges
New abstraction mechanisms? Massively Parallel Computers Internet Computer
Storage and computation Semantics, reliability, availability,
security
![Page 54: The Power of Abstraction Barbara Liskov November 2009](https://reader036.vdocuments.us/reader036/viewer/2022062422/56649f135503460f94c2736f/html5/thumbnails/54.jpg)
The Power of Abstraction
Barbara LiskovOctober 2009