Decision problems for Clark-congruential languages Makoto Kanazawa 1 e 2 Tobias Kapp´ 1 Hosei University, Tokyo 2 University College London Work performed at the National Institute of Informatics, Tokyo. LearnAut, July 13, 2018 1
Introduction Suppose you know the following Japanese phrase: 猫 は 椅 子 で 眠 る The cat sleeps in the chair. 2
Introduction Suppose you know the following Japanese phrase: 猫 は 椅 子 で 眠 る The cat sleeps in the chair. You also know that dog is 犬 . Now, you can form: 犬 は 椅 子 で 眠 る 2
Introduction Suppose you know the following Japanese phrase: 猫 は 椅 子 で 眠 る The cat sleeps in the chair. You also know that dog is 犬 . Now, you can form: 犬 は 椅 子 で 眠 る The dog sleeps in the chair. 2
Introduction This works because 猫 and 犬 are nouns. 3
Introduction This works because 猫 and 犬 are nouns. Replacing nouns (probably) preserves grammatical correctness. 3
Introduction This works because 猫 and 犬 are nouns. Replacing nouns (probably) preserves grammatical correctness. 猫 and 犬 are (almost) syntactically congruent : u 猫 v ∈ Japanese u 犬 v ∈ Japanese “ ⇐ ⇒ ” 3
Introduction Idea: use syntactic congruence to drive learning. 1 1 Clark 2010. 4
Introduction Idea: use syntactic congruence to drive learning. 1 When (for all we know) uwv ∈ L ⇐ ⇒ uxv ∈ L , presume w ≡ L x . 1 Clark 2010. 4
Introduction Idea: use syntactic congruence to drive learning. 1 When (for all we know) uwv ∈ L ⇐ ⇒ uxv ∈ L , presume w ≡ L x . . . . but how to represent the language? 1 Clark 2010. 4
Introduction Definition (Informal) A grammar is Clark-congruential ( CC ) if words derived from the same symbol are syntactically congruent for its language. A language is CC when there exists a CC grammar that describes it. 5
Introduction Definition (Informal) A grammar is Clark-congruential ( CC ) if words derived from the same symbol are syntactically congruent for its language. A language is CC when there exists a CC grammar that describes it. Example Consider these grammars for L = { a , b } + : G 1 : S → SS + a + b S → TS + a + b , T → a + b + ǫ G 2 : 5
Introduction Definition (Informal) A grammar is Clark-congruential ( CC ) if words derived from the same symbol are syntactically congruent for its language. A language is CC when there exists a CC grammar that describes it. Example Consider these grammars for L = { a , b } + : G 1 : S → SS + a + b S → TS + a + b , T → a + b + ǫ G 2 : If S derives w and x in G 1 , then uwv ∈ L implies uxv ∈ L — G 1 is CC. 5
Introduction Definition (Informal) A grammar is Clark-congruential ( CC ) if words derived from the same symbol are syntactically congruent for its language. A language is CC when there exists a CC grammar that describes it. Example Consider these grammars for L = { a , b } + : G 1 : S → SS + a + b S → TS + a + b , T → a + b + ǫ G 2 : If S derives w and x in G 1 , then uwv ∈ L implies uxv ∈ L — G 1 is CC. However: T derives a and ǫ in G 2 . Now, a ∈ L but ǫ �∈ L — G 2 is not CC. 5
Introduction Let G be a CC grammar describing L . 6
Introduction Let G be a CC grammar describing L . In the minimally adequate teacher ( MAT ) model, the learner can query: ◮ Given w ∈ Σ ∗ , does w ∈ L ( G ) hold? ◮ Given a grammar H , does L ( G ) = L ( H ) hold? If not, give a counterexample. 6
Introduction Let G be a CC grammar describing L . In the minimally adequate teacher ( MAT ) model, the learner can query: ◮ Given w ∈ Σ ∗ , does w ∈ L ( G ) hold? ◮ Given a grammar H , does L ( G ) = L ( H ) hold? If not, give a counterexample. Theorem (Clark 2010) Let L be a CC language; L is “MAT-learnable”. That is, given a MAT for L, we can construct a CC grammar for L. 6
Introduction Let G be a CC grammar describing L . In the minimally adequate teacher ( MAT ) model, the learner can query: ◮ Given w ∈ Σ ∗ , does w ∈ L ( G ) hold? ◮ Given a grammar H , does L ( G ) = L ( H ) hold? If not, give a counterexample. Theorem (Clark 2010) Let L be a CC language; L is “MAT-learnable”. That is, given a MAT for L, we can construct a CC grammar for L. Question Let L be a CC language; is L “MAT-teachable”? That is, given a CC grammar for L , can we construct a MAT for L ? 6
Introduction Let G be a CC grammar describing L . In the minimally adequate teacher ( MAT ) model, the learner can query: ◮ Given w ∈ Σ ∗ , does w ∈ L ( G ) hold? ◮ Given a grammar H , does L ( G ) = L ( H ) hold? If not, give a counterexample. Is this decidable? Theorem (Clark 2010) Let L be a CC language; L is “MAT-learnable”. That is, given a MAT for L, we can construct a CC grammar for L. Question Let L be a CC language; is L “MAT-teachable”? That is, given a CC grammar for L , can we construct a MAT for L ? 6
Context Equivalence problem Given grammars G 1 and G 2 , does L ( G 1 ) = L ( G 2 ) hold? 2 Bar-Hillel, Perles, and Shamir 1961. 7
Context Equivalence problem Given grammars G 1 and G 2 , does L ( G 1 ) = L ( G 2 ) hold? Congruence problem Given a grammar G , and w , x ∈ Σ ∗ , are w and x syntactically congruent for L ( G )? 2 Bar-Hillel, Perles, and Shamir 1961. 7
Context Equivalence problem Given grammars G 1 and G 2 , does L ( G 1 ) = L ( G 2 ) hold? Congruence problem Given a grammar G , and w , x ∈ Σ ∗ , are w and x syntactically congruent for L ( G )? Equivalence and congruence are undecidable for grammars in general. 2 2 Bar-Hillel, Perles, and Shamir 1961. 7
Context CC languages 8
Context Context-free languages CC languages 8
Context Context-free languages CC languages Pre-NTS languages 8
Context Context-free languages CC languages Pre-NTS languages NTS languages 8
Context Congruence Equivalence ✓ 3 ✓ 3 NTS ✓ 4 ✓ 4 Pre-NTS 3 S´ enizergues 1985. 4 Autebert and Boasson 1992. 9
Context Congruence Equivalence ✓ 3 ✓ 3 NTS ✓ 4 ✓ 4 Pre-NTS ✓ ✓ CC 3 S´ enizergues 1985. 4 Autebert and Boasson 1992. 9
Preliminaries A congruence on Σ ∗ is an equivalence ≡ on Σ ∗ such that w ≡ w ′ x ≡ x ′ wx ≡ w ′ x ′ 10
Preliminaries A congruence on Σ ∗ is an equivalence ≡ on Σ ∗ such that w ≡ w ′ x ≡ x ′ wx ≡ w ′ x ′ Every language L induces a syntactic congruence ≡ L : ∀ u , v ∈ Σ ∗ . uwv ∈ L ⇐ ⇒ uxv ∈ L w ≡ L x 10
Preliminaries A Context-Free Grammar ( CFG ) is a tuple G = � V , → , I � . Nonterminals 11
Preliminaries A Context-Free Grammar ( CFG ) is a tuple G = � V , → , I � . Production relation 11
Preliminaries A Context-Free Grammar ( CFG ) is a tuple G = � V , → , I � . Initial nonterminals 11
Preliminaries A Context-Free Grammar ( CFG ) is a tuple G = � V , → , I � . We fix G = � V , → , I � . 11
Preliminaries A Context-Free Grammar ( CFG ) is a tuple G = � V , → , I � . We fix G = � V , → , I � . α B γ ∈ (Σ ∪ V ) ∗ B → β α B γ ⇒ G αβγ 11
Preliminaries A Context-Free Grammar ( CFG ) is a tuple G = � V , → , I � . We fix G = � V , → , I � . α B γ ∈ (Σ ∪ V ) ∗ B → β α B γ ⇒ G αβγ L ( G , α ) = { w ∈ Σ ∗ : α ⇒ ∗ G w } 11
Preliminaries A Context-Free Grammar ( CFG ) is a tuple G = � V , → , I � . We fix G = � V , → , I � . α B γ ∈ (Σ ∪ V ) ∗ B → β α B γ ⇒ G αβγ L ( G , α ) = { w ∈ Σ ∗ : α ⇒ ∗ � G w } L ( G ) = L ( G , A ) A ∈ I 11
Preliminaries A Context-Free Grammar ( CFG ) is a tuple G = � V , → , I � . We fix G = � V , → , I � . α B γ ∈ (Σ ∪ V ) ∗ B → β α B γ ⇒ G αβγ L ( G , α ) = { w ∈ Σ ∗ : α ⇒ ∗ � G w } L ( G ) = L ( G , A ) A ∈ I Definition (More formal) We say G is CC when for A ∈ V and w , x ∈ L ( G , A ), we have w ≡ L ( G ) x . 11
Preliminaries We assume a total order � on Σ. 12
Preliminaries We assume a total order � on Σ. This order extends to a total order on Σ ∗ : ◮ If w is shorter than x , then w � x . ◮ If w and x are of equal length, compare lexicographically. 12
Preliminaries We assume a total order � on Σ. This order extends to a total order on Σ ∗ : ◮ If w is shorter than x , then w � x . ◮ If w and x are of equal length, compare lexicographically. For α ∈ (Σ ∪ V ) ∗ with L ( G , α ) � = ∅ , write ϑ G ( α ) for the � -minimum of L ( G , α ). 12
Deciding congruence Let G be CC. We mimic an earlier method to decide congruence. 5 5 Autebert and Boasson 1992. 13
Deciding congruence Let G be CC. We mimic an earlier method to decide congruence. 5 Let � G be the smallest rewriting relation such that A → α L ( G , α ) � = ∅ ϑ G ( α ) � G ϑ G ( A ) 5 Autebert and Boasson 1992. 13
Deciding congruence Let G be CC. We mimic an earlier method to decide congruence. 5 Let � G be the smallest rewriting relation such that A → α L ( G , α ) � = ∅ ϑ G ( α ) � G ϑ G ( A ) Lemma If w � G x, then w ≡ L ( G ) x. 5 Autebert and Boasson 1992. 13
Deciding congruence Lemma w ∈ L ( G ) if and only if w � G ϑ G ( A ) for some A ∈ I. 14
Recommend
More recommend