• No se han encontrado resultados

4.1

Abstract Rewriting Systems

We give a brief introduction of abstract rewriting systems which closely follows the presentation of [41, Chapter 8] by van Oostrom and de Vrijer.

Definition 10. An abstract rewriting system (ARS) is a quadruplehA, Φ, src, tgti where A is a set of objects, Φ is a set of steps and src : Φ → A, tgt : Φ → A mappings called source and target, respectively.

We employ symbols→, ,  (possibly indexed) to range over ARSs, a, b, c, . . . , x, y, . . . to range over objects, and ϕ, ψ, . . . to range over steps. Figure 1.3 gives an intuitive rendering of ARSs with the two maps src and tgt from steps Φto objects A.

object src step tgt object

Figuur 1.3: Abstract rewriting system.

If ϕ is a step with source src(ϕ) = a and target tgt(ϕ) = b we write ϕ : a → b or a→ϕb. We then say that ϕ is a witness for the existence of a step from a to b

(that is, a witness for∃ϕ. a →ϕb).

Definition 11. Let→1 = hA1, Φ1,src1,tgt1i, and →2 = hA2, Φ2,src2,tgt2i be

ARSs. Then→1is called a sub-ARS of→2, denoted→1⊆ →2, if A1⊆ A2, Φ1⊆

Φ2, and src1and tgt1are the restrictions of src2and tgt2to Φ1, respectively.

Definition 12. An object a∈ A of an ARS → = hA, Φ, src, tgti is called a normal form if there exists no step ϕ∈ Φ such that src(ϕ) = a.

Definition 13. A strategy for an ARS→ is a sub-ARS of → with the same objects and normal forms.

Remark 14. A strategy for an ARS→ = hA, Φ, src, tgti picks a subset of the steps. In Definition 13 we require that the strategy has the same normal forms as the ARS→. In other words, for every object a which is the source of some step, the strategy has to pick at least one step ϕ with source a.

We introduce labelings of ARSs which establish the basis of history-aware strategies. This technique allows for endowing objects with additional infor- mation which can be changed by the rewrite steps. In this way the rewriting history of an object can be recorded in its label and traced throughout rewriting. Labelings are bisimulations:

Definition 15. A relationB is a bisimulation between ARSs →1and →2if the

objects and steps of→1are related to the objects and steps of→2, respectively,

4. PRELIMINARIES 19

(i) if aB b, then B relates each step from a to some step of b (forth) ∀a B b. (∀ϕ. src(ϕ) = a =⇒ ∃ψ. src(ψ) = b ∧ ϕ B ψ) , and each step from b to some step from a (back)

∀a B b. (∀ψ. src(ψ) = b =⇒ ∃ϕ. src(ϕ) = a ∧ ϕ B ψ) .

(ii) if ϕB ψ, then the objects and targets of both steps are related (relator), that is:

∀ϕ B ψ. src(ϕ) B src(ψ) ∧ tgt(ϕ) B tgt(ψ) . We call related objects bisimilar, see Figure 1.4.

B B 1 2 B B 1 2 B B B 1 2

Figuur 1.4: Bisimulation: forth (left), back (middle), relator (right). A labeling is a special case of a bisimulation.

Definition 16. A labeling of an ARS→1 = hA1, Φ1,src1,tgt1i is an ARS →2 =

hA2, Φ2,src2,tgt2i together with a bisimulation L between →1and→2for which

the following conditions hold:

(i) for every a2∈ A2there exists a unique a1∈ A1such that a1L a2, and

(ii) for every ϕ1: a1→1b1and a1L a2there exists a unique ϕ2: a2→1b2

such that ϕ1 L ϕ2. The correspondence must be bijective and we use

L(a2, ϕ1), called a2-label of ϕ1, to denote the step ϕ2which corresponds

to a2and ϕ1.

A rewrite labelingL consists of a labeling L together with an initial labeling func- tioni : A1→ A2that maps objects of→1to bisimilar objects of→2.

Pictorially the conditions of rewrite labelings can be rendered as in Figu- re 1.5.

That is, every labeled object a2has an unique pre-image a1, every step ϕ1

together with a labeling a2of its source src(ϕ1) uniquely determines the corres-

! L L i(•) L ! 1 ! 2 L

Figuur 1.5: Rewrite labeling: inversely functional, unique labeling, initial labeling.

Example 17. Figure 1.6 shows a rewrite labeling. Here→1= hA1, Φ1,src1,tgt1i

where A1 = {a}, Φ1 = {ϕ, ψ} and the source and target of the steps ϕ and

ψ are a. Furthermore →2 = hA2, Φ2,src2,tgt2i where A2 = {aϕ, aψ}, Φ2 =

{ϕA, ϕB, ψA, ϕB} with sources and targets as depicted. Then the labeling L (bi-

simulation) relates objects and steps as follows: • on objects aL aϕand aL aψ, and

• on steps ϕL ϕA, ϕL ϕB, ψL ψAand ψL ψB. a aϕ aψ ϕ 1 ψ 1 2 ψB 2 ϕB 2 ϕA 2 ψA i

Figuur 1.6: Example of a rewrite labeling.

Intuitively the labeling ’ remembers’ which step has been applied. This allows for the introduction of history-aware strategies.

Definition 18. A history-aware strategy for an ARS→ is defined as a strategy for a labelingL of →.

Definition 19. An ARS or a (history-aware) strategy is called deterministic if all its objects are the source of at most one step.

We remark that for the ARS→1from Example 17 (Figure 1.6) there exists

no deterministic, history-free strategy that fairly alternates between ϕ and ψ. Such a strategy will either only consist of ϕ or ψ (since a is the only object of →1). However, using the labeling from Figure 1.6 we can define a history-aware

4. PRELIMINARIES 21 aϕ aψ 2 ψ2 2 ϕ2

Figuur 1.7: History-aware strategy for the ARS from Figure 1.6.

4.2

Infinitary Term Rewriting

We give a brief introduction to infinitary term rewriting, the theoretical frame- work for our study of productivity of infinite objects such as streams, that are computed in an infinite timescale. Infinitary term rewriting is a natural extensi- on of ordinary, finitary rewriting, by allowing terms to have infinite branches, and admitting rewrite sequences to be transfinite, requiring convergence at each limit step. For further reading we refer the reader to [41, 29].

Documento similar