week1 Flashcards

(37 cards)

1
Q

programming language

A

describing computer programs
implementable
unambiguous
expressing algorithms to ppl

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

halting problem

A

cannot be computed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

apl

A

oriented toward matrix operations

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

turing complete

A

it is possible to write, in that language, a program that can compute anything that a Turing machine could compute.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

turing machine

A

mathematical model of a computing engine

abstract mathematical model of computation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

state machine

A

set of states and notion of current state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

church’s thesis

A

any computable function can be implemented by a turing machine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

universal turing machine

A

emulate any other tm

given a TM m and an input p, a UTM can emulate the behavior of m on p

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

3 requirements to be tm

A

variable (notion of state)
conditional (show all features can be implemented)
jump (way to transition back to prev state)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

some examples of “power” of a language

A
concise
readability
resusability
versatility
strong typing (for deub)
protability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

high level language

A
  • strong abstraction from the details of the computer.
  • few, if any, language elements that translate directly into a machine’s native opcodes
  • hll can either be interpreted, compiled, or translated to get to lll or ml
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

low level language

A

reflects the underlying hardware: storage, test, jump, arith

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

imperative pl

A
  • state based on storage
  • programs are sequences of statements that modify state and other statements determine flow of control
  • describes process to get final answer “how its being computed”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

oo pl

A
  • lang w sophisticated type systems supporting inheritance
  • typically also imperitive (c++, java, obj c)
  • oo features can be other categories of pl
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

declarative pl

A
  • programs are descriptions of what is to be computed but not how
  • functional languages, logic lang
  • expresses the logic of a computation without describing its control flow
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

functional languages

A
  • variables are not modifiable, represent single value
  • programs consist of functions that can be recursive (math)
  • no loops, can’t modify existing variables
  • declarative
17
Q

logic languages

A
  • declarative
  • based on 1st order logic (relations)
  • i.e. prolog
18
Q

scripting lang

A
  • a domain-specific language for a particular environment

- dynamic high-level general-purpose language,

19
Q

syntax

A
  • rules governing the use of words and sentences in the language
  • using grammars
20
Q

semantics

A
  • define the meaning of the valid syntactic constructs in the language
21
Q

static semantics vs dynamic semantics

A

static - governs the use of types

dynamic - indicates what a construct does

22
Q

assembler

A
  • translate mnemonics and ml language

- machine independent

23
Q

compiler

A
  • translates HLL to assembly or ml

- better for maintenence

24
Q

declarative vs imperative

A

declarative - WHAT a computer should do

imperative - HOW a computer should do it

25
lambda calc
formal computational model | - a program = function from inputs to outputs defined in terms of simper functions through refinement
26
dataflow
flow fo info among primitive nodes
27
von neuman
modification of variables and statements/assignments that influence further computation
28
compilation: | source program => ? => ?
source program => compiler => target input => target => output i.e. source program is compiled into target then input is fed into that target to receive corresponding output
29
interpretation: | source program =>
source program => interpreter input => interpreter interpreter => output i.e. source program and input goes to interpreter, then to output
30
compiler
- translate HL source into target program - better performance - decision made at compile time (variable location) can be saved
31
interpreter
- stags during execution - implements vm whose "ML" is the HLPL - greater flexibility and better diagnostic (error msg) - ex = lisp and prolog
32
mixed model: | source program =>
source program => translator => intermed prog => virtual m input => virtual m virtual m => output i.e. source program is translated to intermediate program; both input and intermediate program is fed into virtual machine for output.
33
intermediate form
used preprocessor to create tokens of keywords to mirror structure of source
34
library routines & linking : ex fortran -> ex2 source program:
fortran -> compiler -> incomplete ML incomplete ML & library routines -> linker -> ml program i.e. use library of subroutines ("extensions" to hardware instruction set source prog -> compiler -> assembly -> assembler -> ML
35
preprocessor define and ex: source ->
allows for conditional compilation to allow several versions of program to be built from same source source -> preprocessor -> modified source program -> compiler -> assembly
36
ex of preprocessor and intermediate lang in c | source ->
source -> preprocesor -> modified source -> c++ compiler -> c code -> c compiler -> assembly
37
phases of compiler
1) lexer : text- > tokens 2) parser : tokens -> parser tree 3) semantic analysis 4) int code generator 5) optimization 6) target code