Computer Languages and Representations Flashcards
What is a factor of the Software crisis and when did the Software crisis begin?
Began - 1960s
High cost of producing software - software costs have been rising as hardware costs have been falling
How are Programs represented and Computation implemented in:
- Functional Programming
- Logic Programming
- Finite State Machines
- Programs are represented by expressions
Computation is represented by reduction - Programs are represented by clauses
Computation is represented by proof - Programs are represented by state machines
Computation is represented by transitions
What are the foundations in Functional and Logic programming?
Functional Programming - lambda calculus
Logic Programming - first-order logic
Define a Function
A function transforms information recieved by inputs to information transmitted by output.
What are arguments and results in functions?
Argument = Inputs
Results = Outputs
What is a must for an equation to apply?
Argument must match the pattern for an equation
(Any argument matches a variable pattern)
What is a Pattern?
A pattern may describe the structure of the argument and name its components
What is a Guard?
A guard is a Boolean expression that must be true for the equation to apply.
(Guards often work with patterns)
Define “otherwise”
A special final guard that is always true.
How are functions used in programming?
The function f to an argument x is written as f x.
What is a Type?
Set of values with the same usage and behaviour.
(All of the values in one of these sets are the same kind of thing such as an integer)
What is a Type System?
The fundamental purpose of a type system is to prevent errors during the execution of the programs, by ensuring types match correctly.
What is Type Checking?
Ensures types are used consistently, and that these errors are avoided.
Define Static Type Checking
Happens before program execution
Define Dynamic Type Checking
Happens during program execution
What is a negative of Local Defintions?
Having all function at the top level of a script can lead to name space pollution - clashes caused by reuse of the same name.