Programming Languages Flashcards

1
Q

What a subprogram side effects?

A

Variables in the calling environment are unexpectedly changed.

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

What is a side effect?

A

When evaluating an expression/function has the result of changes in the environment.

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

What are some common reasons for Program errors?

A
  • Failure to initialise
  • Aliasing
  • Expression evaluation errors
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does it mean to fail to initialise?

A

Variable is being used before it is initialised.

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

Define aliasing:

A

Two or more distinct names refer to the same storage location. Changing one variables changes another.

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

What are some examples of expression evaluation errors?

A
  • Out-of-range
  • array subscript
  • division by zero
  • arithmetic overflow
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the main criteria for the choice of programming languages for Critical Systems?

A
  • Logical soundness
  • Complexity of formal language definition
  • Expressive power
  • Security
  • Verifiability
  • Bounded space and time requirements
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Define logical soundness:

A

The programming language is clear and precise

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

What does the criteria “Complexity of formal language definition” mean?

A

There are simple formal definitions of the language features. If the language is too complex it will lead to errors in compilers and support tools

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

What does the criteria “Expressive Power” mean?

A

Program features can be expressed easily and efficiently? The easier it is to write a program the easier it is to verify it

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

What does the criteria “Security” mean?

A

The programming language can detect errors before execution?

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

What does the criteria “Verifiability” mean?

A

The programming language provides support for verifying that the program code meets the specification

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

What does the criteria “Bounded space and time” mean?

A

The programming language ensures the time and memory constraints are not exceeded

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

Why do we not invent new programming langues?

A

Creating a new programming langue is a complex task. Reliability and predictability is key and therefore new untested and regulated systems are dangerous.

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