Semantics Flashcards

1
Q

What is the difference between operational and denotational semantics:

A

Denotational:
ascribes to programs functions taking input data to output data

Operational:
describes the execution of programs on an abstract machine

operational semantics has two sub-classes:

Structural operational semantics: Small-step semantics describes the operation of a machine on a program and input step by step

Natural semantics: Big-step semantics. Gives the description in one big step and is close to denotational semantics

You can choose the granularity

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

What is a state?

A

Finitely supported partial functions from variables to natural numbers, which we can represent by sets of pairs of the form (X, n)

The value of X in a state ó will be written ó(X)

ó[X – n] refers to the state ó modified at variable X to value n.

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

What are configurations (for commands)?

A

Pairs [(c, ó)] where c is a command (the residual command or what is left to do) and ó is a state

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

Describe steps

A

Intermediate steps: [(c, ó)] -> [(c’, ó’)]
Final step: [(c, ó)] -> ó’

Valid steps are determined by inference rules.

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

What is a computation in the context of semantics

A

A maximal finite or infinite sequence of steps.

Computations can terminate

  • normally (with a final state)
  • abruptly (with a stuck configuration where no further step is possible)

Infinite sequences correspond to nonterminating computations.

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

What do the rules do?

A

They tell you what can be done and how to do it

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

What is nondeterministic semantics?

A

Semantics that has several computations from the same initial configuration

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