More reductions - PowerPoint PPT Presentation

About This Presentation
Title:

More reductions

Description:

weakly object extending cd transformations ... What runs now should run later. Reuse of test objects. language extending cd transformations ... – PowerPoint PPT presentation

Number of Views:16
Avg rating:3.0/5.0
Slides: 33
Provided by: karllie
Category:
Tags: cd | more | now | reductions

less

Transcript and Presenter's Notes

Title: More reductions


1
More reductions
  • Daniel Schulman
  • Creates class graphs but only flat ones.
  • How can he create other class graphs that are not
    flat.

2
Growth plan
cd class dictionary
  • Solution (continued)
  • weakly object extending cd transformations
  • The next class dictionary defines more objects
    but does not invalidate any existing objects.
    What runs now should run later. Reuse of test
    objects.
  • language extending cd transformations
  • The next cd defines a super language of the
    language of the current cd.

3
Object-extending transformations
  • relations on class graphs, associated with
    transformations, fundamental for reuse
  • object-equivalence G1, G2
  • preserves the set of objects Objects(G1)
    Objects(G2)
  • weak extension (G2 weak extension G1)
  • enlarges the set of objects Objects(G1) Í
    Objects(G2)
  • extension
  • enlarges and augments the set of objects

4
How to implement object-equivalence
  • Infinitely many objects to compare
  • Reduce the problem to a simpler one where only
    finitely many things to compare
  • Use notion of PartClusters

5
Part clusters
  • What can be put into parts?
  • PartClusters of a class v is a list of pairs, one
    for each induced part of v. Each pair consists
    of the part name and the set of construction
    classes whose instances can be assigned to the
    part
  • PartClustersFurnace(TempSensor) temp Kelvin,
    Celsius, trigger Integer

6
Object-equivalence
  • Let G1 and G2 be two class graphs. G1 is
    object-equivalent to G2 if for the concrete
    classes VC1 of G1 and the concrete classes VC2 of
    G2
  • VC1 VC2
  • and for all v in VC1
  • PartClustersG1(v) PartClustersG2(v).

7
Covered
  • Let PC1 and PC2 be two part clusters. PC1 is
    covered by PC2 if for each pair (l,T1) in PC1
    there exists a pair (l,T2) in PC2 such that T1Í
    T2.
  • Tightly covered means covered and PC1
    PC2.

8
Weak extension
  • Let G1 and G2 be two class graphs. G1 is a weak
    extension of G2 if for the concrete classes VC1
    of G1 and the concrete classes VC2 of G2
  • VC1 Í VC2 and for all v in VC1
  • PartClustersG1(v) is tightly covered by
    PartClustersG2(v).

9
Extension
  • Let G1 and G2 be two class graphs. G1 is an
    extension of G2 if for the concrete classes VC1
    of G1 and the concrete classes VC2 of G2
  • VC1 Í VC2 and
  • for all v in VC1 PartClustersG1(v) is covered
    by PartClustersG2(v).

10
Properties
  • The three class graph relations have the
    following inclusion properties
  • object-equivalence Í
  • weak-extension Í
  • extension

11
Building blocks of object-equivalence
  • Is there a more primitive set of transformations
  • What are the fundamental building blocks of
    object-equivalence?

12
H
DelA AbsR RepR DisR AddA
G
F
object-equivalent
H
F
G
inheritance
C
B
A
D
E
C
B
A
E
13
Primitive Transformations
  • Addition of Abstract Class (AddA)
  • Deletion of Abstract Class (DelA)
  • Abstraction of Common Reference (AbsR)
  • Distribution of Common Reference (DisR)
  • Replacement of Reference (RepR)
  • object-equivalence DelA AbsR RepR DisR
    AddA.

14
Primitive Transformations
  • Addition of Abstract Class (AddA)
  • adds an abstract class u and subclass edges
    outgoing from u. u must not have any outgoing
    construction edges.
  • Deletion of Abstract Class (DelA)
  • inverse of AddA. Deletes an abstract class u and
    all its subclass edges. u must not have any
    incoming construction or subclass edges nor any
    outgoing construction edges.

15
Primitive Transformations
  • Abstraction of Common Reference (AbsR)
  • moves a construction edge common to a set of
    sibling classes up to their direct superclass.
  • Distribution of Common Reference (DisR)
  • moves a construction edge to the direct
    subclasses.

16
Primitive Transformations
  • Replacement of Reference (RepR)
  • reroutes a construction edge (v,l,u1) to a new
    target (v,l,u2) where u1 and u2 have the same set
    of concrete subclasses.

17
Primitive Transformations
  • Addition of Concrete Class (AddC)
  • Generalization of Reference (GenR)
  • Addition of Reference (AddR)
  • Equiv object equivalence
  • weak-extension (Equiv((GenR)Equiv)AddC
  • extension (Equiv((AddRGenR)Equiv)AddC

18
Primitive Transformations
  • Addition of Concrete Class (AddC)
  • adds an empty concrete class
  • Generalization of Reference (GenR)
  • reroutes a construction edge (v,l,u1) to a new
    target (v,l,u2), where u2 is a direct superclass
    of u1.

19
Primitive Transformations
  • Addition of Reference (AddR)
  • adds a new construction edge between existing
    vertices of the class graph.

20
Warning
  • In the following viewgraphs is-a and has-a edges
    should be switched.

21
H
DelA AbsR RepR DisR AddA
G
F
object-equivalent
H
F
G
inheritance
C
B
A
D
E
C
B
A
E
22
H
F2
DisR AddA
G
F
H
D2
F
G
C
B
A
D
E
C
B
A
E
23
H
F2
RepR DisR AddA
G
F
H
D2
F
G
C
B
A
D
E
C
B
A
E
24
H
F2
AbsR RepR DisR AddA
G
F
H
D2
F
G
C
B
A
D
E
C
B
A
E
25
H
F2
DelA AbsR RepR DisR AddA
G
H
D2
F
G
C
B
A
D
E
C
B
A
E
26
Connections
  • weak extension implies language extension
  • If two cds are in a weakly object-extending
    relationship they can be brought to a language
    extending relationship with appropriate syntax.
  • object-equivalent extension implies
    language-equivalent extension
  • similar

27
Growth plan
behavior phases
P4 P3 P2 P1 P0
L1 Í L2 Í L3
structure, grammar phases
(P0, P1)
(P2,P3)
(P4)
28
Growth plan
  • Consequences Following Growth plan has a number
    of benefits
  • Gradual building of confidence in your software
    development skills.
  • Show prototypes to your customers.
  • Simplified testing. Find earliest phase where a
    bug shows up.
  • faster compilation and generation

29
Example
Same adaptive program for Terminal Buffer Rule
checking works for both phases. Faster for phase
1.
Cd_graph ltfirstgt Adj. Adj ltvertexgt Vertex
ltnsgt Construct .. Construct ltl1gt
Labeled_vertex ltl2gt Labeled_vertex. Labeled_vertex
lt ltlabel_namegt Label gt ltclass_namegt
Vertex. Vertex ltnamegt Ident. Label ltnamegt
Ident.
phase 1
Cd_graph ltfirstgt Adj ltrestgt Adj_list. Adj
ltvertexgt Vertex ltnsgt Neighbors .. Neighbors
Construct Alternat. Construct ltc_nsgt
Any_vertex_list. Labeled_vertex lt
ltlabel_namegt Label gt ltclass_namegt
Vertex. Vertex ltnamegt Ident. Any_vertex_list
ltfirstgt Any_vertex ltrestgt Any_vertex_list. Any-Ver
tex Labeled_vertex Syntax_vertex. ...
phase 2 NOT even an extension
30
Conclusion
  • Using Adaptive Programming you can apply the
    Growth Plan pattern effectively. You can start
    with simple structures and generalize your
    program to more general structures easily.

31
Further information
  • Paul Bergsteins OOPSLA 91 paper
  • Walter Huerschs Ph.D. thesis
  • Linda Seiters Ph.D. thesis

32
End of lecture
Write a Comment
User Comments (0)
About PowerShow.com