Solving the Class Diagram Restructuring Transformation Case with FunnyQT

Similar documents
CS 491G Combinatorial Optimization Lecture Notes

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.

Solutions for HW9. Bipartite: put the red vertices in V 1 and the black in V 2. Not bipartite!

Counting Paths Between Vertices. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs

Lecture 6: Coding theory

CSE 332. Sorting. Data Abstractions. CSE 332: Data Abstractions. QuickSort Cutoff 1. Where We Are 2. Bounding The MAXIMUM Problem 4

Project 6: Minigoals Towards Simplifying and Rewriting Expressions

Section 2.1 Special Right Triangles

22: Union Find. CS 473u - Algorithms - Spring April 14, We want to maintain a collection of sets, under the operations of:

Numbers and indices. 1.1 Fractions. GCSE C Example 1. Handy hint. Key point

2.4 Theoretical Foundations

Chapter 4 State-Space Planning

CS 2204 DIGITAL LOGIC & STATE MACHINE DESIGN SPRING 2014

XML and Databases. Exam Preperation Discuss Answers to last year s exam. Sebastian Maneth NICTA and UNSW

CS 360 Exam 2 Fall 2014 Name

I 3 2 = I I 4 = 2A

6.5 Improper integrals

8 THREE PHASE A.C. CIRCUITS

Solutions to Problem Set #1

18.06 Problem Set 4 Due Wednesday, Oct. 11, 2006 at 4:00 p.m. in 2-106

Factorising FACTORISING.

The DOACROSS statement

Logic, Set Theory and Computability [M. Coppenbarger]

NON-DETERMINISTIC FSA

Equivalent fractions have the same value but they have different denominators. This means they have been divided into a different number of parts.

Now we must transform the original model so we can use the new parameters. = S max. Recruits

Lesson 2.1 Inductive Reasoning

1 This diagram represents the energy change that occurs when a d electron in a transition metal ion is excited by visible light.

Engr354: Digital Logic Circuits

Finite State Automata and Determinisation

Algebra 2 Semester 1 Practice Final

for all x in [a,b], then the area of the region bounded by the graphs of f and g and the vertical lines x = a and x = b is b [ ( ) ( )] A= f x g x dx

Particle Physics. Michaelmas Term 2011 Prof Mark Thomson. Handout 3 : Interaction by Particle Exchange and QED. Recap

A Primer on Continuous-time Economic Dynamics

Momentum and Energy Review

Exam Review. John Knight Electronics Department, Carleton University March 2, 2009 ELEC 2607 A MIDTERM

Intermediate Math Circles Wednesday 17 October 2012 Geometry II: Side Lengths

Part I: Study the theorem statement.

Algorithms & Data Structures Homework 8 HS 18 Exercise Class (Room & TA): Submitted by: Peer Feedback by: Points:

System Validation (IN4387) November 2, 2012, 14:00-17:00

Lecture 11 Binary Decision Diagrams (BDDs)

Lecture 2: Cayley Graphs

Discrete Structures Lecture 11

CS 573 Automata Theory and Formal Languages

Lesson 2.1 Inductive Reasoning

CS311 Computational Structures Regular Languages and Regular Grammars. Lecture 6

Introduction to Olympiad Inequalities

Automata and Regular Languages

= state, a = reading and q j

Nondeterministic Finite Automata

CSC2542 State-Space Planning

Maximum size of a minimum watching system and the graphs achieving the bound

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER MACHINES AND THEIR LANGUAGES ANSWERS

PAIR OF LINEAR EQUATIONS IN TWO VARIABLES

Suppose we want to find the area under the parabola and above the x axis, between the lines x = 2 and x = -2.

Technology Mapping Method for Low Power Consumption and High Performance in General-Synchronous Framework

Common intervals of genomes. Mathieu Raffinot CNRS LIAFA

Lecture Notes No. 10

Symmetrical Components 1

CARLETON UNIVERSITY. 1.0 Problems and Most Solutions, Sect B, 2005

GM1 Consolidation Worksheet

A Disambiguation Algorithm for Finite Automata and Functional Transducers

ANALYSIS AND MODELLING OF RAINFALL EVENTS

Activities. 4.1 Pythagoras' Theorem 4.2 Spirals 4.3 Clinometers 4.4 Radar 4.5 Posting Parcels 4.6 Interlocking Pipes 4.7 Sine Rule Notes and Solutions

Tutorial Worksheet. 1. Find all solutions to the linear system by following the given steps. x + 2y + 3z = 2 2x + 3y + z = 4.

SEMI-EXCIRCLE OF QUADRILATERAL

Basic Derivative Properties

9.1 Day 1 Warm Up. Solve the equation = x x 2 = March 1, 2017 Geometry 9.1 The Pythagorean Theorem 1

Chapter 8 Roots and Radicals

Section 6.1 Definite Integral

Lecture 4: Graph Theory and the Four-Color Theorem

AP Calculus BC Chapter 8: Integration Techniques, L Hopital s Rule and Improper Integrals

= x x 2 = 25 2

Lesson 2: The Pythagorean Theorem and Similar Triangles. A Brief Review of the Pythagorean Theorem.

Unfoldings of Networks of Timed Automata

POSITIVE IMPLICATIVE AND ASSOCIATIVE FILTERS OF LATTICE IMPLICATION ALGEBRAS

Grade 6. Mathematics. Student Booklet SPRING 2008 RELEASED ASSESSMENT QUESTIONS. Assessment of Reading,Writing and Mathematics, Junior Division

APPROXIMATION AND ESTIMATION MATHEMATICAL LANGUAGE THE FUNDAMENTAL THEOREM OF ARITHMETIC LAWS OF ALGEBRA ORDER OF OPERATIONS

SIMPLE NONLINEAR GRAPHS

CS 373, Spring Solutions to Mock midterm 1 (Based on first midterm in CS 273, Fall 2008.)

Convert the NFA into DFA

Welcome. Balanced search trees. Balanced Search Trees. Inge Li Gørtz

Compression of Palindromes and Regularity.

QUADRATIC EQUATION. Contents

Comparing the Pre-image and Image of a Dilation

Metaheuristics for the Asymmetric Hamiltonian Path Problem

Identifying and Classifying 2-D Shapes

THE PYTHAGOREAN THEOREM

Let s divide up the interval [ ab, ] into n subintervals with the same length, so we have

Lecture 8: Abstract Algebra

Dorf, R.C., Wan, Z. T- Equivalent Networks The Electrical Engineering Handbook Ed. Richard C. Dorf Boca Raton: CRC Press LLC, 2000

Lesson 55 - Inverse of Matrices & Determinants

HS Pre-Algebra Notes Unit 9: Roots, Real Numbers and The Pythagorean Theorem

Data Structures LECTURE 10. Huffman coding. Example. Coding: problem definition

AP CALCULUS Test #6: Unit #6 Basic Integration and Applications

, g. Exercise 1. Generator polynomials of a convolutional code, given in binary form, are g. Solution 1.

Total score: /100 points

Section 4.4. Green s Theorem

Statistics in medicine

Mid-Term Examination - Spring 2014 Mathematical Programming with Applications to Economics Total Score: 45; Time: 3 hours

Transcription:

olving the lss Digrm Restruturing Trnsformtion se with FunnyQT Tssilo Horn horn@uni-kolenz.e Institute for oftwre Tehnology, University Kolenz-Lnu, Germny FunnyQT is moel querying n moel trnsformtion lirry for the funtionl Lisp-ilet lojure proviing rih n effiient querying n trnsformtion PI. This pper esries the FunnyQT solution to the TT 2013 lss Digrm Restruturing Trnsformtion se. This solution n the GROOVE solution shre the est overll solution wr for this se. 1 Introution FunnyQT is new moel querying n trnsformtion pproh whih is implemente s n PI for the funtionl, JVM-se Lisp-ilet lojure. It provies severl su-pis for implementing ifferent kins of queries n trnsformtions. For exmple, there is moel-to-moel trnsformtion PI, n there is n in-ple trnsformtion PI for writing progrmme grph trnsformtions. FunnyQT urrently supports EMF n JGrL moels, n it n e extene to other moeling frmeworks, too. For solving the tsks of this trnsformtion se 1, only FunnyQT s plin querying n moel mnipultion PIs hve een use, n the tsk is tkle lgorithmilly. 2 The ore Tsk The ore tsk s solution onsists of some helper funtions, funtion for fining sets of pullle properties n sorting them heuristilly in orer to hieve effetive results, the rules epite in the se esription [1], n funtion pplying the rules in orer to relize the trnsformtion. This setion strts with the helpers, then explins the funtion fining pullle properties, n then isusses the restruturing rules. The omplete soure oe is printe in ppenix. Helper Funtions. The helper funtions isusse in this setion re quite simple n ftor out funtionlity tht is use t severl ples in the rules. There re severl very simple helpers tht re not expline in etil. -prop! s new Property with some given nme n Type to some given Entity. elete-prop! eletes the property ientifie y given nme from given entity. The pull-up funtion gets list of [prop-nme type] tuples, set of soure entities, n trget entity. It then s new properties to the trget entity n eletes them from the soure entities. Lstly, there s mke-generliztion! whih retes new Generliztion etween su- n its super-entity, n there s mke-entity! tht retes new Entity. 1 This FunnyQT solution is ville t https://githu.om/tsh/tt-2013--restrut n on HRE (imge TT13::Uuntu12LT_TT13::FunnyQT.vi) Pieter Vn Gorp, Louis M. Rose, hristin Kruse (Es.): ixth Trnsformtion Tool ontest (TT 2013) EPT 135, 2013, pp. 75 82, oi:10.4204/ept.135.9

76 olving the lss Digrm Restruturing Trnsformtion se with FunnyQT The funtion prop-type-set gets n Entity e n returns its set of [prop-nme type] tuples, i.e., there s one suh tuple for ny owne ttriute of e. 1 (efn prop-type-set [e] 2 (set (mp (fn [p] [(eget p :nme) (eget p :type)]) 3 (eget e :ownettriute)))) The filter-y-properties funtion gets olletion of [prop-nme type] tuples vi its pnts prmeter, n olletion of entities vi its entities prmeter. It returns the suset of entities for whih every entity efines ll of the given properties with ientil types. 1 (efn filter-y-properties [pnts entities] 2 (set (filter (fn [e] (forll? #(memer? % (prop-type-set e)) pnts)) 3 entities))) Restruturing Heuristis. This solution oesn t pull up one ttriute t time, ut inste it pulls up the mximl set of properties tht re shre y mximum of entities. I.e., the heuristis n e speifie s follows. Let P 1 n P 2 e sets of properties shre y the sets of entities E 1 n E 2, respetively. 1. If E 1 > E 2, then the solution pulls up the properties of P 1 inste of the properties of P 2. (Mximlity wrt. the numer of entities elring these properties) { 1 if P1 P 2. If E 1 = E 2, then the solution pulls up the properties of P i where i = 2. 2 otherwise (Mximlity wrt. the numer of pullle properties.) D N1 N2 D Mximl numer of elring entities N1 D N1 Mximl numer of pullle properties N1 Figure 1: Exmples for the heuristis Figure 1 illustrtes these heuristis with two exmples. In the left exmple, the property is shre y three lsses, wheres n re shre y only 2 lsses eh. If the trnsformtion pulls up first into new lss, n e pulle up only from n D into nother new lss. The numer of property elrtion ereses from 8 to 6, n remin uplite one, n 2 new lsses hve een rete. If the trnsformtion uses the first heuristi, it pulls up first euse tht s ommon to more lsses thn n. This lso results in 6 remining property elrtions, n remin uplite one, ut only one new lss hs een rete. In the right exmple, the set of properties {, } n {} re shre y two lsses oth. If the trnsformtion eies to pull up, the numer of property elrtions ereses from 7 to 6, n remin uplite one, n one new lss hs een rete. If the trnsformtion uses the seon heuristi, it pulls up n, n the numer of property elrtions ereses from 7 to 5, only remins uplite one, n gin one new lss hs een rete. The ommon-props funtion fins sets of pullle properties n sorts them oring to the heuristis. It is y fr the most omplex funtion of the trnsformtion. The funtion reeives set of entities vi its lsses prmeter n returns the properties ommon to mximl suset of these entities.

Tssilo Horn 77 1 (efn ommon-props [lsses] 2 (let [pes (set (mp (fn [pnt] [pnt (filter-y-properties [pnt] lsses)]) 3 (set (mpt prop-type-set lsses)))) 4 freq-mp (pply hsh-mp 5 (mpt (fn [[_ ents]] [ents (ount (filter #(= ents (seon %)) 6 pes))]) 7 pes)) 8 ollpse (fn ollpse [es] 9 (when-let [[pnt entities] (first es)] 10 (let [[s r] (split-with (fn [[_ ents]] (= entities ents)) es)] 11 (ons [(mp first s) entities] 12 (lzy-seq (ollpse r))))))] 13 (ollpse (into (sorte-set-y 14 (fn [[_ es :s ] [_ es :s ]] 15 (let [x (- (ount es) (ount es))] 16 (if (zero? x) 17 (let [x (- (freq-mp es) (freq-mp es))] 18 (if (zero? x) (ompre ) x)) 19 x)))) 20 pes)))) In line 2, pes is oun to set of tuples [pnt entity-set], where pnt is [prop-nme type] tuple n entity-set is the set of ll entities elring suh property. Tht is, pes hs the following form 2. #{[[pn1 t1] #{e1 e2 e3}] [[pn2 t2] #{e2 e3 e4 e5}] [[pn4 t2] #{e2 e3 e4}] [[pn3 t2] #{e1 e2 e3}]} In line 4, freq-mp is oun to hsh-mp tht mps to eh set of entities ouring in the items of pes the numer of ourenes in there. This mp is use to implement the seon heuristi. In line 8, lol funtion ollpse is efine. efore explining tht, first lines 13 to 22 re to e expline. Wht s one there is tht the entries of the set pes re put into sorte set. The sorting orer is etermine y the omprtor funtion efine in lines 14 to 21. It reeives two items of the pes set, ins their entity-sets to es n es, respetively, n then performs these heks: 1. If es ontins more entities thn es, shoul e sorte efore. This implements heuristi 1. 2. Else, if the entity set es ours more often in the items of pes, shoul e sorte efore. This implements heuristi 2. 3. Else, the sorting orer is not importnt n etermine y lojure s stnr ompre funtion tht proues stle orering upon ll ojets implementing omprle. s result, the sorte set hs the following struture, i.e., items with lrger entity sets re sorte efore items with smller entity sets. The item with pn2 is sorte efore the others euse it is shre y 4 entities. #{[[pn2 t2] #{e2 e3 e4 e5}] [[pn3 t2] #{e1 e2 e3}] [[pn1 t1] #{e1 e2 e3}] [[pn4 t2] #{e2 e3 e4}]} In se of eqully lrge entity sets, the numer of ourenes of the entity sets etermines the sorting orer, e.g., the items with pn1 n pn2 re sorte efore the item with pn4, euse their entity sets our twie wheres the entity set of pn4 ours only one. Finlly, this set is mngle y the lol ollpse funtion efine in lines 8 to 12. It simply ollpses (merges) jent items with equl entity sets, thus the result of the funtion hs the following form. ([([pn2 t2]) #{e2 e3 e4 e5}], [([pn1 t1] [pn3 t2]) #{e1 e2 e3}], [([pn4 t2]) #{e2 e3 e4}]} euse the items of pn1 n pn3 hve the sme entity set, they re merge into one item. 2 #{...} is lojure set literl.

78 olving the lss Digrm Restruturing Trnsformtion se with FunnyQT Restruturing Rules. The solution efines the funtion pull-up-helper shown in the next listing whih n implement ll three restruturing rules y prmeterizing it ppropritely. The funtion reeives the root moel ojet mo, superlss super, n set of entities lsses in whih to fin ommon properties,. In se of rule 1 n rule 2, super is the superlss of ll lsses, n in se of rule 3, the super prmeter is nil n lsses is the set of top-level lsses. 1 (efn pull-up-helper [mo super lsses] 2 (when (seq lsses) 3 (when-let [[pnts entities] (first (ommon-props lsses))] 4 (if (n super (= lsses entities)) 5 (pull-up mo pnts entities super) ;; rule 1 6 (when (> (ount entities) 1) 7 (let [n (mke-entity! mo)] ;; rule 2 if super is given, else rule 3 8 (pull-up mo pnts entities n) 9 (oseq [s entities] 10 (oseq [olgen (eget s :generliztion) 11 :when (= super (j olgen :generl))] 12 (eelete! olgen)) 13 (mke-generliztion! mo s n)) 14 (when super (mke-generliztion! mo n super)) 15 true)))))) When the set of lsses is not empty (line 2), n if there re ommon properties (line 3), the lrgest list of ommon properties mong the lists of properties elre y mximl numer of entities is oun to pnts, n the entities elring these properties re oun to entities. In se entities equls the set of ll lsses (line 4), the sitution is tht of rule 1, n ll properties in pnts re pulle up to super (line 5). In the other se, the mximl set of ommon properties is shre y mximl ut strit suset of lsses. Here, it hs to e ensure tht there re more thn one entity elring these properties (line 6), euse else the inheritne epth woul inrese without removing elrtions. Then, the sitution is tht of rule 2 if super is non-nil, n the sitution is tht of rule 3 if super is nil. In ny se, ll shre properties re pulle into new entity n (line 8), n the generliztions re pte y eleting the ol generliztions to super (lines 10-12), reting new generliztion to the new superlss n (line 13), n mking super superlss of n (line 14). The overll trnsformtion funtion simply lls the pull-up-helper funtion shown ove with pproprite prmetriztion s long s it n fin mth. Multiple Inheritne Extension. The solution isusse so fr works well lso if the initil moel lrey ontins multiple inheritne. However, they won t rete new entities tht speilize more thn one other entity. To exploit multiple inheritne in orer to restruture the moel resulting from the ore rules so tht there re no uplite properties, one itionl rule is use. It omputes the set of uplite properties of ll lsses, n then ts oring these heuristis. 1. If one of the entities elring the uplite property is top-level lss rete y the ore tsk, then the other entities eome its sulsses. Only top-level entities rete y the ore tsk re reuse, euse reusing one tht lrey existe in the originl lss moel mkes the result s type hierrhy inomptile with originl one, i.e., efore ws no sulss of, ut fterwrs it is. 2. Else, new entity is rete s superlss of the entities, n the property is pulle up. 3 Evlution The evlution results requeste y the se esription [1] re summrize in Tle 1.

Tssilo Horn 79 With 110 LO (ore + extension tsk), the solution s size is quite goo given tht its heuristis re more vne thn wht ws emne. Due to these heuristis, its effetiveness is 100% for ll provie n severl itionl moels (e.g., the ones in Figure 1). The se esription efines the omplexity s the sum of opertor ourenes, type referenes, n feture referenes. The FunnyQT solution onsists of 161 funtion lls (or lls to speil forms or mros), 4 type referenes, n 25 feture referenes. The evelopment effort hs een out 8 hours for the solution plus 2 hours for writing unit tests for it. The most hllenging n time-onsuming tsk hs een eveloping heuristis tht hieve 100% effetiveness in ll moels use for testing. ize (LO) 90 (ore only), 105 (ore + extension) omplexity 190 = 161 funlls + 4 type refs + 25 feture refs Effetiveness 100% Development effort pprox. 8 hours (solution) + 2 hours (tests) Exeution time 6 ses for the lrgest moel (testse2_10000.xmi) History of use pprox. 1 yer No. of se stuies pulishe: the 3 TT13 ses, unpulishe: pprox. 20 Mximum pility pprox. 2 million elements on HRE Tle 1: Evlution mesures The etile exeution times on HRE for the lrger moels re epite in Tle2. The lrgest provie moel testse2_10000 onsisting of 100000 elements 3 n e proesse in out six seons whih is more thn thousn times fster thn the referene UML-RD solution. Moel ore ore n Extension testse2_1000 418 ms 434 ms testse2_5000 2455 ms 2585 ms testse2_10000 5656 ms 6041 ms testse3 248 ms 268 ms testse2_200000 1006848 ms 1045648 ms Tle 2: Detile exeution times on HRE To etermine the mximum pility of the solution, moels up to two millions of elements hve een rete. Given the limite mount of 800 M RM ville to the JVM proess on HRE, the moel with 2 million elements (testse2_200000) is out the mximum pility for the solution. The solution of this se uses only tiny prt of FunnyQT s fetures euse it ws est tkle lgorithmilly. ut next to the moel querying n moel mnipultion PIs use here, FunnyQT provies moel-to-moel trnsformtion PI, PIs for pttern mthing n progrmme grph trnsformtions, n there re more fetures to ome, mking FunnyQT equte for very ivergent set of trnsformtion tsks. Referenes [1] Kevin Lno & hekoufeh Kolhouz Rhimi (2013): se stuy: lss igrm restruturing. In Pieter Vn Gorp, Louis Rose & hristin Kruse, eitors: ixth Trnsformtion Tool ontest (TT 2013), EPT, this volume. 3 The moels testse2_n tully onsist of 10 n elements.

80 olving the lss Digrm Restruturing Trnsformtion se with FunnyQT The omplete oure oe of the olution 1 (efn -prop! [mo e pn t] 2 (let [p (erete! Property)] 3 (e! mo :propertys p) 4 (eset! p :nme pn) 5 (eset! p :type t) 6 (e! e :ownettriute p))) 7 8 (efn elete-prop! [e pn] 9 (let [p (first (filter #(= pn (eget % :nme)) 10 (eget e :ownettriute)))] 11 (eelete! p) 12 (eremove! e :ownettriute p))) 13 14 (efn pull-up [mo pnts froms to] 15 (oseq [[pn t] pnts] 16 (-prop! mo to pn t) 17 (oseq [s froms] 18 (elete-prop! s pn))) 19 true) 20 21 (efn mke-generliztion! [mo su super] 22 (let [gen (erete! Generliztion)] 23 (e! mo :generliztions gen) 24 (eset! gen :generl super) 25 (eset! gen :speifi su))) 26 27 (efn mke-entity! [mo] 28 (let [e (erete! Entity)] 29 (e! mo :entitys e) 30 (eset! e :nme (str (gensym "Newlss"))))) 31 32 (efn prop-type-set [e] 33 (set (mp (fn [p] [(eget p :nme) (eget p :type)]) 34 (eget e :ownettriute)))) 35 36 (efn filter-y-properties [pnts entities] 37 (set (filter (fn [e] 38 (forll? #(memer? % (prop-type-set e)) pnts)) 39 entities))) 40 41 (efn ommon-props [lsses] 42 (let [pes (set (mp (fn [pnt] 43 [pnt (filter-y-properties [pnt] lsses)]) 44 (set (mpt prop-type-set lsses)))) 45 freq-mp (pply hsh-mp 46 (mpt (fn [[_ ents]] 47 [ents (ount (filter #(= ents (seon %)) 48 pes))]) 49 pes)) 50 ollpse (fn ollpse [es] 51 (when-let [[pnt entities] (first es)] 52 (let [[s r] (split-with (fn [[_ ents]] 53 (= entities ents)) es)] 54 (ons [(mp first s) entities]

Tssilo Horn 81 55 (lzy-seq (ollpse r))))))] 56 (ollpse (into (sorte-set-y 57 (fn [[_ es :s ] [_ es :s ]] 58 (let [x (- (ount es) (ount es))] 59 (if (zero? x) 60 (let [x (- (freq-mp es) (freq-mp es))] 61 (if (zero? x) 62 (ompre ) 63 x)) 64 x)))) 65 pes)))) 66 67 (efn pull-up-helper [mo super lsses] 68 (when (seq lsses) 69 (when-let [[pnts entities] (first (ommon-props lsses))] 70 (if (n super (= lsses entities)) 71 (pull-up mo pnts entities super) ;; rule 1 72 (when (> (ount entities) 1) 73 (let [n (mke-entity! mo)] ;; if super rule 2, else rule 3 74 (pull-up mo pnts entities n) 75 (oseq [s entities] 76 (oseq [olgen (eget s :generliztion) 77 :when (= super (j olgen :generl))] 78 (eelete! olgen)) 79 (mke-generliztion! mo s n)) 80 (when super (mke-generliztion! mo n super)) 81 true)))))) 82 83 (efn exploit-multiple-inheritne [mo] 84 (oseq [[pnts entities] (ommon-props (eget mo :entitys)) 85 :while (> (ount entities) 1)] 86 (let [[n reuse] 87 (if-let [top (first (filter 88 #(n (empty? (eget % :generliztion)) 89 (re-mthes #"Newlss.*" (eget % :nme))) 90 entities))] 91 [top true] 92 [(mke-entity! mo) flse])] 93 (oseq [[pn t] pnts] 94 (when-not reuse 95 (-prop! mo n pn t)) 96 (oseq [e (remove #(= n %) entities)] 97 (elete-prop! e pn) 98 (mke-generliztion! mo e n)))))) 99 100 (efn pull-up-1-2 [mo] 101 (loop [lsses (eget mo :entitys), pplie flse] 102 (if (seq lsses) 103 (let [super (first lsses) 104 result (pull-up-helper 105 mo super (set (js super :speiliztion :speifi)))] 106 (reur (rest lsses) (or result pplie))) 107 pplie))) 108 109 (efn pull-up-3 [mo] 110 (pull-up-helper mo nil (set (remove #(seq (eget % :generliztion))

82 olving the lss Digrm Restruturing Trnsformtion se with FunnyQT 111 (eget mo :entitys))))) 112 113 (efn pull-up-ttriutes [moel multi-inheritne] 114 (let [mo (the (ellojets moel moel))] 115 (itertively #(let [r (pull-up-1-2 mo)] 116 (or (pull-up-3 mo) r))) 117 (when multi-inheritne (exploit-multiple-inheritne mo)) 118 moel))