Sie sind auf Seite 1von 3

MIT 6.

001: Structure &


Interpretation of Computer
Programs
Introduction to Computation
Types of knowledge

Declarative: What is knowledge.


o Example: geometry, sqrt(x) is the y such that y2 = x and y x.
Imperative: How to knowledge.
o Example: computer science.
Understanding the process of information transformation.
Example: the steps taken to approximate a square root.
o Procedure: The recipe for describing imperative knowledge.
o Process: the actual sequence of steps resulting in information
transformation.

Why imperative?
Instead of storing information, its thought its more useful to capture the process of
deducing a particular value.

Describing imperative knowledge


A language to describe imperative knowledge should have several components:

Vocabulary: the basic elements of computation (simple data and procedures).


Syntax: a set of rules for connecting these elements together.
Semantics: a set of rules to assign meaning to these constructs.
Procedures: a set of rules on how to combine these expressions to describe
computation.

The Goal
To control the complexity in large systems by using language. The way we do this is build
something large and complex, and then abstract it to treat it as a primitive.

Managing complexity
Abstraction: isolating the use of a procedure from its actual implementation to form a
black box that takes inputs to provide outputs.
Interfaces: the standard ways of connecting abstracted basic units together.

Manifest typing
Streams
Object-oriented programming

Meta-linguistic abstraction: the process of generalizing computational machinery into a


language oriented for a particular domain.

Layered languages (new problems)


Hardware/register languages
Scheme evaluator(s)
Manipulation of programs: compilation

Representing basic information


Numbers, characters, and Booleans are the basic data structures we have, and the
assumption is that our language provides primitive operators for manipulating these
primitive data structures.
The simplest case is said to be self-evaluating expressions (the value is the object itself)

Numbers
o The most basic representation is said to be the bit that can be either 0 or 1.
o A sequence of bits can form larger structures representing larger numbers
or even words though encoding.
o The highest order bit can be reserved to indicate positive or negative
numbers.
o This concept is thus abstracted to avoid too much detail (namely having to
deal with operations on individual bits).
o Can include integers, real numbers, and scientific notation numbers.
o Operators: +, -, *, /, >, <, , , =
Strings
o Sequences of characters (including numbers and special characters).
o All delimited by double quotes.
o Symbolic rather than numeric.
o Operators: string-length, string=?
Booleans
o Logical values (true or false) rather than symbolic or numeric.
o Operators: and, or, not

Primitive procedures: are themselves treated as expressions with values. In scheme we


can ask for the underlying mechanism for performing a procedure.

Das könnte Ihnen auch gefallen