CMPUT 174 Computation Vignette Notes
CMPUT 174 Computation Vignette Notes
e.g.) Token: the smallest meaningful unit of information in a sequence of data for a compiler; a
sequence of bits passed continuously in a fixed order and enabling a node to transmit information
- for concept maps; generally the blue nouns (noun phrases) are enclosed in a rectangle and
represent basic concepts; black verbs (two-word phrases) denote relationships between
concepts labelled on arrows -> help explain definitions using linkages
- Is a black verbs define relationships between individuals and categories
- Kind of defines sub-categories between nouns; DOES NOT WORK IN BOTH DIRECTIONS!! i.e.
every giraffe is a herbivore but not every herbivore is a giraffe
- Use inference rules to infer new relationships part of i.e. if a membrane is part of a cell and a
cell is part of an organism, then a membrane is part of an organism and kind of (with kind of,
any relation relating to a parent noun can be linked to the child noun, for example: giraffe is a
herbivore and herbivores eat plants, therefore giraffes eat plants)
Programming:
- Computation is used for computational problem solving and creating a computer application is
one kind of computational problem solving; we want a computer to perform appropriate
computations in the application
How can we get a computer to perform the appropriate computations?
Can the computer execute the computer program to perform its computation?
No. The computer program is a high-level description written in a programming language and
the computer can only execute machine instructions.
- A translator must first translate the computer program into machine instructions, which the
computer can then execute to perform the computation.
We can use an analogy to better understand the difference between a compiler and an interpreter.
Consider the problem of translating natural languages such as English, Chinese and sign language.
- There are two kinds of translation. One kind of translation is where a translator translates an
entire document from one language to another. This process is usually just called translation and
is analogous to compilation of computer languages.
The ODE has this definition for interpreter:
- A person who interprets, especially one who translates speech orally or into sign language.
Interpretation occurs in real time, since an interpreter translates speech, one phrase at a time, as a
speaker is speaking. This kind of translation is sometimes called simultaneous interpretation and is
analogous to interpretation of computer languages.
Summary: a computer program describes a computation that solves a computational problem and how
an interpreter or compiler translates this solution description into machine language instructions that a
computer executes to solve the problem.
Objects:
- Python interpreter creates the object, which has a type, value and identity
The identity of the object is unique and cannot be changed; can be represented as an address in
computer memory
The type of object determines the operations that can be performed on the object, and its format
and layout in memory (memory format). Inferring from this statement, and the fact that the memory
format cant change without disrupting close objects in memory, therefore the type of an object is
immutable (immovable)
int is a python type, that represents a whole number that supports operations (+,-,/)
the exact memory format of a type depends on the specific Python interpreter
- The object represents data