Model Checking and Functional Program Transformations
|
|
- Noreen Owen
- 6 years ago
- Views:
Transcription
1 Model Checking nd Functionl Progrm Trnsformtions Axel Hddd LIAFA (Université Pris Diderot / CNRS) LIGM (Université Pris Est / CNRS) Astrct We study model for recursive functionl progrms clled higher order recursion schemes (HORS). We give new proofs of two verifiction relted prolems: reflection nd selection for HORS. The previous proofs re sed on the equivlence etween HORS nd collpsile pushdown utomt nd they lose the structure of the initil progrm. The constructions presented here re sed on shpe preserving trnsformtions, nd cn e pplied on ctul progrms without losing the structure of the progrm ACM Suject Clssifiction F.3.1 Specifying nd Verifying nd Resoning out Progrms Keywords nd phrses Higher-order recursion schemes, Model checking, Tree utomt Digitl Oject Identifier /LIPIcs.FSTTCS Introduction Recursion schemes were introduced in the erly 70s s model of computtion, descriing the syntcticl prt of functionl progrm [18, 6, 7, 8]. Originlly they only hndled order-0 (constnts) or order-1 (functions on constnts) expressions, ut not higher-order types. Higher-order versions of recursion schemes were lter introduced to del with functions tking functions s rguments [13, 9, 10]. Recently, the focus cme ck on higher-order recursion schemes when considering them s genertors of possily infinite trees [14, 19, 12]. Indeed, roughly speking recursion scheme is deterministic rewriting system on typed terms tht genertes d infinitum unique infinite tree. As the trees they generte re very generl nd s they cn cpture the computtion tree of (higher-order) functionl progrms, studying their logicl properties leds to very nturl nd chllenging prolems. The most populr one is (locl) model-checking: for given recursion scheme nd formul e.g. from mondic second order logic (MSO) or µ-clculus, decide whether the tree generted y the scheme stisfies the formul. Following prtil decidility results for the suclss of sfe recursion schemes [14, 5], Ong proved, using the notion of trversls, the decidility of MSO model-checking for the whole clss of trees generted y recursion schemes [19]. Since then, other proofs of this result hve een otined using different pproches: Hgue, Murwski, Ong nd Serre estlished the equivlence of schemes nd higher-order collpsile pushdown utomt (CPDA), nd then showed the MSO decidility y reduction to prity gmes on collpsile pushdown utomt [12]; following ides from [1], Koyshi nd Ong [17] developed the type system of [15] to otin new proof. Finlly, Slvti nd Wlukiewicz used Krivine mchines to estlish the MSO decidility of λ-y-clculus, which is typed lmd clculus with recursion, equivlent to higher order recursion schemes [21]. This work ws supported y the project AMIS (ANR 2010 JCJC AMIS). Axel Hddd; licensed under Cretive Commons License CC-BY 33rd Int l Conference on Foundtions of Softwre Technology nd Theoreticl Computer Science (FSTTCS 2013). Editors: Anil Seth nd Nisheeth K. Vishnoi; pp Leiniz Interntionl Proceedings in Informtics Schloss Dgstuhl Leiniz-Zentrum für Informtik, Dgstuhl Pulishing, Germny
2 116 Model Checking nd Functionl Progrm Trnsformtions Another importnt prolem is glol model-checking: for given recursion scheme nd formul, provide finite representtion of the set of nodes in the tree generted y the scheme where the formul holds. Brodent, Cryol, Ong nd Serre nswered this question using so-clled endogenous pproch to represent the set of nodes: they showed how to construct nother scheme generting the sme tree s the originl scheme except tht now those nodes where the formul holds re mrked [3]. They refer to this property s the logicl reflection. The technique they used relies on the equivlence etween schemes nd CPDA. Going further with the ide of mrking set of nodes, Cryol nd Serre considered in [4] the following prolem clled logicl selection nd generlising glol model-checking: for given recursion scheme nd n MSO formul ϕ[x] with one free set vrile, provide (if it exists) finite representtion of set S of nodes in the tree generted y the scheme such tht ϕ[s] holds. They show tht one cn construct nother scheme generting the sme tree s the originl scheme except tht now those nodes re mrked nd descrie set S with the previous property. Agin, they relied on the equivlence with CPDA. One interest for logicl reflection nd logicl selection is tht they cn e used to modify scheme in useful wy. Indeed, ssume some (syntx tree of ) progrm is descried y scheme nd tht it contins d ehviours: using logicl reflection, one cn get new scheme where those d ehviours re mrked nd this ltter scheme cn then esily e modified to remove these ehviours. Using logicl selection, one cn e.g. select rnches in the syntx tree so tht given property is stisfied in the resulting sutree. A drwck of the pproch in [3, 4] tht goes ck nd forth etween schemes nd CPDA is tht the scheme tht is finlly otined is structurlly very fr from the originl one (the nmes of the non terminls s well s the shpe of the rewriting rules hve een lost): hence this is serious prolem if one is interested in doing utomted correction of progrms or even synthesis. Our min contriution in this pper is to provide proofs of oth logicl reflection nd selection without ppeling to CPDA s we only reson on schemes. Our constructions void the loss of the structure, i.e. the solution scheme is otined only y duplicting nd nnotting some prts of the initil scheme nd the trnsformtion is esily reversile. Our constructions re sed on the type system nd the gme used y Koyshi nd Ong in their proof of the model-checking decidility [17]. There is no known correspondence etween these proofs nd the former ones. In order to prove the logicl reflection, we introduce the notion of morphism inspired y denottionl semntics, nd we give morphism for MSO. In order to prove the logicl selection, we emed crefully winning strtegy of the model-checking gme into the scheme. In Section 2 we give the sic definitions nd in Section 3 we introduce the two prolems we re looking t in the pper. In Section 4 we introduce morphisms, explin how to emed morphism into scheme, nd give some possile pplictions. In Section 6, we show how to use morphisms to otin new proof of logicl reflection. In Section 7, we del with logicl selection. In Section 5, we present simple exmple tht descries how we cn use morphism descriing property to trnsform scheme. An extended version of this work is ville online: 2 Preliminries In this section we give the definition of higher order recursion scheme, which is deterministic rewriting system tht produces n infinite tree. It hndles terms of typed symols, i.e. ech symol is constnt or function tht cn hve functions s rguments. Terms my represent expressions of higher order progrmming lnguges, for exmple the term Apply Copy File
3 A. Hddd 117 mens pply the function Copy to the file. In this exmple n intuitive rewrite rule for the function Apply would e the term where the first rgument is pplied on the second rgument, written: Apply ϕ x ϕ x. Types. Types re defined y the grmmr τ ::= o τ τ nd o is clled the ground type. Considering tht is ssocitive to the right (i.e. τ 1 (τ 2 τ 3 ) cn e written τ 1 τ 2 τ 3 ), ny type τ cn e written uniquely s τ 1 τ k o. The integer k is clled the rity of τ. We define the order of type y order(o) = 0 nd order(τ 1 τ 2 ) = mx(order(τ 1 ) + 1, order(τ 2 )). For instnce o o o o is type of order 1 nd rity 3, (o o) (o o), tht cn lso e written (o o) o o is type of order 2.We let τ l τ e shorthnd for τ } {{ τ } τ. l times Terms. Let Γ e finite set of typed symols, nd Let Γ τ denote the set of symols of type τ. For ll type τ, we define the set of terms of type τ, T τ (Γ) s the smllest set contining the symols of type τ nd the ppliction of term of type τ τ to term of type τ for ll τ ; formlly: Γ τ T τ (Γ) nd τ {t s t T τ τ (Γ), s T τ (Γ)} T τ (Γ). We shll write T (Γ) for the set of terms of ny type, nd t : τ if t hs type τ. The rity of term t, rity(t), is the rity of its type. Remrk tht ny term t cn e uniquely written s t = α t 1... t k with α Γ nd 0 k rity(α). We sy tht α is the hed of the term t. For instnce, let Γ = {F : (o o) o o, G : o o o, H : (o o), : o}. Then F H nd G re terms of type o o; F (G ) (H (H )) is term of type o; F is not term since F is expecting first rgument of type o o while hs type o. A set of symols of order t most 1 (i.e. ech symol hs type o or o o o) is clled signture. In the following, we use the letters t, r, s to denote terms, nd given tuple of term t = (t 1,..., t k ) we my use the shorthnd s t to denote s t 1... t k. Contexts. Let t : τ, t : τ e two terms, x : τ e symol of type τ, then we write t [x t ] : τ for the term otined y sustituting ll occurrences of x y t in the term t. A τ-context is term C[ τ ] T (Γ { τ : τ}) contining exctly one occurrence of τ ; it cn e seen s n ppliction turning term into nother, such tht for ll t : τ, C[t] = C[ τ ] [ τ t]. In generl we will only tlk out ground type contexts where τ = o nd we will omit to specify the type when it is cler. For instnce, if C[ ] = F (H (H )) nd t = G then C[t ] = F (G ) (H (H )). Rewrite Rules. Given two disjoint sets of symols Γ, V where V is clled set of vriles, we define (fully pplied) rewrite rule on Γ nd V s pir of terms of T (Γ V) of type o written F x 1... x k e with F Γ, x 1,..., x k V such tht for ll i j x i x j, nd e T (Γ {x 1,..., x k }). Given set of rewrite rules R, we define the rewriting reltion T (Γ) 2 s t t iff there exists context C[ ], rewrite rule F x 1... x k e, nd term F t 1... t k : o such tht t = C[F t 1... t k ] nd t = C[e [x1 t 1]...[x k t k ]]. We cll F t 1... t k : o redex. We define s the reflexive nd trnsitive closure of. Finlly we sy tht set of rewrite rules is deterministic 1 if for ll F Γ there exists t most one rule of the form F x 1... x k e. Trees. Let Σ e finite signture, m e the mximum rity in Σ nd : o e fresh symol. A (rnked) tree t over Σ is mpping t : dom t Σ, where dom t is prefix-closed suset of {1,..., m} such tht if u dom t nd t(u) = then {j u j dom t } = {1,..., rity()}. Given node u dom t, we define the sutree of t rooted t u s the tree t u such tht dom tu = {j u j dom t } nd for ll v dom tu, t u (v) = t(u v). Given : o k o nd 1 Although the rules re deterministics, there my e severl possile rules to pply in term. F S T T C S
4 118 Model Checking nd Functionl Progrm Trnsformtions some trees t 1,..., t k we use the nottion t 1... t k to denote the tree t whose domin is dom t = i i domti, t (ε) = nd t (i u) = t i (u). Note tht there is direct ijection etween ground terms of T o (Σ ) nd finite trees. Hence we will freely llow ourselves to tret ground terms over Σ s trees. We define the prtil order over trees s t t if dom t dom t nd for ll u dom t, t(u) = t (u) or t(u) =. Given (possily infinite) sequence of trees t 0, t 1, t 2,... such tht t i t i+1 for ll i, the set of ll t i hs supremum tht is clled the limit tree of the sequence. Higher Order Recursion Schemes. A higher order recursion scheme (HORS) G = V, Σ, N, R, S is tuple such tht: V is finite set of typed symols clled vriles; Σ is finite signture, clled the set of terminls; N is finite set of typed symols clled non-terminls; R is deterministic set of rewrite rules on Σ N nd V, such tht there is exctly one rule per non terminl nd no rule for terminls; S N is the initil non-terminl. We define inductively the -trnsformtion ( ) : T o (N Σ) T o (Σ { : o}) turning ground term into finite tree s: (F t 1... t k ) = for ll F N nd ( t 1... t k ) = t 1... t k for ll Σ. We define derivtion, s possily infinite sequence of terms linked y the rewrite reltion, nd we will minly look t derivtions where the first term of the sequence is equl to the initil non terminl. Let t 0 = S t 1 t 2 e derivtion, then one cn check tht (t 0 ) (t 1 ) (t 2 )..., hence it dmits limit. One cn prove 2 tht the set of ll such limit trees hs gretest element tht we denote G nd refer to s the vlue tree of G. Note tht G is the supremum of {t S t}. Given term t : o, we denote y G t the scheme otined y trnsforming G such tht it strts derivtions with the term t, formlly, G t = V, Σ, N {S }, R {S t}, S. One cn prove tht if t t then G t = G t. We cll G t the vlue tree of t in G. Prllel derivtion. Intuitively, the prllel rewriting from term t is otined y rewriting ll the redexes in t simultneously. Formlly, given term t = α t 1... t k with α Σ N, we define inductively the prllel rewriting t of t s if α Σ or k < rity(α), then t = α t 1... t k, if α N nd k = rity(α), let α x 1... x k e e the rewrite rule ssocited to α, we hve t = e [ i xi t i ]. Given t, t, we write t t for the reltion t = t. Notice tht if t t nd t t then t t (in prticulr t t ). Furthermore the derivtion S t 1 t 2... leds to G. c Exmple 1. Let G = Σ, V, N, S, R with Σ = {, : o o, c : o c o o}, V = {x : o, ϕ : o o}, N = {S : o, I, F : (o o) o, D, A : c (o o) o o} nd R = {S F, D ϕ x ϕ (ϕ x), A ϕ x ϕ ( x), I ϕ ϕ (I ϕ), F ϕ c (I (A ϕ)) (F (D ϕ))}.... Remrk the rewrite rule ssocited to D: it mens tht for ny function t, D t is simply the function otined y composing t with itself. The rule ssocited to I is lso interesting: for ny function t, I t leds to the infinite itertion of t. For exmple the term I cn e derived to otin ( ( ( (... )))). The tree G is depicted on the left, its rnches re lelled y c ω or c n ( 2(n 1) ) ω for ll n Prity tree utomton. A non-deterministic mx prity utomton (we will just refer to them s utomt in the following) is tuple A = Σ, Q, δ, q 0, Ω with Σ finite signture, Q finite set clled the set of sttes, δ {q (q 1,..., q rity() ) Σ, q, q 1,..., q rity() Q} 2 The existence of vlue tree is consequence the confluence property of HORS.
5 A. Hddd 119 is clled the trnsition reltion, q 0 Q the initil stte, Ω : Q {1,..., m mx } for some m mx N the colouring function. Given n infinite tree t on Σ we define run r of A on t s tree on Σ Q = { q : o k o : o k o, q Q} such tht dom r = dom t, for ll u dom t, if r(u) = q then t(u) = nd there exists q q 1,..., q k δ such tht for ll i, r(u i) = t(u i) qi, nd r(ε) = t(ε) q0. We sy tht the utomton A ccepts the tree t, written t = A, if there exists run r on t such tht for every infinite rnch = ( 0, q 0 ) j 0 ( 1, q 1 ) j 1... in r, the gretest colour seen infinitely often in Ω(q 0 ), Ω(q 1 ), Ω(q 2 ),... is even. We define A q s the utomton otined y chnging in A the initil stte to q: A q = Σ, Q, δ, q, Ω, nd we sy tht A ccepts the tree t from stte q, if t = A q. Exmple 2. Let A = Σ, Q, q 0, δ, Ω e n utomton with Σ = {, : o o, c : o o o}, Q = {q 0, q 1, q 2 }, Ω = {q 0 0, q 1 1, q 2 2} c q 1, q 1 q 2, q 1 nd δ = {q 0 (q 0, q 0 ), q 0 q 1, q 2 q 2, q 2 q 1 }. The utomton A ccepts the trees whose rnches re lelled y c ω or y c ( ) ω. An ccepting run of A on the tree G of Exmple 1 is depicted on the right. q0 q1 q2 q1 q2 q1 q2 q1. c q0 q0 q1 q1 q2 q1 q1 q2. c q0 q0 q1 q1 q1 q1 q2. c q Logicl reflection nd logicl selection In this section we formlise the notion of nnotted tree nd we define the prolems of logicl reflection nd logicl selection we re interested in. Given signture Σ, set X nd tree t on the signture Σ, we define the signture Σ X = {(, x) : o k o : o k o Σ, x X} nd we sy tht the tree t on the signture Σ X is n X-nnottion of t, if dom t = dom t nd if for ll u dom t, t (u) = (t(u), x) for some x X. For exmple run of n utomton over tree t is Q-nnottion of t, with Q eing the set of sttes of the utomton. Furthermore, for ny tree t on the signture Σ X, we define Unl(t ) s the tree on Σ otined y turning ll nodes (, x) of t into i.e. the tree otined y removing the nnotted prt of the tree. Given set of nodes S in tree t, we define n S-mrking of t s {0, 1}-nnottion t of t such tht for ll nodes u, u S if nd only if t (u) = (t(u), 1). Given µ-clculus formul ϕ, we sy tht t is ϕ-reflection of t if it is mrking of the set of nodes u such tht the sutree of t rooted t u stisfies the formul ϕ. Given mondic second-order logic (MSO) formul ϕ[x] with first order free vrile, we sy tht t is ϕ[x]-reflection of t if it is mrking of the set of nodes u stisfying ϕ[u]. Given n MSO formul ϕ[x] with second order free vrile, we sy tht t is ϕ[x]-selection of t if it is mrking of set of nodes S stisfying ϕ[s]. Finlly, we define the µ-clculus reflection, MSO reflection, nd MSO selection s follow. Given clss R of genertors of trees (i.e. set of finitely descried elements such tht to ech g R we ssocite unique tree g ), we sy tht R is (effectively) reflective with respect to the µ-clculus (resp. MSO) if for ny µ-clculus formul ϕ (resp. ny MSO formul ϕ[x]) nd ny tree genertor g R, one cn construct nother genertor g such tht the g is ϕ-reflection (resp. ϕ[x]-reflection) of g. We sy tht R is (effectively) selective with respect to MSO if for ny MSO formul ϕ[x] nd ny genertor g R such tht there F S T T C S
6 120 Model Checking nd Functionl Progrm Trnsformtions exists suset S of nodes of g stisfying ϕ[s], one cn construct nother genertor g such tht g is ϕ[x]-selection. The min contriution of this pper is to give new proofs of the fct tht schemes hve these properties. In order to do so we use the equivlence results etween logic nd utomt, nd we rther prove utomt reflexivity nd utomt selectivity defined s follows. Given tree t on the signture Σ nd n utomton A = Σ, Q, q 0, δ, Ω, we define n A-reflection of A on t s 2 Q -nnottion t of t, such tht for ll nodes u, t (u) = (t(u), Q ) with Q Q eing the set of sttes q such tht A q ccepts the sutree of t rooted on u; we define n A-selection of A on t s n ccepting run of A on t. We sy tht clss R of genertors of trees is reflective with respect to utomt if for ny utomton A nd ny genertor g R, one cn construct nother genertor g such tht g is n A-reflection of g. We sy tht R is selective with respect to utomt if for ny utomton A nd ny genertor g R such tht g = A, one cn construct nother genertor g such tht g is n A-selection of g. From the equivlence etween logics nd utomt [20] we hve tht schemes re reflective with respect to the µ-clculus iff they re reflective with respect to utomt, nd they re selective with respect to MSO iff they re reflective with respect to utomt. Furthermore, it is shown in [3] tht µ-clculus reflection for schemes implies MSO reflection. 4 Morphisms 4.1 Definitions In the following we fix scheme G = Σ, N, V, S, R. We define typed domin D s set such tht ech element is typed, nd to ech element d : τ 1 τ 2 D is ssocited prtil mpping f d from D τ1 to D τ2, where D τ = {d D d : τ}. We write d d the element f d (d ). We define morphism : T (Σ N ) D from terms on Σ N to the domin D s mpping such tht (1) if t : τ then t : τ, (2) if t 0 : τ 1 τ 2 nd t 1 : τ 1, then t t is defined nd equl to t t. In the following, we refer to t s the D-vlue of the term t. Exmple 3. Let D = τ { τ : τ, τ : τ} such tht for ll τ 1, τ 2 : τ1 τ2 τ1 = τ2 ; τ1 τ2 τ1 = τ2 ; τ1 τ2 τ1 = τ2 ; If τ 2 = o then τ1 τ2 τ1 = τ2, otherwise τ1 τ2 τ1 = τ2. For t : τ, we define t s t = τ if t contins ground suterm nd t = τ otherwise. Then is morphism since t 1 t 2 contins ground suterm iff t 1 contins ground suterm, or t 2 contins ground suterm, or t 1 t 2 is ground. Note tht morphism is entirely defined y its vlue on Σ N, i.e. from those vlues one cn compute t for ny term t. Also remrk tht given context C[ ] nd two terms t nd t, if t = t then C[t] = C[t ]. We sy tht morphism is stle y rewriting if for t, t T such tht t t, t = t. Finlly, given set of terms T T (Σ N ), we sy tht the morphism recognises T if there exists suset D of D such tht t T if nd only if t D. In Exmple 3, the morphism recognises the set of terms contining ground term s suterm. 4.2 Emedding morphism into scheme We fix scheme G = V, Σ, N, R, S nd morphism : T (Σ N ) D on G, stle y rewriting, such tht for ll type τ, D τ is finite. We trnsform G into G = V, Σ, N, R, S which, while it is producing derivtion, evlutes t for ny suterm t of the current term nd nnottes the term with ll these D-vlues. The new symols of G re symols
7 A. Hddd 121 of G nnotted with elements of the domin D, nd we define trnsformtion ( ) + from terms of G to terms of G such tht the trnsformtion t + of t will e nnotted with the D-vlues of the suterms of t. The tree generted y G will e nnotted nd when one removes these nnottions, one retreives ck the tree generted y G. More precisely we show the following. Theorem 4 (Emedding morphism). Given two terms t, t : o T (Σ N ), if t G t, then t + G t +. In prticulr Unl( G t ) = G + t (where Unl is the function tht removes the nnottions). Remrk. This trnsformtion keeps the structure of the originl scheme i.e. the new symols re simple lelings of the originl ones, new rewrite rules re otined y duplicting some suterms nd leling the symols, very simple trnsformtion llows to get ck to the originl scheme, nd there is direct correspondence etween derivtions of the two schemes. 4.3 Applictions Emedding properties of suterms during derivtion, or properties of sutrees of the vlue tree, cn e useful for progrm nlysis: insted of sying There will e foridden ehviour in the progrm reflection llows to sy during the execution of progrm Here, the foridden ehviour will pper in this suexpression, ut the rest of the progrm is vlid. Furthermore, once property is emedded into scheme, one cn dd some new rewrite rules tht del explicitly with wether the property is vlid or not. For exmple one could replce ll foridden sutrees of the vlue tree y specil symol foridden, s illustrted in Section 5. Some morphisms generted y type systems re used in [15] to model check suclss of trivil cceptnce condition utomt (i.e. utomt where there is no colouring function, nd the cceptnce of tree simply sks if there exists run of the utomton on the tree). Then the construction llows one to reflect the ccepting sttes of the utomton (s defined in Section 3). This result hs een improved in [22] to del with the whole clss of trivil cceptnce condition utomt. In Section 6 we extend this result to show tht for ny prity tree utomton one cn crete morphism tht reflects the cceptnce of the utomton on the vlue tree. One cn crete model (for exmple in [2]) to decide whether or not ground term t would e productive or not (i.e. t ). Reflecting the productivity of terms into scheme G llows one to crete scheme G on the signture Σ { } such tht G = G, ut such tht no derivtion will crete some non productive terms. In [11] we developed this ide to compre evlution policies. 5 An exmple of scheme trnsformtion In this section, we present simple exmple tht descries how one cn use the emedding procedure to trnsform progrm. Let Mp({0, 1}) e the typed domin inductively defined y Mp({0, 1}) o = {0, 1}, Mp({0, 1}) τ τ is the set of totl functions from Mp({0, 1}) τ to Mp({0, 1}) τ. And given f : τ τ nd h : τ in Mp({0, 1}), f h = f(h). Let G = V, Σ, N, S, R e defined y V = {y : o o, x : o}, Σ = { : o 2 o, : o, c : o}, F S T T C S
8 122 Model Checking nd Functionl Progrm Trnsformtions c c c Figure 1 The vlue tree of the scheme of Section 5. N = {S : o, H : o o, J : o o, F : (o o) o}, R contins the following rewrite rules: S (F H) (F J) H x x (H x) J x (J x) (J x) F y (y ) (y c). The vlue tree of G is (prtilly) depicted in Figure 1. We write [u, v] the mpping f : {0, 1} {0, 1} such tht f(0) = u nd f(1) = v for ll u, v. We define the morphism ϕ s follows: ϕ() = 0 ϕ(c) = 1 ϕ(s) = 1 ϕ() u v = u v ϕ(h) u = u ϕ(j) u = 0 ϕ(f ) [u, v] = u v. One cn check tht the morphism ϕ is stle y rewrite. Furthermore it recognises the property t hs type o, nd its vlue tree contins c, with the suset A = {1}. We construct scheme G = V, Σ, N, S, R tht consists of n emedding of the morphism ϕ inside the scheme G. V = {x : o, y 0, y 1 : o o}, Σ = { 0,0, 0,1, 1,0, 1,1 : o 2 o,, c : o}, N = {S : o, H 0, H 1, J 0, J 1 : o, F [0,0], F [0,1], F [1,0], F [1,1] : (o o) 2 o}, R contins the following rewrite rules: S 1,0 (F [0,1] H 0 H 1 ) (F [0,0] J 0 J 1 ) H 0 x 0,0 x (H 0 x) H 1 x 1,1 x (H 0 x) J 0 x 0,0 (J 0 x) (J 0 x) J 1 x 0,0 (J 1 x) (J 1 x) F [0,0] y 0 y 1 0,0 (y 0 ) (y 1 c) F [0,1] y 0 y 1 0,1 (y 0 ) (y 1 c) F [1,0] y 0 y 1 1,0 (y 0 ) (y 1 c) F [1,1] y 0 y 1 1,1 (y 0 ) (y 1 c). Let us explin how the rewrite rule relted to F [0,1] hs een produced. Recll the originl rule: F y (y ) (y c). The first occurrence of y is pplied to, therefore it should e nnotted with ϕ() = 0. Similrly, the second occurrence of y should e nnotted with ϕ(c) = 1. This justifies the occurrence of y 0 nd y 1 on the left hnd prt of the rule. The nnottion [0, 1] mens tht this rule will e pplied to n rgument whose evlution is the mpping [0, 1], thus the evlution of y is equl to [0, 1] ϕ() = [0, 1] 0 = 0 nd y similr resoning the evlution of y c is equl to 1. Therefore the occurrence of should e nnotted with (0, 1). We wnt to trnsform the scheme in order to forid the derivtion of suterm when its ssocited vlue tree will not include ny c. For instnce, the occurrence of c would correspond to completed service, nd thus such sitution witnesses useless derivtion. In the emedded scheme, this cn e detected y pplying the evlution of the hed over
9 A. Hddd 123 its nnottion. For instnce F [0,0] t 1 t 2 is the nnottion of term F t whose vlue is ϕ(f ) [0, 0] = 0. Therefore we might turn the rule ssocited to F [0,0] into F [0,0] y 1 y 2 foridden, where foridden : o is new terminl dded to the scheme. Here is the whole set of rewrite rules trnsformed this wy. S 1,0 (F [0,1] H 0 H 1 ) (F [0,0] J 0 J 1 ) H 0 x foridden H 1 x 1,1 x (H 0 x) J 0 x foridden J 1 x foridden F [0,0] y 0 y 1 foridden F [0,1] y 0 y 1 0,1 (y 0 ) (y 1 c) F [1,0] y 0 y 1 1,0 (y 0 ) (y 1 c) F [1,1] y 0 y 1 1,1 (y 0 ) (y 1 c). 6 Logicl reflection In the following we present morphism sed on [17] tht recognises the cceptnce of prity tree utomton. Using the construction introduced in Section 4.2, one cn construct scheme tht reflects the ccepting sttes of the utomton, which is equivlent to reflect the sutrees ccepted y formul of the µ-clculus. In [3], µ-clculus reflection (nd MSO reflection) on schemes is lredy proven, ut this construction uses the equivlence etween schemes nd collpsile pushdown utomt, nd the successive trnsformtions (scheme pushdown utomton reflective pushdown utomton reflective scheme) lose the structure of the scheme. In our construction, the structure of the scheme is the preserved, in the sense of Remrk 4.2. Since our proof of the logicl reflection, s well s the one of logicl selection in Section 7, is uild on top of the MSO model checking proof of Koyshi nd Ong [17], we first recll their construction nd then we explin how to use this result to otin the logicl reflection. 6.1 Koyshi-Ong result We fix non deterministic prity tree utomton A = Σ, Q, q I, δ, Ω nd scheme G = Σ, N, V, S, R. We let rity mx, order mx, nd m mx e the mximum rity in Σ N, order in Σ N, colour in Ω(Q). The ide of the result is to define type system, nd to use this type system in the construction of two plyer prity gme, such tht Eve wins the gme if nd only if the utomton ccepts the vlue tree of the scheme. The type system. Koyshi nd Ong introduced set of judgement rules tht llow to type term y n element of the typed set Mp, clled the set of mppings. Mppings of type o re the sttes Q, nd mppings of type τ τ re of the form (θ 1, m 1 )... (θ k, m k ) θ with for ll i θ i is mpping of type τ, m i is color, nd θ is mpping of type τ. The judgements re of the form Γ t θ mening tht under the environment Γ, one cn judge t with the mpping θ. The environment Γ ssocites some mpping nd colors to non terminl nd vriles, nd gives some restriction on the judgements one cn mke. Terminls re judged ccording to the trnsition of the utomton, i.e. : o k o Σ my e judged s (q 1, m 1 )... (q k, m k ) q with for ll i, m i = mx(ω(q i ), Ω(q)) nd q q 1,..., q k δ. This type system keeps trck of the colours in order to know exctly wht colour hs een seen long the term. It is given formlly in the extended version. F S T T C S
10 124 Model Checking nd Functionl Progrm Trnsformtions The gme. Now we define gme G A in which Eve s sttes will e triples mde of non terminl, mpping nd colour, nd Adm s sttes will e environments. Eve chooses n environment tht cn judge the rewrite rule of the current nonterminl with the current tomic mpping, while Adm picks one inding in the current environment. Intuitively, Eve tries to show well-typing of the terms with respect to the rewrite rules, tht would induce well-coloured run of the utomton, nd Adm tries to show tht she is wrong. From the stte (F, θ, m), Eve hs to find n environment Γ such tht she cn prove Γ r F : θ, then Adm picks F nd θ in Γ nd sks Eve to prove tht θ is chosen correctly ccording to the rewrite rule of F. If t some point of ply, Eve cnnot find correct environment, she loses the ply; if she cn choose the empty environment, Adm would hve nothing to choose then she wins the ply; if the ply is infinite, Eve wins if nd only if the gretest colour seen infinitely often is even. The gme is lso given formlly in the extended version. Theorem 5 (Koyshi, Ong 09). The tree G is ccepted y A from the stte q if nd only if Eve hs winning strtegy from the vertex (S, q, Ω(q)) in the gme G A. 6.2 A morphism for utomt reflection From the Eve s winning strtegy, we define morphism : T (Σ N ) D: the domin D contins the sets of mppings of the sme type: for ll τ, D τ = 2 Mpτ. Given nonterminl F, F = {θ m Eve wins from (F, θ, m)}, given Σ, = {θ : θ}, nd given d : τ 1 τ 2 D nd d : τ 1 D d d = {θ (θ 1, m 1 )... (θ k, m k ) θ d i θ i d }. Theorem 6. The morphism recognises the sttes of the utomton, i.e. for ech stte q Q of the utomton, it recognises the set T q = {t : o G t = A q } which is the set of ground terms whose ssocited vlue tree is recognised y the utomton from stte q. Furthermore, it is stle y rewriting. Using the construction of Section 4.2, we hve the following result. Corollry 7 (Automt Reflection). Higher order recursion schemes re reflective with respect to utomt (hence they re reflective with respect to µ-clculus, nd to MSO). 7 Selection Given signture Σ, we recll the selection prolem: given n MSO formul ϕ[x] hving one free mondic second order vrile X, nd scheme G such tht G stisfies the formul X ϕ[x], produce nother scheme G on the signture Σ {0, 1} such tht their exists set S stisfying ϕ[s] nd G is S-mrking of G. Note tht MSO selection implies MSO reflection. Indeed, eing le to mrk the nodes u stisfying the formul ϕ[x] is equivlent to eing le to mrk (unique) set stisfying ψ[x] = x x X ϕ[x]. As mentioned in Section 3, MSO selection is equivlent to utomt selection; we show construction of scheme nnotting itself with n ccepting run of the utomton. Since we cnnot emed this prolem into morphism, we define nother construction, similr to the one of Section 4.2. The construction is lso sed on the Koyshi-Ong result presented in Section 5. The min difference etween reflexivity nd selectivity is tht to construct reflection of n utomton we emedded the winning region of the gme into the scheme, while here we will emed the winning strtegy of the gme to prove the selection. Theorem 8 (Automt Selection). Higher order recursion schemes re selective with respect to utomt (hence to MSO).
11 A. Hddd 125 Proof sketch. In the following, we give n informl glimpse on the proof, the full (technicl) proof cn e found in the extended version. Tke scheme G nd n utomton A such tht G = A. We wnt to construct scheme G such tht G is n ccepting run of A on G. The first oservtion is tht there re some gret similrities etween the structure of the proof trees in the type system system nd the definition of term. Indeed, one cn type proofs nd one cn pply proofs to one nother to get new proofs. For exmple tke two terms t 0 : o o nd t 1 : o nd ssume tht we hve proof P 0 of t 0 (θ 1, m 1 ) θ nd proof P 1 of t 1 θ 1 under some environments. Then one cn put together P 0 nd P 1 to otin proof of t 0 t 1 θ. We cn see this proof s P 0 P 1 : the ppliction of P 1 to P 0. In the ctul construction, the trnsformed scheme will not del with such proofs, ut we use this similrity etween proofs nd terms to crete nnottions of terms. Given term t nd proof P of judgement Γ t θ, we will define the nnotted term t P where ech symol is nnotted y n tomic mpping nd color, verifying tht if non terminl F is nnotted y (θ, m) then Γ ssicite F to (θ, m). The term t P is somehow trce of the proof P. Now given rewrite rule F x 1...x k e in the originl scheme, we wnt to define for ll nnotted versions F (θ,m) n ssocited rewrite rule in the trnsformed scheme. If (F, θ, m) is winning vertex of the gme, then Eve cn choose n environment Γ such tht Γ e θ. We tke proof P of this judgement nd we define F (θ,m) x 1... x k e P. Since Eve hs chosen the environment Γ with respect to her winning strtegy, then for ll nnotted non terminls H (θ,m ) ppering in e P, (H, θ, m ) is winning in the gme. In prticulr, if the initil non terminl of the trnsformed scheme is S (θ,m) with (S, θ, m) winning in the gme (s it will e), ny non terminl in ny term of ny derivtion will e nnotted in order to represent winning vertex in the gme. Therefore we do not need to cre out which rewrite rule is chosen for F (θ,m) when (F, θ, m) is not winning. As we sid, the initil non terminl is (S, q 0, Ω(q 0 )) which is winning in the gme since A ccepts G from stte q 0. Any terminl will e nnotted y some (q 1 q k q, m). Then to otin elements of Σ Q, we just turn ny (q1 qk q,m) into non terminl nd we dd rewrite rule trnsforming it into q. The intuition of why this construction works is the following, sed on the proof of the soundness of Koyshi nd Ong construction. To derivtion in the trnsformed scheme we ssocite tree of plys in the gme. The terms will e leled y some F (θ,m) tht Eve hs chosen in the environments she picked, nd ech time Adm choose one such F (θ,m), it is rewritten ccording to Eve s strtegy. Due to the colour constrints in the type systems, we cn show tht from the point where F (θ,m) is creted to the point where it is on the hed of redex, the mximum colour tht hs een seen is m. Furthermore, we hve tht long n infinite rnch, there is n infinite sequence of nonterminls tht re rewritten such tht ech non terminl is creted when the previous one is rewritten. This mens tht we cn mp n infinite rnch to n infinite ply in the gme. Furthermore the gretest colour seen infinitely often long this rnch is equl to the gretest colour seen infinitely often in the sequence of mximum colours ppering etween the non terminls of the sequence. And this is equl to the gretest colour seen infinitely often in the ply. Since Eve wins in the gme, this colour is even, then for ny rnch of the vlue tree of G the gretest colour seen infinitely often is even, hence it is n ccepting run. 8 Conclusion We hve given new shpe preserving constructions for logicl reflection nd logicl selection using scheme-only pproch, which cn e useful for correction or synthesis of progrms. F S T T C S
12 126 Model Checking nd Functionl Progrm Trnsformtions The complexity is the sme s in the solutions proposed so fr, i.e. the prolem is n- EXPTIME complete, nd the size of the new scheme is n-exp the size of the originl one n eing the order of the scheme. As possile continution of these work, we my e interesting to see if these results scle for ctul progrm verifiction, nd if they cn e included in tools like T-RecS [16], model-checker for HORS. References 1 Klus Aehlig. A finite semntics of simply-typed lmd terms for infinite runs of utomt. In CSL 06, volume 4207 of LNCS, pges , R. M. Amdio nd P.-L. Curien. Domins nd Lmd-Clculi. CTTCS, Christopher H. Brodent, Arnud Cryol, C.-H. Luke Ong, nd Olivier Serre. Recursion schemes nd logicl reflection. In LICS 10, pges , Arnud Cryol nd Olivier Serre. Collpsile pushdown utomt nd leled recursion schemes. In LICS 12, pges , Didier Cucl. On infinite terms hving decidle mondic theory. In MFCS 02, volume 2420 of LNCS, pges , Bruno Courcelle. A representtion of trees y lnguges I. TCS, 6: , Bruno Courcelle. A representtion of trees y lnguges II. TCS, 7:25 55, Bruno Courcelle nd Murice Nivt. The lgeric semntics of recursive progrm schemes. In MFCS 78, volume 64 of LNCS, pges 16 30, Werner Dmm. Higher type progrm schemes nd their tree lnguges. In Theoreticl Computer Science, 3rd GI-Conference, volume 48 of LNCS, pges 51 72, Werner Dmm. Lnguges defined y higher type progrm schemes. In ICALP 77, volume 52 of LNCS, pges , Axel Hddd. IO vs oi in higher-order recursion schemes. In FICS 12, pges 23 30, Mtthew Hgue, Andrzej S. Murwski, C.-H. Luke Ong, nd Olivier Serre. Collpsile pushdown utomt nd recursion schemes. In LICS 08, pges , Klus Indermrk. Schemes with recursion on higher types. In MFCS 76, volume 45 of LNCS, pges , Teodor Knpik, Dmin Niwiński, nd Pwel Urzyczyn. Higher-order pushdown trees re esy. In FOSSACS 02, volume 2303 of LNCS, pges , Noki Koyshi. Types nd higher-order recursion schemes for verifiction of higher-order progrms. In POPL 09, pges , Noki Koyshi. A prcticl liner time lgorithm for trivil utomt model checking of higher-order recursion schemes. In FOSSACS 11, pges , Noki Koyshi nd C.-H. Luke Ong. A type system equivlent to the modl mu-clculus model checking of higher-order recursion schemes. In LICS 09, pges , M. Nivt. On the interprettion of recursive progrm schemes. In Symp. Mt., C.-H. Luke Ong. On model-checking trees generted y higher-order recursion schemes. In LICS 06, pges 81 90, M.O. Rin. Decidility of second-order theories nd utomt on infinite trees. In Trns. Amer. Mth. Soc., Sylvin Slvti nd Igor Wlukiewicz. Krivine mchines nd higher-order schemes. In ICALP 11, pges , Sylvin Slvti nd Igor Wlukiewicz. Using models to model-check recursive schemes. In Typed Lmd Clculi nd Applictions, pges Springer, 2013.
Coalgebra, Lecture 15: Equations for Deterministic Automata
Colger, Lecture 15: Equtions for Deterministic Automt Julin Slmnc (nd Jurrin Rot) Decemer 19, 2016 In this lecture, we will study the concept of equtions for deterministic utomt. The notes re self contined
More informationOn Determinisation of History-Deterministic Automata.
On Deterministion of History-Deterministic Automt. Denis Kupererg Mich l Skrzypczk University of Wrsw YR-ICALP 2014 Copenhgen Introduction Deterministic utomt re centrl tool in utomt theory: Polynomil
More informationConvert the NFA into DFA
Convert the NF into F For ech NF we cn find F ccepting the sme lnguge. The numer of sttes of the F could e exponentil in the numer of sttes of the NF, ut in prctice this worst cse occurs rrely. lgorithm:
More informationParse trees, ambiguity, and Chomsky normal form
Prse trees, miguity, nd Chomsky norml form In this lecture we will discuss few importnt notions connected with contextfree grmmrs, including prse trees, miguity, nd specil form for context-free grmmrs
More informationDesigning finite automata II
Designing finite utomt II Prolem: Design DFA A such tht L(A) consists of ll strings of nd which re of length 3n, for n = 0, 1, 2, (1) Determine wht to rememer out the input string Assign stte to ech of
More informationIntermediate Math Circles Wednesday, November 14, 2018 Finite Automata II. Nickolas Rollick a b b. a b 4
Intermedite Mth Circles Wednesdy, Novemer 14, 2018 Finite Automt II Nickols Rollick nrollick@uwterloo.c Regulr Lnguges Lst time, we were introduced to the ide of DFA (deterministic finite utomton), one
More information1 Nondeterministic Finite Automata
1 Nondeterministic Finite Automt Suppose in life, whenever you hd choice, you could try oth possiilities nd live your life. At the end, you would go ck nd choose the one tht worked out the est. Then you
More informationTutorial Automata and formal Languages
Tutoril Automt nd forml Lnguges Notes for to the tutoril in the summer term 2017 Sestin Küpper, Christine Mik 8. August 2017 1 Introduction: Nottions nd sic Definitions At the eginning of the tutoril we
More informationFormal Languages and Automata
Moile Computing nd Softwre Engineering p. 1/5 Forml Lnguges nd Automt Chpter 2 Finite Automt Chun-Ming Liu cmliu@csie.ntut.edu.tw Deprtment of Computer Science nd Informtion Engineering Ntionl Tipei University
More informationThe Caucal Hierarchy of Infinite Graphs in Terms of Logic and Higher-order Pushdown Automata
The Cucl Hierrchy of Infinite Grphs in Terms of Logic nd Higher-order Pushdown Automt Arnud Cryol 1 nd Stefn Wöhrle 2 1 IRISA Rennes, Frnce rnud.cryol@iris.fr 2 Lehrstuhl für Informtik 7 RWTH Achen, Germny
More informationLecture 3: Equivalence Relations
Mthcmp Crsh Course Instructor: Pdric Brtlett Lecture 3: Equivlence Reltions Week 1 Mthcmp 2014 In our lst three tlks of this clss, we shift the focus of our tlks from proof techniques to proof concepts
More informationCM10196 Topic 4: Functions and Relations
CM096 Topic 4: Functions nd Reltions Guy McCusker W. Functions nd reltions Perhps the most widely used notion in ll of mthemtics is tht of function. Informlly, function is n opertion which tkes n input
More informationChapter 2 Finite Automata
Chpter 2 Finite Automt 28 2.1 Introduction Finite utomt: first model of the notion of effective procedure. (They lso hve mny other pplictions). The concept of finite utomton cn e derived y exmining wht
More informationMinimal DFA. minimal DFA for L starting from any other
Miniml DFA Among the mny DFAs ccepting the sme regulr lnguge L, there is exctly one (up to renming of sttes) which hs the smllest possile numer of sttes. Moreover, it is possile to otin tht miniml DFA
More informationGood-for-Games Automata versus Deterministic Automata.
Good-for-Gmes Automt versus Deterministic Automt. Denis Kuperberg 1,2 Mich l Skrzypczk 1 1 University of Wrsw 2 IRIT/ONERA (Toulouse) Séminire MoVe 12/02/2015 LIF, Luminy Introduction Deterministic utomt
More informationNondeterminism and Nodeterministic Automata
Nondeterminism nd Nodeterministic Automt 61 Nondeterminism nd Nondeterministic Automt The computtionl mchine models tht we lerned in the clss re deterministic in the sense tht the next move is uniquely
More informationCS 275 Automata and Formal Language Theory
CS 275 utomt nd Forml Lnguge Theory Course Notes Prt II: The Recognition Prolem (II) Chpter II.5.: Properties of Context Free Grmmrs (14) nton Setzer (Bsed on ook drft y J. V. Tucker nd K. Stephenson)
More informationAssignment 1 Automata, Languages, and Computability. 1 Finite State Automata and Regular Languages
Deprtment of Computer Science, Austrlin Ntionl University COMP2600 Forml Methods for Softwre Engineering Semester 2, 206 Assignment Automt, Lnguges, nd Computility Smple Solutions Finite Stte Automt nd
More information80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES. 2.6 Finite State Automata With Output: Transducers
80 CHAPTER 2. DFA S, NFA S, REGULAR LANGUAGES 2.6 Finite Stte Automt With Output: Trnsducers So fr, we hve only considered utomt tht recognize lnguges, i.e., utomt tht do not produce ny output on ny input
More informationHierarchy of pushdown graphs
Hierrchy o pushdown grphs Didier Cucl CNRS / LIGM University Pris- Est Frnce The hierrchy o pushdown grphs recursive trnsition grphs Corresponding hierrchies o lnguges, terms, ordinls, ininite words higher
More informationLecture 09: Myhill-Nerode Theorem
CS 373: Theory of Computtion Mdhusudn Prthsrthy Lecture 09: Myhill-Nerode Theorem 16 Ferury 2010 In this lecture, we will see tht every lnguge hs unique miniml DFA We will see this fct from two perspectives
More informationFormal languages, automata, and theory of computation
Mälrdlen University TEN1 DVA337 2015 School of Innovtion, Design nd Engineering Forml lnguges, utomt, nd theory of computtion Thursdy, Novemer 5, 14:10-18:30 Techer: Dniel Hedin, phone 021-107052 The exm
More informationCS 330 Formal Methods and Models
CS 330 Forml Methods nd Models Dn Richrds, George Mson University, Spring 2017 Quiz Solutions Quiz 1, Propositionl Logic Dte: Ferury 2 1. Prove ((( p q) q) p) is tutology () (3pts) y truth tle. p q p q
More informationLecture 9: LTL and Büchi Automata
Lecture 9: LTL nd Büchi Automt 1 LTL Property Ptterns Quite often the requirements of system follow some simple ptterns. Sometimes we wnt to specify tht property should only hold in certin context, clled
More informationCMPSCI 250: Introduction to Computation. Lecture #31: What DFA s Can and Can t Do David Mix Barrington 9 April 2014
CMPSCI 250: Introduction to Computtion Lecture #31: Wht DFA s Cn nd Cn t Do Dvid Mix Brrington 9 April 2014 Wht DFA s Cn nd Cn t Do Deterministic Finite Automt Forml Definition of DFA s Exmples of DFA
More informationHandout: Natural deduction for first order logic
MATH 457 Introduction to Mthemticl Logic Spring 2016 Dr Json Rute Hndout: Nturl deduction for first order logic We will extend our nturl deduction rules for sententil logic to first order logic These notes
More informationThe University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER LANGUAGES AND COMPUTATION ANSWERS
The University of Nottinghm SCHOOL OF COMPUTER SCIENCE LEVEL 2 MODULE, SPRING SEMESTER 2016 2017 LNGUGES ND COMPUTTION NSWERS Time llowed TWO hours Cndidtes my complete the front cover of their nswer ook
More informationCSCI 340: Computational Models. Kleene s Theorem. Department of Computer Science
CSCI 340: Computtionl Models Kleene s Theorem Chpter 7 Deprtment of Computer Science Unifiction In 1954, Kleene presented (nd proved) theorem which (in our version) sttes tht if lnguge cn e defined y ny
More informationRevision Sheet. (a) Give a regular expression for each of the following languages:
Theoreticl Computer Science (Bridging Course) Dr. G. D. Tipldi F. Bonirdi Winter Semester 2014/2015 Revision Sheet University of Freiurg Deprtment of Computer Science Question 1 (Finite Automt, 8 + 6 points)
More informationCompiler Design. Fall Lexical Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz
University of Southern Cliforni Computer Science Deprtment Compiler Design Fll Lexicl Anlysis Smple Exercises nd Solutions Prof. Pedro C. Diniz USC / Informtion Sciences Institute 4676 Admirlty Wy, Suite
More informationMore on automata. Michael George. March 24 April 7, 2014
More on utomt Michel George Mrch 24 April 7, 2014 1 Automt constructions Now tht we hve forml model of mchine, it is useful to mke some generl constructions. 1.1 DFA Union / Product construction Suppose
More informationThe practical version
Roerto s Notes on Integrl Clculus Chpter 4: Definite integrls nd the FTC Section 7 The Fundmentl Theorem of Clculus: The prcticl version Wht you need to know lredy: The theoreticl version of the FTC. Wht
More information12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2016
CS125 Lecture 12 Fll 2016 12.1 Nondeterminism The ide of nondeterministic computtions is to llow our lgorithms to mke guesses, nd only require tht they ccept when the guesses re correct. For exmple, simple
More informationChapter Five: Nondeterministic Finite Automata. Formal Language, chapter 5, slide 1
Chpter Five: Nondeterministic Finite Automt Forml Lnguge, chpter 5, slide 1 1 A DFA hs exctly one trnsition from every stte on every symol in the lphet. By relxing this requirement we get relted ut more
More informationNon-deterministic Finite Automata
Non-deterministic Finite Automt Eliminting non-determinism Rdoud University Nijmegen Non-deterministic Finite Automt H. Geuvers nd T. vn Lrhoven Institute for Computing nd Informtion Sciences Intelligent
More informationHomework 3 Solutions
CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 3 Solutions 1. Give NFAs with the specified numer of sttes recognizing ech of the following lnguges. In ll cses, the lphet is Σ = {,1}.
More informationFirst Midterm Examination
Çnky University Deprtment of Computer Engineering 203-204 Fll Semester First Midterm Exmintion ) Design DFA for ll strings over the lphet Σ = {,, c} in which there is no, no nd no cc. 2) Wht lnguge does
More informationExercises with (Some) Solutions
Exercises with (Some) Solutions Techer: Luc Tesei Mster of Science in Computer Science - University of Cmerino Contents 1 Strong Bisimultion nd HML 2 2 Wek Bisimultion 31 3 Complete Lttices nd Fix Points
More informationFinite Automata. Informatics 2A: Lecture 3. John Longley. 22 September School of Informatics University of Edinburgh
Lnguges nd Automt Finite Automt Informtics 2A: Lecture 3 John Longley School of Informtics University of Edinburgh jrl@inf.ed.c.uk 22 September 2017 1 / 30 Lnguges nd Automt 1 Lnguges nd Automt Wht is
More informationCS103B Handout 18 Winter 2007 February 28, 2007 Finite Automata
CS103B ndout 18 Winter 2007 Ferury 28, 2007 Finite Automt Initil text y Mggie Johnson. Introduction Severl childrens gmes fit the following description: Pieces re set up on plying ord; dice re thrown or
More information3 Regular expressions
3 Regulr expressions Given n lphet Σ lnguge is set of words L Σ. So fr we were le to descrie lnguges either y using set theory (i.e. enumertion or comprehension) or y n utomton. In this section we shll
More informationOverview HC9. Parsing: Top-Down & LL(1) Context-Free Grammars (1) Introduction. CFGs (3) Context-Free Grammars (2) Vertalerbouw HC 9: Ch.
Overview H9 Vertlerouw H 9: Prsing: op-down & LL(1) do 3 mei 2001 56 heo Ruys h. 8 - Prsing 8.1 ontext-free Grmmrs 8.2 op-down Prsing 8.3 LL(1) Grmmrs See lso [ho, Sethi & Ullmn 1986] for more thorough
More informationLecture 08: Feb. 08, 2019
4CS4-6:Theory of Computtion(Closure on Reg. Lngs., regex to NDFA, DFA to regex) Prof. K.R. Chowdhry Lecture 08: Fe. 08, 2019 : Professor of CS Disclimer: These notes hve not een sujected to the usul scrutiny
More informationAutomata Theory 101. Introduction. Outline. Introduction Finite Automata Regular Expressions ω-automata. Ralf Huuck.
Outline Automt Theory 101 Rlf Huuck Introduction Finite Automt Regulr Expressions ω-automt Session 1 2006 Rlf Huuck 1 Session 1 2006 Rlf Huuck 2 Acknowledgement Some slides re sed on Wolfgng Thoms excellent
More informationFABER Formal Languages, Automata and Models of Computation
DVA337 FABER Forml Lnguges, Automt nd Models of Computtion Lecture 5 chool of Innovtion, Design nd Engineering Mälrdlen University 2015 1 Recp of lecture 4 y definition suset construction DFA NFA stte
More informationSWEN 224 Formal Foundations of Programming WITH ANSWERS
T E W H A R E W Ā N A N G A O T E Ū P O K O O T E I K A A M Ā U I VUW V I C T O R I A UNIVERSITY OF WELLINGTON Time Allowed: 3 Hours EXAMINATIONS 2011 END-OF-YEAR SWEN 224 Forml Foundtions of Progrmming
More informationDFA minimisation using the Myhill-Nerode theorem
DFA minimistion using the Myhill-Nerode theorem Johnn Högerg Lrs Lrsson Astrct The Myhill-Nerode theorem is n importnt chrcteristion of regulr lnguges, nd it lso hs mny prcticl implictions. In this chpter,
More informationModel Reduction of Finite State Machines by Contraction
Model Reduction of Finite Stte Mchines y Contrction Alessndro Giu Dip. di Ingegneri Elettric ed Elettronic, Università di Cgliri, Pizz d Armi, 09123 Cgliri, Itly Phone: +39-070-675-5892 Fx: +39-070-675-5900
More informationClosure Properties of Regular Languages
Closure Properties of Regulr Lnguges Regulr lnguges re closed under mny set opertions. Let L 1 nd L 2 e regulr lnguges. (1) L 1 L 2 (the union) is regulr. (2) L 1 L 2 (the conctention) is regulr. (3) L
More informationReview of Gaussian Quadrature method
Review of Gussin Qudrture method Nsser M. Asi Spring 006 compiled on Sundy Decemer 1, 017 t 09:1 PM 1 The prolem To find numericl vlue for the integrl of rel vlued function of rel vrile over specific rnge
More informationCS 301. Lecture 04 Regular Expressions. Stephen Checkoway. January 29, 2018
CS 301 Lecture 04 Regulr Expressions Stephen Checkowy Jnury 29, 2018 1 / 35 Review from lst time NFA N = (Q, Σ, δ, q 0, F ) where δ Q Σ P (Q) mps stte nd n lphet symol (or ) to set of sttes We run n NFA
More informationAUTOMATA AND LANGUAGES. Definition 1.5: Finite Automaton
25. Finite Automt AUTOMATA AND LANGUAGES A system of computtion tht only hs finite numer of possile sttes cn e modeled using finite utomton A finite utomton is often illustrted s stte digrm d d d. d q
More information1. For each of the following theorems, give a two or three sentence sketch of how the proof goes or why it is not true.
York University CSE 2 Unit 3. DFA Clsses Converting etween DFA, NFA, Regulr Expressions, nd Extended Regulr Expressions Instructor: Jeff Edmonds Don t chet y looking t these nswers premturely.. For ech
More informationp-adic Egyptian Fractions
p-adic Egyptin Frctions Contents 1 Introduction 1 2 Trditionl Egyptin Frctions nd Greedy Algorithm 2 3 Set-up 3 4 p-greedy Algorithm 5 5 p-egyptin Trditionl 10 6 Conclusion 1 Introduction An Egyptin frction
More informationHow to simulate Turing machines by invertible one-dimensional cellular automata
How to simulte Turing mchines by invertible one-dimensionl cellulr utomt Jen-Christophe Dubcq Déprtement de Mthémtiques et d Informtique, École Normle Supérieure de Lyon, 46, llée d Itlie, 69364 Lyon Cedex
More informationEhrenfeucht-Fraïssé Games: Applications and Complexity. Department of Mathematics and Computer Science University of Udine, Italy ESSLLI 2010 CPH
Ehrenfeucht-Frïssé Gmes: Applictions nd Complexity Angelo Montnri Nicol Vitcolonn Deprtment of Mthemtics nd Computer Science University of Udine, Itly ESSLLI 2010 CPH Outline Introduction to EF-gmes Inexpressivity
More informationCHAPTER 1 Regular Languages. Contents
Finite Automt (FA or DFA) CHAPTE 1 egulr Lnguges Contents definitions, exmples, designing, regulr opertions Non-deterministic Finite Automt (NFA) definitions, euivlence of NFAs nd DFAs, closure under regulr
More information1 From NFA to regular expression
Note 1: How to convert DFA/NFA to regulr expression Version: 1.0 S/EE 374, Fll 2017 Septemer 11, 2017 In this note, we show tht ny DFA cn e converted into regulr expression. Our construction would work
More informationCS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)
CS 373, Spring 29. Solutions to Mock midterm (sed on first midterm in CS 273, Fll 28.) Prolem : Short nswer (8 points) The nswers to these prolems should e short nd not complicted. () If n NF M ccepts
More informationCSE : Exam 3-ANSWERS, Spring 2011 Time: 50 minutes
CSE 260-002: Exm 3-ANSWERS, Spring 20 ime: 50 minutes Nme: his exm hs 4 pges nd 0 prolems totling 00 points. his exm is closed ook nd closed notes.. Wrshll s lgorithm for trnsitive closure computtion is
More informationCS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS
CS 310 (sec 20) - Winter 2003 - Finl Exm (solutions) SOLUTIONS 1. (Logic) Use truth tles to prove the following logicl equivlences: () p q (p p) (q q) () p q (p q) (p q) () p q p q p p q q (q q) (p p)
More information5. (±±) Λ = fw j w is string of even lengthg [ 00 = f11,00g 7. (11 [ 00)± Λ = fw j w egins with either 11 or 00g 8. (0 [ ffl)1 Λ = 01 Λ [ 1 Λ 9.
Regulr Expressions, Pumping Lemm, Right Liner Grmmrs Ling 106 Mrch 25, 2002 1 Regulr Expressions A regulr expression descries or genertes lnguge: it is kind of shorthnd for listing the memers of lnguge.
More informationNon-deterministic Finite Automata
Non-deterministic Finite Automt From Regulr Expressions to NFA- Eliminting non-determinism Rdoud University Nijmegen Non-deterministic Finite Automt H. Geuvers nd J. Rot Institute for Computing nd Informtion
More informationI1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3
2 The Prllel Circuit Electric Circuits: Figure 2- elow show ttery nd multiple resistors rrnged in prllel. Ech resistor receives portion of the current from the ttery sed on its resistnce. The split is
More informationCMSC 330: Organization of Programming Languages
CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 CMSC 330 1 Types of Finite Automt Deterministic Finite Automt (DFA) Exctly one sequence of steps for ech string All exmples so fr Nondeterministic
More information1 Online Learning and Regret Minimization
2.997 Decision-Mking in Lrge-Scle Systems My 10 MIT, Spring 2004 Hndout #29 Lecture Note 24 1 Online Lerning nd Regret Minimiztion In this lecture, we consider the problem of sequentil decision mking in
More informationFinite Automata. Informatics 2A: Lecture 3. Mary Cryan. 21 September School of Informatics University of Edinburgh
Finite Automt Informtics 2A: Lecture 3 Mry Cryn School of Informtics University of Edinburgh mcryn@inf.ed.c.uk 21 September 2018 1 / 30 Lnguges nd Automt Wht is lnguge? Finite utomt: recp Some forml definitions
More informationA negative answer to a question of Wilke on varieties of!-languages
A negtive nswer to question of Wilke on vrieties of!-lnguges Jen-Eric Pin () Astrct. In recent pper, Wilke sked whether the oolen comintions of!-lnguges of the form! L, for L in given +-vriety of lnguges,
More informationCS 311 Homework 3 due 16:30, Thursday, 14 th October 2010
CS 311 Homework 3 due 16:30, Thursdy, 14 th Octoer 2010 Homework must e sumitted on pper, in clss. Question 1. [15 pts.; 5 pts. ech] Drw stte digrms for NFAs recognizing the following lnguges:. L = {w
More informationBernoulli Numbers Jeff Morton
Bernoulli Numbers Jeff Morton. We re interested in the opertor e t k d k t k, which is to sy k tk. Applying this to some function f E to get e t f d k k tk d k f f + d k k tk dk f, we note tht since f
More informationContext-Free Grammars and Languages
Context-Free Grmmrs nd Lnguges (Bsed on Hopcroft, Motwni nd Ullmn (2007) & Cohen (1997)) Introduction Consider n exmple sentence: A smll ct ets the fish English grmmr hs rules for constructing sentences;
More informationa,b a 1 a 2 a 3 a,b 1 a,b a,b 2 3 a,b a,b a 2 a,b CS Determinisitic Finite Automata 1
CS4 45- Determinisitic Finite Automt -: Genertors vs. Checkers Regulr expressions re one wy to specify forml lnguge String Genertor Genertes strings in the lnguge Deterministic Finite Automt (DFA) re nother
More informationCS415 Compilers. Lexical Analysis and. These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University
CS415 Compilers Lexicl Anlysis nd These slides re sed on slides copyrighted y Keith Cooper, Ken Kennedy & Lind Torczon t Rice University First Progrmming Project Instruction Scheduling Project hs een posted
More informationMarking shortest paths on pushdown graphs does not preserve MSO decidability
Mrking shortest pths on pushdown grphs does not preserve MSO decidility Arnud Cryol, Olivier Serre To cite this version: Arnud Cryol, Olivier Serre Mrking shortest pths on pushdown grphs does not preserve
More informationCS 314 Principles of Programming Languages
C 314 Principles of Progrmming Lnguges Lecture 6: LL(1) Prsing Zheng (Eddy) Zhng Rutgers University Ferury 5, 2018 Clss Informtion Homework 2 due tomorrow. Homework 3 will e posted erly next week. 2 Top
More informationLecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations.
Lecture 3 3 Solving liner equtions In this lecture we will discuss lgorithms for solving systems of liner equtions Multiplictive identity Let us restrict ourselves to considering squre mtrices since one
More informationTalen en Automaten Test 1, Mon 7 th Dec, h45 17h30
Tlen en Automten Test 1, Mon 7 th Dec, 2015 15h45 17h30 This test consists of four exercises over 5 pges. Explin your pproch, nd write your nswer to ech exercise on seprte pge. You cn score mximum of 100
More informationTHE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS.
THE EXISTENCE-UNIQUENESS THEOREM FOR FIRST-ORDER DIFFERENTIAL EQUATIONS RADON ROSBOROUGH https://intuitiveexplntionscom/picrd-lindelof-theorem/ This document is proof of the existence-uniqueness theorem
More informationMore general families of infinite graphs
More generl fmilies of infinite grphs Antoine Meyer Forml Methods Updte 2006 IIT Guwhti Prefix-recognizle grphs Theorem Let G e grph, the following sttements re equivlent: G is defined y reltions of the
More informationTypes of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. Comparing DFAs and NFAs (cont.) Finite Automata 2
CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt
More informationState Minimization for DFAs
Stte Minimiztion for DFAs Red K & S 2.7 Do Homework 10. Consider: Stte Minimiztion 4 5 Is this miniml mchine? Step (1): Get rid of unrechle sttes. Stte Minimiztion 6, Stte is unrechle. Step (2): Get rid
More informationFinite Automata-cont d
Automt Theory nd Forml Lnguges Professor Leslie Lnder Lecture # 6 Finite Automt-cont d The Pumping Lemm WEB SITE: http://ingwe.inghmton.edu/ ~lnder/cs573.html Septemer 18, 2000 Exmple 1 Consider L = {ww
More informationThe size of subsequence automaton
Theoreticl Computer Science 4 (005) 79 84 www.elsevier.com/locte/tcs Note The size of susequence utomton Zdeněk Troníček,, Ayumi Shinohr,c Deprtment of Computer Science nd Engineering, FEE CTU in Prgue,
More informationFormal Languages and Automata Theory. D. Goswami and K. V. Krishna
Forml Lnguges nd Automt Theory D. Goswmi nd K. V. Krishn Novemer 5, 2010 Contents 1 Mthemticl Preliminries 3 2 Forml Lnguges 4 2.1 Strings............................... 5 2.2 Lnguges.............................
More informationSpeech Recognition Lecture 2: Finite Automata and Finite-State Transducers. Mehryar Mohri Courant Institute and Google Research
Speech Recognition Lecture 2: Finite Automt nd Finite-Stte Trnsducers Mehryr Mohri Cournt Institute nd Google Reserch mohri@cims.nyu.com Preliminries Finite lphet Σ, empty string. Set of ll strings over
More informationImproper Integrals. The First Fundamental Theorem of Calculus, as we ve discussed in class, goes as follows:
Improper Integrls The First Fundmentl Theorem of Clculus, s we ve discussed in clss, goes s follows: If f is continuous on the intervl [, ] nd F is function for which F t = ft, then ftdt = F F. An integrl
More informationDATABASE DESIGN I - 1DL300
DATABASE DESIGN I - DL300 Fll 00 An introductory course on dtse systems http://www.it.uu.se/edu/course/homepge/dstekn/ht0/ Mnivskn Sesn Uppsl Dtse Lortory Deprtment of Informtion Technology, Uppsl University,
More informationDeterministic Finite Automata
Finite Automt Deterministic Finite Automt H. Geuvers nd J. Rot Institute for Computing nd Informtion Sciences Version: fll 2016 J. Rot Version: fll 2016 Tlen en Automten 1 / 21 Outline Finite Automt Finite
More informationA tutorial on sequential functions
A tutoril on sequentil functions Jen-Éric Pin LIAFA, CNRS nd University Pris 7 30 Jnury 2006, CWI, Amsterdm Outline (1) Sequentil functions (2) A chrcteriztion of sequentil trnsducers (3) Miniml sequentil
More informationGenetic Programming. Outline. Evolutionary Strategies. Evolutionary strategies Genetic programming Summary
Outline Genetic Progrmming Evolutionry strtegies Genetic progrmming Summry Bsed on the mteril provided y Professor Michel Negnevitsky Evolutionry Strtegies An pproch simulting nturl evolution ws proposed
More informationBases for Vector Spaces
Bses for Vector Spces 2-26-25 A set is independent if, roughly speking, there is no redundncy in the set: You cn t uild ny vector in the set s liner comintion of the others A set spns if you cn uild everything
More informationTypes of Finite Automata. CMSC 330: Organization of Programming Languages. Comparing DFAs and NFAs. NFA for (a b)*abb.
CMSC 330: Orgniztion of Progrmming Lnguges Finite Automt 2 Types of Finite Automt Deterministic Finite Automt () Exctly one sequence of steps for ech string All exmples so fr Nondeterministic Finite Automt
More informationSoftware Engineering using Formal Methods
Softwre Engineering using Forml Methods Propositionl nd (Liner) Temporl Logic Wolfgng Ahrendt 13th Septemer 2016 SEFM: Liner Temporl Logic /GU 160913 1 / 60 Recpitultion: FormlistionFormlistion: Syntx,
More informationNon Deterministic Automata. Linz: Nondeterministic Finite Accepters, page 51
Non Deterministic Automt Linz: Nondeterministic Finite Accepters, pge 51 1 Nondeterministic Finite Accepter (NFA) Alphbet ={} q 1 q2 q 0 q 3 2 Nondeterministic Finite Accepter (NFA) Alphbet ={} Two choices
More informationFinite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018
Finite Automt Theory nd Forml Lnguges TMV027/DIT321 LP4 2018 Lecture 10 An Bove April 23rd 2018 Recp: Regulr Lnguges We cn convert between FA nd RE; Hence both FA nd RE ccept/generte regulr lnguges; More
More information12.1 Nondeterminism Nondeterministic Finite Automata. a a b ε. CS125 Lecture 12 Fall 2014
CS125 Lecture 12 Fll 2014 12.1 Nondeterminism The ide of nondeterministic computtions is to llow our lgorithms to mke guesses, nd only require tht they ccept when the guesses re correct. For exmple, simple
More informationCS375: Logic and Theory of Computing
CS375: Logic nd Theory of Computing Fuhu (Frnk) Cheng Deprtment of Computer Science University of Kentucky 1 Tle of Contents: Week 1: Preliminries (set lger, reltions, functions) (red Chpters 1-4) Weeks
More informationThoery of Automata CS402
Thoery of Automt C402 Theory of Automt Tle of contents: Lecture N0. 1... 4 ummry... 4 Wht does utomt men?... 4 Introduction to lnguges... 4 Alphets... 4 trings... 4 Defining Lnguges... 5 Lecture N0. 2...
More informationImproper Integrals, and Differential Equations
Improper Integrls, nd Differentil Equtions October 22, 204 5.3 Improper Integrls Previously, we discussed how integrls correspond to res. More specificlly, we sid tht for function f(x), the region creted
More informationAnatomy of a Deterministic Finite Automaton. Deterministic Finite Automata. A machine so simple that you can understand it in less than one minute
Victor Admchik Dnny Sletor Gret Theoreticl Ides In Computer Science CS 5-25 Spring 2 Lecture 2 Mr 3, 2 Crnegie Mellon University Deterministic Finite Automt Finite Automt A mchine so simple tht you cn
More information