1 / 11

BX from Synchronous Grammars

BX from Synchronous Grammars. Yingfei Xiong , 2013 In cooperation with Yangyi Wu, Yiming Wu. Synchronous Grammar. Invented by the natural language processing community at 60s Initially for language translation Normal Grammar (postfix expressions) N -> N N ‘*’ | N N ‘+’’ | int

sirius
Download Presentation

BX from Synchronous Grammars

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. BX from Synchronous Grammars Yingfei Xiong, 2013 In cooperation with Yangyi Wu, Yiming Wu

  2. Synchronous Grammar • Invented by the natural language processing community at 60s • Initially for language translation • Normal Grammar (postfix expressions) • N -> N N ‘*’ | N N ‘+’’ | int • Synchronous Grammar (prefix  postfix) • ‘*’ N N <- N -> N N ‘*’ • ‘+’ N N <- N -> N N ‘+’ • int <- N -> int

  3. Translation with Synchronous Grammar • Syntax-directed translation • Rules on one side => actions on the other side • N -> N N‘*’ { print(‘*’ N N); } • N -> N N‘+’ { print(‘+’ N N); } • N -> int {print(int);}

  4. BX with Synchronous Grammar • Composer Composers <- Compsers -> Composer Composers • Composer <- Composers -> Composer • Name ‘,’ Years ‘,’ Country <- Composer -> Name ‘,’ Country • alpha alpha <- Name -> alpha alpha • year ‘-’ year <- Years -> year ‘-’ year • alpha <- Country -> alpha

  5. BX with Synchronous Grammar • Perdita Steven’s framwork • R: source and target can be produced by the grammar

  6. A backward transformation m N’ parse parse AST_m AST_n’ Backward merge AST’ print m’

  7. BX properties • Hippocraticness • Holds when the grammar is unambiguous • Correctness • Holds since the syntax-directed translation is just the inverse of parsing on the same side • Undoability • Not hold as usual, since there might be information loss during changes

  8. Symmetric Lenses • We can construct a symmetric lenses by letting C be the merged AST

  9. Extension: dictionary lenses • Composer* <- Composers -> Composer* • key Name ‘,’ Years ‘,’ Country <- Composer -> Name ‘,’ Country • alpha alpha <- Name -> alpha alpha • year ‘-’ year <- Years -> year ‘-’ year • alpha <- Country -> alpha

  10. Expressiveness • Comparing with Boomerang • Boomerang is a regular language, unable to handle cases such as “matching the parentheses” • Conjecture: Any lenses expressible by Boomerang is expressible in this approach • Work-in-progress • Several basic lens combinators have been translated into combinators on grammars • Working on dictionary lenses

  11. Conclusion • A novel way of constructing BX • Less learning effort • Reuse existing asserts: theories, algorithms and grammars • Potentially more expressive than Boomerang

More Related