• Aucun résultat trouvé

Ordered Tree-Pushdown Systems

N/A
N/A
Protected

Academic year: 2021

Partager "Ordered Tree-Pushdown Systems"

Copied!
18
0
0

Texte intégral

(1)

HAL Id: hal-01145598

https://hal.archives-ouvertes.fr/hal-01145598

Submitted on 24 Apr 2015

HAL

is a multi-disciplinary open access archive for the deposit and dissemination of sci- entific research documents, whether they are pub- lished or not. The documents may come from teaching and research institutions in France or abroad, or from public or private research centers.

L’archive ouverte pluridisciplinaire

HAL, est

destinée au dépôt et à la diffusion de documents scientifiques de niveau recherche, publiés ou non, émanant des établissements d’enseignement et de recherche français ou étrangers, des laboratoires publics ou privés.

Ordered Tree-Pushdown Systems

Lorenzo Clemente, Pawel Parys, Sylvain Salvati, Igor Walukiewicz

To cite this version:

Lorenzo Clemente, Pawel Parys, Sylvain Salvati, Igor Walukiewicz. Ordered Tree-Pushdown Systems.

FSTTCS 2015, Dec 2015, Bangalore, India. �hal-01145598�

(2)

Lorenzo Clemente1, Sylvain Salvati2, and Igor Walukiewicz2

1 University of Warsaw, Poland

2 CNRS, Universit´e de Bordeaux, INRIA, France

Abstract. We define a new class of pushdown systems where the push- down is a tree instead of a word. We allow a limited form of lookahead on the pushdown conforming to a certain ordering restriction, and we show that the resulting class enjoys a decidable reachability problem.

This follows from a preservation of recognizability result for the backward reachability relation of such systems. As an application, we show that our simple model can encode several formalisms generalizing pushdown systems, such as ordered multi-pushdown systems, annotated higher-order pushdown systems, the Krivine machine, and ordered annotated multi- pushdown systems. In each case, our procedure yields tight complexity.

1 Introduction

Context. Modeling complex systems requires to strike the right balance between the accuracy of the model, and the complexity of its analysis. A particularly successful example is given bypushdown systems, which are a popular class of infinite-state systems arising in diverse contexts, such as language processing, data-flow analysis, security, computational biology, and program verification.

Many interesting analyses reduce to checking reachability in pushdown systems, which can be decided inPTIMEusing, e.g., the popularsaturation technique[?,?]

(cf. also the recent survey [?]). Pushdown systems have been generalized in several directions. In [?] tree-pushdown systems are introduced, where the pushdown is a tree instead of a linear word. It is observed that, unlike ordinary pushdown systems, non-destructive lookahead on the pushdown cannot be introduced without leading to undecidability. It is proved that, when seen as automata, the pushdown can be linearized without changing the expressiveness of the model w.r.t. the class of recognized tree languages.

A seemingly unrelated generalization isordered multi-pushdown systems[?,?], where several linear pushdowns are available instead of just one. Since already two unrestricted linear pushdowns can simulate a Turing machine, an ordering restriction is put on popping transitions, requiring that all pushdowns smaller than the popped one are empty. Reachability in this model is2-EXPTIMEc[?].

Higher-order pushdown systems generalize ordinary pushdown systems by allowing pushdowns to be nested inside other pushdowns [?,?].Collapsible push- down systems [?,?] additionally enrich pushdown symbols with collapse links to inner sub-pushdowns. This allows the automaton to push a new symbol and to save, at the same time, the current context in which the symbol is pushed,

(3)

and to later return to this context via a collapse operation.Annotated pushdown systems [?] provide a simplification of collapsible pushdown systems by replacing collapse links with arbitrary pushdown annotations3. TheKrivine machine [?] is a related model which evaluates terms in simply-typedλY-calculus. Reachability in all these models ispn´1q-EXPTIMEc[?,?], and one exponential higher in the presence of alternation. The more generalordered annotated multi-pushdown sys- tems [?] have several annotated pushdown systems under an ordering restriction similar to [?] in the first-order case. They subsume both ordered multi-pushdown systems and annotated pushdown systems. The saturation method (cf. [?]) has been adapted to most of these models, and it is the basis of the prominent MOPED tool [?] for the analysis of pushdown systems, as well as the C-SHORe model-checker for annotated pushdown systems [?].

Contributions. Motivated by a unification of the results above, we introduce ordered tree-pushdown systems. This is a natural model extending tree-pushdown systems by allowing a limited form of partially destructive lookahead on the pushdown. We introduce an order between pushdown symbols, and we require that, whenever a sub-pushdown is read, all sub-pushdowns of smaller order must be discarded. The obtained model is expressive enough to simulate all systems mentioned above, and still not Turing-powerful thanks to the ordering condition.

Our contributions are: i) A general preservation of recognizability result for ordered tree-pushdown systems. ii) Direct encoding of several popular exten- sions of pushdown systems, such as ordered multi-pushdown systems, annotated pushdown systems, the Krivine machine, and ordered annotated multi-pushdown systems. iii) A conceptually simple saturation algorithm working on finite tree automata representing sets of configurations, subsuming and unifying previous constructions. iv) A complete complexity characterization of reachability in or- dered tree-pushdown systems and natural subclasses thereof. v) A short and simple correctness proof, simplifying substantially the previous literature.

Related work. Apart from the results mentioned above, we should note a satura- tion method for recursive program schemes [?]. Since schemes andλY-calculus are equi-expressive, our method can also be adapted to schemes. Concerning multi- pushdown systems, apart from the restriction based on the pushdown order there are other restrictions making their analysis decidable. Indeed, in [?] decidability is proved for annotated multi-pushdowns with phase-bounded and scope-bounded restrictions. It is not clear how to treat these restrictions in the simple frame- work presented here. For standard multi-pushdown systems split-width has been proposed as a unifying restriction [?]. It is not known how to extend this method to annotated multi-pushdown systems, or to our tree-pushdown systems.

3 Collapsible and annotated systems generate the same configuration graphs when started from the same initial configuration, since new annotations can only be created to sub-pushdowns of the current pushdown. However, annotated pushdown systems have a richer backward reachability set which includes non-constructible pushdowns.

(4)

Outline. In Sec. 2 we introduce common notions. In Sec. 3 we define our model and we present our saturation-based algorithm to decide reachability. In Sec. 4 we show that ordered systems can optimally encode several popular formalisms.

In Sec. 5 we conclude with some perspectives on open problems.

2 Preliminaries

We will work with rewriting systems on ranked trees, and with alternating tree automata. The novelty is that every letter of the ranked alphabet will have an order. A tree will have the order determined by the letter in the root. The order will be used later to constrain rewriting rules.

Analternating transition system is a tuple S“ xC,Ñy, whereC is the set of configurations andÑĎCˆ2C is the alternating transition relation. We lift the relationÑto sets of configurationsA, B ĎC by definingAÑB iff, for every c PA, there exists C ĎB s.t. cÑ C, and we denote by Ñ˚ its reflexive and transitive closure. The set of predecessors of a set C ĎC of configurations is Pre˚pCq “ tc| tcu Ñ˚Cu.

Ordered trees. LetNbe the set of non-negative integers, and letNą0be the set of strictly positive integers. Anodeis an elementuPN˚ą0. A nodeuis apredecessor of a node v iff uis a prefix of v, i.e., there exists w P N˚ą0 s.t. v “uw, and similarly for the notion ofsuccessor. Atree domain is a non-empty prefix-closed set of nodesDĎN˚ą0s.t., ifu¨ pi`1q PD, thenu¨iPD for everyiPNą0. Aleaf is a nodeuinD without successors. Aranked alphabetis a pairpΣ,rankqof a set of symbolsΣtogether with a ranking functionrank:ΣÑN. Anordered alphabet is a triplepΣ,rank,ordqwherepΣ,rankqis a ranked alphabet andord:ΣÑNą0. For a ranked/ordered alphabetpΣ,rank,ordqand a finite tree domainD, afinite Σ-tree (or justtree) is a functiont:DÑΣthat assigns to each node uinD withnsuccessors a labela“tpuqinΣs.t.rankpaq “n. Thesize oftis|t|:“ |D|.

For aΣ-tree t:DÑΣand labelaPΣ, lett´1paq “ tuPD |tpuq “aube the set of nodes labelled witha. We denote byTpΣqthe set ofΣ-trees. Theorder of a tree tisordptq:“ordptpεqq.

Rewriting. For each ordernPN, letVn be a countably infinite set of variables s.t.

V0,V1, . . . are pairwise disjoint, and let V“Ť

nVn. We consider the extended ordered alphabetpΣYV,rank,ordqwhere a variablexPVn hasrankpxq “0 and ordpxq “n. LetTpΣ,Vqbe the set ofpΣYVq-trees. Fix apΣYVq-treet, and letVptqbe the set of variables appearing in it.t islinear if each variable inVptq appears exactly once int. For apΣYVq-treeu,tisu-ground ifVptq XVpuq “ H.

A treet“apt1, . . . , tnqisu-shallowif eachti is eitheru-ground, or just a variable (possibly appearing inu). Asubstitution is a finite mappingσ:VÑTpΣYVq s.t. ordpσpxqq “ordpxq. Given a pΣYVq-treet and a substitution σ, tσ is the pΣYVq-tree obtained by replacing each variablexin tin the domain ofσwith σpxq. Arewrite rule overΣ is a pairlÑrofpΣYVq-treesl andr. A rewrite rulelÑrisleft-linear ifl is linear, and it isshallow ifl isr-shallow.

(5)

Alternating tree automata. Analternating tree automaton(or justtree automaton) is a tupleB“ xΣ, Q, ∆ywhere Σ is a finite ranked alphabet, Qis a finite set of states, and∆ĎQˆΣˆ p2Qq˚ is a set of alternating transitions of the form pÝÑa P1¨ ¨ ¨Pn, withaof rankn. We say thatBisnon-deterministicif, for every transition as above, allPj’s are just singletons, and we omit the braces in this case. An automaton isordered if, for every statepand symbolsa, bs.t.pÝÑ ¨ ¨ ¨a andpÝÑ ¨ ¨ ¨b , we have ordpaq “ordpbq. We assume w.l.o.g. that automata are ordered, and we denote byordppqthe order of statep. The transition relation is extended to a set of statesP ĎQby definingP ÝÑa P1¨ ¨ ¨Pn iff, for everypPP, there exists a transitionpÝÑa P1p¨ ¨ ¨Pnp, andPj“Ť

pPPPjp for every 1ďjďn.

It will be useful later in the definition of the saturation procedure to define run trees not just on ground trees, but also on trees possibly containing variables. A variable of orderk is treated like a leaf symbol which is accepted by all states of the same order. LetP ĎQbe a set of states, and lett:DÑ pΣYVqbe an input tree. Arun tree fromP ont is a 2Q-tree4 s:DÑ2Q over the same tree domainD s.t.spεq “P, and: i) iftpuq “ais not a variable and of rankn, then spuqÝÑa spu¨1q ¨ ¨ ¨spu¨nq, and ii iftpuq “xthen@pPspuq,ordppq “ordpxq. The language recognized by a set of states P ĎQ, denoted by LpPq, is the set of Σ-treest s.t. there exists a run tree fromP ont.

3 Ordered tree-pushdown systems

We introduce a generalization pushdown systems, where the pushdown is a tree instead of a linear word. Analternating ordered tree-pushdown system of order nPNą0 is a tupleS “ xn, Σ, P,RywhereΣis an ordered alphabet containing symbols of order at mostn,P is a finite set ofcontrol locations, andRis a set of rules of the formp, lÑS, rs.t.pPP andSĎP. Moreover,lÑris a left-linear rewrite rule over Σwithl:“apu1, . . . , umqsuch that at most oneuˆıis neither r-ground nor a variable, and if such anuˆı exists then

(1)uˆı“bpv1, . . . , vnqwithbPΣ and allvj’s either r-ground or a variable, and (2) for everyjP t1, . . . , mu,j ­“ˆı: ifordpujq ďordpbqthenuj isr-ground.

We refer top2qasthe ordering condition. A rule is calleddeepifuˆıexists, otherwise it isshallow; letRd be the set of deep rules. For example,apx,yq Ñcpapx,yq,xq is shallow, but apbpxq,yq Ñcpx,yqis deep; here necessarily ordpyq ąordpbq. In Sec. 4 we provide more examples of such rewrite rules by encoding many popular formalisms. Note thatrcan be non-linear, thus sub-trees can be duplicated. The size ofS is|S|:“ |Σ| ` |P| ` |R|, where|R|:“ř

p,lÑS,rPRp1` |l| ` |S| ` |r|q. We say thatS isnon-deterministic ifS is a singleton for every rulep, lÑS, rPR, andshallow if every rule is shallow. Rewrite rules induce an alternating transition system xC,ÑSy, where the set of configurationsC consists of pairspp, tqwith

4 Strictly speaking 2Qdoes not have a rank/order. It is easy to duplicate each subset at every rank/order to obtain an ordered alphabet, which we avoid for simplicity.

(6)

p P P and t P TpΣq, and, for every configuration pp, tq, S Ď P, and tree u, pp, tq ÑS Sˆ tuuif, and only if, there exists a rule pp, lq Ñ pS, rq PR and a substitutionσs.t.t“lσ andu“rσ.

LetA“ xΣ, Q, ∆ybe a tree automaton s.t. PĎQ. Thelanguage of configu- rations recognized byA fromP isLpA, Pq:“ tpp, tq PC | pPP andtPLppqu.

Given an initial configurationpp0, t0q PC and a tree automatonArecognizing a regular set of target configurationsLpA, Pq ĎC, thereachability problem forS amounts to determine whetherpp0, t0q PPre˚pLpA, Pqq.

3.1 Reachability analysis

We present a saturation-based procedure to decide reachability in ordered tree- pushdown systems. This follows from a general preservation of recognizability result for the backward reachability relation.

Theorem 1 (Preservation of recognizability). Let S be an order-n tree- pushdown system and let C be regular set of configurations. Then, Pre˚pCq is effectively regular, and an automaton recognizing it can be built in n-fold exponential time.

Let S “ xn, Σ, P,Ry be a tree-pushdown system. The target setC is given as a tree automaton A s.t. LpA, Pq “ C. We construct a tree automaton B “ xΣ, Q1, ∆1y recognizing Pre˚pLpA, Pqq. Q1 is obtained by adding states to Q, and ∆1 by adding transitions to ∆ according to a saturation procedure. For every rule p, lÑS, rPR and for everyv which is a r-ground subtree of l we create a new state pv of orderordpvqrecognizing all ground trees that can be obtained by replacing variables in v by arbitrary trees, i.e., Lppvq “ tvσ |σ : V ÑTpΣq ¨vσ is groundu. LetQ0be the set of suchpv’s and let∆0 the required transitions. Notice that|Q0| ď |R|.

In order to deal with with deep rules we add new states in the following stratified way: Let Q1n “ QYQ0, and, for every order 1 ď i ă n, let Q1i “ Q1i`1

gPRdtgu ˆ

´ 2Q1i`1

¯rankpgq´1

, where rankpg “ p, l Ñ S, rq is the rank of the root symbol in l. We define the set of states in B to be Q1 :“Q11. We add transitions to B in an iterative process until no more transitions can be added. During the saturation process, we maintain the following invariant:For 1ďkăn, states inQ1kzQ1k`1 recognize only trees of orderk. Therefore,Bis also an ordered tree automaton. Formally,∆1 is the least set containing∆Y∆0 and closed under adding transitions according to the following condition: For every ruleg“p, lÑS, rPRwithl“apu1, . . . , umq, and for every run treetfromS onrinB, we add a transition

pÝÑa P1¨ ¨ ¨Pm (∆1-shallow) s.t., for every 1 ď i ď m, i) if ui “ x is a variable, then Pi :“ Ť

tpr´1pxqq, ii) if ui is not a variable but is r-ground, then Pi :“ tpuiu, and iii) if g is a deep rule, then for the unique uˆı “bpv1, . . . , vnqwe letPˆı :“ tpˆıuwherepˆı :“

(7)

pg, P1, . . . , Pˆı´1, Pˆı`1, . . . , Pmq. Thanks to the ordering condition, ifordpbq “k, thenP1, . . . , Pˆı´1, Pˆı`1, . . . , PmĎQ1k`1, and thuspˆı is indeed a state of order k in Q1kzQ1k`1. Then, we add the transition

pg, P1, . . . , Pˆı´1, Pˆı`1, . . . , PmqÝÑb S1¨ ¨ ¨Sn (∆1-deep) s.t., for every 1ďjďn, iii.1) ifvj “xis a variable, thenSj:“Ť

tpr´1pxqq, and iii.2) ifvj is not a variable (and therefore necessarilyr-ground), thenSj :“ tpvju.

Lemma 1. ForAandB be as above,LpB, Pq “Pre˚pLpA, Pqq.

The correctness proof, even though short, is presented in the appendix. The right- to-left direction is by straightforward induction on the number of rewrite steps to reachLpA, Pq. The left-to-right direction is more subtle, but with an appropriate invariant of the saturation process it also follows by a direct inspection.

3.2 Complexity

For an initial configurationpp0, t0q PCand an automatonArecognizing a regular set of target configurations LpA, Pq, we can decide the reachability problem by constructingBas in the previous section, and then testingpp0, t0q PLpB, Pq. In the following, let mą1 be the maximal rank of any symbol in Σ. Using the notation from the previous subsection we have that|Q1n| ď |Q| ` |R|, and, for every 1ďiăn,|Q1i| ďˇ

ˇQ1i`1ˇ

ˇ` |R| ¨2pm´1q¨|Q1i`1| ďO

´

|R| ¨2pm´1q¨|Q1i`1|¯ , and thus |Q1| ďexpn´1pOppm´1q ¨ p|Q| ` |R|qqq, where exp0pxq “xand, foriě0, expi`1pxq “2expipxq. Similarly, we derive|∆1| ďexpnpOppm´1q ¨ p|Q| ` |R|qqq.

Theorem 2. Reachability in orderntree-pushdown systems is n-EXPTIMEc.

We identify three subclasses of ordered tree-pushdown systems, for which the reachability problem is of decreasing complexity. First we consider the class of linear non-deterministic systems. Assume that A is non-deterministic. When S is linear, i.e., variables in the r.h.s. of rules in R appear exactly once, all Pi’s in (∆1-shallow) are singletons, and thus also B is also non-deterministic.

Consequently, the construction of Q1i can be simplified to avoid the exponen- tial blow-up at each order: Q1i “Q1i`1

gPRdtgu ˆ`

Q1i`1˘rankpgq´1

, yielding

|Q1| ďOpp|Q| ` |R|qpm´1qnq and|∆1| ďOp|R| ¨ |Q1|mq. Therefore, B is doubly exponential inn.

Theorem 3. Reachability in linear non-deterministic ordered tree-pushdown systems is2-EXPTIMEc.

If the system isshallow, then we do not need to add states recursively (Q1 :“

QYQ0), and we thus avoid the multiple exponential blow-up. The same happens if the system isunary, i.e.,m“1.

Theorem 4. Reachability in shallow/unary ordered tree-pushdown systems is EXPTIMEc, and inPTIMEfor the non-deterministic variant.

All lower-bounds follow from the reductions presented in Sec. 4.

(8)

4 Applications

In this section, we give examples of systems that can be encoded as ordered tree-pushdown systems. Ordinary alternating pushdown systems (and even prefix- rewrite systems) can be easily encoded as alternating ordered tree-pushdown systems by viewing a word as a linear tree; the ordering condition is trivial since symbols have arity ď 1. This yields an EXPTIME reachability procedure, by Theorem 4.Tree-pushdown systems [?] can be seen as ordered tree-pushdown systems where every rule is shallow. By Theorem 4, reachability in alternating tree-pushdown systems is inEXPTIME. Both complexities above reduce toPTIME for non-alternating systems. In the rest of the section, we show how to encode four more sophisticated classes of systems, namely ordered multi-pushdown sys- tems (Sec. 4.1),annotated high-order pushdown systems (Sec. 4.2), theKrivine machine with states (Sec. 4.3), andordered annotated multi-pushdown systems (Sec. 4.4), and we show that reachability for these models can be decided with

tight complexity bounds using our saturation procedure.

4.1 Ordered multi-pushdown systems

In an ordered multi-pushdown systems there arenpushdowns. Symbols can be pushed on any pushdown, but only the first non-empty pushdown can be popped [?]. This is equivalent to say that to pop a symbol from thek-th pushdown, the contents of the previous pushdowns 1, . . . , k´1 should be discarded. Formally, an alternating ordered multi-pushdown systemis a tupleO“ xn, Γ, Q, ∆y, where nPNą0 is theorder of the system (i.e., the number of pushdowns), Γ is a finite pushdown alphabet,Qis a finite set of control locations, and∆ĎQˆOnˆ2Qis a set of rules of the formpp, o, PqwithpPQ,P ĎQ, andoa pushdown operation in On:“ tpushkpaq,popkpaq |1ďkďn, aPΓu. We say thatOisnon-deterministic when P is a singleton for every rule. A multi-pushdown system induces an alternating transition system xC,ÑOy where the set of configurations is C “ Qˆ pΓ˚qn, and transitions are defined as follows: for everypp,pushkpaq, Pq P∆ there exists a transitionpp, w1, . . . , wnq ÑO Pˆtpw1, . . . , a¨wk, . . . , wnqu, and for everypp,popkpaq, Pq P∆ there exists a transitionpp, w1, . . . , a¨wk, . . . , wnq ÑO

Pˆ tpε, . . . , ε, wk,¨ ¨ ¨ , wnqu. Fortp0u, T ĎQ, thereachability problem forOasks whetherpp0, ε, . . . , εq PPre˚pTˆ pΓ˚qnq.

Encoding. We show that an ordered multi-pushdown system can be simulated by an ordered tree-pushdown system. The idea is to encode thek-th pushdown as a linear tree of orderk, and to encode a multi-pushdown as a tree of linear pushdowns. Let K and ‚ be two new symbols not in Γ, let ΓK “ Γ Y tKu, and let Σ “ Ť

1ďiďnΓKˆ tiu Y t‚u be an ordered alphabet, where a symbol pa, iq P ΓKˆ tiu has order i, rank 1 if a P Γ and rank 0 if a “ K. More- over,‚ has rankn and order 1. For simplicity, we writeai instead of pa, iq. A multi-pushdown w1, . . . , wn, where each wj “ aj,1. . . aj,nj is encoded as the tree encpw1, . . . , wnq:“ ‚pa11,1pa11,2p. . .K1qq, . . . , ann,1pann,2p. . .Knqqq. For an or- dered multi-pushdown systemO“ xn, Γ, Q, ∆ywe define an equivalent ordered

(9)

tree-pushdown system S “ xn, Σ, Q,Ry with Σ defined as above, and set of rules R defined as follows (we use the convention that variablexk has order k): For every push rule pp,pushkpaq, Pq P∆, we have a rulep,‚px1, . . . ,xnq Ñ P,‚px1, . . . , akpxkq, . . . ,xnq P R, and for every pop rule pp,popkpaq, Pq P ∆, we have p,‚px1, . . . , akpxkq, . . . ,xnq Ñ P,‚pK1, . . . ,Kk´1,xk,xk`1, . . . ,xnq P R.

Both kind of rules above are linear, and the latter one satisfies the ordering con- dition since lower-order variablesx1, . . . ,xk´1 are discarded. It is easy to see that pp, w1, . . . , wnq ÑO Pˆ tpw11, . . . , w1nqu if, and only if, pp,encpw1, . . . , wnqq ÑS

Pˆ tencpw11, . . . , w1nqu. Thus, the encoding preserves reachability properties. By Theorem 2, we obtain an-EXPTIMEupper-bound for reachability in alternating multi-pushdown systems of ordern. Moreover, sinceS is linear, and sinceS is non-deterministic when O is non-deterministic, by Theorem 3 we recover the optimal2-EXPTIMEccomplexity of [?].

Theorem 5 ([?]). Reachability in alternating ordered multi-pushdown systems is in n-EXPTIME. Reachability in non-deterministic ordered multi-pushdown systems is2-EXPTIMEc.

4.2 Annotated higher-order pushdown systems

Let Γ be a finite pushdown alphabet. In the following, we fix an order ně1, and we let 1 ďk ďnrange over orders. For our purpose, it is convenient to expose the topmost pushdown at every order recursively5. We define Γk, the set of pushdowns of orderk, simultaneously for all 1ďkďn, as the least set containing the empty pushdownx y, and, wheneveru11, . . . , ukk,vjj for some 1 ďj ď n, thenxavj, u1, . . . , uky P Γk. Pushdown operations are as follows. The operation pushbk pushes a symbolbPΓ on the top of the topmost order-1 stack and annotates it with the topmost order-kstack,pushk duplicates the topmost order-pk´1qstack,popk removes the topmost order-pk´1qstack, andcollapsek replaces the topmost order-kstack with the topmost order-kstack annotating the topmost symbol:

pushbkpxau, u1, . . . , unyq “ xbxau,u1,...,uky,xau, u1y, u2, . . . , uny

pushkpxau, u1, . . . , unyq “ xau, u1, . . . , uk´1,xau, u1, . . . , uky, uk`1, . . . , uny popkpxau, v1, . . . , vk´1,xbv, u1, . . . , uky, uk`1, . . . , unyq “ xbv, u1, . . . , uny collapsekpxaxbv,v1,...,vky, u1, . . . , unyq “ xbv, v1, . . . , vk, uk`1, . . . , uny Let On “ Ťn

k“1tpushbk,pushk,popk,collapsek | b P Γu be the set of stack op- erations. An alternating order-n annotated pushdown automaton is a tuple P “ xn, Γ, Q, ∆y, whereΓ is a finite stack alphabet, Qis a finite set of control locations, and∆ĎQˆΓ ˆOnˆ2Q is a set of rules. An annotated pushdown automaton induces a transition system xC,ÑPy, where C “QˆΓn, and the transition relation is defined as pp, wq ÑP Pˆ tw1uwhenever pp, a, o, Pq P∆ withw“ xau,¨ ¨ ¨yandw1“opwq. Giventp0u, T ĎQ, thereachability problem forP asks whetherpp0,x yq PPre˚pTˆΓnq.

5 Our definition is equivalent to [?].

(10)

Encoding. We represent annotated pushdowns as trees. LetΣ be the ordered alphabet containing, for each 1ďkďn, an end-of-stack symbolKk PΣof rank 0 and orderk. Moreover, for eachaPΓ and order 1ďkďn, there is a symbol xa, ky PΣof orderkand rankk`1 representing the root of a tree encoding a stack of orderk. An order-kstack is encoded as a tree recursively byenckpx yq “ Kkand enckpxau, u1, . . . , ukyq “ xa, kypenc1pu1q, . . . ,enckpukq,encipuqq, where i is the order ofu. LetP “ xn, Γ, Q, ∆ybe an annotated pushdown system. We define an equivalent ordered tree-pushdown systemS“ xn, Σ, Q,Ry, whereΣis as defined above, andRcontains a rulep, lÑP, r for each rule inpp, a, o, Pq P∆, where lÑris as follows (cf. also Fig. 1 in the appendix for a pictorial representation).

We use the convention that a variable subscripted by ihas orderi, and we write xi..j forpxi, . . . ,xjq, and similarly forzi..j:

xa, nypx1..n,yq Ñ xb, nypxa,1ypx1,yq,x2..n,xa, kypx1..k,yq ifo“pushbk xa, nypx1..n,yq Ñ xa, nypx1..k´1,xa, kypx1..k,yq,xk`1..n,yq ifo“pushk xa, nypz1..k´1,xb, kypx1..k,yq,xk`1..n,zq Ñ xb, nypx1..n,yq ifo“popk xa, nypz1..k,xk`1..n,xb, kypx1..k,yqq Ñ xb, nypx1..n,yq ifo“collapsek The last two rules satisfy the ordering condition of tree-pushdown systems since only higher-order variablesxk`1, . . . ,xn are not discarded. It is easy to see that pp, wq ÑP Pˆtw1uif, and only if,pp,encnpwqq ÑS Pˆtencnpw1qu. Consequently, the encoding preserves reachability properties. Since an annotated pushdown system of ordernis simulated by a tree-pushdown system of the same order, the following complexity result is an immediate consequence of Theorem 2.

Theorem 6 ([?]). Reachability in alternating annotated pushdown systems of ordern isn-EXPTIMEc.

4.3 Krivine machine with states

We show that the Krivine machine evaluating on simply-typed λY-terms can be encoded as an ordered tree-pushdown system. This provides the first saturation algorithm for the Krivine machine, yielding an optimal reachability procedure.

A type is either the basic type 0 or α Ñ β for types α, β. Thelevel of a type islevelp0q “1 andlevelpαÑβq “maxplevelpαq `1,levelpβqq. We abbreviate αÑ ¨ ¨ ¨ ÑαÑβ asαk Ñβ. Let V“ txα11, xα22, . . .ube a countably infinite set of typed variables, and letΓ be a ranked alphabet. Atermis either (i) a constant f0kÑ0 PΓ, (ii) a variable xα PV, (iii) an abstraction pλxα¨MβqαÑβ, (iv) an applicationpMαÑβNαqβ, or (v) a fixpointpY MαÑαqα. For a given termM, its set offree variablesis defined as usual. A termM isclosed if it does not have any free variable. We denote byΛpMqbe the set ofsub-termsofM. Anenvironment ρis a finite type-preserving function assigning closures to variables, and aclosure Cαis a pair consisting of a term of typeαand an environment, as expressed by the following mutually recursive grammar:ρ::“ H |ρrxαÞÑCαsandCα::“ pMα, ρq.

In a closurepMα, ρq,Mα is called theskeleton, and it determines the type and level of the closure. LetClαpMqbe the set of closures of typeαwith skeleton

(11)

inΛpMq. Aalternating Krivine machine6 with states of levellPNą0 is a tuple M“ xl, Γ, Q, M0, ∆y, wherexΓ, Q, ∆yis an alternating tree automaton, andM0 is a closed term of type 0 s.t. the level of any sub-term inΛpM0qis at mostl.

In the following, letτ “τ1Ñ ¨ ¨ ¨ Ñτk Ñ0. The Krivine machineMinduces a transition systemxC,ÑMy, where in a configurationpp, Cτ, C1τ1, . . . , Ckτkq PC,pP Q,CτPClτpM0qis thehead closure, andC1τ1 PClτ1pM0q, . . . , CkτkPClτkpM0q are theargument closures. The transition relationÑM depends on the structure of the skeleton of the head closure. It is deterministic except when the head is a constant inΓ, in which case∆ controls how the state changes:

pp,pxτ, ρq, C1τ1, . . . , Ckτkq ÑM tpp, ρpxqτ, C1τ1, . . . , Ckτkqu

pp,pMτNτ1, ρq, C2τ2, . . . , Ckτkq ÑM tpp,pMτ, ρq,pNτ1, ρq, C2τ2, . . . , Ckτkqu pp,pY MτÑτ, ρq, C1τ1, . . . , Ckτkq ÑM tpp,pMτÑτ, ρq,ppY Mqτ, ρq, C1τ1, . . . , Ckτkqu pp,pλxτ0¨Mτ, ρq, C0τ0, . . . , Ckτkq ÑM tpp,pMτ, ρrxτ0 ÞÑC0τ0sq, C1τ1, . . . , Ckτkqu

pp,pa0kÑ0, ρq, C10, . . . , Ck0q ÑM P1ˆ tC10u Y ¨ ¨ ¨ YPkˆ tCk0u for everypÝÑa P1¨ ¨ ¨Pk P∆

Given tp0u, T Ď Q, the reachability problem for M asks whether pp0, M0q P Pre˚pTˆ pŤ

τ“τ1Ѩ¨¨ÑτkÑ0ClτpM0q ˆClτ1pM0q ˆ ¨ ¨ ¨ ˆClτkpM0qqq.

Encoding. Following [?], we encode closures and configurations of the Krivine machine as trees. Fix a Krivine machine M“ xl, Γ, Q, M0, ∆y of level l. We assume a total order on all variables xxα11, . . . , xαnny appearing in M0. For a typeτ, we defineordpτq “l´levelpτq. We construct an ordered tree-pushdown system S “ xl, Σ, Q1,Ry of order l as follows. The ordered alphabet is Σ “ tNτ,rNτs | Nτ PΛpM0qu Y tKu. Here, Nτ is a symbol ofrankpNτq “n and ordpNτq “ordpτq. Moreover, ifτ “τ1Ñ ¨ ¨ ¨ Ñτk Ñ0 for somekě0, thenrNτs is a symbol of rankprNτsq “ n`k andordprNτsq “ordpτq. Finally, Kis a leaf of order 1. The set of states isQ1 “QYŤ

pÝÑPa 1¨¨¨PkP∆tp1, P1q, . . . ,pk, Pkqu. A closure pNτ, ρqis encoded recursively asencpNτ, ρq “Nτpt1, . . . , tnq, where, for every 1ďiďn, i) ifxiPFVpNτqthen ti“encpρpxiqq, and ii)ti“ Kotherwise.

A configurationc “ pp,pNτ, ρq, C1τ1, . . . , Ckτkq is encoded as the tree encpcq “ rNτspt1, . . . , tn,encpC1τ1q, . . . ,encpCkτkqq, where the first n subtrees encode the closurepNτ, ρq, i.e.,encpNτ, ρq “Nτpt1, . . . , tnq. The encoding is extended point- wise to sets of configurations. Below, we assume thatτ “τ1 Ñ ¨ ¨ ¨ Ñτk Ñ0, that variableyj has orderordpτjqfor every 1ďjďk, and that variablesxiandx1i have orderordpαiqfor every 1ďiďn. Notice thatordpτq ăordpτ1q, . . . ,ordpτkq.

Moreover, we write x “ xx1, . . . ,xny, z “ xz1, . . . ,zny, and y “ xy1, . . . ,yky. R contains the following rules:

p,rxτispz1, . . . , Mτpxq, . . . ,zn,yq Ñtpu,rMτspx,yq

p,rMτNτ1spx,y2, . . . ,ykq Ñtpu,rMτspx, Nτ1pxq,y2, . . . ,ykq p,rY MτÑτspx,yq Ñtpu,rMτÑτspx, Y Mpxq,yq

p,rλxτi0¨Mτspx,y0,yq Ñtpu,rMτspx1, . . . ,xi´1, y0,xi`1, . . . ,xn,yq

6 Cf. also [?] for a definition of the Krivine machine in a different context.

(12)

p,ra0kÑ0spx,yq Ñ tp1, P1q, . . . ,pk, Pkqu,ra0kÑ0spx,yq @ppÝÑa P1¨ ¨ ¨Pk P∆q pi, Piq,ra0kÑ0spz,y1, . . . , Mi0pxq, . . . ,ykq ÑPi,rMi0spxq

The first rule satisfies the ordering condition since the shared variablesyi’s are of order strictly higher thanMτ. A direct inspection of the rules shows that, for a configurationcand a set of configurationsD, wheretcu YD does not contain an intermediate configuration of the formppi, Piq,¨ ¨ ¨ q, we havecÑ˚MDif, and only if,encpcq Ñ˚S encpDq. Therefore, the encoding preserves reachability properties.

Since a Krivine machine of levelnis simulated by a tree-pushdown system of ordern, the following is an immediate consequence of Theorem 2.

Theorem 7 ([?]). Reachability in alternating Krivine machines with states of level nisn-EXPTIMEc.

4.4 Ordered annotated multi-pushdown systems

Ordered annotated multi-pushdown systems are the common generalization of ordered multi-pushdown systems and annotated pushdown systems [?]. Such a system is comprised ofmą0 annotated higher-order pushdowns arranged from left to right, where each pushdown is of orderną0. While push operations are unrestricted, pop and collapse operations implicitly destroy all pushdowns to the left of the pushdown being manipulated, in the spirit of [?]. [?] has shown that reachability in this model can be decided inmn-fold exponential time, by using a saturation-based construction leveraging on the previous analysis for the first-order case [?]. In Sec. B in the appendix we provide a simple encoding of an annotated multi-pushdown system with parameterspm, nqinto a tree-pushdown system of ordermn. It is essentially obtained by taking together our previous encodings of ordered (cf. Sec.4.1) and annotated systems (cf. Sec. 4.2). The following complexity result is a direct consequence of Theorem 2.

Theorem 8 ([?]).Reachability in alternating ordered annotated multi-pushdown systems of parameterspm, nqis inpmnq-EXPTIME.

5 Conclusions

We have introduced a novel extension of pushdown automata which is able to capture several sophisticated models thanks to a simple ordering condition on the tree-pushdown. As future research it would be interesting to study other restric- tions, such as phase-bounding [?] orscope-bounding [?]. Our general saturation algorithm can be used to verify reachability properties. We plan to extend it to the more general parity properties, in the spirit of [?,?]. We leave as future work implementing our saturation algorithm, leveraging on subsumption techniques to keep the search space small.

Acknowledgments. We kindly acknowledge stimulating discussions with Ir`ene Durand, G´eraud S´enizergues, and Jean-Marc Talbot.

(13)

A Proof of Lemma 1

LetAbe the automaton recognizing the target set of configurations, and letB be the automaton obtained at the end of the saturation procedure (cf. page 5).

Lemma 1. ForAandB be as above,LpB, Pq “Pre˚pLpA, Pqq.

We prove the two inclusions of the lemma separately.

Lemma 2 (Completeness).ForAandBas above,Pre˚pLpA, Pqq ĎLpB, Pq.

Proof. Let pp, tq be a configuration in Pre˚pLpA, Pqq with p P P and t “ apt1, . . . , tmq. We show pp, tq P LpB, Pq by induction on the length d ě 0 of the shortest sequence of rewrite steps from pp, tq to LpA, Pq. If d “ 0, then pp, tq PLpA, Pq. Since the saturation procedure only adds states and transitions toA, we directly have pp, tq PLpB, Pq. Inductively, assume that the property holds for all configurations reaching LpA, Pq in at mostd ě 0 steps, and let configuration pp, tqbe at distanced`1ą0 fromLpA, Pq. There exists a rule p, lÑS, rPRwithl“apu1, . . . , umqand a substitutionσs.t.t“lσ and

pp, tq ÑS Sˆ trσu ĎPre˚pLpA, Pqq

By induction hypothesis, S ˆ trσu Ď LpB, Pq. By definition of ∆1, automa- ton B contains a transition p ÝÑa P1¨ ¨ ¨Pm. It thus suffices to show that t1 P LpP1q, . . . , tm P LpPmq. If ui “ x is a variable, then by definition Pi “ Ťtpr´1pxqq. SinceSˆ trσu ĎLpB, Pq,ti“σpxq PLpPiq. Ifui is not a variable and r-ground, thenPi “ tpuiuand ti PLppuiqby construction. Finally, if ui

is not r-ground, then ui “bpv1, . . . , vnq, ti “ bps1, . . . , snq, and B contains a transitionpg, P1, . . . , Pi´1, Pi`1, . . . , PmqÝÑb S1¨ ¨ ¨Sn. Thus, it suffices to show s1PLpS1q, . . . , snPLpSnq, which is done as above.

Lemma 3 (Soundness). ForAandB as above,LpB, Pq ĎPre˚pLpA, Pqq.

The soundness proof requires several steps. We assume w.l.o.g that in the au- tomaton A initial states in P have no incoming transitions. Notice that this property is preserved during the saturation procedure, therefore also inB there are no transitions entering initial states inP. We also assume that in deep rules p, apu1, . . . , umq ÑS, r, the uniqueui “bp¨ ¨ ¨ qwhich is notr-ground actually occurs in the first position, i.e, i“1. This is w.l.o.g. since we can always add shallow rules that just reshuffle subtrees. First, we assign a semanticsJpKĎTpΣq to all states pin B. For a set of statesS ĎQ1, JSK :“Ş

pPSJpK, where JpK is defined as follows:

JpK:“

$

’’

’’

’&

’’

’’

’%

tt| pp, tq PPre˚pLpA, Pqqu ifpPP

Lppq ifpPQzP or p“pvPQ0

"

t1| @pt2PJP2K, . . . , tmPJPmKq¨

pq, apt1, . . . , tmqq PPre˚pLpA, Pqq

* ifpPQ1izQ1i`1 for some 1ďiăn withp“ pg, P2, . . . , Pmq, andg“ pq, ap¨ ¨ ¨ q Ñ ¨ ¨ ¨ q

(14)

In the second case,Lppqrefers to the language ofpin the automatonB. In the last case,JpKis defined in terms of JP2K, . . . ,JPmK, which is well-defined by induction on the order since P2, . . . , PmĎQ1i`1. Second, we define sound transitions as those respecting the semantics: Formally, a transition PÝÑa P1¨ ¨ ¨Pmissound iff whenever@pt1PJP1K, . . . , tmPJPmKq, apt1, . . . , tmq PJPK.

Proposition 1. If all transitions are sound, then Lppq ĎJpKfor everypPQ1. Proof. Let t P Lppq. We proceed by complete induction on the height of t. If t “ a is a leaf, then there exists a sound transition p ÝÑ, and thusa a P JpK by definition of sound transition. For the inductive step, lett “apt1, . . . , tmq.

There exists a sound transitionpÝÑa P1¨ ¨ ¨Pms.t. t1PLpP1q, . . . , tmPLpPmq.

By induction hypothesis,t1PJP1K, . . . , tmPJPmK, and thus by the definition of sound transition,apt1, . . . , tmq PJpK.

Proposition 2. Transitions in∆Y∆0 are sound.

Proof. Let pÝÑa P1¨ ¨ ¨Pm P∆Y∆0, and let t1 PJP1K, . . . , tm P JPmK. Since we assume that there are no transitions back to the initial states inP, we have P1, . . . , Pm ĎQzP, and thus t1 PLpP1q, . . . , tm PLpPmqby the definition of the semantics. Consequently, t :“apt1, . . . , tmq P Lppq. If pR P we are done, sinceJpK“Lppqin this case. Otherwise, ifpPP thenpp, tq PLpA, Pq, which is included in Pre˚pLpA, Pqq, and thus we havetPJpKby definition.

Proposition 3. The saturation procedure adds only sound transitions.

Proof. Let g “ p, l Ñ S, r with l “ apu1, . . . , umq, and let t be a sound run tree in B fromS on r. We show that the transitionpÝÑa P1¨ ¨ ¨Pm as added by rule (∆1-shallow) is sound. To this end, let t1 P JP1K, . . . , tm P JPmK, and we show t1 :“ apt1, . . . , tmq PJpK. Since pP P, this amounts to showing that pp, t1q PPre˚pLpA, Pqq. We apply the rewrite ruleg above to configurationpp, t1q:

pp, t1q ÑSˆ trσu,

whereσis the unique substitution s.t.t1“lσ. (σis unique sincelis linear.) It thus suffices to showSˆ trσu ĎPre˚pLpA, Pqq. First, assume thatgis shallow. Every variablexappearing inr is labelled bytby the set of states Pi“Ť

tpr´1pxqq, for somei. Sincetuses only sound transitions and t1PJP1K, . . . , tmPJPmK, by induction on its height we haverσPJSK, which impliesSˆtrσu ĎPre˚pLpA, Pqq by the definition of the semantics since S ĎP. Ifg is not shallow, then P1“ tpg, P2, . . . , Pmqu. In this case, sincet1PJP1K, by the definition of the semantics, we deduce directlypp, t1q PPre˚pLpA, Pqq.

When g is not shallow, the transition pg, P2, . . . , PmqÝÑb S1¨ ¨ ¨Sn is addi- tionally added by rule (∆1-deep), and we have to show that this transition is sound too. Let w1 P JS1K, . . . , wn P JSnK, and we show t1 :“ bpw1, . . . , wnq P Jpg, P2, . . . , PmqK. To this end, let t2 P JP2K, . . . , tm P JPmK, and we show

(15)

pp, apt1, . . . , tmqq P Pre˚pLpA, Pqq. The proof is as above, noticing that t la- bels a variablexinrby either Pi for some 2ďiďm, or Sj for some 1ďjďn, and we can again concluderσPJSKby induction on the height oft.

Proof (of Lemma 3). By Proposition 2, the initial transitions in∆Y∆0 are sound, and by Proposition 3, all transitions in∆1 are sound. Letpp, tq PLpB, Pq.

Thus,tPLppq. By Proposition 1,tPJpK. Since pPP, by the definition of the semantics,pp, tq PPre˚pLpA, Pqq.

B Ordered annotated multi-pushdown systems

We encode ordered annotated multi-pushdown systems [?] into tree-pushdown systems. Formally, analternating ordered annotated multi-pushdown system is a tupleR“ xm, n, Γ, Q, ∆y, wheremPNą0 is the the number of higher-order pushdowns,nPNą0is the order of each of themhigher-order pushdowns,Γ is a finite pushdown alphabet,Qis a finite set of control locations, and∆ĎQˆΓKmˆ Oˆ2Qis a set of rules. LetO“Ťm

l“1

Ťn

k“1tluˆtpushbk,pushk,popk,collapsek|bP Γu. Pop and collapse operations are calledconsuming. An alternating ordered annotated multi-pushdown systemRinduces an alternating transition system xC,ÑRy,C“QˆΓnm, andpp, w1, . . . , wmq ÑR Pˆtpw11, . . . , w1mquif, and only if, there exists a rulepp,pa1, . . . , amq,pl, oq, Pq P∆s.t. 1)w1“ xau11,¨ ¨ ¨y, . . . , wm“ xaumm,¨ ¨ ¨y, 2) if o is consuming, then w11 “ ¨ ¨ ¨ “ wl´11 “ x y, 3) if o is not consuming, then w11 “ w1, . . . , w1l´1 “ wl´1, 4) w1l “ opwlq, and 5) wl`11 “ wl`1, . . . , wm1 “ wm. For tp0u, T Ď Q, the reachability problem for R asks whetherpp0,x y, . . . ,x yq PPre˚pTˆΓnmq.

Encoding. LetΣbe an ordered alphabet containing, for everyaPΓK, pushdown index 1ďlďm, and order 1ďkďna symbolpl, k, aqof orderpl´1q ¨n`k and rankk`1. Moreover,Σalso contains, for every tuplepa1, . . . , amq PΓKm, a symbolpa1, . . . , amqof order 1 and rankm¨ pn`1q. ThusΣ has ordermn. Fix a pushdown indexl. An order-kpushdown is encoded as the tree

encl,kpxauˆ, u1, . . . , ukyq “ pl, k, aq

encl,1pu1q ¨ ¨ ¨ encl,kpukq encl,ipˆuq ,

whereiis the order of ˆu, and am-tuple of order-npushdowns w“ xau1ˆ1, u1,1, . . . , u1,ny, . . . , wm“ xaumˆm, . . . , um,ny is encoded as the as a the following tree encnpwq

pa1, . . . , amq

enc1,1pu1,1q ¨ ¨ ¨ enc1,npu1,nq enc1,i1pˆu1q ¨ ¨ ¨ encm,impˆumq

(16)

wherei1 is the order of ˆu1,. . .,imis the order of ˆum.

Let xm, n, Γ, Q, ∆y be an ordered annotated multi-pushdown system. We define an equivalent ordered tree-pushdown systemS “ xmn, Σ, Q,Ryof order mn, where Σ andQare as defined above, andRcontains a rule for each rule in ∆, as follows. We use the convention that a variable subscripted bypl, kqhas order pl´1q ¨n`k, and we write xi..jl (withi ďj) for the tuple of variables pxl,i, . . . ,xl,jq. If pp,pa1, . . . , amq,pl,pushbkq, Pq P ∆, then there is the following shallow rule inR:

p, pa1, . . . , amq x1..n1 y1 ¨ ¨ ¨ x1..nm ym

ÝÑP, pa1, . . . , b, . . . , amq

¨ ¨ ¨ pl,1, alq xl,1 yl

x2..nl pl, k, alq x1..kl yl

¨ ¨ ¨

Ifpp,pa1, . . . , amq,pl,pushkq, Pq P∆, then there is the following shallow rule in R:

p, pa1, . . . , amq x1..n1 y1 ¨ ¨ ¨ x1..nm ym

ÝÑP, pa1, . . . , amq

¨ ¨ ¨ xl,k´1 pl, k, alq x1..kl yl

xl,k`1 ¨ ¨ ¨

Ifpp,pa1, . . . , amq,pl,popkq, Pq P∆, then there is the following deep rule inR:

p, pa1, . . . , amq

¨ ¨ ¨ zl,k´1pl, k, bq x1..kl yl

xl,k`1 ¨ ¨ ¨

ÝÑP, pa1, . . . , b, . . . , amq K ¨ ¨ ¨ K x1..nl yl ¨ ¨ ¨

Finally, ifpp,pa1, . . . , amq,pl,collapsekq, Pq P∆, then there is the following deep rule in R:

p, pa1, . . . , amq

¨ ¨ ¨ z1..kl xk`1..nl pl, k, bq x1..kl yl

¨ ¨ ¨

ÝÑP, pa1, . . . , b, . . . , amq K ¨ ¨ ¨ K x1..nl yl ¨ ¨ ¨

The two deep rules above satisfy the ordering condition sincepl, k, bqhas order pl´1q ¨n`k, and all other variablesxk`1..nl ,x1..nl`1, yl`1,. . .,x1..nm , ymhave strictly higher order.

Lemma 4 (Simulation). We have that pp, wq ÑR P ˆ tw1u if, and only if, pp,encnpwqq ÑS Pˆtencnpw1qu. Thus, the reachability problem forRis equivalent to the reachability problem forS.

(17)

C The translation for annotated pushdown systems

We present graphically the rewrite rules of the resulting ordered tree transition system. The rules in Figure 1 are the same as in the main text. We hope that the graphical presentation better conveys the intuition behind them.

p, xa, ny x1..n y

ÝÑP, pb, nq

xa,1y x1 y

x2..n xa, ky x1..ky

ifo“pushbk

p, xa, ny x1..n y

ÝÑP, xa, ny

x1..k´1 xa, ky x1..k y

xk`1..n y

ifo“pushk

p, xa, ny

z1..k´1 xb, ky x1..k y

xk`1..n z

ÝÑP, xb, ny x1..n y

ifo“popk

p, xa, ny

z1..k xk`1..n xb, ky x1..ky

ÝÑP, xb, ny x1..n y

ifo“collapsek

Fig. 1: Translation from annotated pushdowns to ordered tree-pushdown systems.

(18)

D The translation for Krivine machines

We present graphically the rewrite rules of the resulting ordered tree transition system. The rules in Figure 2 are the same as in the main text. We hope that the graphical presentation better conveys the intuition behind them.

p, rxτis z1 ¨ ¨ ¨ Mτ

x

¨ ¨ ¨ zn y

ÝÑ tpu, rMτs x y

(var)

p, rMτNτ1s x y2 ¨ ¨ ¨ yk

ÝÑ tpu, rMτs

x Nτ1 x

y2 ¨ ¨ ¨ yk

(app)

p, rY MτÑτs x y

ÝÑ tpu, rMτÑτs x Y M

x y

(fix)

p, rλxτi0¨Mτs x y0 y

ÝÑ tpu, rMτs

x1 ¨ ¨ ¨ xi´1 y0 xi`1 ¨ ¨ ¨ xn y

(abs)

p, ra0kÑ0s

x y

ÝÑ tp1, P1q, . . . ,pk, Pkqu, ra0kÑ0s

x y

@ppÝÑa P1¨ ¨ ¨PkP∆q (const1)

pi, Piq, ra0kÑ0s x z1 ¨ ¨ ¨ Mi0

y

¨ ¨ ¨ zk

ÝÑPi, Mi0

x

(const2)

Fig. 2: Translation from the Krivine machine to ordered tree-pushdown systems.

Références

Documents relatifs

As for first-order push- down systems, checking bounded latency amounts to checking finiteness of a higher-order pushdown language.. For arbitrary higher-order push- down language,

By restriction to rational vertex sets, the pushdown automata and the word rewriting systems define the same (prefix) graphs which are the graphs of bounded degree and regular in

A tree-like phase decomposition of an SQMSC M is a strongly acyclic phase decomposition such that the in-degree of any vertice in the residual graph is at... Next, we refine

We obtain simple, uniform and optimal decision procedures for various verification problems parametrized by split-width, ranging from reachability to model-checking against MSO, PDL

Nevertheless, in the case of SEVPA, even with an optimal choice of the equivalence relation ↔ Σ over Σ call the minimal automata ↔-SEVPA constructed Σ can be exponentially bigger

We reduce the malware detection problem to the model checking problem of PDSs against SPCARET formulas, and we propose efficient algorithms to model check SPCARET formulas for PDSs..

Il est institué, conformément aux dispositions de la loi n°65-00 portant code de la couverture médicale de base, un régime d'assistance médicale fondée sur les

We consider higher-order pushdown systems and investigate two basic variants of diagno- sis problems: the diagnosability, which consists in deciding whether defects can be