Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jesse proposal1 Jesse’s proposal Karl Lieberherr.

Similar presentations


Presentation on theme: "Jesse proposal1 Jesse’s proposal Karl Lieberherr."— Presentation transcript:

1 Jesse proposal1 Jesse’s proposal Karl Lieberherr

2 Jesse proposal2 Crosscut language Jesse D ::= a set of paths [A,B] | paths from A to B bypassing {C, …} D. D | concatenation of paths D | D | union of paths !D complement of paths base language Jesse actually had: exclude(D1, D2): PathSet(D1) – PathSet(D2) (set difference). But we can simulate negation: !D = exclude(all paths, D)

3 Jesse proposal3 Crosscut language Jesse D ::= a set of paths [A,B] | paths from A to B bypassing {C, …} D. D | concatenation of paths D | D | union of paths !D complement of paths base language Two forms of negation: EASY and HARD negation

4 Jesse proposal4 Are algorithmic results of any use to AOSD tool builders/users? YES! –Positive results: Fast algorithms lead to faster tools. –Negative results: Indicate that we need to use different kinds of algorithms or different semantics.

5 Jesse proposal5 class Main { // Java Program with DJ X1 x1; Nx1 nx1; public static void main(String[] s) { ClassGraph cg = new ClassGraph(); Main m = new Main(); String strategy = "intersect(" + // union is expressed by concatenation of edges "{Main -> X1 X1 -> Target " + "Main ->Nx2 Nx2 -> Target " + "Main -> X3 X3 -> Target}," + "{Main -> Nx1 Nx1 -> Target " + "Main -> X2 X2 -> Target}," + "{Main -> X1 X1 -> Target}," + "{Main -> Nx3 Nx3 -> Target})”; cg.traverse(m, // m is the complete tree with 8 leaves strategy, new Visitor(){ public void start (){System.out.println(" start traversal");} public void finish (){System.out.println(" finish traversal");} void before (Target host){System.out.print(host + ' ');} void before (Nx3 host) {System.out.print(host + ' ');} void before (X2 host) {System.out.print(host + ' ');} void before (X1 host) {System.out.print(host + ' ');} });} } class X1 { X2 x2; Nx2 nx2; } class Nx1 { X2 x2; Nx2 nx2; } class X2 { X3 x3; Nx3 nx3; } class Nx2 { X3 x3; Nx3 nx3; } class X3 { Target t; } class Nx3 { Target t; } class Target {} X1 Main Nx1 X2Nx2 X3 Nx3 Target Main X1 X2 X3 Target Nx3 Target … Meta graph= Class graph Instance tree Object tree Selected by strategy

6 Jesse proposal6 Crosscut language SD D ::= a set of paths [A,B] | paths from A to B D. D | concatenation of paths D | D | union of paths D & D | intersection of paths !D complement of paths base language

7 Jesse proposal7 Computational Properties Select-Sat: Given a strategy p and a class graph G, is there an instance tree for G for which p selects a non-empty set of nodes. X/Y/Z –X is a problem, e.g., Select-Sat –Z is a language, e.g. SAJ or SD –Y is one of -,&,! representing a version of Z. X/-/Z base language of Z. X/&/Z is base language of Z plus intersection. X/!/Z is base language of Z plus negation.

8 Jesse proposal8 Select-First Select-First: Does an edge in an instance graph lead to a node selected by the strategy? Select-First is useful for guiding traversals

9 Jesse proposal9 More precise Definition 8 (Select-First). Given a selector p and class graph G, compute the set of outgoing edges from a node of an instance I satisfying G that might lead to a target node selected by p.

10 Jesse proposal10 Results (Problem) ProblemSDSAJ -PP &NP-complete ! both problems: Select-First and Select-Sat

11 Jesse proposal11 Remember Mitch Semantics Take an edge if there is a possibility of success. But deciding whether there is a possibility of success is now NP-complete. What should we do?

12 Jesse proposal12 Matthias semantics to the rescue The meaning of a strategy is a function that maps object graphs (og) to object graph slices (ogs): M(s,G) : (og:OG(G) -> ogs:OG(G)) There are different ways of defining this function. The standard, presented in the paper with Mitch has the property: M[Mitch](s,G) satisfies: there exists s,G and ogs: (not (Leaves(ogs) subset Instances(Targets(s)))) M[Matthias](s,G) satisfies: for all s,G and ogs: Leaves(ogs) subset Instances(Targets(s)) M[Mitch] has the advantage that during one traversal we compute the object graph slice and execute the visitor. M[Matthias] can be computed with two traversals: the first one computes the slice (using the class graph a la M[Mitch] implementations, if feasible) and the second executes the visitor.

13 Jesse proposal13 Have we solved an NP-complete problem in polynomial time? No! Why?


Download ppt "Jesse proposal1 Jesse’s proposal Karl Lieberherr."

Similar presentations


Ads by Google