• No se han encontrado resultados

EN BAJA TENSIÓN

In document Instituto Politécnico Nacional (página 66-76)

DESCRIPCIÓN DEL PROGRAMA

EN BAJA TENSIÓN

We are going to see here how to construct models that recognize the same class of terms as Ω-even weak parity automata. For this, in the course of this section, we fix an Ω-even weak parity automaton A = hQ, Σ, δ0 : Q × (Σ0∪ {Ω}) →

{ff , tt }, δ2 : Q × Σ2 → P(Q2), rk : Q → Ni. The construction of the model

is presented in [S15] and is a generalization of the construction of [S31]. Here we are going to give a slightly more general presentation of the construction that is at the cross-road of denotational semantics and automata theory. For this we introduce the notion of wreath product of applicative structures. As we will use the wreath product so as to construct models of λY Ω-calculus, we describe a notion wreath product for applicative structures that are made of lattices and that we thus call lattice applicative structures.

Definition 52 Given a lattice applicative structure M = ((MA)A∈T (Σ), •)

and a monotone applicative structure N = (NA)A∈T (Σ) we construct a lattice

applicative structure M w N = ((FA)A∈T (Σ), ?). So as to define M w N we use

an intermediate family of lattices (GA)A∈T (Σ), the definition is as follows:

• Go= No

• GA→B= MA→mGA→mGB where S →mT is the lattice of monotone

functions from the lattice S to to the lattice T ordered pointwise, • FA= MA× GA which is ordered coordinatewise,

• (f, g) ? (a, b) = (f • a, g(a)(b)).

Note that the operation _ w _ is asymmetric not only in the treatment of its components but also on their requirements. The left argument of the operator could have been a priori any applicative structure. We have chosen to use lat- tice applicative structures because it gives a nicer connection with intersection types (though we don’t give the details here on intersection types for wMSOL, they can be found in [S15]). For the right argument, we require that it is a monotone applicative structure. The reason for this is that we wish to use wreath products of applicative structures so as to construct models of λY Ω- calculus which requires that we are able to define the semantics of fixpoints and the lattice structure allows us to prove the existence of such fixpoints. More- over, the asymmetry in requirements allows us to obtain lattice applicative structures as results of wreath products and thus to iterate the construction. Again,we could have chosen weaker requirements but they suit our needs so as to construct models capturing wMSOL.

The idea of the wreath product is to create a dependence of the evaluation in the second applicative structure on the evaluation in the first applicative structure. In the context of finite state automata, when we want to build an automaton whose runs are built on the runs of another automaton on the input string, this amounts at the level of syntactic monoids to construct their wreath product.

The definition of weak parity automata implies that in every of their runs the ranks of states are decreasing along each branch of the tree. The idea of using wreath products then comes naturally. If we know for each node of a Böhm tree of a term M in which are the states of rank 0 from which the automaton has an accepting run, then we can deduce from which state of rank 1 the automaton has an accepting run in each node and so on. The idea is thus to construct a λ-model by induction on the ranks and then construct a model for the next rank using wreath product.

We let Qk be the set {q ∈ Q | rk(q) = k} and Q≤k be the set {q ∈ Q |

rk(q) ≤ k}. We write Ak for the automaton obtained from A by restriction to

the states in Q≤k.

Note that A0is a trivial automaton. Thus from Theorem 50, we know that

there is a GFP model M0 = ((M0,A)A∈T (Σ), [[·, ·]]0) so that M0,o = P(Q≤0)

and so that, for a closed term M of type o, q ∈ [[M ]]0iff A0has a run on BT (M )

starting with state q. Now supposing that Mk = ((Mk,A)A∈T (Σ), [[·, ·]]k) is a

lattice model so that Mk,o = P(Q0) × . . . P(Qk) and so that, for a closed

term M of type o, [[M ]]k = (R0, . . . , Rk) and q ∈ Ri iff Ak has an accepting

run on BT (M ) starting with state q. Then we define Mk+1 by taking as

applicative structure(Mk+1,A)A∈T (Σ)= (Mk,A)A∈T (Σ)w Rk+1 where Rk+1 is

the monotone applicative structure generated by P(Qk+1). We now need to

define the value of constants, we start by the definition of the fixpoint. For this, following the definition we have given of the wreath product, we use an intermediate family of lattices, (Gk+1,A)A∈T (Σ), that is defined as expected.

The value [[YA, ∅]]k+1needs to be in

Mk+1,(A→A)→A= Mk,(A→A)→A× Gk+1,(A→A)→A ,

Thus the value of [[YA, ∅]]

k+1is a pair (f, g) where f is in Mk,(A→A)→A. As the

idea of the wreath product is to compute the value of the term in Mk and use

this information to compute its value in Mk+1, we need to take f as [[YA, ∅]]k.

Let’s see now which value of g we need. We first unfold the definition of the wreath product and we have that g should be in:

Gk+1,(A→A)→A = Mk,A→A→m(Mk,A→mGk+1,A→mGk+1,A) →mGk+1,A .

So, given x, that represents the semantics of a program in Mk, and y that

represents the semantics of that program in Mk+1, we need to compute a

fixpoint. By applying y to [[YA, ∅]]

k(x), we obtain a value in Gk+1,A→mGk+1,A,

for which we can compute either a least or a greatest fixpoint finally obtaining a value in Gk+1,A. Moreover, we may notice that indeed, [[YA, ∅]]k(x) represents

the value of the fixpoint of the program that is denoted by x in Mk which is

precisely the value on which we want the evaluation of the fixpoint to depend on. In a nutshell, we obtain that3:

• [[YA, ∅]] k+1= ([[Y A, ∅]] k, λλ(x, y).µt.y([[Y A, ∅]] k(x)) t) when k + 1 is odd,

• [[YA, ∅]] k+1= ([[Y A, ∅]] k, λλ(x, y).νt.y([[Y A, ∅]] k(x)) t) when k + 1 is even.

Computing a least fixpoint in the case of an odd value amounts to only au- thorize finitely many repetitions of states with odd ranks in an accepting run. Dually, computing a greatest fixpoint in the case of an even rank amounts to authorize possibly infinite repetitions of states with even ranks in accepting runs. Notice that with this definition a non-converging computation, Ω, is interpreted with every states with even rank and no state of odd rank which mirrors the Ω-even convention.

The other constants are either binary or nullary, by convention. With the definition of wreath product, we have that a binary constant is interpreted in

Q0× · · · × Qk× Qk+1→mQ0× · · · × Qk× Qk+1→mQ0× · · · × Qk× Qk+1

and a nullary constant in

Q0× · · · × Qk× Qk+1 .

We simply define their intuitive interpretation that mimics the transitions of the automaton as follows:

• when a is binary, [[a, ∅]]k+1(R0, . . . , Rk+1)(R00, . . . , R0k+1) = (P0, . . . , Pk+1)

iff:

– [[a, ∅]]k(R0, . . . , Rk)(R00, . . . , R0k) = (P0, . . . , Pk),

– Pk+1 = {q ∈ Qk+1 | ∃q1 ∈ R0∪ · · · ∪ Rk+1. ∃q2 ∈ R00 ∪ · · · ∪

R0k+1. (q1, q2) ∈ δ2(a, q)},

• when a is nullary, [[a, ∅]]k+1 = (R0, . . . , Rk+1) if [[a, ∅]]k = (R0, . . . , Rk)

and Rk+1= {q ∈ Qk+1| δ0(a, q) = tt }.

A simple induction on k shows the property we have announced:

Theorem 53 For every closed term M of type o, if [[M, ∅]]k = (R1, . . . Rk),

then q ∈ Ri iff rk(q) = i and Ak has an accepting run from q on BT (M ).

Another interesting fact about the proof of that theorem is that it uses usual techniques for proving adequacy theorems in simply typed λ-calculus. It can be therefore considered as a purely semantic theorem.

Moreover the symmetries induced by the construction give a nice syntactic representation of the model with intersection types that give two dual systems for reasoning about programs. One of the type system allows one to prove that the automaton accepts the Böhm tree of a term from a given state, while the other system allows one to prove that the automaton does not accept the Böhm tree from a given state (see [S15]).

In document Instituto Politécnico Nacional (página 66-76)

Documento similar