a programmable editor for developing structured documents based on bidirectional transformations...
TRANSCRIPT
![Page 1: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/1.jpg)
A Programmable Editor forDeveloping Structured Documents based on
Bidirectional Transformations
Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi
University of Tokyo
![Page 2: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/2.jpg)
Structured Documents
IPL Address Book
Zhenjiang Hu: Assoc. Prof. Shin-Cheng Mu: Post Doc Masato Takeichi: Prof.
Names
Zhenjiang Hu: hu@mist … Shin-Cheng Mu: scm@ipl … Masato Takeichi: takeichi@ …
Addresses
XML<addressBook> <person> <name> Zhenjiang Hu </name> …. </person> <person> … </person></addressBook>
DTD XSLT
![Page 3: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/3.jpg)
Document Engineering
XML<addressBook> <person> <name> Zhenjiang Hu </name> …. </person> <person> … </person></addressBook>
DTD XSLT
Redesign &Refinement
Like software development …
![Page 4: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/4.jpg)
Editors Supporting Development of Structured Documents
http://www.xmlsoftware.com/editors.html
• XML Spy (Altova)
• Xdoc (Microsoft)
• IBM Visual XML Creator (IBM)
• Ark II (JustSYSTEM)
• Proxima (Utrecht)and many …
![Page 5: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/5.jpg)
Can we develop structured documents in a WYSIWYG
manner? IPL Address Book
Zhenjiang Hu: Assoc. Prof. Shin-Cheng Mu: Post Doc Masato Takeichi: Prof.
Names
Zhenjiang Hu: hu@mist … Shin-Cheng Mu: scm@ipl … Masato Takeichi: takeichi@ …
Addresses
Redesign &Refinement
XML, DTD, XSLT
Derive
![Page 6: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/6.jpg)
Transformation
Internal Representation IPL Address Book
Zhenjiang Hu: Assoc. Prof. Shin-Cheng Mu: Post Doc Masato Takeichi: Prof.
Names
Zhenjiang Hu: hu@mist Shin-Cheng Mu: scm@ipl Masato Takeichi: takeichi@
Addresses
Zhenjiang Hu:Position: Asso. Prof.Email: [email protected]:03-5841-7411Address: 7-3-1 Hongo, Bunkyo Tokyo 113, JapanWWW: www.ipl.t.u-tokyo.ac.jp
Masato TakeichiPosition: Prof.Email: [email protected]: 03-5841-7430…
Display
![Page 7: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/7.jpg)
Transformation
IPL Address Book
ZHENJIANG HU: Assoc. Prof. Shin-Cheng Mu: Post Doc Masato Takeichi: Prof.
Names
Zhenjiang Hu: hu@mist Shin-Cheng Mu: scm@ipl Masato Takeichi: takeichi@
Addresses
Zhenjiang Hu:Position: Asso. Prof.Email: [email protected]:03-5841-7411Address: 7-3-1 Hongo, Bunkyo Tokyo 113, JapanWWW: www.ipl.t.u-tokyo.ac.jp
Masato TakeichiPosition: Prof.Email: [email protected]: 03-5841-7430…
DisplayInternal Representation
![Page 8: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/8.jpg)
Transformation
IPL Address Book
ZHENJIANG HU: Assoc. Prof. Shin-Cheng Mu: Post Doc Masato Takeichi: Prof.
Names
ZHENJIANG HU: hu@mist Shin-Cheng Mu: scm@ipl Masato Takeichi: takeichi@
Addresses
ZHENJIANG HU:Position: Asso. Prof.Email: [email protected]:03-5841-7411Address: 7-3-1 Hongo, Bunkyo Tokyo 113, JapanWWW: www.ipl.t.u-tokyo.ac.jp
Masato TakeichiPosition: Prof.Email: [email protected]: 03-5841-7430…
DisplayInternal Representation
![Page 9: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/9.jpg)
Transformation
IPL Address Book
ZHENJIANG HU: Assoc. Prof. Shin-Cheng Mu: Post Doc Masato Takeichi: Prof.
Names
ZHENJIANG HU: hu@mist Shin-Cheng Mu: scm@ipl Masato Takeichi: takeichi@
Addresses
ZHENJIANG HU:Position: Asso. Prof.Email: [email protected]:03-5841-7411Address: 7-3-1 Hongo, Bunkyo Tokyo 113, JapanWWW: www.ipl.t.u-tokyo.ac.jp…Masato TakeichiPosition: Prof.Email: [email protected]: 03-5841-7430…
DisplayInternal Representation
3
3
![Page 10: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/10.jpg)
Source View
editingX
Two issues of concern:-- How to update the source when the view is changed?-- A formal model of the editor?
The Rest of the Talk
![Page 11: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/11.jpg)
The Rest of the Talk
• Introducing X, the language we use to code XML transformation– allowing duplication– supporting recursive tree traversals
• Overview of the editor– editing data as well as transformation– allowing data dependency and derived
values
![Page 12: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/12.jpg)
The Bidirectional Transformation Language
X
An extension of the lens language by Greenwald et al With dup, if and fold. [Ref: PLANX2004]
CView AView
View ::= N String [View]
![Page 13: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/13.jpg)
Semantics
satisfying 2 laws:
GET:PUT:
With each construct x come 2 functions:
![Page 14: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/14.jpg)
Basic Transformations
CView AView
f
g
CView AViewf
![Page 15: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/15.jpg)
Sequential Combinator
CView AView Aview’
x1 x2
![Page 16: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/16.jpg)
Product
![Page 17: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/17.jpg)
Duplication
![Page 18: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/18.jpg)
Map and Fold
![Page 19: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/19.jpg)
Derived Transformation idX and constX
constX f = NFun f
![Page 20: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/20.jpg)
Derived Transformation exchangeX
a
b
b
a
exX
![Page 21: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/21.jpg)
Derived Transformation: hoistX
m
hoistX m
![Page 22: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/22.jpg)
Hole Manipulation
![Page 23: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/23.jpg)
Bidirectionality
There are two ways to insert a new subtree:
![Page 24: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/24.jpg)
Coding Editing Operators in X
![Page 25: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/25.jpg)
Source View
editingX
![Page 26: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/26.jpg)
The Editor State
The state of the editor is a triple:
satisfying the following SNYC property:
![Page 27: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/27.jpg)
Actions the User Can Do
remembersdependency
introducetransformation
![Page 28: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/28.jpg)
General Editing Operators
InsertE p v (c,x,a) = Aa(c,x,insert p v a)
DeleteE p v (c,x,a) = Aa(c,x,delete p v a)
MoveE p1 p2 (c,x,a) = Aa(c,x,move p1 p2 a)
FieldEdit p v (c,x,a) = Aa(c,x,fieldEdit p v a)
![Page 29: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/29.jpg)
Special Editing Operators
DuplicateE p (c,x,a) = A
cx (c, (x ; applyX p Dup), a)
TransformE p x’ (c,x,a) = A
cx (c, (x ; apply p x’), a)
![Page 30: A Programmable Editor for Developing Structured Documents based on Bidirectional Transformations Zhenjiang Hu, Shin-Cheng Mu, Masato Takeichi University](https://reader030.vdocuments.net/reader030/viewer/2022032607/56649eda5503460f94be8f84/html5/thumbnails/30.jpg)
Conclusion
• We proposed a new transformation language with the following features.– It is bidirectional.– It supports duplication and recursive
transformation.
• We applied the language to the design of a new editor for developing structured documents:– Data dependency and local synchronization– Derived values– Efficient implementation of infinite undos