Abstraction in computer science timothy colburn gary shute
1 / 34

Abstraction In Computer Science Timothy Colburn Gary Shute - PowerPoint PPT Presentation

  • Uploaded on

Abstraction In Computer Science Timothy Colburn Gary Shute. Science and Models Computer Science and Mathematics Abstraction in Mathematics Information Neglect vs. Information Hiding Abstraction in Computer Science. Science and Models.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Abstraction In Computer Science Timothy Colburn Gary Shute' - cheche

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Abstraction in computer science timothy colburn gary shute
Abstraction In Computer ScienceTimothy ColburnGary Shute

  • Science and Models

  • Computer Science and Mathematics

  • Abstraction in Mathematics

  • Information Neglect vs. Information Hiding

  • Abstraction in Computer Science

Science and models
Science and Models

  • All legitimate sciences build and study mathematical models of their subject matter. For example:

    • Graph-theoretic models of molecules

    • Models of forest growth, climate change

    • Models of demographic trends, etc.

  • Their role is one of supporting scientific reasoning in an attempt to discover explanations of observed phenomena.

Science and models cont d
Science and Models (cont'd)

  • Carnap:

    • "Formal science [that is, logic and mathematics] ... is an auxiliary component introduced for technical reasons in order to facilitate linguistic transformations in the factual [that is, empirical] sciences."

Science and models cont d1
Science and Models (cont'd)

  • The nonmathematical models of empirical science are arrangements of experimental apparatus to test hypotheses

  • Example:

    • high-energy particle accelerators to model conditions in the early universe to test hypotheses concerning the number of neutrino families there are

Computer science and models
Computer Science and Models

  • The primary models of computer science are models of computational processes.

  • A computational process is an instance of a program execution:

    • comprises dynamic electronic events

    • described statically in textual artifacts written in programming languages

Programs as abstractions
Programs as Abstractions

  • The elements of computational processes that are described in textual programs might be as basic as binary digits (bits) and machine registers, or as familiar as telephone books and shopping carts.

  • Textual programs are always abstractions of the electronic events that will ultimately occur.

  • One of the most remarkable features of such abstractions is that they not only describe computational processes but also bring them about.

Software s medium of description vs its medium of execution
Software's Medium of Description vs. Its Medium of Execution

c = a + b

High-level language program


Machine language






physical state

of bistable

memory elements

Formal languages as abstract tools
Formal Languages as Abstract Tools

  • The power and utility of tools like compilers, assemblers, and link-loaders mask the fundamental fact that to program a machine is to put its memory into a certain physical state.

  • The various levels of formal language that we use today to describe these states are abstract tools for achieving this.

Computer science and mathematics
Computer Science and Mathematics

  • Computer science, insofar as it is concerned with software, is distinguished from the empirical sciences in that the only models it builds and studies are abstractions.

  • Mathematics is also distinguished from the empirical sciences in that the types of models it builds and studies are abstractions.

  • Should we be tempted to infer that computer science is a subspecies of mathematics?

Abstraction in mathematics
Abstraction in Mathematics

  • Among philosophers of mathematics there is agreement on the nature of mathematical abstraction being to remove the meaning of specific scientific terms.

  • Cohen and Nagel:

    • A system is deductive not in virtue of the special meaning of its terms, but in virtue of the universal relations between them. The specific quality of the things which the terms denote do not, as such, play any part in the system.

  • Consider the validity of modus ponens.

Abstraction in mathematics cont d
Abstraction in Mathematics (cont'd)

  • It is even common in mathematics to reduce as far as possible the use of abstractions themselves.

  • Whitehead and Russell (means "reduced to"):

    • real numbers  Dedekind cuts (sets) of rational numbers

    • rational numbers  equivalence classes of pairs of integers

    • integers  equivalence classes of pairs of counting numbers

    • counting numbers  sets of sets

Formal abstraction in computer science
Formal Abstraction in Computer Science

  • Turing machines are abstractions of computing devices

  • A Turing machine is defined as a quadruple (K,,,s) where:

    • K is a finite set of states,

    •  is an alphabet of symbols,

    •  is a function from K x   K, and

    • s K is the initial state

  • Computation is a mathematical concept, and studying it will naturally involve mathematical methods.

Two kinds of mathematical abstraction
Two Kinds of Mathematical Abstraction

  • Mathematical abstraction aids in discovering universal properties or relationships

    • for example, deducing the relationships between the lengths of the sides of any right triangle, or

    • proving that the halting problem is unsolvable

  • Mathematical abstraction is employed when deciding that certain properties are irrelevant when reasoning about the properties of the class of such things as a whole

    • for example, the color of a right triangle, or

    • the speed of a computing device

Two kinds of mathematical abstraction cont d
Two Kinds of Mathematical Abstraction (cont'd)

  • The abstraction of form in favor of content

  • The abstraction of certain features in favor of others

  • Cohen and Nagel:

    • A deductive system is therefore doubly abstract: it abstracts from the specific qualities of a subject matter, and it selects some relations and neglects others

Information neglect vs information hiding
Information Neglect vs. Information Hiding

  • Any science succeeds by constructing formal mathematical models of their subject matter that eliminate inessential details--information neglect

  • Computer science is unique among all sciences, including mathematics, in the use of a kind of abstraction that computer scientists call information hiding

Abstraction as information hiding
Abstraction as Information Hiding

  • Computer science abstraction tools hide, but do not neglect, details that are essential in a lower-level processing context but inessential in a software design and programming context

  • Details can be essential in one context and inessential in another because of abstraction and translation tools that have evolved over the history of software development

Kinds of abstraction in computer science
Kinds of Abstraction in Computer Science

  • Abstraction of processor and memory

  • Abstraction of language

  • Abstraction of software architecture

  • Abstraction of computing resources

  • Abstraction of network architecture

Abstraction of processor and memory
Abstraction of Processor and Memory

  • Charles Babbage's Analytical Engine design (19th century):

    • mill (processor), store (memory), and punched cards (program)

  • Had this design been realized in cogs and gears, we would regard it as a stored-program computer, even though it was not electronic

  • A stored program computer itself is an abstraction that can be realized by devices in disparate realms

Abstractions of processor and memory cont d

Subroutine, Function



Abstract data type

Garbage collector



Virtual machine

Abstractions of Processor and Memory (cont'd)

  • Bit, Byte

  • Logic gate

  • Register

  • Adder, Shifter

  • Machine instruction

  • Machine data type

  • Memory variable

Procedural abstraction
Procedural Abstraction

Consider the algorithm:

for i = 1 to n do

for j = 1 to m do


for j = 1 to m do

for k = 1 to p do

read (B[j,k])

for i = 1 to n do

for k = 1 to p do begin

C[i,k] = 0

for j = 1 to m do

C[i,k] = C[i,k] + A[i,j] * B[j,k]


Question: What does this algorithm do?

Procedural abstraction cont d
Procedural Abstraction (cont'd)

Answer: It fills an n x m matrix A and an m x p matrix B

with numbers and multiplies them, putting the result in

an n x p matrix C such that:


j = 1

A much easier representation to read:




Abstractions of language
Abstractions of Language

  • Language Abstraction: abstraction of the content of computer instructions, allowing descriptions with more expressive power.

    • Machine Language: 01000000010101110001000001010010

    • Assembly Language: addb r7,sum

    • High-Level Language: SQRT(B^2 - 4*A*C)

    • Algebraic language:

  • Programming paradigms constitute general models of computer problem solving which any one of a number of particular programming languages may attempt to instantiate.

The imperative programming paradigm
The Imperative Programming Paradigm

  • Assembly Languages

    • Objects: memory locations and registers

    • Actions: loading and storing memory, shifting bits, etc.

  • Procedural Languages (C, Pascal, Ada)

    • Objects: procedures, matrices, etc.

    • Actions: calling a procedure, multiplying matrices, etc.

The functional programming paradigm
The Functional Programming Paradigm

  • Languages like Lisp, Scheme, and ML:

    • Objects: Functions, arguments, and values

    • Actions: Function calls

  • Insofar as lambda calculus is an appropriate information modeling language for real-world problems, functional programming languages are also appropriate.

The logic oriented programming paradigm
The Logic-Oriented Programming Paradigm

  • Languages like Prolog:

    • Objects: Facts, logic variables, rules, and goals

    • Actions: Goal matching, rule firing, backtracking

  • Also called a declarative programming paradigm

Artificial intelligence and knowledge representation in prolog
Artificial Intelligence and Knowledge Representation in Prolog

  • A rule: X is a grandparent of Y if there is a Z such that X is a parent of Z and Z is a parent of Y

  • A Prolog program:

    grandparent(X,Y) :- parent(X,Z), parent(Z,Y).

    parent(pat, priscilla).

    parent(priscilla, cecilia).

  • A Prolog query:

    ? grandparent(Who, cecilia).

  • Prolog answer:

    Who = pat

The object oriented programming paradigm
The Object-Oriented Programming Paradigm Prolog

  • Languages like C++, Java, Smalltalk, Eiffel:

    • Objects: Classes, instances of classes, and class methods

    • Actions: Instantiation of classes, calling of methods (sending messages)

  • An important aspect of this paradigm is the arrangement of classes of objects in a hierarchy, allowing for the inheritance of both features and operations by one class from another.

Oop example bank account hierarchy
OOP Example: Bank Account Hierarchy Prolog








Compute Interest













Change Password

Abstraction of computing resources
Abstraction of Computing Resources Prolog

  • The logical view of a computing system is that provided to an application programmer of the system's physical state of affairs

  • Virtualization is the process involved in converting a physical view to a logical view. Purpose:

    • creates a simpler, abstract view for application programmers (information hiding)

    • minimizes resource management problems by allowing resources to be shared without conflict

Virtualizable resources
Virtualizable Resources Prolog

  • A single physical system can have multiple processes

  • Single physical resources that are virtualized for each separate process:

    • Displays

    • Mice and keyboards

    • Disk storage

    • Printers

    • Networks

Virtualization mechanisms
Virtualization Mechanisms Prolog

  • Mechanisms for giving the appearance of multiple instances of a resource

    • Time sharing

    • Partitioning

Abstraction of software architecture
Abstraction of Software Architecture Prolog

  • Architectural patterns:

    • Multi-Layer

    • Client-Server, Peer-to-Peer

    • Broker

    • Transaction-Processing

    • Pipe-and-Filter

    • Model-View-Controller

Abstraction of network architecture
Abstraction of Network Architecture Prolog

  • Application layer: includes protocols that support network applications (HTTP, SMTP, FTP)

  • Transport layer: transports application layer messages (TCP, UDP)

  • Network layer: routes packets from one host to another using IP

  • Link layer: provides services to the network layer

  • Physical layer: moves individual bits from one node to the next

Conclusions Prolog

  • The use of abstraction tools in computer science is unique and sharply distinguishes it from mathematics.

  • The evolution of programming languages is tied to ever-increasing abstraction tools and methods, the current embodiment of which only happens to be object-oriented programming.

  • In computer science, the more complex the technology, the more removed from technology's complexity its users become.