-
Notifications
You must be signed in to change notification settings - Fork 1
/
ReduceBoolExpression.py
431 lines (394 loc) · 21.2 KB
/
ReduceBoolExpression.py
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
def walk_branches(tree,root):
""" a generator that recursively yields child nodes of a wx.TreeCtrl """
item, cookie = tree.GetFirstChild(root)
while item.IsOk():
yield item
if tree.ItemHasChildren(item):
walk_branches(tree,item)
item,cookie = tree.GetNextChild(root,cookie)
class ReduceSol(object):
def Length(self, a):
""" return the number of 0 and 1 in a
"""
c=0
for i in range(0,len(a)):
if (a[i]!= 2):
c +=1
return c
def __init__(self, parent, AllSolutions,vars,outs):
self.outs = outs
self.vars = vars
self.parent = parent
self.SolOuts = []
self.AllSolutions = self.SetSolutions(AllSolutions)
def SetSolutions(self, AllSolutions):
""" Get the solution from the tree
For each Outputs [Solution0, ..., SolutionN]
For each Solution [Var0, ..., VarN, Out0Equ0, ..., Out0EquN, OutNEqu0, ..., OutNEquN, Equ0, ..., EquN]
For now OutXEquX are '2' (don't care) and EquX doesn't exist yet
"""
SolOuts0 = []
for outSolutions in AllSolutions:
self.SolOuts.append(len(outSolutions))
for Solution in outSolutions:
SolOuts0.append(2)
for outSolutions in AllSolutions:
for Solution in outSolutions:
Solution.extend(SolOuts0)
return AllSolutions
def ReduceEquation(self,Subsol0):
# Search for same part of equation
All = []
CurrentSubSol0 = list(Subsol0)
Index = [0]
for i in range(self.Length(CurrentSubSol0)-1):
Index.append(-1)
NbReplace = 1
while self.Length(CurrentSubSol0) >=2:
CurrentSubSol0 = list(Subsol0)
Start = -1
for i in range(NbReplace-1,-1,-1):
CurrentSubSol0,Start = self.Replace(CurrentSubSol0, Start+1, Index[i])
All.append( CurrentSubSol0)
Index[0] += 1
for i in range(NbReplace):
offset = 0
for j in range(i+1,len(Index)):
offset += Index[j]+1
if Index[i] >= self.Length(Subsol0)-(offset+i):
#print 'offset : %s' % str(offset)
for j in range(i+1):
Index[j] = 0
Index[i+1] +=1
if NbReplace == i+1:
NbReplace += 1
return All
def reduce0(self):
AllSolutions = self.AllSolutions
for index0, Solution0 in enumerate(AllSolutions[:-1]):
# Seach for same solution
for index1, Solution1 in enumerate(AllSolutions[index0+1:],index0+1):
tree = self.parent.solution[index1]
root = tree.GetRootItem()
if Solution0 == Solution1:
# Same solution
tree.SetItemText(root, '%s = %s' % (OutputsName[index1],OutputsName[index0]))
break
for index10, Subsol in enumerate(SolutionList):
if Solution0 == list(Subsol):
# Same solution in equation
RootText = tree.GetItemText(root)
RootTextList = RootText.split(' = ')
if(self.solveSOP):
AndOr = ' + '
else:
AndOr = ' . '
RootTextList = RootTextList[1].split(AndOr)
OldItemText = RootTextList[index10]
RootTextList[index10] = self.parent.OutputName(index0)
RootText = ' . '.join(RootTextList)
tree.SetItemText(root, '%s = %s' % (self.parent.OutputName(index1),RootText))
for item in walk_branches(tree,root):
sol=(self.parent.solution[out].GetItemData(item)).GetData();
if sol == Subsol:
tree.SetItemText(item, self.parent.OutputName(index0))
break
for index00, Subsol0 in enumerate(Solution0):
self.SearchForSame(Subsol0, index0, AllSolutions)
for out, Solution in enumerate(AllSolutions):
for index00, Subsol0 in enumerate(Solution):
self.ReduceEquation(Subsol0)
def reduce(self):
AllSolutions = self.AllSolutions
for NbInputs in range(self.vars,2-1,-1):
EquationList = [[sol for sol in Solution
if self.Length(sol[:self.vars]) >= NbInputs]
for Solution in AllSolutions]
BestCommon = []
NoMoreCommon = False
while (not NoMoreCommon):
for out0, Solution0 in enumerate(EquationList):
for index0, SubSol0 in enumerate(Solution0):
EquationList = [[sol for sol in Solution
if self.Length(sol[:self.vars]) >= NbInputs]
for Solution in AllSolutions]
for out1, Solution1 in enumerate(EquationList):
for index1, SubSol1 in enumerate(Solution1):
## if (SubSol1 == SubSol0) and (out0 != out1):
## # Same equation as other out
## SubSol1 = self.mask(SubSol0, SubSol0)
## out,index = self.CommonFound(SubSol0)
## SubSol1[self.vars+sum(self.SolOuts[:out])+index]=1
if (index0 != index1 or out0 != out1):
c = self.comp(SubSol0, SubSol1)
if (self.Length(c) >= 2):
# common exist
if self.Length(BestCommon) < self.Length(c):
BestCommon = c
if BestCommon:
out,index = self.CommonFound(BestCommon)
EquationList0 = []
for Solution in AllSolutions:
SubSollist = [sol for sol in Solution
if self.Length(sol) >= self.Length(BestCommon)
and self.comp(BestCommon, sol) == BestCommon]
EquationList0.append(SubSollist)
## EquationList0 = [[sol for sol in Solution
## if self.Length(sol) >= self.Length(BestCommon)]
## for Solution in AllSolutions]
for outindex, Equ in enumerate(EquationList0):
for SubSol in Equ:
if outindex != out or SubSol != BestCommon:
SubSol = self.mask(SubSol, BestCommon)
if out == self.outs:
# It's an equation
SubSol[self.vars+sum(self.SolOuts)+index]=1
else:
# It's an output equation
SubSol[self.vars+sum(self.SolOuts[:out])+index]=1
## SubSol0 = self.mask(SubSol0, c)
## if out == self.outs:
## # It's an equation
## SubSol0[self.vars+self.outs+index]=1
## else:
## # It's an output equation
## SubSol0[self.vars+sum(self.SolOuts[:out])+index]=1
BestCommon = []
else:
NoMoreCommon = True
def ColName(self, index):
names= ['VRAMP@VBAT','PA_EN','BD_SW','EDGE','EN_HB_B2','EN_LB_B1','MODE_SEL_B8','MODE2_B5','MODE1_VM0','MODE0_VM1']
return names[index]
def OutputName(self, index):
names= ['MODE<0>','MODE<1>','MODE<2>','MODE<3>','MODE<4>','','','','','']
return names[index]
def solutionStr(self, values, OP ='.'):
outs = self.SolOuts
vars = self.vars
if OP == '.':
b = '' # A, B, C, D
else:
b = '('
a = '' # All the rest
for i in range(0, len(values)):
if values[i] != 2:
if i < vars:
if(values[i]==0):
a += '|'
a += self.ColName(i)+OP
elif i >=vars and i < sum(outs)+vars:
for outindex in range(len(outs)):
if i >= vars+sum(outs[:outindex]) and i < vars+sum(outs[:outindex+1]):
if(values[i]==0):
a += '|'
a += '%s_Equ%s' % (self.OutputName(outindex),str(i- (vars+sum(outs[:outindex])) ))+OP
elif i >= sum(outs)+vars:
if(values[i]==0):
a += '|'
a += 'Equ%s' % str(i- (sum(outs)+vars) ) + OP
b=b+a[0:-1]
if OP == '.' and b == '':
b='1'
elif OP == '+':
if b == '(':
b='0'
else:
b = b + ')'
return b
def CommonFound(self, a):
AllSolutions = self.AllSolutions
NbInputs = self.Length(a[:self.vars])
EquationList = [[sol for sol in Solution
if self.Length(sol[:self.vars]) == NbInputs]
for Solution in AllSolutions]
for index, Solution in enumerate(EquationList):
if a in Solution:
return index, AllSolutions[index].index(a)
# The equation is new
if len(AllSolutions) == self.outs:
# Create the equations entry
AllSolutions.append([a])
else:
AllSolutions[-1].append(a)
for outSolutions in AllSolutions:
for Solution in outSolutions:
Solution.append(2)
return self.outs, AllSolutions[-1].index(a)
def mask(self, a, mask):
for i in range(0,self.vars):
if mask[i] !=2:
a[i] = 2
return a
def comp(self, a, b):
c = []
for i in range(0,len(a)):
if(a[i]!=b[i]):
c.append(2)
else:
c.append(a[i])
return c
def GetSimpleValue(self, values):
def Add(a, b):
c =[]
for i in range(len(a)):
if a[i] == b[i]:
c.append(a[i])
elif a[i] == 2:
c.append(b[i])
elif b[i] == 2:
c.append(a[i])
else:
raise()
return c
outs = self.SolOuts
vars = self.vars
if self.Length(values[vars:]) != 0:
newvalues = values[:vars]
for i in range(vars, len(values)):
if values[i] != 2:
if i < vars:
subValues = newvalues
elif i >=vars and i < sum(outs)+vars:
for outindex in range(len(outs)):
if i >= vars+sum(outs[:outindex]) and i < vars+sum(outs[:outindex+1]):
subValues = self.GetSimpleValue(self.AllSolutions[outindex][i- (vars+sum(outs[:outindex]))])
elif i >= sum(outs)+vars:
#Select the Equation solution
subValues = self.GetSimpleValue(self.AllSolutions[-1][i- (vars+sum(outs))])
newvalues = Add(newvalues[:vars],subValues)
return newvalues[:vars]
else:
return values[:vars]
def GetSubValues(self, values):
outs = self.SolOuts
vars = self.vars
if self.Length(values[vars:]) != 0:
Subvalues = []
for i in range(vars, len(values)):
if values[i] != 2:
## if i < vars:
## subValues = newvalues
if i >=vars and i < sum(outs)+vars:
for outindex in range(len(outs)):
if i >= vars+sum(outs[:outindex]) and i < vars+sum(outs[:outindex+1]):
Subvalues.append(self.AllSolutions[outindex][i- (vars+sum(outs[:outindex]))])
Subvalues.extend(self.GetSubValues(Subvalues[-1]))
elif i >= sum(outs)+vars:
#Select the Equation solution
Subvalues.append( self.AllSolutions[-1][i- (vars+sum(outs))] )
Subvalues.extend( self.GetSubValues(Subvalues[-1]) )
return Subvalues
else:
return [values]
def SearchForSame(self, sol, out, AllSolutions):
for index1, SolutionList in enumerate(AllSolutions[out+1:],1):
tree = self.parent.solution[index1+out]
root = tree.GetRootItem()
#print SolutionList
for index10, Subsol in enumerate(SolutionList):
if sol == Subsol:
# Same solution in equation
RootText = tree.GetItemText(root)
RootTextList = RootText.split(' = ')
if(self.parent.solveSOP):
AndOr = ' + '
else:
AndOr = ' . '
RootTextList = RootTextList[1].split(AndOr)
#print RootTextList
if len(RootTextList) >= index10:
OldItemText = RootTextList[index10]
#print out , AllSolutions[out]
RootTextList[index10] = '%s_%s' % (self.parent.OutputName(out),AllSolutions[out].index(sol))
RootText = AndOr.join(RootTextList)
tree.SetItemText(root, '%s = %s' % (self.parent.OutputName(index1+out),RootText))
for item in walk_branches(tree,root):
sol0=(self.parent.solution[out].GetItemData(item)).GetData();
if sol0 == Subsol:
tree.SetItemText(item, '%s_%s' % (self.parent.OutputName(out),AllSolutions[out].index(sol)))
break
break
def GetValue(self,sol,Index):
searchindex = 0
for i in range(0,len(sol)):
if (sol[i] != 2) :
if searchindex==Index:
break
else:
searchindex += 1
return sol[i]
def Replace(self, sol, Start, Index, Value = 2):
searchindex = 0
i = -1
for i in range(Start,len(sol)):
if type(Value) == list:
if (Value[i] != 2):
if searchindex==Index and sol[i] == 2:
sol[i] = Value[i]
break
else:
searchindex += 1
else:
if (sol[i] != 2):
if searchindex==Index:
sol[i] = Value
break
else:
searchindex += 1
return sol,i
def IsPartOf(self, a, b):
""" Checks if a node is part of b
"""
c=0
for i in range(0,len(a)):
if not (a[i]!= 2 and a[i]==b[i]):
return False
return True
def main():
AllSol = [[[1, 0, 0, 1, 0, 0, 0, 0, 0, 2], [1, 0, 0, 1, 0, 0, 0, 0, 2, 1], [2, 0, 0, 0, 1, 2, 0, 0, 0, 1], [1, 2, 1, 0, 0, 0, 0, 0, 0, 2], [1, 2, 1, 0, 0, 0, 0, 0, 2, 1], [1, 0, 0, 0, 1, 2,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2, 2, 1], [1, 1, 0, 2, 1, 2, 2, 0, 2, 1], [1, 1, 0, 2, 1, 2, 0, 2, 1, 2], [1, 1, 0, 0, 1, 2, 2, 1, 2, 2], [1, 2, 0, 0, 1, 2, 0, 1, 2, 2], [1, 1, 0, 2, 1, 2, 1, 0, 2, 2], [1, 2, 0, 0, 1, 2, 1, 0, 2, 2], [1, 1, 0, 1, 1, 2, 2, 0, 2, 2], [0, 0, 2, 2, 2, 1, 0, 0, 2, 2], [0, 0, 2, 2, 1, 2, 0, 0, 2, 2], [0, 2, 1, 2, 1, 2, 0, 0, 2, 2], [2, 2, 2, 0, 1, 1, 2, 2, 1, 2], [2, 1, 2, 2, 1, 1, 2, 2, 1, 2], [2, 2, 1, 2, 1, 1, 2, 2, 2, 2], [0, 1, 1, 2, 2, 2, 2, 2, 2, 2]]]
red = ReduceSol(None, AllSol)
red.reduce()
red.GetSimpleValue(red.AllSolutions[0][0])
red.GetSubValues(red.AllSolutions[0][0])
print [[sol[:10] for sol in Solution] for Solution in red.AllSolutions]
print [[red.Length(sol) for sol in Solution] for Solution in red.AllSolutions]
print [sum([red.Length(sol) for sol in Solution]) for Solution in red.AllSolutions]
if __name__ == '__main__':
main()
##import sympy
##
##Inputs = sympy.symbols('S3 S4 S5 S6')
##Outputs = sympy.symbols('Th0 Th1 Th2 Th3 Th4')
##Equations=[]
##for out in range(1,outs):
## tree = parent.solution[out]
## root = tree.GetRootItem()
## solution=tree.GetItemText(root)
## solution = solution.split('=')[1]
## solution = solution.replace('|','~')
## solution = solution.replace('.','&')
## solution = solution.replace('+','|')
## res = sympy.sympify(solution)
## print res
## Equations[out] = res
##
##for index0, Equation0 in enumerate(Equations[:-1]):
## # Seach for same solution
## for index1, Equation1 in enumerate(Equations[index0+1:],index0+1):
## if Equation0 == Equation1:
## # Same solution
## Equations[index1] = Outputs[index0]
## break
## for index10, arg in enumerate(Equation1.args):
## if Equation0 == arg:
## # Same solution in equation
## argleft = list(Equation1.args)
## argleft.remove(arg)
## argleft.append(Outputs[index0])
## Equations[index1] = Equation1.func(tuple(argleft))
## break
## for index100, arg1 in enumerate(args.args):
## break
## # Search for same equation or part of it
## for index00, arg in enumerate(Equation0.args):
## break