week1 Flashcards
(37 cards)
programming language
describing computer programs
implementable
unambiguous
expressing algorithms to ppl
halting problem
cannot be computed
apl
oriented toward matrix operations
turing complete
it is possible to write, in that language, a program that can compute anything that a Turing machine could compute.
turing machine
mathematical model of a computing engine
abstract mathematical model of computation
state machine
set of states and notion of current state
church’s thesis
any computable function can be implemented by a turing machine
universal turing machine
emulate any other tm
given a TM m and an input p, a UTM can emulate the behavior of m on p
3 requirements to be tm
variable (notion of state)
conditional (show all features can be implemented)
jump (way to transition back to prev state)
some examples of “power” of a language
concise readability resusability versatility strong typing (for deub) protability
high level language
- 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
low level language
reflects the underlying hardware: storage, test, jump, arith
imperative pl
- 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”
oo pl
- lang w sophisticated type systems supporting inheritance
- typically also imperitive (c++, java, obj c)
- oo features can be other categories of pl
declarative pl
- 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
functional languages
- variables are not modifiable, represent single value
- programs consist of functions that can be recursive (math)
- no loops, can’t modify existing variables
- declarative
logic languages
- declarative
- based on 1st order logic (relations)
- i.e. prolog
scripting lang
- a domain-specific language for a particular environment
- dynamic high-level general-purpose language,
syntax
- rules governing the use of words and sentences in the language
- using grammars
semantics
- define the meaning of the valid syntactic constructs in the language
static semantics vs dynamic semantics
static - governs the use of types
dynamic - indicates what a construct does
assembler
- translate mnemonics and ml language
- machine independent
compiler
- translates HLL to assembly or ml
- better for maintenence
declarative vs imperative
declarative - WHAT a computer should do
imperative - HOW a computer should do it