-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConfigKnowledgeLaws.pvs
171 lines (151 loc) · 5.07 KB
/
ConfigKnowledgeLaws.pvs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
ConfigKnowledgeLaws: THEORY
BEGIN
IMPORTING FeatureModel, FeatureModelSemantics, Name, ConfigurationKnowledge
%%%%%%%%%%%%%%%%%%%%%%%%%%%% LAW 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%syntax law 1
syntaxLaw1(item1,item2:Item, ck1,ck2:CK):boolean =
ck1(item1) AND
ck2(item2) AND
(NOT ck1(item2)) AND
(NOT ck2(item1)) AND
(FORALL (i:Item): ck1(i) AND (i/=item1) => ck2(i)) AND
(FORALL (i:Item): ck2(i) AND (i/=item2) => ck1(i)) AND
assets(item1)=assets(item2)
%conditions law 1
conditionsLaw1(it1,it2:Item, fm: WFM):boolean =
FORALL (c: Configuration):
semantics(fm)(c) => (satisfies(exp(it1),c)<=>satisfies(exp(it2),c))
%law 1
simplifyFeatureExpressionNew: THEOREM
FORALL(item1,item2:Item, fm: WFM, A:AM, ck1,ck2:CK):
(
wfCK(fm,A,ck1) AND wfCK(fm,A,ck2) AND
%syntax
syntaxLaw1(item1,item2,ck1,ck2) AND
%conditions
conditionsLaw1(item1,item2,fm)
)
=> ckEq(fm,A,ck1,ck2)
syntaxLaw1alt(item1,item2:Item, items:finite_sets[Item].finite_set, ck1,ck2:CK):boolean =
ck1 = union(item1,items) AND
ck2 = union(item2,items) AND
assets(item1)=assets(item2)
%law 1
% simplifyFeatureExpressionNew2: THEOREM
% FORALL(item1,item2:Item, fm: WFM, A:AM, ck1,ck2:CK):
% (
% wfCK(fm,A,ck1) AND wfCK(fm,A,ck2) AND
% %syntax
% syntaxLaw1alt(item1,item2,ck1,ck2) AND
% %conditions
% conditionsLaw1(item1,item2,fm)
% )
% => ckEq2(ck1,ck2)
%%%%%%%%%%%%%%%%%%%%%%%%%%%% LAW 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%syntax law 2
syntaxLaw2(it1,it2,it3:Item, ck1,ck2:CK):boolean =
ck1(it1) AND
ck1(it2) AND
ck2(it3) AND
(NOT ck1(it3)) AND
(NOT ck2(it1)) AND
(NOT ck2(it2)) AND
assets(it3) = (union(assets(it1),assets(it2))) AND
exp(it1) = exp(it3) AND
(FORALL (i:Item): ck1(i) AND (i/=it1) AND (i/=it2) => ck2(i)) AND
(FORALL (i:Item): ck2(i) AND (i/=it3) => ck1(i))
%conditions law 2
conditionsLaw2(it1,it2:Item, fm: WFM):boolean =
FORALL (c: Configuration):
semantics(fm)(c) => (satisfies(exp(it1),c)<=>satisfies(exp(it2),c))
%law 2
equivalentFeatureExpressions: THEOREM
FORALL(it1,it2,it3:Item, fm: WFM, A:AM, ck1,ck2:CK):
(
wfCK(fm,A,ck1) AND wfCK(fm,A,ck2) AND
%syntax
syntaxLaw2(it1,it2,it3,ck1,ck2) AND
%conditions
conditionsLaw2(it1,it2,fm)
)
=> ckEq(fm,A,ck1,ck2)
%%%%%%%%%%%%%%%%%%%%%%%%%%%% LAW 3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%syntax law 3
syntaxLaw3(it1,it2,it3:Item, ck1,ck2:CK):boolean =
ck1(it1) AND
ck1(it2) AND
ck2(it3) AND
(NOT ck1(it3)) AND
(NOT ck2(it1)) AND
(NOT ck2(it2)) AND
(assets(it1) = assets(it2)) AND
(assets(it2) = assets(it3)) AND
(assets(it1) = assets(it3)) AND
(exp(it3) = IMPLIES_FORMULA(NOT_FORMULA(exp(it1)),exp(it2))) AND
(FORALL (i:Item): ck1(i) AND (i/=it1) AND (i/=it2) => ck2(i)) AND
(FORALL (i:Item): ck2(i) AND (i/=it3) => ck1(i))
duplicatedTasks2: THEOREM
FORALL(it1,it2,it3:Item, fm: WFM, A:AM, ck1,ck2:CK):
(
wfCK(fm,A,ck1) AND wfCK(fm,A,ck2) AND
%syntax
syntaxLaw3(it1,it2,it3,ck1,ck2)
)
=> ckEq2(ck1,ck2)
%law 3
duplicatedTasks: THEOREM
FORALL(it1,it2,it3:Item, fm: WFM, A:AM, ck1,ck2:CK):
(
wfCK(fm,A,ck1) AND wfCK(fm,A,ck2) AND
%syntax
syntaxLaw3(it1,it2,it3,ck1,ck2)
)
=> ckEq(fm,A,ck1,ck2)
%%%%%%%%%%%%%%%%%%%%%%%%%%%% LAW 4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%syntax law 4
syntaxLaw4(item:Item, ck1,ck2:CK):boolean =
ck1(item) AND
(NOT ck2(item)) AND
(FORALL (i:Item): ck1(i) AND (i/=item) => ck2(i)) AND
(FORALL (i:Item): ck2(i) => ck1(i))
%conditions law 4
conditionsLaw4(item:Item, fm: WFM):boolean =
FORALL (c: Configuration):
semantics(fm)(c) => NOT (satisfies(exp(item),c))
%law 4
deadFeatureExpression: THEOREM
FORALL(item:Item, fm: WFM, A:AM, ck1,ck2:CK):
(
wfCK(fm,A,ck1) AND
%syntax
syntaxLaw4(item,ck1,ck2) AND
%conditions
conditionsLaw4(item,fm)
)
=> ckEq(fm,A,ck1,ck2)
%%%%%%%%%%%%%%%%%%%%%%%%%%%% LAW 5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
changeOrder: THEOREM
FORALL(fm: WFM, A:AM, ck1,ck2:CK):
(
wfCK(fm,A,ck1) AND
%syntax
ck1 = ck2
)
=> ckEq(fm,A,ck1,ck2)
% moveAsset : THEOREM
% FORALL(fm: {featMod: FM | wf(featMod)}, A:AM, ck1,ck2:CK, f,g:Name, it1,it2:Item, S:finite_sets[Item].finite_set):
% (
% wfCK(fm,A,ck1) AND
% wfCK(fm,A,ck2) AND
% ck1) = union(it1,S) AND
% ck2) = union(it2,S) AND
% (NOT member(it1,ck2))) AND
% (NOT member(it2,ck1))) AND
% (assets(it1)=assets(it2)) AND
% (FORALL (c:Configuration) : satisfies(exp(it1),c) => satisfies(NAME_FORMULA(f),c)) AND
% (FORALL (c:Configuration) : satisfies(exp(it2),c) => satisfies(NAME_FORMULA(g),c)) AND
% (formulae(fm)(IMPLIES_FORMULA(NAME_FORMULA(g),NAME_FORMULA(f)))) AND
% (formulae(fm)(IMPLIES_FORMULA(NAME_FORMULA(f),NAME_FORMULA(g))))
% ) =>
% ckEq(fm,A,ck1,ck2)
End ConfigKnowledgeLaws