Upload
leonardo-passos
View
99
Download
4
Embed Size (px)
DESCRIPTION
Citation preview
Defaults Analyses in non-Boolean Feature Models
Leonardo Passos([email protected])
February 2012
1 / 19
Outline
Proposed Analysis
Initial Definitions
Analysis Encoding
Case Study: CDL
2 / 19
Proposed Analysis
3 / 19
Analysis
Given a model with defaults, is it the case that for every correctpartial configuration, its completion using defaults result in aconflict-free completion?
4 / 19
Initial Definitions
5 / 19
Encoding of Boolean FMs with no Defaults
I Given a feature model (FM) M, let F = {f1, . . . , fn} be theset of its features.
I Each analysis over F is modelled as a SAT problem (given toSMT Solvers).
I Encoding scheme for Boolean FMs with no defaults:I E = {e1, . . . , en}: set of variables, each denoting a feature’s
enabled state.
I Φ = ΦFM ∧ ΦCTC: satisfiability constraint
6 / 19
Encoding of Boolean FMs with Defaults
I E and Φ as before.
I DE = {de1 , . . . , den}: set of variables, each denoting afeature’s default enable state.
I OE = {oe1 , . . . , oen}: set of variables, each controlling if afeature’s default enable state has been overridden by the user.
I UE = {ue1 , . . . , uen}: set of variables, each denoting afeature’s enable state as set by the user.
7 / 19
Encoding of Boolean FMs with Defaults
I New satisfiability constraint:
Φ ∧ ΦSE ∧ ΦDE ∧ ΦOE
7 / 19
Encoding of Boolean FMs with Defaults
I New satisfiability constraint:
Φ ∧ ΦSE ∧ ΦDE ∧ ΦOE
I ΦSE : source of a feature’s enabled value.
n∧i=1
ei = (oei ?uei : dei )
7 / 19
Encoding of Boolean FMs with Defaults
I New satisfiability constraint:
Φ ∧ ΦSE ∧ ΦDE ∧ ΦOE
I ΦDE : defaults setting.
n∧i=1
dei = default enabled expression for fi
7 / 19
Encoding of Boolean FMs with Defaults
I New satisfiability constraint:
Φ ∧ ΦSE ∧ ΦDE ∧ ΦOE
I ΦOE : controls which features cannot have the enabled valueoverridden. ∧
i∈{k | fk∈F , ¬overridableE(fk )}
oei = false
where
overridableE(fi ) =
{false, fi is mandatory
true, otherwise
7 / 19
Encoding of Non-Boolean Feature Models with Defaults
I E , DE , OE , UE , ΦSE , ΦDE , ΦOE as before
I Create set of variables and constraints for the data value part:V, DV , OV , UV , ΦSV , ΦDV , ΦOV .
I Φ = ΦFM ∧ ΦCTC is now defined over E and V.
I Note that:I |V = {v1, . . . , vm}| ≤ |E|
I |DV | = |V| ≤ |DE |
I |OV | = |V| ≤ |OE |
I |UV | = |V| ≤ |UE |
8 / 19
Analysis Encoding
9 / 19
Analysis Statement
Given a model with defaults, is it the case that for every correctpartial configuration, its completion using defaults result in a
conflict-free completion?
10 / 19
Abstract Idea
Partial configuration+
completion(SAT)
Partial configuration+
default completion with conflicts(SAT)
User provided value Correct completion value Default completion value
Coun
ter e
xample
copied
copied
copied
M1 M2
11 / 19
1) Build M1I Model M1 has no defaults.
I Solution: use completion variables instead.
I Sets of variables:
I E : enable variables.
I CE (new): enabledcompletion valuevariables.
I HUE (new): flag variablesthat signal whether theuser has set a feature’senabled state.
I UE : user set enabledvalue variables.
I V: set of data valuevariables.
I CV (new): data valuecompletion variables.
I HUV (new) : flagvariables that signalwhether the user has seta feature’s data value.
I UV : user set data valuevariables.
12 / 19
1) Build M1
I Satisfiability constraint ΦM1:
Φ1 ∧ ΦSE1∧ ΦSV1
∧ ΦHUE1∧ ΦHUV1
12 / 19
1) Build M1
I Satisfiability constraint ΦM1:
Φ1 ∧ ΦSE1∧ ΦSV1
∧ ΦHUE1∧ ΦHUV1
I ΦSE : source of a feature’s enabled value.
n∧i=1
ei = (hei ?uei : cei )
where ei ∈ E , hei ∈ HUE , uei ∈ UE and cei ∈ CE .
I ΦSV : analogous, but manipulates variables related to V.
12 / 19
1) Build M1
I Satisfiability constraint ΦM1:
Φ1 ∧ ΦSE1∧ ΦSV1
∧ ΦHUE1∧ ΦHUV1
I ΦHUE: controls which features cannot have the enabled value
set by the user. ∧i∈{k | fk∈F , ¬overridableE(fk )}
hei = false
where overridableE(fi ) is as defined before.
I ΦHV : analogous, but manipulates variables related to V.
12 / 19
2) Copy User-Values to M2
I Copy constraint (ΦCOPY):(n∧
i=1
(oei2 = hei1)
)∧
(m∧i=1
(ovi2 = hvi1)
)∧(
n∧i=1
(uei2= uei1
)
)∧
(m∧i=1
(uvi2= uvi1
)
)
13 / 19
3) Counter Example for Default Completion in M2
I Φ2 constraint was defined as
ΦFM2 ∧ ΦCTC2
I Counter example constraint (ΦCOUNTER-EXAMPLE-M2):
(ΦFM2 ∧ ¬ΦCTC2) ∧ (ΦSE2∧ ΦSV2
) ∧ (ΦDE2∧ ΦDV2
)
14 / 19
4) Putting Everything Together
ΦM1 ∧ ΦCOPY ∧ ΦCOUNTER-EXAMPLE-M2
I If SMT Solver returns SAT, a counter example is readilyavailable.
I Otherwise, the SMT returns UNSAT: no counter exampleexists and the set of defaults is valid for all correct partialconfigurations.
15 / 19
Case Study: CDL
16 / 19
CDL Specifics
I CDL requires a new constraint: ΦDo (stating a feature’s legalvalues).
I Completion of M1 should be based on default-defaults.
17 / 19
Analysis of CDL Models
I Analysis of existing CDL models, given this logical framework,is straightforward.
I In CDL, each feature has an enabled and data value part(n = m).
I Simple models were manually translated to Z3 SMT Solver asa proof of concept.
I Will it scale to the whole set of models?. . .
18 / 19
Questions?
19 / 19