linear logic and higher order model checking
play

Linear logic and higher-order model checking Joint work with - PowerPoint PPT Presentation

Linear logic and higher-order model checking Joint work with Charles Grellois Paul-Andr Mellis CNRS & Universit Paris Diderot Abstraction and Verification in Semantics 23 27 June 2014 Institut Henri Poincar Purpose of this


  1. Linear logic and higher-order model checking Joint work with Charles Grellois Paul-André Melliès CNRS & Université Paris Diderot Abstraction and Verification in Semantics 23 → 27 June 2014 Institut Henri Poincaré

  2. Purpose of this talk I . Apply the ideas of linear logic to connect the type-theoretic account by Kobayashi & Ong ⊲ the domain-theoretic account by Salvati & Walukiewicz ⊲ of higher-order model-checking. II . Construct a cartesian-closed category D of coloured domains. Very similar in spirit as Kazushige’s talk of this morning 2

  3. Higher-order recognizability Suppose given a set L of Böhm trees of same type A . Question: When should one consider the set L as a recognizable language? Tentative answer: Use a finite domain interpretation of types. 3

  4. Higher-order recognizability Suppose given a set L of Böhm trees of same type A . Question: When should one consider the set L as a recognizable language? Tentative answer: Use a finite domain interpretation of types. 4

  5. Higher-order recognizability Every finite domain D induces an interpretation of A as a finite domain: [ [ o ] ] : = D [ [ A × B ] ] : = [ [ A ] ] × [ [ B ] ] [ [ A → B ] ] : = [ [ A ] ] → [ [ B ] ] By continuity, every Böhm tree M of type A is interpreted as an element [ [ M ] ] ∈ [ [ A ] ] of the domain [ [ A ] ] . 5

  6. Higher-order recognizability Now, every finite subset ϕ ⊆ [ [ A ] ] induces a set L ϕ = { M | [ [ M ] ] ∈ ϕ } of Böhm trees of type A . Notation: We write � M : ϕ to mean that [ [ M ] ] ∈ ϕ . Definition. [ adapted from Salvati 2009 ] A set of Böhm trees L is recognizable when it is of the form L ϕ . 6

  7. Refinement types Every such pair ( D , ϕ ) should be seen as a predicate over the type A . ϕ ψ D D f � B A Pullback operation: Given a predicate ψ ⊆ [ [ B ] ] one defines the predicate f ∗ ( ψ ) : = { x ∈ [ [ A ] ] | f ( x ) ∈ ψ } in such a way that ] ∗ ( ψ ) � P : [ [ M ] ⇐⇒ � MP : ψ for every Böhm tree P of type A . 7

  8. Refinement types Every such pair ( D , ϕ ) should be seen as a predicate over the type A . ϕ ψ D D f � B A Pushforward operation: Given a predicate ϕ ⊆ [ [ A ] ] one defines the predicate f ( ϕ ) : = { f ( x ) ∈ [ [ B ] ] | x ∈ ϕ } in such a way that � P : ϕ ⇒ � MP : [ [ M ] ]( ϕ ) for every Böhm tree P of type A . 8

  9. The Scott semantics of linear logic Well-known principle. Every preorder ( A , ≤ ) induces a domain Domain ( A ) defined as follows: its elements are the ideals of the preorder, ⊲ the ideals are ordered by inclusion. ⊲ Recall that a subset X ⊆ A is called an ideal of the preorder A when ∀ a ∈ A , ∀ x ∈ X , a ≤ x ⇒ a ∈ X . 9

  10. The Scott semantics of linear logic Key observation. Suppose that the base type o is interpreted as the domain of ideals [ [ o ] ] Domain ( Q , ≤ ) = generated by a preorder Q of atomic states . In that case, the interpretation of every type A is the domain of ideals [ [ A ] ] : = Domain ( Q A , ≤ A ) generated by a specific preorder Q A of higher-order states . 10

  11. The Scott semantics of linear logic A series of new connectives on preorders, such as: A ⊥ A op : = A & B : = ( A + B , ≤ A + ≤ B ) A ⊗ B : = ( A × B , ≤ A × ≤ B ) ! A : = ℘ fin ( A ) where the finite sets of elements of A are ordered as: { a 1 , . . . , a p } ≤ ! A { b 1 , . . . , b q } ⇐⇒ ∀ i ∈ [ p ] ∃ j ∈ [ q ] a i ≤ A b j 11

  12. The Scott semantics of linear logic Given a preorder of atomic states for the base type o Q o ( Q , ≤ ) = the preorder Q A of higher-order states is defined by induction: Q A × B = Q A & Q B Q A → B = ! Q A ⊸ Q B In particular, a state of the simple type A → B is of the form { q 1 , . . . , q n } ⊸ q where q 1 , . . . , q n are states of A and q is a state of B . 12

  13. What is a higher-order automaton? Methodological question. Given a simple type A , a finite preorder ( Q , ≤ ) and a subset ϕ ⊆ [ [ A ] ] can we describe the Böhm trees of the associated language L ϕ = { M | [ [ M ] ] ∈ ϕ } = { M | � M : ϕ } in a more direct and automata-theoretic fashion ? 13

  14. What is a higher-order automaton? Methodological question. Given a simple type A , a finite preorder ( Q , ≤ ) and an element q ∈ Q A can we describe the Böhm trees of the associated language L q = { M | q ∈ [ [ M ] ] } in a more direct and automata-theoretic fashion ? 14

  15. What is a higher-order automaton? Definition. A higher-order automaton A = � Σ , Q , δ , q 0 � consists of: a finite signature Σ : Type → Set ⊲ a finite set of states Q ⊲ a family of transition functions δ X : Σ X −→ [ [ X ] ] ⊲ a higher-order initial state q 0 ∈ [ [ A ] ] ⊲ where the interpretation [ ] of types is induced by the preorder Q o = Q . [ − ] 15

  16. What is a higher-order automaton? Suppose given a finite preorder ( Q , ≤ ) . Adequacy Theorem. The interpretation of a Böhm tree M is the set of its accepting states. In other words, for every higher-order state q ∈ [ [ A ] ] , q ∈ [ [ M ] ] ⇐⇒ q is accepted by the automaton �∅ , Q , ∅ , q � Corollary. Acceptance of a Böhm tree generated by a λ Y -term M is decidable. 16

  17. Higher-order recursion schemes The infinite tree a a b b c a b b c b b c is generated by the higher-order recursion scheme � S �→ F a b c F x y z �→ x ( y z ) ( F x y ( y z )) 17

  18. Church encoding in the λ -calculus The higher-order recursion scheme � S �→ F a b c F x y z �→ x ( y z ) ( F x y ( y z )) may be seen as a λ -term of type ( o → o → o ) → ( o → o ) → o → o . in the simply-typed λ -calculus extended with a recursion operator Y . Here, each tree-constructor a , b and c is of type: a : o → o → o b : o → o c : o 18

  19. Higher-order recursion schemes Signature a : o → o → o b : o → o c : o Non terminals S : o F : o → o Rewrite rules S �→ F c F �→ λ x . a x ( F ( b x ) ) S → F c → a c ( F ( b c ) ) → a c ( a ( b c ) F ( b ( b c ) ) )

  20. Church encoding in linear logic The formula ( o → o → o ) → ( o → o ) → o → o traditionally translated in linear logic as A ! ( ! o ⊸ ! o ⊸ o ) ⊸ ! ( ! o ⊸ o ) ⊸ ! o ⊸ o = may be also translated as B = ! ( o ⊸ o ⊸ o ) ⊸ ! ( o ⊸ o ) ⊸ ! o ⊸ o . 20

  21. Church encoding in linear logic So, the same tree may be seen as a term of type A ! ( ! o ⊸ ! o ⊸ o ) ⊸ ! ( ! o ⊸ o ) ⊸ ! o ⊸ o = with tree-constructors a , b and c of type a : ! o ⊸ ! o ⊸ o b : ! o ⊸ o c : o or as a term of type B = ! ( o ⊸ o ⊸ o ) ⊸ ! ( o ⊸ o ) ⊸ ! o ⊸ o with tree-constructors a , b and c of type a : o ⊸ o ⊸ o b : o ⊸ o c : o 21

  22. Principle of duality Proponent Opponent Program Environment plays the formula plays the formula A ⊥ A Negation permutes the rôles of Proponent and Opponent 22

  23. Principle of duality Opponent Proponent Environment Program plays the formula plays the formula A ⊥ A Negation permutes the rôles of Opponent and Proponent 23

  24. Duality applied to the Church encoding Question: So, what is the dual of a tree ? Answer: Well, it should be a tree automaton ! 24

  25. Duality applied to the Church encoding The formulas A and B have counter-formulas: A ⊥ ! ( ! o ⊸ ! o ⊸ o ) ⊗ ! ( ! o ⊸ o ) ⊗ ! o ⊗ o ⊥ = B ⊥ ! ( o ⊸ o ⊸ o ) ⊗ ! ( o ⊸ o ) ⊗ o ⊗ o ⊥ = Claim: the counter-formula B ⊥ is the type of tree automata ⊲ the counter-formula A ⊥ is the type of alternating tree automata ⊲ 25

  26. What is a linear higher-order automaton? Suppose given a finite preorder ( Q , ≤ ) . Adequacy Theorem. The interpretation of a Böhm tree M is the set of its accepting states. In other words, for every higher-order state q ∈ [ [ A ] ] , q ∈ [ [ M ] ] ⇐⇒ q is accepted by the automaton �∅ , Q , ∅ , q � Corollary. Acceptance of a Böhm tree generated by a LL Y -term M is decidable. 26

  27. The modal nature of priorities A proof-theoretic account of parity tree automata 27

  28. An intersection type system equivalent to the modal µ -calculus The grammar of kinds κ :: o | κ ⇒ κ κ Naoki Kobayashi and Luke Ong [LICS 2009] 28

  29. An intersection type system equivalent to the modal µ -calculus The grammar of atomic types θ and intersection types τ q i :: atomic o θ 1 :: atomic κ θ n :: atomic κ . . . ( θ 1 , m 1 ) ∧ . . . ∧ ( θ n , m n ) :: κ τ 1 :: κ 1 τ n :: κ n q :: atomic o . . . τ 1 ⇒ · · · τ k ⇒ q :: atomic κ 1 ⇒ . . . ⇒ κ k ⇒ o Naoki Kobayashi and Luke Ong [LICS 2009] 29

  30. A type system equivalent to the modal µ -calculus x : ( θ, Ω [ θ ]) ⊢ x : θ { ( i , q ij ) | 1 ≤ i ≤ n , 1 ≤ j ≤ k i } satisfies δ A ( q , a ) a : � k 1 j = 1 ( q 1 j , m 1 j ) ⇒ . . . ⇒ � k n j = 1 ( q nj , m nj ) ⇒ q where m ij = max ( Ω [ q ij ] , Ω [ q ]) ∆ ⊢ t : ( θ 1 , m 1 ) ∧ . . . ∧ ( θ k , m k ) ⇒ θ ∆ 1 ⊢ u : θ 1 · · · ∆ k ⊢ u : θ k ∆ , ∆ 1 ⇑ m 1 , . . . , ∆ k ⇑ m k ⊢ t u : θ ∆ ⇑ m = { F : ( θ , max ( m , m ′ ) | F : ( θ, m ) ∈ ∆ } where ∆ , x : � i ∈ I ( θ i , m i ) ⊢ t : θ I ⊆ J ∆ ⊢ λ x . t : � i ∈ J ( θ i , m i ) ⇒ θ 30

Recommend


More recommend