Outline N OMINAL C- UNIFICATION on † , Washington L. R. de Carvalho Segundo †‡ , Mauricio Ayala-Rinc´ andez ‡ and Daniele Nantes Sobrinho † Maribel Fern´ ‡ K ING ’ S C OLLEGE L ONDON † U NIVERSIDADE DE B RAS ´ ILIA 27 th Int. Sym. on Logic-Based Program Synthesis and Transformation — LOPSTR Namur, 12 October 2017 Univ. de Bras´ ılia, King’s College London Nominal C-unification LOPSTR 2017 1 / 34
Outline Outline Motivation 1 Unification problems 2 Formalisation of a nominal C-unification algorithm Termination Soundness Completeness Nominal C-unification is 3 Infinitary NP-complete 4 Conclusion and future work Univ. de Bras´ ılia, King’s College London Nominal C-unification LOPSTR 2017 1 / 34
Motivation Unification Equations between first-order terms s ≈ ? t where variables { X, Y, Z, . . . } can be substituted by terms Application contexts: logic programming theorem provers type inference security protocol analysis term rewriting information retrieval Univ. de Bras´ ılia, King’s College London Nominal C-unification LOPSTR 2017 2 / 34
Motivation Equational and binding operators Function symbols f with basic equational properties like: A { f ( X, f ( Y, Z )) ≈ f ( f ( X, Y ) , Z ) } C { f ( X , Y ) ≈ f ( Y , X ) } D { f ( g ( X, Y ) , Z ) ≈ g ( f ( X, Z ) , f ( Y, Z )) } U { f ( X, 1) ≈ X } Bound object-level variables [ a ] s ∀ a ∀ b, P ( a ) ∨ Q ( b ) ⇒ R ( a, b ) represented as f ∀ [ a ] f ∀ [ b ] f ⇒ ( f ∨ ( P ( a ) , P ( b )) , R ( a, b )) Univ. de Bras´ ılia, King’s College London Nominal C-unification LOPSTR 2017 3 / 34
Motivation Nominal basic objects atoms { a, b, c, . . . } and variables { X, Y, Z, . . . } Freshness contexts ∇ = { a # X, b # Y, c # Z, . . . } permutations as lists of name-swappings π = ( a 0 b 0 ) :: ( a 1 b 1 ) :: . . . :: ( a n b n ) :: nil The inverse of π is its reverse list π − 1 = ( a n b n ) :: ( a n − 1 b n − 1 ) :: . . . :: ( a 0 b 0 ) :: nil Univ. de Bras´ ılia, King’s College London Nominal C-unification LOPSTR 2017 4 / 34
Motivation Nominal syntax and { α, C } -equivalence Nominal syntax t, u, v ::= �� | a | [ a ] t | � u, v � | f E k t | π.X Freshness relation ∇ ⊢ a # t a is fresh to t under the freshness context ∇ ∇ ⊢ a # π.X only if ( π − 1 · a )# X ∈ ∇ { α, C } - equivalence ∇ ⊢ s ≈ { α,C } t { α, E } -equivalence instantiated with E = { C } (see [Ayala-Rinc´ on et al., 2016a]) Univ. de Bras´ ılia, King’s College London Nominal C-unification LOPSTR 2017 5 / 34
Motivation Related work: formalisation on nominal Nominal Unification (Revisited) in Isabelle/HOL [Urban, 2010] Nominal Reasoning Techniques in Isabelle/HOL [Urban, 2008] Nominal Reasoning Techniques in Agda [Copello et al., 2015] Nominal Reasoning Techniques in Coq [Aydemir et al., 2007] Nominal Unification in HOL4 [Kumar and Norrish, 2010] General binders in Isabelle/HOL [Urban and Kaliszyk, 2012] ] Nominal Unification in Isabelle/HOL [Urban et al., 2004] 5 1 0 2 , l . a e t ] a n 6 1 Nominal Unification in PVS [Ayala-Rinc´ o 0 2 , . l a t e n Nominal α -A/AC in Coq [Ayala-Rinc´ o 2004 2006 2008 2010 2012 2014 2016 Univ. de Bras´ ılia, King’s College London Nominal C-unification LOPSTR 2017 6 / 34
Motivation Related work: HO correspondence and efficiency of nominal algorithms andez, 2010] andez, 2008] n [Levy and Villaret, 2010] andez, 2011] es and Fern´ es and Fern´ k [Calv` es and Fern´ n [Levy and Villaret, 2012] l [Calv` c e h n [Calv` l [Cheney, 2005] o a C i i t m a e c o c fi n o n i i y n e t a l U l o a c P v l fi a i a i u n s n r n q e i U i i m n m E t t l o - a o o a α P i N n N t a d i m O c c → n fi i H t a o i n a N n r g → U d r n c e a i i l h l t a u t a t a c a n Q r n t P i d i m a m M a O o u o H N Q N 2006 2008 2010 2012 Univ. de Bras´ ılia, King’s College London Nominal C-unification LOPSTR 2017 7 / 34
Motivation Related work: reasoning modulo equational theories and nominal unification extensions on et al., 2017] c [Schmidt-Schauß et al., 2016] s [Ayala-Rinc´ q [Contejean, 2004] on et al., 2016b] L [Nipkow, 1989] n [Baumgartner et al., 2015] q [Contejean, 2007] n o q [Braibant and Pous, 2011] i t a e u g [Ayala-Rinc´ O r q e o t H e C o l t / n e n C h l i l t o i i e n w m p b i o n x a h s n t i m i fi s t a w o i I r c i C o r o t n e fi a g r o i r c i t n a l l C a fi e a f u o n n t i i g n - n i r i m n t a l u w n i n o i e n l o e h i a a t t i n r c a i m r l n t a g C a t w i u n o m n / m m e N C i o i r m v A C r N l e C o o / A P A N S A 2004 2006 2008 2010 2012 2014 2016 Univ. de Bras´ ılia, King’s College London Nominal C-unification LOPSTR 2017 8 / 34
Motivation Unification problems Unification problems Unification problem �∇ , P � = �∇ , id, P � P is a finite set of equations and freshness constraints of the form s ≈ ? t and a # ? s Univ. de Bras´ ılia, King’s College London Nominal C-unification LOPSTR 2017 9 / 34
Formalisation of a nominal C-unification algorithm System ⇒ # �∇ , σ, P ⊎ { a # ? ¯ �∇ , σ, P ⊎ { a # ? ��}� b }� (# ? a¯ (# ? �� ) b ) �∇ , σ, P � �∇ , σ, P � �∇ , σ, P ⊎ { a # ? f t }� �∇ , σ, P ⊎ { a # ? [ a ] t }� (# ? app ) (# ? a [ a ]) �∇ , σ, P ∪ { a # ? t }� �∇ , σ, P � �∇ , σ, P ⊎ { a # ? [ b ] t }� �∇ , σ, P ⊎ { a # ? π.X }� (# ? a [ b ]) (# ? var ) �{ ( π − 1 · a )# X } ∪ ∇ , σ, P � �∇ , σ, P ∪ { a # ? t }� �∇ , σ, P ⊎ { a # ? � s, t �}� (# ? pair ) �∇ , σ, P ∪ { a # ? s, a # ? t }� Univ. de Bras´ ılia, King’s College London Nominal C-unification LOPSTR 2017 10 / 34
Formalisation of a nominal C-unification algorithm System ⇒ ≈ �∇ , σ, P ⊎ { s ≈ ? s }� �∇ , σ, P ⊎ {� s 1 , t 1 � ≈ ? � s 2 , t 2 �}� ( ≈ ? refl ) ( ≈ ? pair ) �∇ , σ, P � �∇ , σ, P ∪ { s 1 ≈ ? s 2 , t 1 ≈ ? t 2 }� �∇ , σ, P ⊎ { f E k s ≈ ? f E k t }� , if E � = C ( ≈ ? app ) �∇ , σ, P ∪ { s ≈ ? t }� �∇ , σ, P ⊎ { f C k s ≈ ? f C k t }� � where s = � s 0 , s 1 � and t = � t 0 , t 1 � � , ( ≈ ? C ) v = � t i , t ( i +1) mod 2 � , i = 0 , 1 �∇ , σ, P ∪ { s ≈ ? v }� �∇ , σ, P ⊎ { [ a ] s ≈ ? [ a ] t }� �∇ , σ, P ⊎ { [ a ] s ≈ ? [ b ] t }� ( ≈ ? [ aa ]) ( ≈ ? [ ab ]) �∇ , σ, P ∪ { s ≈ ? t }� �∇ , σ, P ∪ { s ≈ ? ( a b ) t, a # ? t }� �∇ , σ, P ⊎ { π.X ≈ ? t }� let σ ′ := σ { X/π − 1 · t } , if X / ∈ V ar ( t ) ( ≈ ? inst ) � { a # ? Y σ ′ } � � ∇ , σ ′ , P { X/π − 1 · t } ∪ Y ∈ dom ( σ ′ ) , a # Y ∈∇ �∇ , σ, P ⊎ { π.X ≈ ? π ′ .X }� , if π ′ � = id ( ≈ ? inv ) �∇ , σ, P ∪ { π ⊕ ( π ′ ) − 1 .X ≈ ? X }� Univ. de Bras´ ılia, King’s College London Nominal C-unification LOPSTR 2017 11 / 34
Formalisation of a nominal C-unification algorithm Derivation tree for �∇ , P � Nodes are labelled w.r.t. each ⇒ ≈ (resp. ⇒ # )-derivation step The root node is labelled with P = �∇ , id, P � 1 P is reduced by ⇒ ≈ (for each branch) , 2 until reach Q i (a normal form w.r.t. ⇒ ≈ ) For each Q i = �∇ i , δ i , Q i � . 3 If Q i contains only fixpoint equations and freshness contraints then it is reduced until reach ¯ Q (a normal form w.r.t. ⇒ # ) Univ. de Bras´ ılia, King’s College London Nominal C-unification LOPSTR 2017 12 / 34
Formalisation of a nominal C-unification algorithm Derivation tree for �∇ , P � Nodes are labelled w.r.t. each ⇒ ≈ (resp. ⇒ # )-derivation step The root node is labelled with P = �∇ , id, P � 1 P is reduced by ⇒ ≈ (for each branch) , 2 until reach Q i (a normal form w.r.t. ⇒ ≈ ) For each Q i = �∇ i , δ i , Q i � . 3 If Q i contains only fixpoint equations and freshness contraints then it is reduced until reach ¯ Q (a normal form w.r.t. ⇒ # ) Univ. de Bras´ ılia, King’s College London Nominal C-unification LOPSTR 2017 12 / 34
Formalisation of a nominal C-unification algorithm Derivation tree for �∇ , P � Nodes are labelled w.r.t. each ⇒ ≈ (resp. ⇒ # )-derivation step The root node is labelled with P = �∇ , id, P � 1 P is reduced by ⇒ ≈ (for each branch) , 2 until reach Q i (a normal form w.r.t. ⇒ ≈ ) For each Q i = �∇ i , δ i , Q i � . 3 If Q i contains only fixpoint equations and freshness contraints then it is reduced until reach ¯ Q (a normal form w.r.t. ⇒ # ) Univ. de Bras´ ılia, King’s College London Nominal C-unification LOPSTR 2017 12 / 34
Recommend
More recommend