10. Rewriting Flashcards

1
Q

What restrictions must a rewrite rule (a => b) satisfy?

A
  • a is not a variable
  • vars(b) ⊆ vars(a)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does this mean?

A

Zero or more rewrite rule application

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

What does this mean?

A

(should be and)

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

What does this mean?

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

What is a redex?

A

Any subexpression that can be rewritten (reducible expression)

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

When is a set of rewrite rules terminating?

A

Starting with any expression, successively apply rewrite rules eventually brings us to a state where no rule applies

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

What is terminating also called?

A

(strongly) normalizing or noetherian

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

What is normal form?

A

An expression were no rewrite rules apply is called a normal form (w.r.t. a set of rewrite rules)

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

How can you prove termination?

A

1. Define natural number measure on expressions

  1. Show that each rule application reduces the measure
    Measure cant go bellow zero, so any sequence will terminate
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is canonical normal form?

A

If all normal forms for s are identical, s has a canonical normal form

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

What does it mean for a set of rewrite rules to be confluent?

A

For every r, s1, s2

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

What does it mean for a rewrite set that is confluent and terminating?

A

Any expression will rewrite to a canonical normal form

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

What does it mean for a set of rewrite rules to be locally confluent?

A

For every r, s1, s2

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

What is newmans lemma (rewriting)?

A

local confluence + termination = confluence

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

What is the Knuth-Bendix (KB) completion algorithm?

A
  1. Take a critical pair [1, s2 ] in R
  2. Normalize s1 to s1’ and s2 to s2
  3. If R union {s1’ => s2’} is termination add it to R, otherwise if R union {s2’ => s1’} is terminating add it to R otherwise fail
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the rewrite rule of inference?

A
17
Q

What conditions does isabelle apply a rewrite rule in the form

[| P_1, …, P_n |] ==> s = t

A
18
Q

Advantages of rewritting?

A
  • Efficent
  • if confluent + termination: decision procedure for equational goals in the theory defined by the rules
19
Q

Disadvantages of rewritting?

A
  • Not complete if non-confluent or non-terminating
  • Knowledge and goals must often be represented in the form of equations