f eature d iagrams l ogic t here and b ack a gain
play

F eature D iagrams & L ogic T here and B ack A gain Krzysztof - PowerPoint PPT Presentation

F eature D iagrams & L ogic T here and B ack A gain Krzysztof Czarnecki University of Waterloo Andrzej W asowski IT University of Copenhagen F eature M odels car F eature M odels car body engine gear keyless-entry power-locks F


  1. F eature D iagrams & L ogic T here and B ack A gain Krzysztof Czarnecki University of Waterloo Andrzej W ˛ asowski IT University of Copenhagen

  2. F eature M odels car

  3. F eature M odels car body engine gear keyless-entry power-locks

  4. F eature M odels car body engine gear keyless-entry power-locks electric gas manual automatic

  5. F eature M odels keyless-entry → power-locks car body engine gear keyless-entry power-locks electric gas manual automatic

  6. F eature M odels keyless-entry → power-locks car body engine gear keyless-entry power-locks electric gas manual automatic Model variability & commonality.

  7. F eature M odels keyless-entry → power-locks car body engine gear keyless-entry power-locks electric gas manual automatic Model variability & commonality. Standard semantics: φ ( car , body , engine , gear , . . . )

  8. S emantics keyless-entry → power-locks φ car body engine gear keyless-entry power-locks electric gas manual automatic

  9. R everse E ngineering S yntax φ ?

  10. R everse E ngineering S yntax keyless-entry → power-locks φ car body engine gear keyless-entry power-locks electric gas manual automatic

  11. R everse E ngineering S yntax φ a c a a, c b c a b c b a → c b

  12. R everse E ngineering S yntax φ a b c

  13. C ontents Motivation Syntax & Semantics (going there) Algorithm (going back again) Concluding remarks

  14. C ontents Motivation Syntax & Semantics (going there) Algorithm (going back again) Concluding remarks

  15. T heoretical M otivation To deepen understanding of feature models To explore the relation between logics and FMs To characterize formulæ that are FMs without leftover constraint

  16. A pplied M otivation To visualize variability given as systems of constraints.

  17. A pplied M otivation To visualize variability given as systems of constraints. To guide the user interactively in visualizing constraints.

  18. A pplied M otivation To visualize variability given as systems of constraints. To guide the user interactively in visualizing constraints. To support refactoring tools.

  19. A pplied M otivation To visualize variability given as systems of constraints. To guide the user interactively in visualizing constraints. To support refactoring tools. To support reverse engineering FMs from code.

  20. C ontents Motivation Syntax & Semantics (going there) Algorithm (going back again) Concluding remarks

  21. S yntax: G oing T here f Solitary [1..1] → mandatory

  22. S yntax: G oing T here f Solitary [1..1] → mandatory f Solitary [0..1] → optional

  23. S yntax: G oing T here f Solitary [1..1] → mandatory f Solitary [0..1] → optional f Solitary [0..1] → grouped

  24. S yntax: G oing T here f Solitary [1..1] → mandatory f Solitary [0..1] → optional f Solitary [0..1] → grouped Group [1..1] → xor-group

  25. S yntax: G oing T here f Solitary [1..1] → mandatory f Solitary [0..1] → optional f Solitary [0..1] → grouped Group [1..1] → xor-group Group [1..k] → or-group

  26. S yntax: G oing T here f Solitary [1..1] → mandatory f Solitary [0..1] → optional f Solitary [0..1] → grouped Group [1..1] → xor-group Group [1..k] → or-group φ Left-over constraints

  27. S emantics: G oing T here a a a b c d c ∧ b c d ∨ e f e f e f

  28. S emantics: G oing T here a a a b c d c ∧ b c d ∨ e f e f e f a b c d ∨ e f An implication (hyper)graph

  29. C ontents Motivation Syntax & Semantics (going there) Algorithm (going back again) Concluding remarks

  30. W hy I s I t S o H ard? 1. Possibly no models corresponding to φ

  31. W hy I s I t S o H ard? 1. Possibly no models corresponding to φ 2. Possibly many models corresponding to φ a c a a, c b c a b c b a → c b

  32. W hy I s I t S o H ard? 1. Possibly no models corresponding to φ 2. Possibly many models corresponding to φ a c a a, c b c a b c b a → c b 3. Brute-force infeasible

  33. R oot F eature P roperty The root of a feature tree T est A variable r implied by all the other variables: for all i . φ → ( f i → r )

  34. R oot F eature P roperty The root of a feature tree T est A variable r implied by all the other variables: keyless-entry → power-locks car body engine gear keyless-entry power-locks electric gas manual automatic body → car , gas → car , . . .

  35. F eature H ierarchy P roperty f is an ancestor of g (descendant) T est Implication from descendant ( g ) to ancestor ( f ) g → f

  36. F eature H ierarchy P roperty f is an ancestor of g (descendant) T est Implication from descendant ( g ) to ancestor ( f ) keyless-entry → power-locks car body engine gear keyless-entry power-locks electric gas manual automatic body → car , gas → car , . . .

  37. F eature H ierarchy P roperty f is an ancestor of g (descendant) T est Implication from descendant ( g ) to ancestor ( f ) keyless-entry → power-locks car body engine gear keyless-entry power-locks electric gas manual automatic Direct links: transitive reduction

  38. M andatory F eatures P roperty g is a mandatory subfeature of f T est Biimplication between variables corresponding to g and f f → g

  39. M andatory F eatures P roperty g is a mandatory subfeature of f T est Biimplication between variables corresponding to g and f keyless-entry → power-locks car body engine gear keyless-entry power-locks electric gas manual automatic body → car , car → body , . . .

  40. A nd G roups P roperty g is a mandatory subfeature of f T est Biimplication between variables corresponding to g and f keyless-entry → power-locks car body engine gear keyless-entry power-locks electric gas manual automatic And-groups: cliques in the graph

  41. O r G roups Recall that for an or-group: φ → ( f → f 1 ∨ · · · ∨ f k ) But then also φ → ( f → f 1 ∨ · · · ∨ f k ∨ g ) holds for g other than f i .

  42. O r G roups Implied disjunction can always be weakened! All implied disjunctions = oversized and too-many or-groups So detect minimal disjunctions

  43. O r G roups Implied disjunction can always be weakened! All implied disjunctions = oversized and too-many or-groups So detect minimal disjunctions { f i } i = 1.. k is a prime implicant of f (see the paper) Prime implicants are well studied in fault tolerance analysis

  44. O r G roups P roperty Or-groups of features rooted in f T est Find prime implicants of f keyless-entry → power-locks car body engine gear keyless-entry power-locks electric gas manual automatic electric ∧ gas → engine

  45. O r G roups P roperty Or-groups of features rooted in f T est Find prime implicants of f keyless-entry → power-locks car body engine gear keyless-entry power-locks electric gas manual automatic manual ∧ electric ∧ gas → engine

  46. A lgorithm 1 if unstatisfiable then quit 2 remove & report dead features 3 compute implication graph & its transitive reduction 4 find and-groups by contracting cliques 5 find all or-groups and xor-groups candidates

  47. C ontents Motivation Syntax & Semantics (going there) Algorithm (going back again) Concluding remarks

  48. D iscussion (I) Constructs an overapproximation (add a leftover constraint) The graph constructed contains maximum information (complete)

  49. D iscussion (I) Constructs an overapproximation (add a leftover constraint) The graph constructed contains maximum information (complete) Implemented using BDDs, algorithm by Coudert&Madre,1992 Efficient and scalable (computing prime implicants is the bottleneck)

  50. D iscussion (II) Semantic operations on feature models become logical operations on corresponding formulæ Merge: ( φ FM 1 → r ) ∧ ( φ FM 2 → r ) Difference: φ FM 1 ∧ ¬ φ FM 2 ...

  51. F uture W ork Generalize the kind of models extracted beyond FODA Implement complex refactorings using logical representations Experiment with extracting models from code

  52. S ummary Successful exercise in semantics Exhibited links between logical & relational phenomena and FMs implication graphs, transitive reduction, cliques, prime implicants Effective extraction procedure Implemented Suggested ideas for future work

Recommend


More recommend