Language Evolution, Metasyntactically. First International Workshop on Bidirectional Transformations (BX 2012)

Similar documents
Proof Theory for Syntacticians

Objectives. Chapter 2: The Representation of Knowledge. Expert Systems: Principles and Programming, Fourth Edition

CS 598 Natural Language Processing

Language properties and Grammar of Parallel and Series Parallel Languages

Syntax Parsing 1. Grammars and parsing 2. Top-down and bottom-up parsing 3. Chart parsers 4. Bottom-up chart parsing 5. The Earley Algorithm

The presence of interpretable but ungrammatical sentences corresponds to mismatches between interpretive and productive parsing.

Compositional Semantics

Evolution of Symbolisation in Chimpanzees and Neural Nets

Version Space. Term 2012/2013 LSI - FIB. Javier Béjar cbea (LSI - FIB) Version Space Term 2012/ / 18

Introduction to HPSG. Introduction. Historical Overview. The HPSG architecture. Signature. Linguistic Objects. Descriptions.

Abstractions and the Brain

Content Language Objectives (CLOs) August 2012, H. Butts & G. De Anda

An Introduction to the Minimalist Program

Specifying Logic Programs in Controlled Natural Language

Erkki Mäkinen State change languages as homomorphic images of Szilard languages

A Framework for Customizable Generation of Hypertext Presentations

Grammars & Parsing, Part 1:

AGS THE GREAT REVIEW GAME FOR PRE-ALGEBRA (CD) CORRELATED TO CALIFORNIA CONTENT STANDARDS

CS 1103 Computer Science I Honors. Fall Instructor Muller. Syllabus

Cooperative evolutive concept learning: an empirical study

Modeling full form lexica for Arabic

On the Combined Behavior of Autonomous Resource Management Agents

Physics 270: Experimental Physics

Intra-talker Variation: Audience Design Factors Affecting Lexical Selections

SOFTWARE EVALUATION TOOL

On-Line Data Analytics

A Version Space Approach to Learning Context-free Grammars

An Open Framework for Integrated Qualification Management Portals

Learning to Schedule Straight-Line Code

IBM Software Group. Mastering Requirements Management with Use Cases Module 6: Define the System

Program Matrix - Reading English 6-12 (DOE Code 398) University of Florida. Reading

GACE Computer Science Assessment Test at a Glance

Some Principles of Automated Natural Language Information Extraction

School of Innovative Technologies and Engineering

Highlighting and Annotation Tips Foundation Lesson

Teaching a Laboratory Section

Parsing of part-of-speech tagged Assamese Texts

The Strong Minimalist Thesis and Bounded Optimality

"f TOPIC =T COMP COMP... OBJ

End-of-Module Assessment Task

PowerTeacher Gradebook User Guide PowerSchool Student Information System

Cal s Dinner Card Deals

Rule Learning With Negation: Issues Regarding Effectiveness

Dublin City Schools Mathematics Graded Course of Study GRADE 4

a) analyse sentences, so you know what s going on and how to use that information to help you find the answer.

CSC200: Lecture 4. Allan Borodin

Textbook Chapter Analysis this is an ungraded assignment, however a reflection of the task is part of your journal

Given a directed graph G =(N A), where N is a set of m nodes and A. destination node, implying a direction for ow to follow. Arcs have limitations

Computerized Adaptive Psychological Testing A Personalisation Perspective

Approaches to control phenomena handout Obligatory control and morphological case: Icelandic and Basque

11/29/2010. Statistical Parsing. Statistical Parsing. Simple PCFG for ATIS English. Syntactic Disambiguation

Page 1 of 11. Curriculum Map: Grade 4 Math Course: Math 4 Sub-topic: General. Grade(s): None specified

Rule Learning with Negation: Issues Regarding Effectiveness

PAGE(S) WHERE TAUGHT If sub mission ins not a book, cite appropriate location(s))

Notetaking Directions

MASTER S THESIS GUIDE MASTER S PROGRAMME IN COMMUNICATION SCIENCE

Extending Place Value with Whole Numbers to 1,000,000

A Grammar for Battle Management Language

Curriculum and Assessment Guide (CAG) Elementary California Treasures First Grade

Lecture 1: Basic Concepts of Machine Learning

Designing a Computer to Play Nim: A Mini-Capstone Project in Digital Design I

Examining the Structure of a Multidisciplinary Engineering Capstone Design Program

GCE. Mathematics (MEI) Mark Scheme for June Advanced Subsidiary GCE Unit 4766: Statistics 1. Oxford Cambridge and RSA Examinations

AQUA: An Ontology-Driven Question Answering System

Evaluation of Usage Patterns for Web-based Educational Systems using Web Mining

Evaluation of Usage Patterns for Web-based Educational Systems using Web Mining

GRADE 2 SUPPLEMENT. Set D4 Measurement: Capacity. Includes. Skills & Concepts. Activity 1: Predict & Fill D4.1

TRAITS OF GOOD WRITING

Specification and Evaluation of Machine Translation Toy Systems - Criteria for laboratory assignments

Reading Horizons. Aid for the School Principle: Evaluate Classroom Reading Programs. Sandra McCormick JANUARY Volume 19, Issue Article 7

Rule discovery in Web-based educational systems using Grammar-Based Genetic Programming

Exemplar 6 th Grade Math Unit: Prime Factorization, Greatest Common Factor, and Least Common Multiple

KLI: Infer KCs from repeated assessment events. Do you know what you know? Ken Koedinger HCI & Psychology CMU Director of LearnLab

ICTCM 28th International Conference on Technology in Collegiate Mathematics

Informatics 2A: Language Complexity and the. Inf2A: Chomsky Hierarchy

FUZZY EXPERT. Dr. Kasim M. Al-Aubidy. Philadelphia University. Computer Eng. Dept February 2002 University of Damascus-Syria

Comprehension Recognize plot features of fairy tales, folk tales, fables, and myths.

Rule-based Expert Systems

Inleiding Taalkunde. Docent: Paola Monachesi. Blok 4, 2001/ Syntax 2. 2 Phrases and constituent structure 2. 3 A minigrammar of Italian 3

Interpreting ACER Test Results

Timeline. Recommendations

Classifying combinations: Do students distinguish between different types of combination problems?

CAAP. Content Analysis Report. Sample College. Institution Code: 9011 Institution Type: 4-Year Subgroup: none Test Date: Spring 2011

Spoken Language Parsing Using Phrase-Level Grammars and Trainable Classifiers

Causal Link Semantics for Narrative Planning Using Numeric Fluents

Organizing Comprehensive Literacy Assessment: How to Get Started

WSU Five-Year Program Review Self-Study Cover Page

Edexcel GCSE. Statistics 1389 Paper 1H. June Mark Scheme. Statistics Edexcel GCSE

Specification of the Verity Learning Companion and Self-Assessment Tool

Excel Intermediate

Florida Reading Endorsement Alignment Matrix Competency 1

LING 329 : MORPHOLOGY

: USING RUBRICS FOR THE ASSESSMENT OF SENIOR DESIGN PROJECTS

Guidelines for Writing an Internship Report

Cognitive Modeling. Tower of Hanoi: Description. Tower of Hanoi: The Task. Lecture 5: Models of Problem Solving. Frank Keller.

Introduction to CRC Cards

Knowledge-Based - Systems

Lecture 10: Reinforcement Learning

Basic Parsing with Context-Free Grammars. Some slides adapted from Julia Hirschberg and Dan Jurafsky 1

Transcription:

Language Evolution, Metasyntactically First International Workshop on Bidirectional Transformations (BX 2012) Vadim Zaytsev, SWAT, CWI 2012

Introduction Every language document employs its own We focus on metalanguage evolution the language itself does not evolve the in which it is written, does We limit ourselves to ware technical space Working prototypes are a part of SLPS

Metalanguage evolution Notation correction Misused Overused Notation evolution Notations are languages, they evolve Mapping between s Many s are equivalent Most are (almost EBNF) + (little extra)

Metasyntactic evolution megamodel

Syntactic specification Megamodel

EBNF Dialect Definition program::= function+; function::= name argument* = expr?; List of indicators Together form a specification Zaytsev, What Have We Done About the Unnecessary Diversity of Notation for Syntactic Definitions, SAC/PL 2012.

EDD example defining metasymbol : definition separator metasymbol terminator metasymbol ; postfix optionality metasymbol? postfix star metasymbol * postfix plus metasymbol + start terminal metasymbol end terminal metasymbol

Syntactic specification extract infer Megamodel Generated

Generated (in Rascal) module LLL import util::ide; // needed only for advanced IDE support (see last two lines) start syntax LLLGrammar = LLLLayoutList LLLProduction* LLLLayoutList; syntax LLLProduction = LLLNonterminal ":" {LLLDefinition " "}+ ";"; syntax LLLDefinition = LLLSymbol+; syntax LLLSymbol = @category="identifier" nonterminal: LLLNonterminal @category="constant" terminal: LLLTerminal group: "(" LLLDefinition ")" optional: LLLSymbol "?" star: LLLSymbol "*" plus: LLLSymbol "+" sepliststar: "{" LLLSymbol LLLSymbol "} *" seplistplus: "{" LLLSymbol LLLSymbol "} +"; lexical LLLTerminal = "\"" LLLTerminalSymbol* "\""; lexical LLLTerminalSymbol =![\"]; lexical LLLNonterminal = [A-Za-z_01-9\-/]+!>> [A-Za-z_01-9\-/]; layout LLLLayoutList = LLLLayout*!>> [\t-\n \r \ ]!>> "#"; lexical LLLLayout = [\t-\n \r \ ] LLLComment ; lexical LLLComment = @category="comment" "#"![\n]* [\n]; Tree getlll(str s,loc z) = parse(#lllgrammar,z); public void registerlll() = registerlanguage("lll","lll",getlll);

Grammar internal representation from [LZ09, LZ11, Zay10,...]. Its logic programming-based specification follows: (Rs,Ps) mapoptlist(n,rs), maplist(prod,ps). prod(p(l,n,x)) mapopt(label,l), atom(n), expr(x). label(l(x)) atom(x). expr(true). expr(fail). expr(a). expr(t(t)) atom(t). expr(n(n)) atom(n). expr(, (Xs)) maplist(expr,xs). expr( ; (Xs)) maplist(expr,xs). expr(? (X)) expr(x). expr( (X)) expr(x). expr( + (X)) expr(x). expr(slp(x,y)) expr(x), expr(y). expr(sls(x,y)) expr(x), expr(y). expr(s(s,x)) atom(s), expr(x). = start symbols + productions production = label + lhs + rhs production labels ε empty language universal type terminal symbols nonterminal symbols sequential composition choice optionality Kleene star transitive closure Y -separated list with 1 or more elements Y -separated list with 0 or more elements selectable expressions As you can see, it is a pretty straightforward term, with a minimal set of features Lämmel, Zaytsev, An Introduction to Grammar Convergence, IFM 2009.

Generated (in BGF) LLL1Grammar: LLL1Production* LLL1Production: LLL1Nonterminal ":" {LLL1Definition " "}+ ";" LLL1Definition: LLL1Symbol+ [nonterminal] LLL1Symbol: LLL1Nonterminal [terminal] LLL1Symbol: LLL1Terminal [optional] LLL1Symbol: LLL1Symbol "?" [star] LLL1Symbol: LLL1Symbol "*" [plus] LLL1Symbol: LLL1Symbol "+"

Megamodel Syntactic specification extract infer Generated adapt Beautified

Beautified (in BGF) : rule+ rule: sort ":" alts ";" alts: alt alts-tail* alts-tail: " " alt alt: term* term: basis repetition? basis: literal sort repetition: "*" "+" "?"

Megamodel Syntactic specification extract infer Generated adapt Beautified

Bidirectional adaptation XBGF!BGF: renamen, factor, etc: flip arguments addv/removev, narrow/widen: form pairs extract/inline, unlabel/designate: asymmetry distribute: removed from the language unite, equate: tricky, superposition of others BX is a stable way to represent relationship Lämmel, Zaytsev, Recovering Grammar Relationships for the Java Language Specification, SQJ 19:2, 2011.

Megamodel Syntactic specification extract infer Generated adapt Beautified pretty-print recover Notation in itself

Megamodel Syntactic specification extract infer Generated adapt Beautified pretty-print recover Notation in itself Syntactic specification extract infer Generated adapt Beautified pretty-print recover Notation in itself

Megamodel Syntactic specification extract infer Generated adapt Beautified pretty-print recover Notation in itself transform Syntactic specification infer extract Generated adapt Beautified recover pretty-print Notation in itself

Notation transformation EDD, consists of metasymbols XEDD transformation language rename-metasymbol(s, v1, v2) e.g., change defining metasymbol from : to ::= introduce-metasymbol(s, v) e.g., bring a terminator metasymbol to a eliminate-metasymbol(s, v)

Megamodel Syntactic specification extract infer Generated adapt Beautified pretty-print recover Notation in itself transform convergence relationship Syntactic specification infer extract Generated adapt Beautified recover pretty-print Notation in itself

Grammar convergence source source XBGF transformation target transformation!bgf source bidirectional transformation source = relationship

Megamodel Syntactic specification extract infer Generated adapt Beautified pretty-print recover Notation in itself transform convergence relationship Syntactic specification infer extract Generated adapt Beautified recover pretty-print Notation in itself

Megamodel Syntactic specification extract infer Generated adapt Beautified pretty-print recover Notation in itself Other s transform convergence relationship coupled mutations Other s Syntactic specification infer extract Generated adapt Beautified recover pretty-print Notation in itself

Grammar transformation vs. mutation A transformation operator " can be formalised as a triplet: " = c_pre, t, c_post. A transformation then is "_a_i (G), resulting in G. if a_i are of incorrect types and quantity than expected by t! " is incorrectly called; if the constraint c_pre does not hold on G! "_a_i is inapplicable to G; if the constraint c_post holds on G! "_a_i is vacuous on G; if the constraint c_pre holds on G and c_post does not hold on G!! t is incorrectly implemented; if c_pre holds on G, c_post holds on G!! " has been applied correctly with arguments a_i to G resulting in G!.

Grammar transformation vs. mutation A mutation does not have a single precondition It has a set of preconditions that serve as triggers: µ = {c_i}, {t_i}, c_post. The mutation terminates once no trigger c_i holds and the postcondition c_post is met. A bidirectional mutation: µ_bx = c_pre, {c_i}, {t_i}, c_post will be an instantiation of a mutation The family of spawned BMs does not define the original: 1 i.e., "µ #G #G! µ_bx, G! = µ(g)$g! = µ_bx(g)$g = µ (G!).

Notation evolution summary A evolution step! consists of the following coupled components: σ, a bidirectional transformation that changes the itself δ, a convergence relationship that can transform the s γ, a bidirectional adaptation that prepares a beautified readable version of N μ, an unidirectional coupled mutation that migrates the base according to changes possibly μ, an unidirectional coupled mutation that migrates the base according to the inverse of the intended changes

Evaluation

Megamodel: case study LLL1.edd edd2rsc+ rsc2bgf LLL1. spec. bgf LLL1. spec2doc. ξbgf LLL1. doc. bgf bgfpp Grammar Hunter LLL1.LLL1 *.LLL1 LLL1to2.xedd LLL1to2.ξbgf EliminateGroup.rsc LLL2.edd edd2rsc+ rsc2bgf LLL2. spec. bgf LLL2. spec2doc. ξbgf LLL2. doc. bgf Grammar Hunter bgfpp *.LLL2 LLL2.LLL2

Megamodel: previously LLL1.edd edd2rsc+ rsc2bgf LLL1. spec. bgf LLL1. spec2doc. ξbgf LLL1. doc. bgf bgfpp Grammar Hunter LLL1.LLL1 *.LLL1 LLL1to2.xedd LLL1to2.ξbgf EliminateGroup.rsc LLL2.edd edd2rsc+ rsc2bgf LLL2. spec. bgf LLL2. spec2doc. ξbgf LLL2. doc. bgf Grammar Hunter bgfpp *.LLL2 LLL2.LLL2

LLL1 in itself : rule+; rule : sort ":" alts ";"; alts : alt alts-tail*; alts-tail : " " alt; alt : term*; term : basis repetition?; basis : literal sort; repetition : "*" "+" "?"; Kort, Lämmel, Verhoef, The Grammar Deployment Kit: System Demonstration, LDTA 2002.

LLL2 in itself specification : rule+; rule : ident ":" disjunction ";"; disjunction : { conjunction } +; conjunction : term*; term : basis repetition?; basis : ident literal alternation group; repetition : + *? ; alternation : { basis basis } repetition; group : ( disjunction ) ; Kort, Grammar Deployment Kit Reference Manual, UvA/SourceForge 2003.

Megamodel: manually LLL1.edd edd2rsc+ rsc2bgf LLL1. spec. bgf LLL1. spec2doc. ξbgf LLL1. doc. bgf bgfpp Grammar Hunter LLL1.LLL1 *.LLL1 LLL1to2.xedd LLL1to2.ξbgf EliminateGroup.rsc LLL2.edd edd2rsc+ rsc2bgf LLL2. spec. bgf LLL2. spec2doc. ξbgf LLL2. doc. bgf Grammar Hunter bgfpp *.LLL2 LLL2.LLL2

Megamodel: automated LLL1.edd edd2rsc+ rsc2bgf LLL1. spec. bgf LLL1. spec2doc. ξbgf LLL1. doc. bgf bgfpp Grammar Hunter LLL1.LLL1 *.LLL1 LLL1to2.xedd LLL1to2.ξbgf EliminateGroup.rsc LLL2.edd edd2rsc+ rsc2bgf LLL2. spec. bgf LLL2. spec2doc. ξbgf LLL2. doc. bgf Grammar Hunter bgfpp *.LLL2 LLL2.LLL2

Applying coupled mutation eliminate-metasymbol(group) to Grammar Zoo ada-kellogg 108 csharp-iso-23270-2003 0 java-1-jls-read 0 ada-kempe 89 csharp-iso-23270-2006 0 java-2-jls-impl 36 ada-laemmel-verhoef 79 csharp-msft-ls-1.0 0 java-2-jls-read 0 ada-lncs-2219 89 csharp-msft-ls-1.2 0 java-5-habelitz 65 ada-lncs-4348 109 csharp-msft-ls-3.0 0 java-5-jls-impl 60 c-iso-9899-1999 0 csharp-msft-ls-4.0 0 java-5-jls-read 1 c-iso-9899-tc2 0 csharp-zaytsev 23 java-5-parr 95 c-iso-9899-tc3 0 dart-google 58 java-5-stahl 92 cpp-iso-14882-1998 0 dart-spec-0.01 56 java-5-studman 91 cpp-iso-n2723 0 dart-spec-0.05 62 mediawiki-bnf 32 csharp-ecma-334-1 0 eiffel-bezault 45 mediawiki-ebnf 30 csharp-ecma-334-2 0 eiffel-iso-25436-2006 345 modula-sdf 50 csharp-ecma-334-3 0 fortran-derricks 101 modula-src-052 65 csharp-ecma-334-4 0 java-1-jls-impl 0 w3c-xpath1 3

Conclusion

Conclusion Extended XBGF to bidirectionality, resulting in!bgf. Proposed EDD and XEDD for & its evolution. Presented a case study of LLL evolution (GDK). Generalised transformers and generators to transformations and mutations; also formalised them. Implemented an XEDD processor for evolution, coevolution, change propagation and mutation.

Discussion ware.net slps.sf.net