Totalization To define refinement for partial relations, we consider their totalised forms: where X = X ⋃ {⊥} Y = Y ⋃ {⊥}
Complement of s
Example
Example a b c d ⊥ a b c d ⊥
Example a b c d ⊥ a b c d ⊥
Refinement Having decided upon totalization using ⊥, we may derive the conditions for one partial relation to be a correct refinement of another. If σ and ρ are two partial relations of the same type then σ refines ρ precisely when is a subset of . This is true if and only if the domain of σ is at least as big as that of ρ and σ agrees with ρ on dom ρ.
Refinement
Refinement a a b b c ρ a a Provided some additional information by extending the domain and removed some non-determinism b b c c σ
Not a Refinement
Using Totalization
Refinement If σ and ρ are two partial relations of the same type then σ refines ρ precisely when is a subset of .
Example We may corrupt a bit – an element of set {0, 1} – by changing its value.
The relation corruptsto associates two sequences of bits if the second is no longer than the first, and no two adjacent bits have been corrupted. _corruptsto_ : seq Bit ↔ seq Bit ∀ bs, bs’ : seq Bit ∙ bs corruptsto bs’ ⇔ #bs’ ≤ #bs ∧ ∀ i : 1 .. #bs’ – 1 ∙ bs i ≠ bs’ i ⇒ bs(i + 1) = bs’(i + 1) For example, <1, 0, 0, 0, 1, 1> corruptsto <1, 0, 1, 0, 0, 1> <1, 1, 0, 1, 1, 1, 0, 0> corruptsto <0, 1, 0, 0, 1>
The relation changesto associates two sequences of bits if the second is no longer than the first, and every bit with an odd index has been corrupted. _changesto_ : seq Bit ↔ seq Bit ∀ bs, bs’ : seq Bit ∙ bs changesto bs’ ⇔ #bs’ ≤ #bs ∧ ∀ i : 1 .. (#bs’ – 1) ∙ i ∈ {n : N1 ∙ 2 * n} ⇒ bs i = bs’ i ∧ i ∈ {n : N1 ∙ 2 * n + 1} ⇒ bs i ≠ bs’ i For example, <1, 1, 0, 1, 1, 1, 0, 0> changesto <0, 1, 1, 1, 0> <1, 0, 0, 0, 1, 1> changesto <0, 0, 1, 0, 0, 1>
The second relation is a refinement of the first: both are total relations on seq Bit changesto resolves all the non-determinism present in the definition of corruptsto. If we are content with the behavior of corruptsto, then we will be content with changesto.