Axiomatic Semantics Flashcards

1
Q

What are axiomatic semantics?

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

What is an assertion?

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

Give an example of an assertion.

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

(T/F) Axiomatic semantics are used for creating programs.

A

True.

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

Give an example of a Hoare triple.

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

What can be used to prove that a Hoare triple is valid?

A
  • Axioms
  • Inference Rules

They implicitly define the meaning of a program.

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

In axiomatic semantics, what notation is used to say that A is stronger then B, and B is weaker than A.

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

Out of the following triples, which one is the weakest.

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

(T/F) A stronger assertion has less elements in its set.

A

True.

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

Give an example of an inference rule notation.

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

(T/F) Inference rules can allow to strengthen precondition and weaken postcondition.

A

True.

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

Give an example of a sequence rule.

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

What is another way to write

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

Explain what logical variables are.

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

Prove the following using the assignment axiom.

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

E has to equal 0.

17
Q
A

The summation is over an empty range, thus has a value of 0, the identity of +.

18
Q

Create an inference for the following skip triple.

A
19
Q

Create an inference for the following if triple.

A
20
Q

Create an inference for the following triple.

A
21
Q

Assignment Axiom

{Q[V :=E] and E is defined}

V := E

{Q}

What does the assignment axiom say about V and E?

A

It says that whatever is true about E beforehand, is true about V afterwards.

22
Q

Use the assignment axiom to show the following triple is valid.

{ x = 0 }

x := x + 1

{ x = 1 }

A
  1. { x = 0 }
  2. { x + 1 = 1 }

x := x + 1

{ x = 1 }

23
Q

If a triple cannot be proven using assignment axioms, what is an alternative?

A

Inference rules.

24
Q
A