of grammars

35
Dr. Vadim Zaytsev, SWAT, CWI 2013 Pending Evolution of Grammars XM2013: Second Extreme Modelling Workshop

Upload: others

Post on 06-Apr-2022

14 views

Category:

Documents


0 download

TRANSCRIPT

Page 2: of Grammars

Why the problem is a problem

! Grammar evolution

is (meta)model transformation

! MDE doesn’t work

! All MDE tools are crap

! Model transformation bores people

! We need more agility! [citation needed] ! also XM keynote by Jon Whittle

Page 3: of Grammars

Consider it done!

http://cheezburger.com/6125443584

Page 4: of Grammars

Grammar evolution

G G G G G

Page 5: of Grammars

Grammar evolution

G G G G G

unfold

Page 6: of Grammars

Composable default fragments

Page 7: of Grammars

Composable default fragments

G G G G G

defineN

defineNdefineN

Page 8: of Grammars

Composable default fragments

G G G G G

defineN

defineNdefineN

= =

Page 9: of Grammars

Composable default fragments

G G G G G

defineN

= =

two defineN failed

Page 10: of Grammars

Asserting preconditions

Page 11: of Grammars

Asserting preconditions

G G G G G

vertical

deyaccify

verticaldeyaccify

Page 12: of Grammars

Asserting preconditions

G G G G G

vertical

deyaccify

verticaldeyaccify

=

Page 13: of Grammars

Asserting preconditions

G G G G G

deyaccify

verticaldeyaccify

=

all Ok

Page 14: of Grammars

Bulk processing

Page 15: of Grammars

Bulk processing

G G G G G

inject

defineNreplace

deyaccify

Page 16: of Grammars

Bulk processing

G G G G G

fix

fixfix

fix

Page 17: of Grammars

Bulk processing

G G G G G

fix

fixfix

fix

report

=

=

Page 18: of Grammars

Bulk processing

G G G G G

fix

fixfix

fix

report

=

Page 19: of Grammars

Bulk processing

G G G G G

fix

fixfix

fix

report

Page 20: of Grammars

Pending failure

Page 21: of Grammars

Pending failure

G G G G G

introduce

narrowunite

renameN

Page 22: of Grammars

Pending failure

G G G G G

introduce

narrowunite

renameN

Page 23: of Grammars

Pending failure

G G G G G

introduce

narrowunite

renameN

report

Page 25: of Grammars

Persistent normalisation

Page 26: of Grammars

Persistent normalisation

G G G G G

introduce

factordefine

addV

Page 27: of Grammars

Persistent normalisation

G G G G G

introduce

factordefine

addV

:-(

Page 28: of Grammars

Persistent normalisation

G G G G G

introduce

factordefine

addV

horizontal :-)horizontalhorizontal

Page 29: of Grammars

Pre-export normalisation

Page 30: of Grammars

Pre-export normalisation

G G G G G

change

changechange

change

G G

Page 31: of Grammars

Pre-export normalisation

G G G G G

change

changechange

change

G Gnormalisenormalise

Page 32: of Grammars

Also diff:

G G G G G

change

changechange

change

G Gnormalisenormalise

differ

Page 33: of Grammars

To summarise

http://commons.wikimedia.org/wiki/File:Torii_kiyoshige_bando_hikosaburo_ii.jpg

! Don’t do

! Consider it done

! Accumulate failures

! Plan beforehand

! Execute optionally

! ???

! PROFIT!

Page 35: of Grammars

Pending Evolution of Grammars

Vadim Zaytsev

Software Analysis & Transformation Team,Centrum Wiskunde & Informatica,

Amsterdam, The Netherlands

Abstract. The classic approach to grammar manipulation is based oninstant processing of grammar edits, which limits the kinds of grammarevolution scenarios that can be expressed with it. Treating transforma-tion preconditions as guards poses limitations on concurrent changes ofthe same grammar, on reuse of evolution scripts, on expressing option-ally executed steps, on batch processing and optimization of them, etc.We propose an alternative paradigm of evolution, where a transforma-tion can be scheduled for later execution based on its precondition. Thiskind of extreme evolution can be useful for expressing scenarios that areimpossible to fully automate within the classic or the negotiated trans-formation paradigms.

1 Introduction

A colloquial expression ‘consider it done’ means that the subject of the conver-sation is either indeed already done, or will be done in the very near future —in either case, the receiver of such a message can rest assured that the subjectwill take place if it has not already, and is expected to act as if it has indeedhappened. The technique of pending evolution that we introduce in this paper,is similar to that expression, and the benefits of it are not unlike the subtledifferences between considering something done and it having been done.

As it turns out, the pending evolution scheme allows us to efficiently modelscenarios of grammar evolution, deployment and maintenance that are impossi-ble to model within the traditional grammar transformation paradigm, which isbriefly explained in §2. The method is introduced in §3. Since the most profitshide deep in the details, we spend the rest of the paper (§4) by motivating theuse of pending evolution for grammars instead of classical evolution scripts, byconcrete examples. §5 concludes the paper by summarizing its contributions anddiscussing related work.

2 GrammarLab

GrammarLab is a codename for a grammar manipulation project that is cur-rently being migrated from the Software Language Processing Suite1 initiative

1 V. Zaytsev, R. Lammel, T. van der Storm, L. Renggli, G. Wachsmuth. SoftwareLanguage Processing Suite, 2008–2013. http://slps.github.io.

28