init commit

This commit is contained in:
YuhangQ 2022-11-18 11:48:44 +08:00
parent 31f02dda01
commit 78f6ae93e3
35 changed files with 9909 additions and 0 deletions

View File

@ -0,0 +1,68 @@
# 甘棠约束条件编码器
## 使用方法
Linux 二进制已经编译好了,直接 ./encoder 即可。
自动读取当前目录 ./data 下的三个 csv 文件作为程序输入,如果需要修改输入数据,就改那三个 csv 文件一定要UTF-8编码的因为文件里有中文Office Excel 转成的 csv 是 GBK 编码的,需要额外处理一下)。
```bash
约束条件可以使用任意数理逻辑表达式,包括 =>、<=、()、!、~、&、|、<=>,并且可以任意嵌套
运算符默认优先级 (~|!) > (&) > (|) > (=>) = (<=) > (<=>)
```
程序的标准输出就是 CNF 格式的,并且包含合理的注释信息,直接重定向就可以:
```bash
./encoder > result.cnf
```
## 如何编译
比较懒没有写 makefile.h 和 .cpp 文件之间互相依赖太多了,基本改了一个就要全部重新编译,所以直接用脚本,每次重新全部编译。
```bash
./build.sh
```
没有使用系统调用,在 Windows 上编译也可以直接编译通过,也是同样的编译命令。
## 正确性
在给定的示例编码文件中,最终编码文件 result.cnf 在 appmc 和 projMC 的计算中,都为 36288和给定的目标完全一致。
projMC 的程序好像是有数组越界的 BUG需要稍微把 p cnf 中的变量数量改的比实际变量的范围和数量要大一点才不会报错appmc 没有问题。
```
> approxmc --epsilon 0.05 result.cnf
c Total time (this thread) : 0.67
c [appmc+arjun] Total time: 0.67
c [appmc] Number of solutions is: 4536*2**3
s SATISFIABLE
s mc 36288
> ./binary/projMC_linux -fpv=name_nbvar.var result.cnf
c Projected Model Counter Information
c Number of recursive calls: 16
c Number of decomposable AND nodes: 17
c Number of UNSAT subproblems: 3
c Number of positive hits: 2
c
c Final time: 0.015772
c
s 36288
```
## 编码思路
对于基本可选特征值和特征族的编码,可以用传统方式直接编码,最麻烦的一个部分是约束条件的形式是一个没有任何特殊性质的数理逻辑表达式(&、|、~、=>、<=>、()、!),并且可以任意组合,因此需要构造一个通用的语法分析器。
### 语法分析
使用 LR(1)/LALR(1) 文法自动机对每个约束语句进行语法分析,按照数理逻辑的符号优先级定义规约顺序,并且规则设定为左结合优先,使二义性文法符合 LR(1) 文法,利用文法构造器,去生成语法分析代码框架。
### 语法制导
按照自底向上的语法制导方法,每次依次合并两个变量或者取反,用新的变量等价代替它,然后将新的变量压入栈中,这样会有状态数过多的问题。
实际上连续的析取和合取子句,只需要一个等价的变量去代替就可以了,因此构建一个新的类代表若干个子句的析取或合取式子,重载该类的所有操作,遇到必须合并的时候再整体等价为一个变量操作。

BIN
binary/projMC_linux Normal file

Binary file not shown.

2
build.sh Normal file
View File

@ -0,0 +1,2 @@
#!/bin/bash
g++ src/CalculatorParser.cpp src/Main.cpp src/Allocate.cpp src/CNF.cpp -O3 -std=c++17 -o encoder

View File

@ -0,0 +1,238 @@
序号,销售车型编码,特征族编码,是否必选
1,TEST01,A8088382906,
2,TEST01,A8088382908,
3,TEST01,A8088382909,
4,TEST01,A8088382910,
5,TEST01,A8088382912,
6,TEST01,A8088382915,
7,TEST01,A8088382919,
8,TEST01,A8088382920,
9,TEST01,A8088382923,
10,TEST01,A8088382928,
11,TEST01,A8088382930,
12,TEST01,A8088382933,
13,TEST01,A8088382934,
14,TEST01,A8088382936,
15,TEST01,A8088382939,
16,TEST01,A8088382940,
17,TEST01,A8088382942,
18,TEST01,A8088382945,
19,TEST01,A8088382947,
20,TEST01,A8088382948,
21,TEST01,A8088382949,
22,TEST01,A8088382953,
23,TEST01,A8088382954,
24,TEST01,A8088382955,
25,TEST01,A8088382956,
26,TEST01,A8088382959,
27,TEST01,A8088382960,
28,TEST01,A8088382961,
29,TEST01,A8088382971,
30,TEST01,A8088382972,
31,TEST01,A8088382974,
32,TEST01,A8088382977,
33,TEST01,A8088382982,
34,TEST01,A8088382984,
35,TEST01,A8088382986,
36,TEST01,A8088382987,
37,TEST01,A8088382988,
38,TEST01,A8088382989,
39,TEST01,A8088382991,
40,TEST01,A8088382992,
41,TEST01,A8088382993,
42,TEST01,A8088382994,
43,TEST01,A8088382996,
44,TEST01,A8088382997,
45,TEST01,A8088383002,
46,TEST01,A8088383005,
47,TEST01,A8088383009,
48,TEST01,A8088383010,
49,TEST01,A8088383011,
50,TEST01,A8088383012,
51,TEST01,A8088383014,
52,TEST01,A8088383018,
53,TEST01,A8088383019,
54,TEST01,A8088383020,
55,TEST01,A8088383021,
56,TEST01,A8088383022,
57,TEST01,A8088383024,
58,TEST01,A8088383029,
59,TEST01,A8088383030,
60,TEST01,A8088383034,
61,TEST01,A8088383036,
62,TEST01,A8088383037,
63,TEST01,A8088383039,
64,TEST01,A8088383040,
65,TEST01,A8088383042,
66,TEST01,A8088383043,
67,TEST01,A8088383046,
68,TEST01,A8088383047,
69,TEST01,A8088383048,
70,TEST01,A8088383049,
71,TEST01,A8088383050,
72,TEST01,A8088383051,
73,TEST01,A8088383054,
74,TEST01,A8088383057,
75,TEST01,A8088383059,
76,TEST01,A8088383064,
77,TEST01,A8088383067,
78,TEST01,A8088383068,
79,TEST01,A8088383070,
80,TEST01,A8088383071,
81,TEST01,A8088383072,
82,TEST01,A8088383073,
83,TEST01,A8088383075,
84,TEST01,A8088383083,
85,TEST01,A8088383084,
86,TEST01,A8088383085_AP-1,
87,TEST01,A8088383085_AP-2,
88,TEST01,A8088383085_AP-3,
89,TEST01,A8088383086,
90,TEST01,A8088383089,
91,TEST01,A8088383090,
92,TEST01,A8088383091,
93,TEST01,A8088383092,
94,TEST01,A8088383093,
95,TEST01,A8088383094,
96,TEST01,A8088383096,
97,TEST01,A8088383099,
98,TEST01,A8088383105,
99,TEST01,A8088383107,
100,TEST01,A8088383108,
101,TEST01,A8088383109,
102,TEST01,A8088383118,
103,TEST01,A8088383120,
104,TEST01,A8088383122,
105,TEST01,A8088383130,
106,TEST01,A8088383133,
107,TEST01,A8088383139,
108,TEST01,A8088383143,
109,TEST01,A8088383144,
110,TEST01,A8088383145,
111,TEST01,A8088383146,
112,TEST01,A8088383149,
113,TEST01,A8088383150,
114,TEST01,A8088383151,
115,TEST01,A8088383152,
116,TEST01,A8088383153,
117,TEST01,A8088383154,
118,TEST01,A8088383155,
119,TEST01,A8088383159,
120,TEST01,A8088383160,
121,TEST01,A8088383163,
122,TEST01,A8088383165,
123,TEST01,A8088383169,
124,TEST01,A8088383170,
125,TEST01,A8088383176,
126,TEST01,A8088383181,
127,TEST01,A8088383182,
128,TEST01,A8088383183,
129,TEST01,A8088383184,
130,TEST01,A8088383185,
131,TEST01,A8088383189,
132,TEST01,A8088383190,
133,TEST01,A8088383191,
134,TEST01,A8088389461,
135,TEST01,A8129009430,
136,TEST01,A8130212104,
137,TEST01,A8130218285,
138,TEST01,A8132534722,
139,TEST01,A8132565715,
140,TEST01,A8133696776,
141,TEST01,A8133703916,
142,TEST01,A8133728830,
143,TEST01,A8134836166,
144,TEST01,A8134856799,
145,TEST01,A8147586459,
146,TEST01,A8150106844,
147,TEST01,A8218592989,
148,TEST01,A8235299888,
149,TEST01,A8236984717,
150,TEST01,A8238806396,
151,TEST01,A8238822364,
152,TEST01,A8240441229,
153,TEST01,A8242038029,
154,TEST01,A8245325114,
155,TEST01,A8247709306,
156,TEST01,A8247710572,
157,TEST01,A8247710818,
158,TEST01,A8249270116,
159,TEST01,A8249270719,
160,TEST01,A8249270825,
161,TEST01,A8249271073,
162,TEST01,A8276674900,
163,TEST01,A8387261123,
164,TEST01,A8405143036,
165,TEST01,A8408490681,
166,TEST01,A8408492609,
167,TEST01,A8486081323,
168,TEST01,A8565145791,
169,TEST01,A8565155034,
170,TEST01,A8583136039,
171,TEST01,A8583148769,
172,TEST01,A8583224847,
173,TEST01,A8688949972,
174,TEST01,A8770692605,
175,TEST01,A8770692765,
176,TEST01,A8833045633,
177,TEST01,MB_2FT,
178,TEST01,MB_CK,
179,TEST01,MB_CMF,
180,TEST01,MB_DO,
181,TEST01,MB_EF,
182,TEST01,MB_FW,
183,TEST01,MB_TR,
184,TEST01,A8088382964,
185,TEST01,A8088382995,
186,TEST01,A8088383001,
187,TEST01,A8088383027,
188,TEST01,A8088383062,
189,TEST01,A8088383066,
190,TEST01,A8088383079,
191,TEST01,A8088383085_AP-R,
192,TEST01,A8088383087,
193,TEST01,A8088383095,
194,TEST01,A8088383097,
195,TEST01,A8088383104,
196,TEST01,A8088383106,
197,TEST01,A8088383129,
198,TEST01,A8088383134,
199,TEST01,A8088383142,
200,TEST01,A8088383158,
201,TEST01,A8088383161,
202,TEST01,A8088383171,
203,TEST01,A8132543233,
204,TEST01,A8132543303,
205,TEST01,A8132543712,
206,TEST01,A8133704162,
207,TEST01,A8133718802,
208,TEST01,A8134840666,
209,TEST01,A8134896521,
210,TEST01,A8134902324,
211,TEST01,A8218505828,
212,TEST01,A8218621069,
213,TEST01,A8219533203,
214,TEST01,A8219534112,
215,TEST01,A8219554553,
216,TEST01,A8223795058,
217,TEST01,A8236984887,
218,TEST01,A8238604496,
219,TEST01,A8238849646,
220,TEST01,A8238851748,
221,TEST01,A8238871437,
222,TEST01,A8303611888,
223,TEST01,A8405138477,
224,TEST01,A8469783998,
225,TEST01,A8620459012,
226,TEST01,A8633749842,
227,TEST01,A8695503860,
228,TEST01,A8718209024,
229,TEST01,A8741776772,
230,TEST01,A8827994616,
231,TEST01,MB_EX,
232,TEST01,MB_LW,
233,TEST01,MB_MT,
234,TEST01,MB_RS,
235,TEST01,MB_SM,
236,TEST01,MB_SW,
237,TEST01,MB_WT,
1 序号 销售车型编码 特征族编码 是否必选
2 1 TEST01 A8088382906
3 2 TEST01 A8088382908
4 3 TEST01 A8088382909
5 4 TEST01 A8088382910
6 5 TEST01 A8088382912
7 6 TEST01 A8088382915
8 7 TEST01 A8088382919
9 8 TEST01 A8088382920
10 9 TEST01 A8088382923
11 10 TEST01 A8088382928
12 11 TEST01 A8088382930
13 12 TEST01 A8088382933
14 13 TEST01 A8088382934
15 14 TEST01 A8088382936
16 15 TEST01 A8088382939
17 16 TEST01 A8088382940
18 17 TEST01 A8088382942
19 18 TEST01 A8088382945
20 19 TEST01 A8088382947
21 20 TEST01 A8088382948
22 21 TEST01 A8088382949
23 22 TEST01 A8088382953
24 23 TEST01 A8088382954
25 24 TEST01 A8088382955
26 25 TEST01 A8088382956
27 26 TEST01 A8088382959
28 27 TEST01 A8088382960
29 28 TEST01 A8088382961
30 29 TEST01 A8088382971
31 30 TEST01 A8088382972
32 31 TEST01 A8088382974
33 32 TEST01 A8088382977
34 33 TEST01 A8088382982
35 34 TEST01 A8088382984
36 35 TEST01 A8088382986
37 36 TEST01 A8088382987
38 37 TEST01 A8088382988
39 38 TEST01 A8088382989
40 39 TEST01 A8088382991
41 40 TEST01 A8088382992
42 41 TEST01 A8088382993
43 42 TEST01 A8088382994
44 43 TEST01 A8088382996
45 44 TEST01 A8088382997
46 45 TEST01 A8088383002
47 46 TEST01 A8088383005
48 47 TEST01 A8088383009
49 48 TEST01 A8088383010
50 49 TEST01 A8088383011
51 50 TEST01 A8088383012
52 51 TEST01 A8088383014
53 52 TEST01 A8088383018
54 53 TEST01 A8088383019
55 54 TEST01 A8088383020
56 55 TEST01 A8088383021
57 56 TEST01 A8088383022
58 57 TEST01 A8088383024
59 58 TEST01 A8088383029
60 59 TEST01 A8088383030
61 60 TEST01 A8088383034
62 61 TEST01 A8088383036
63 62 TEST01 A8088383037
64 63 TEST01 A8088383039
65 64 TEST01 A8088383040
66 65 TEST01 A8088383042
67 66 TEST01 A8088383043
68 67 TEST01 A8088383046
69 68 TEST01 A8088383047
70 69 TEST01 A8088383048
71 70 TEST01 A8088383049
72 71 TEST01 A8088383050
73 72 TEST01 A8088383051
74 73 TEST01 A8088383054
75 74 TEST01 A8088383057
76 75 TEST01 A8088383059
77 76 TEST01 A8088383064
78 77 TEST01 A8088383067
79 78 TEST01 A8088383068
80 79 TEST01 A8088383070
81 80 TEST01 A8088383071
82 81 TEST01 A8088383072
83 82 TEST01 A8088383073
84 83 TEST01 A8088383075
85 84 TEST01 A8088383083
86 85 TEST01 A8088383084
87 86 TEST01 A8088383085_AP-1
88 87 TEST01 A8088383085_AP-2
89 88 TEST01 A8088383085_AP-3
90 89 TEST01 A8088383086
91 90 TEST01 A8088383089
92 91 TEST01 A8088383090
93 92 TEST01 A8088383091
94 93 TEST01 A8088383092
95 94 TEST01 A8088383093
96 95 TEST01 A8088383094
97 96 TEST01 A8088383096
98 97 TEST01 A8088383099
99 98 TEST01 A8088383105
100 99 TEST01 A8088383107
101 100 TEST01 A8088383108
102 101 TEST01 A8088383109
103 102 TEST01 A8088383118
104 103 TEST01 A8088383120
105 104 TEST01 A8088383122
106 105 TEST01 A8088383130
107 106 TEST01 A8088383133
108 107 TEST01 A8088383139
109 108 TEST01 A8088383143
110 109 TEST01 A8088383144
111 110 TEST01 A8088383145
112 111 TEST01 A8088383146
113 112 TEST01 A8088383149
114 113 TEST01 A8088383150
115 114 TEST01 A8088383151
116 115 TEST01 A8088383152
117 116 TEST01 A8088383153
118 117 TEST01 A8088383154
119 118 TEST01 A8088383155
120 119 TEST01 A8088383159
121 120 TEST01 A8088383160
122 121 TEST01 A8088383163
123 122 TEST01 A8088383165
124 123 TEST01 A8088383169
125 124 TEST01 A8088383170
126 125 TEST01 A8088383176
127 126 TEST01 A8088383181
128 127 TEST01 A8088383182
129 128 TEST01 A8088383183
130 129 TEST01 A8088383184
131 130 TEST01 A8088383185
132 131 TEST01 A8088383189
133 132 TEST01 A8088383190
134 133 TEST01 A8088383191
135 134 TEST01 A8088389461
136 135 TEST01 A8129009430
137 136 TEST01 A8130212104
138 137 TEST01 A8130218285
139 138 TEST01 A8132534722
140 139 TEST01 A8132565715
141 140 TEST01 A8133696776
142 141 TEST01 A8133703916
143 142 TEST01 A8133728830
144 143 TEST01 A8134836166
145 144 TEST01 A8134856799
146 145 TEST01 A8147586459
147 146 TEST01 A8150106844
148 147 TEST01 A8218592989
149 148 TEST01 A8235299888
150 149 TEST01 A8236984717
151 150 TEST01 A8238806396
152 151 TEST01 A8238822364
153 152 TEST01 A8240441229
154 153 TEST01 A8242038029
155 154 TEST01 A8245325114
156 155 TEST01 A8247709306
157 156 TEST01 A8247710572
158 157 TEST01 A8247710818
159 158 TEST01 A8249270116
160 159 TEST01 A8249270719
161 160 TEST01 A8249270825
162 161 TEST01 A8249271073
163 162 TEST01 A8276674900
164 163 TEST01 A8387261123
165 164 TEST01 A8405143036
166 165 TEST01 A8408490681
167 166 TEST01 A8408492609
168 167 TEST01 A8486081323
169 168 TEST01 A8565145791
170 169 TEST01 A8565155034
171 170 TEST01 A8583136039
172 171 TEST01 A8583148769
173 172 TEST01 A8583224847
174 173 TEST01 A8688949972
175 174 TEST01 A8770692605
176 175 TEST01 A8770692765
177 176 TEST01 A8833045633
178 177 TEST01 MB_2FT
179 178 TEST01 MB_CK
180 179 TEST01 MB_CMF
181 180 TEST01 MB_DO
182 181 TEST01 MB_EF
183 182 TEST01 MB_FW
184 183 TEST01 MB_TR
185 184 TEST01 A8088382964
186 185 TEST01 A8088382995
187 186 TEST01 A8088383001
188 187 TEST01 A8088383027
189 188 TEST01 A8088383062
190 189 TEST01 A8088383066
191 190 TEST01 A8088383079
192 191 TEST01 A8088383085_AP-R
193 192 TEST01 A8088383087
194 193 TEST01 A8088383095
195 194 TEST01 A8088383097
196 195 TEST01 A8088383104
197 196 TEST01 A8088383106
198 197 TEST01 A8088383129
199 198 TEST01 A8088383134
200 199 TEST01 A8088383142
201 200 TEST01 A8088383158
202 201 TEST01 A8088383161
203 202 TEST01 A8088383171
204 203 TEST01 A8132543233
205 204 TEST01 A8132543303
206 205 TEST01 A8132543712
207 206 TEST01 A8133704162
208 207 TEST01 A8133718802
209 208 TEST01 A8134840666
210 209 TEST01 A8134896521
211 210 TEST01 A8134902324
212 211 TEST01 A8218505828
213 212 TEST01 A8218621069
214 213 TEST01 A8219533203
215 214 TEST01 A8219534112
216 215 TEST01 A8219554553
217 216 TEST01 A8223795058
218 217 TEST01 A8236984887
219 218 TEST01 A8238604496
220 219 TEST01 A8238849646
221 220 TEST01 A8238851748
222 221 TEST01 A8238871437
223 222 TEST01 A8303611888
224 223 TEST01 A8405138477
225 224 TEST01 A8469783998
226 225 TEST01 A8620459012
227 226 TEST01 A8633749842
228 227 TEST01 A8695503860
229 228 TEST01 A8718209024
230 229 TEST01 A8741776772
231 230 TEST01 A8827994616
232 231 TEST01 MB_EX
233 232 TEST01 MB_LW
234 233 TEST01 MB_MT
235 234 TEST01 MB_RS
236 235 TEST01 MB_SM
237 236 TEST01 MB_SW
238 237 TEST01 MB_WT

Binary file not shown.

318
data/销售配置表.csv Normal file
View File

@ -0,0 +1,318 @@
序号,特征族编码,特征徝编码,TEST01,,,符合条件数量36288,参与穷举特征族
1,A8088382906,F2H,S,,,,A8134836166
2,A8088382908,D0S,S,,,,A8387261123
3,A8088382909,D8L,S,,,,A8238851748
4,A8088382910,M8Y,S,,,,A8088382936
5,A8088382912,X3H,S,,,,A8633749842
6,A8088382915,K0W,S,,,,A8088383105
7,A8088382919,S1L,S,,,,A8088383027
8,A8088382920,F5Y,S,,,,A8088383104
9,A8088382923,M5D,S,,,,A8088382933
10,A8088382928,Z4P,S,,,,A8088383153
11,A8088382930,I6X,S,,,,A8219534112
12,A8088382933,J5R,S,,,,A8088383154
13,A8088382934,W2U,S,,,,A8129009430
14,A8088382936,D4T,S,,,,A8695503860
15,A8088382939,A1G,S,,,,A8238604496
16,A8088382940,S8C,S,,,,A8088383085_AP-R
17,A8088382942,K0T,S,,,,A8132543303
18,A8088382945,R1Q,S,,,,A8088382964
19,A8088382945,R7S,O,,,,A8088383142
20,A8088382947,U1S,S,,,,A8088383185
21,A8088382948,Q0R,-,,,,A8088383064
22,A8088382948,Q4K,S,,,,A8219554553
23,A8088382949,D3F,S,,,,A8088383062
24,A8088382953,Q5J,-,,,,A8134896521
25,A8088382953,Q5U,S,,,,A8088383146
26,A8088382954,M6M,S,,,,A8088383068
27,A8088382955,C6K,S,,,,A8088383189
28,A8088382956,Q1K,S,,,,A8088383067
29,A8088382959,E1K,O,,,,A8088383143
30,A8088382959,E1L,S,,,,A8088383066
31,A8088382960,S5Z,S,,,,A8088382915
32,A8088382961,S1D,S,,,,A8088382959
33,A8088382964,D4Y,S,,,,A8827994616
34,A8088382964,D4Z,O,,,,A8088383085_AP-1
35,A8088382971,F4Y,S,,,,A8088383085_AP-2
36,A8088382972,C6C,S,,,,A8088383085_AP-3
37,A8088382974,H8X,S,,,,A8088382995
38,A8088382977,Z5X,S,,,,A8088383005
39,A8088382982,D6F,S,,,,A8088383049
40,A8088382982,D6G,O,,,,A8088382994
41,A8088382984,J1V,S,,,,A8132543712
42,A8088382986,Y4Z,S,,,,A8620459012
43,A8088382987,F4I,S,,,,A8132543233
44,A8088382988,G1W,-,,,,A8088382997
45,A8088382988,G1X,-,,,,A8088382953
46,A8088382988,G2B,-,,,,A8088383129
47,A8088382988,G2E,S,,,,A8088383097
48,A8088382989,I1W,S,,,,A8088383095
49,A8088382989,I2F,O,,,,A8132534722
50,A8088382991,F2A,S,,,,A8088383134
51,A8088382992,G5A,S,,,,A8150106844
52,A8088382993,K3M,S,,,,A8088383176
53,A8088382994,D1N,S,,,,A8088383094
54,A8088382994,D2D,O,,,,A8088383171
55,A8088382995,D6I,-,,,,A8088383050
56,A8088382996,F2W,S,,,,A8088382948
57,A8088382997,K2R,S,,,,A8088382908
58,A8088382997,K8M,-,,,,A8088382909
59,A8088382997,K8T,-,,,,A8303611888
60,A8088383001,S8B,O,,,,A8133718802
61,A8088383002,B1F,S,,,,A8088382982
62,A8088383005,I1V,S,,,,A8134902324
63,A8088383005,I2E,O,,,,A8088383158
64,A8088383009,B4L,-,,,,A8218592989
65,A8088383009,B4M,S,,,,A8088382945
66,A8088383010,S1H,S,,,,A8088382989
67,A8088383011,C8B,S,,,,A8223795058
68,A8088383012,M4A,-,,,,A8088382986
69,A8088383012,M4B,-,,,,A8088383087
70,A8088383012,Z5E,S,,,,A8133703916
71,A8088383014,M7I,S,,,,A8088383084
72,A8088383018,F1R,S,,,,A8405138477
73,A8088383019,IZY,S,,,,A8238806396
74,A8088383020,E0P,S,,,,A8218621069
75,A8088383021,O0A,S,,,,A8088383089
76,A8088383022,O1X,S,,,,A8088383165
77,A8088383024,C5P,S,,,,A8088383083
78,A8088383027,U2I,O,,,,
79,A8088383029,G5G,S,,,,
80,A8088383030,F1I,S,,,,
81,A8088383034,U1W,S,,,,
82,A8088383036,F0X,S,,,,
83,A8088383037,Q6Z,S,,,,
84,A8088383039,F2P,S,,,,
85,A8088383040,F7A,S,,,,
86,A8088383042,O1Y,S,,,,
87,A8088383043,A5D,O,,,,
88,A8088383043,A6Y,S,,,,
89,A8088383046,I4I,S,,,,
90,A8088383047,D2Y,S,,,,
91,A8088383048,I6N,S,,,,
92,A8088383049,F3B,S,,,,
93,A8088383049,F3C,O,,,,
94,A8088383050,B1B,O,,,,
95,A8088383050,B1U,S,,,,
96,A8088383051,F6C,S,,,,
97,A8088383054,C7F,S,,,,
98,A8088383057,B2A,S,,,,
99,A8088383059,C1N,S,,,,
100,A8088383062,D6M,-,,,,
101,A8088383064,J2I,S,,,,
102,A8088383064,J2K,O,,,,
103,A8088383066,Q0A,O,,,,
104,A8088383067,Q0W,S,,,,
105,A8088383068,S1P,S,,,,
106,A8088383068,S1W,O,,,,
107,A8088383070,A1Z,S,,,,
108,A8088383071,I6K,S,,,,
109,A8088383072,J3V,S,,,,
110,A8088383073,B5I,S,,,,
111,A8088383075,E3L,S,,,,
112,A8088383079,B3J,-,,,,
113,A8088383083,Q6D,S,,,,
114,A8088383084,F3W,S,,,,
115,A8088383084,F3Y,O,,,,
116,A8088383085_AP-1,F38MEA 0C,O,,,,
117,A8088383085_AP-1,F58L96 81,-,,,,
118,A8088383085_AP-1,F58LFA 0C,-,,,,
119,A8088383085_AP-1,F58MEA 0C,-,,,,
120,A8088383085_AP-1,V18MEA 0C,S,,,,
121,A8088383085_AP-2,AP-2 F38MFA 0C,O,,,,
122,A8088383085_AP-2,AP-2 F58L96 81,-,,,,
123,A8088383085_AP-2,AP-2 F58L98 81,-,,,,
124,A8088383085_AP-2,AP-2 V18MFA 0C,S,,,,
125,A8088383085_AP-3,AP-3 F38MFA 0C,O,,,,
126,A8088383085_AP-3,AP-3 F58L96 81,-,,,,
127,A8088383085_AP-3,AP-3 F58L98 81,-,,,,
128,A8088383085_AP-3,AP-3 V18MFA 0C,S,,,,
129,A8088383085_AP-R,AP-B F38MEA 0C,O,,,,
130,A8088383085_AP-R,AP-B F38MFA 0C,-,,,,
131,A8088383085_AP-R,AP-B F58L96 81,-,,,,
132,A8088383085_AP-R,AP-B F58L98 81,-,,,,
133,A8088383085_AP-R,AP-B F58LFA 0C,-,,,,
134,A8088383085_AP-R,AP-B F58MEA 0C,-,,,,
135,A8088383085_AP-R,AP-B V18MEA 0C,O,,,,
136,A8088383085_AP-R,AP-B V18MFA 0C,-,,,,
137,A8088383086,C6I,S,,,,
138,A8088383087,D7J,O,,,,
139,A8088383089,Q4X,S,,,,
140,A8088383090,M5C,S,,,,
141,A8088383091,D3C,S,,,,
142,A8088383092,C5B,S,,,,
143,A8088383093,F7T,S,,,,
144,A8088383094,K4X,S,,,,
145,A8088383094,K8K,-,,,,
146,A8088383094,K8L,-,,,,
147,A8088383094,K8N,-,,,,
148,A8088383095,D7A,-,,,,
149,A8088383096,F7X,S,,,,
150,A8088383097,F5L,O,,,,
151,A8088383099,K5Q,S,,,,
152,A8088383104,L1H,O,,,,
153,A8088383105,J1H,S,,,,
154,A8088383106,M0E,-,,,,
155,A8088383107,B1G,S,,,,
156,A8088383108,M8B,S,,,,
157,A8088383109,Z2H,S,,,,
158,A8088383118,I6D,S,,,,
159,A8088383120,E6I,S,,,,
160,A8088383122,M7T,S,,,,
161,A8088383129,R8P,O,,,,
162,A8088383130,E1N,S,,,,
163,A8088383133,A2U,S,,,,
164,A8088383134,R8F,O,,,,
165,A8088383139,F8E,S,,,,
166,A8088383142,Y1X,O,,,,
167,A8088383143,Y4A,S,,,,
168,A8088383144,I5F,S,,,,
169,A8088383145,L3A,S,,,,
170,A8088383146,D1E,S,,,,
171,A8088383146,D1R,O,,,,
172,A8088383146,D2E,O,,,,
173,A8088383149,L1B,S,,,,
174,A8088383150,F7C,S,,,,
175,A8088383151,Z4M,-,,,,
176,A8088383151,Z5I,S,,,,
177,A8088383152,K7N,S,,,,
178,A8088383153,F5B,S,,,,
179,A8088383154,E7F,S,,,,
180,A8088383155,X2T,S,,,,
181,A8088383158,E0D,O,,,,
182,A8088383159,IZS,S,,,,
183,A8088383160,Z5Q,S,,,,
184,A8088383161,C8H,S,,,,
185,A8088383163,C5D,S,,,,
186,A8088383165,H1J,S,,,,
187,A8088383169,C6Q,S,,,,
188,A8088383170,Z5Y,S,,,,
189,A8088383171,Z4R,-,,,,
190,A8088383176,J6A,S,,,,
191,A8088383176,J6C,-,,,,
192,A8088383181,M5V,S,,,,
193,A8088383182,D7R,S,,,,
194,A8088383183,F6I,S,,,,
195,A8088383184,C8I,S,,,,
196,A8088383185,K5M,S,,,,
197,A8088383189,S5A,S,,,,
198,A8088383189,S5E,-,,,,
199,A8088383189,S5M,O,,,,
200,A8088383190,C0A,S,,,,
201,A8088383191,D2V,S,,,,
202,A8088389461,DUP0,S,,,,
203,A8129009430,B5C,S,,,,
204,A8130212104,C8Y,S,,,,
205,A8130218285,D0L,S,,,,
206,A8132534722,D4U,S,,,,
207,A8132543233,D5B,O,,,,
208,A8132543303,D5Z,O,,,,
209,A8132543712,D6C,-,,,,
210,A8132565715,D7G,S,,,,
211,A8133696776,E3Q,S,,,,
212,A8133703916,E5J,S,,,,
213,A8133704162,E5K,-,,,,
214,A8133718802,F0T,O,,,,
215,A8133728830,F4Z,S,,,,
216,A8134836166,F6Q,S,,,,
217,A8134836166,F6R,O,,,,
218,A8134840666,F6T,-,,,,
219,A8134856799,F8B,S,,,,
220,A8134896521,F8W,O,,,,
221,A8134902324,G0L,-,,,,
222,A8134902324,G0T,O,,,,
223,A8147586459,M5F,S,,,,
224,A8150106844,Q0X,S,,,,
225,A8218505828,A9X,-,,,,
226,A8218592989,Q0Y,S,,,,
227,A8218621069,S1I,O,,,,
228,A8219533203,S1R,O,,,,
229,A8219534112,S6G,O,,,,
230,A8219534112,S6H,O,,,,
231,A8219554553,S3A,O,,,,
232,A8223795058,L1G,O,,,,
233,A8235299888,S8E,S,,,,
234,A8236984717,Y4J,S,,,,
235,A8236984887,Y4W,-,,,,
236,A8238604496,D4N,O,,,,
237,A8238806396,E2Y,S,,,,
238,A8238822364,E8A,S,,,,
239,A8238849646,Q3V,-,,,,
240,A8238851748,R0Q,O,,,,
241,A8238871437,V5N,-,,,,
242,A8240441229,S2B,S,,,,
243,A8242038029,Z3H,S,,,,
244,A8245325114,X3D,S,,,,
245,A8245325114,X3E,-,,,,
246,A8247709306,I8R,S,,,,
247,A8247710572,IYY,S,,,,
248,A8247710818,IZG,S,,,,
249,A8249270116,M1U,-,,,,
250,A8249270116,M1V,-,,,,
251,A8249270116,M1W,-,,,,
252,A8249270116,M1X,-,,,,
253,A8249270116,M1Y,-,,,,
254,A8249270116,M3A,-,,,,
255,A8249270116,M3B,-,,,,
256,A8249270116,M3C,-,,,,
257,A8249270116,M3D,-,,,,
258,A8249270116,M3E,S,,,,
259,A8249270719,V2B,S,,,,
260,A8249270825,V1A,S,,,,
261,A8249271073,ZZT,S,,,,
262,A8276674900,O5Q,S,,,,
263,A8303611888,D0A,O,,,,
264,A8387261123,U3W,S,,,,
265,A8405138477,F8V,O,,,,
266,A8405143036,Z3J,S,,,,
267,A8408490681,J8O,S,,,,
268,A8408492609,J8Q,S,,,,
269,A8469783998,Z4J,-,,,,
270,A8486081323,G5L,S,,,,
271,A8565145791,U2G,S,,,,
272,A8565155034,U2S,S,,,,
273,A8583136039,G0K,S,,,,
274,A8583148769,U1E,S,,,,
275,A8583148769,U1F,O,,,,
276,A8583224847,U9Z,S,,,,
277,A8620459012,E3W,-,,,,
278,A8633749842,S1G,-,,,,
279,A8688949972,Z4K,S,,,,
280,A8695503860,S2M,O,,,,
281,A8718209024,M6E,-,,,,
282,A8741776772,C8M,O,,,,
283,A8770692605,I8M,S,,,,
284,A8770692605,I8N,-,,,,
285,A8770692765,I8O,-,,,,
286,A8770692765,I8P,S,,,,
287,A8827994616,F3Z,-,,,,
288,A8833045633,M0C,S,,,,
289,MB_2FT,MB_2FT_A42_B64/62/4,-,,,,
290,MB_2FT,MB_2FT_A64/62,S,,,,
291,MB_2FT,MB_2FT_WT_A64/62,-,,,,
292,MB_2FT,MB_2FT_WT_B64/62,-,,,,
293,MB_CK,MB_CK_C,S,,,,
294,MB_CMF,MB_CMF_C,S,,,,
295,MB_CMF,MB_CMF_T,O,,,,
296,MB_CMF,MB_CMF_TP,O,,,,
297,MB_DO,MB_DO_C,S,,,,
298,MB_DO,MB_DO_T,O,,,,
299,MB_EF,MB_EF_C,S,,,,
300,MB_EF,MB_EF_T_A,O,,,,
301,MB_EF,MB_EF_T_B,-,,,,
302,MB_EX,MB_EX_C,O,,,,
303,MB_EX,MB_EX_ST_A,O,,,,
304,MB_EX,MB_EX_T_A,O,,,,
305,MB_EX,MB_EX_T_B,-,,,,
306,MB_EX,MB_EX_T_B_B1,O,,,,
307,MB_FW,MB_FW_JO_6X4/6X2,S,,,,
308,MB_LW,MB_LW_A/B_B1,O,,,,
309,MB_MT,MB_MT_A/B,O,,,,
310,MB_RS,MB_RS_A/B,O,,,,
311,MB_SM,MB_SM_A/B,-,,,,
312,MB_SW,MB_SW_G70,O,,,,
313,MB_SW,MB_SW_G80,O,,,,
314,MB_TR,MB_TR_G70_6x4,O,,,,
315,MB_TR,MB_TR_G80_6x4,S,,,,
316,MB_WT,MB_WT_A_64/62,-,,,,
317,MB_WT,MB_WT_B_64/62,-,,,,
1 序号 特征族编码 特征徝编码 TEST01 符合条件数量36288 参与穷举特征族
2 1 A8088382906 F2H S A8134836166
3 2 A8088382908 D0S S A8387261123
4 3 A8088382909 D8L S A8238851748
5 4 A8088382910 M8Y S A8088382936
6 5 A8088382912 X3H S A8633749842
7 6 A8088382915 K0W S A8088383105
8 7 A8088382919 S1L S A8088383027
9 8 A8088382920 F5Y S A8088383104
10 9 A8088382923 M5D S A8088382933
11 10 A8088382928 Z4P S A8088383153
12 11 A8088382930 I6X S A8219534112
13 12 A8088382933 J5R S A8088383154
14 13 A8088382934 W2U S A8129009430
15 14 A8088382936 D4T S A8695503860
16 15 A8088382939 A1G S A8238604496
17 16 A8088382940 S8C S A8088383085_AP-R
18 17 A8088382942 K0T S A8132543303
19 18 A8088382945 R1Q S A8088382964
20 19 A8088382945 R7S O A8088383142
21 20 A8088382947 U1S S A8088383185
22 21 A8088382948 Q0R - A8088383064
23 22 A8088382948 Q4K S A8219554553
24 23 A8088382949 D3F S A8088383062
25 24 A8088382953 Q5J - A8134896521
26 25 A8088382953 Q5U S A8088383146
27 26 A8088382954 M6M S A8088383068
28 27 A8088382955 C6K S A8088383189
29 28 A8088382956 Q1K S A8088383067
30 29 A8088382959 E1K O A8088383143
31 30 A8088382959 E1L S A8088383066
32 31 A8088382960 S5Z S A8088382915
33 32 A8088382961 S1D S A8088382959
34 33 A8088382964 D4Y S A8827994616
35 34 A8088382964 D4Z O A8088383085_AP-1
36 35 A8088382971 F4Y S A8088383085_AP-2
37 36 A8088382972 C6C S A8088383085_AP-3
38 37 A8088382974 H8X S A8088382995
39 38 A8088382977 Z5X S A8088383005
40 39 A8088382982 D6F S A8088383049
41 40 A8088382982 D6G O A8088382994
42 41 A8088382984 J1V S A8132543712
43 42 A8088382986 Y4Z S A8620459012
44 43 A8088382987 F4I S A8132543233
45 44 A8088382988 G1W - A8088382997
46 45 A8088382988 G1X - A8088382953
47 46 A8088382988 G2B - A8088383129
48 47 A8088382988 G2E S A8088383097
49 48 A8088382989 I1W S A8088383095
50 49 A8088382989 I2F O A8132534722
51 50 A8088382991 F2A S A8088383134
52 51 A8088382992 G5A S A8150106844
53 52 A8088382993 K3M S A8088383176
54 53 A8088382994 D1N S A8088383094
55 54 A8088382994 D2D O A8088383171
56 55 A8088382995 D6I - A8088383050
57 56 A8088382996 F2W S A8088382948
58 57 A8088382997 K2R S A8088382908
59 58 A8088382997 K8M - A8088382909
60 59 A8088382997 K8T - A8303611888
61 60 A8088383001 S8B O A8133718802
62 61 A8088383002 B1F S A8088382982
63 62 A8088383005 I1V S A8134902324
64 63 A8088383005 I2E O A8088383158
65 64 A8088383009 B4L - A8218592989
66 65 A8088383009 B4M S A8088382945
67 66 A8088383010 S1H S A8088382989
68 67 A8088383011 C8B S A8223795058
69 68 A8088383012 M4A - A8088382986
70 69 A8088383012 M4B - A8088383087
71 70 A8088383012 Z5E S A8133703916
72 71 A8088383014 M7I S A8088383084
73 72 A8088383018 F1R S A8405138477
74 73 A8088383019 IZY S A8238806396
75 74 A8088383020 E0P S A8218621069
76 75 A8088383021 O0A S A8088383089
77 76 A8088383022 O1X S A8088383165
78 77 A8088383024 C5P S A8088383083
79 78 A8088383027 U2I O
80 79 A8088383029 G5G S
81 80 A8088383030 F1I S
82 81 A8088383034 U1W S
83 82 A8088383036 F0X S
84 83 A8088383037 Q6Z S
85 84 A8088383039 F2P S
86 85 A8088383040 F7A S
87 86 A8088383042 O1Y S
88 87 A8088383043 A5D O
89 88 A8088383043 A6Y S
90 89 A8088383046 I4I S
91 90 A8088383047 D2Y S
92 91 A8088383048 I6N S
93 92 A8088383049 F3B S
94 93 A8088383049 F3C O
95 94 A8088383050 B1B O
96 95 A8088383050 B1U S
97 96 A8088383051 F6C S
98 97 A8088383054 C7F S
99 98 A8088383057 B2A S
100 99 A8088383059 C1N S
101 100 A8088383062 D6M -
102 101 A8088383064 J2I S
103 102 A8088383064 J2K O
104 103 A8088383066 Q0A O
105 104 A8088383067 Q0W S
106 105 A8088383068 S1P S
107 106 A8088383068 S1W O
108 107 A8088383070 A1Z S
109 108 A8088383071 I6K S
110 109 A8088383072 J3V S
111 110 A8088383073 B5I S
112 111 A8088383075 E3L S
113 112 A8088383079 B3J -
114 113 A8088383083 Q6D S
115 114 A8088383084 F3W S
116 115 A8088383084 F3Y O
117 116 A8088383085_AP-1 F38MEA 0C O
118 117 A8088383085_AP-1 F58L96 81 -
119 118 A8088383085_AP-1 F58LFA 0C -
120 119 A8088383085_AP-1 F58MEA 0C -
121 120 A8088383085_AP-1 V18MEA 0C S
122 121 A8088383085_AP-2 AP-2 F38MFA 0C O
123 122 A8088383085_AP-2 AP-2 F58L96 81 -
124 123 A8088383085_AP-2 AP-2 F58L98 81 -
125 124 A8088383085_AP-2 AP-2 V18MFA 0C S
126 125 A8088383085_AP-3 AP-3 F38MFA 0C O
127 126 A8088383085_AP-3 AP-3 F58L96 81 -
128 127 A8088383085_AP-3 AP-3 F58L98 81 -
129 128 A8088383085_AP-3 AP-3 V18MFA 0C S
130 129 A8088383085_AP-R AP-B F38MEA 0C O
131 130 A8088383085_AP-R AP-B F38MFA 0C -
132 131 A8088383085_AP-R AP-B F58L96 81 -
133 132 A8088383085_AP-R AP-B F58L98 81 -
134 133 A8088383085_AP-R AP-B F58LFA 0C -
135 134 A8088383085_AP-R AP-B F58MEA 0C -
136 135 A8088383085_AP-R AP-B V18MEA 0C O
137 136 A8088383085_AP-R AP-B V18MFA 0C -
138 137 A8088383086 C6I S
139 138 A8088383087 D7J O
140 139 A8088383089 Q4X S
141 140 A8088383090 M5C S
142 141 A8088383091 D3C S
143 142 A8088383092 C5B S
144 143 A8088383093 F7T S
145 144 A8088383094 K4X S
146 145 A8088383094 K8K -
147 146 A8088383094 K8L -
148 147 A8088383094 K8N -
149 148 A8088383095 D7A -
150 149 A8088383096 F7X S
151 150 A8088383097 F5L O
152 151 A8088383099 K5Q S
153 152 A8088383104 L1H O
154 153 A8088383105 J1H S
155 154 A8088383106 M0E -
156 155 A8088383107 B1G S
157 156 A8088383108 M8B S
158 157 A8088383109 Z2H S
159 158 A8088383118 I6D S
160 159 A8088383120 E6I S
161 160 A8088383122 M7T S
162 161 A8088383129 R8P O
163 162 A8088383130 E1N S
164 163 A8088383133 A2U S
165 164 A8088383134 R8F O
166 165 A8088383139 F8E S
167 166 A8088383142 Y1X O
168 167 A8088383143 Y4A S
169 168 A8088383144 I5F S
170 169 A8088383145 L3A S
171 170 A8088383146 D1E S
172 171 A8088383146 D1R O
173 172 A8088383146 D2E O
174 173 A8088383149 L1B S
175 174 A8088383150 F7C S
176 175 A8088383151 Z4M -
177 176 A8088383151 Z5I S
178 177 A8088383152 K7N S
179 178 A8088383153 F5B S
180 179 A8088383154 E7F S
181 180 A8088383155 X2T S
182 181 A8088383158 E0D O
183 182 A8088383159 IZS S
184 183 A8088383160 Z5Q S
185 184 A8088383161 C8H S
186 185 A8088383163 C5D S
187 186 A8088383165 H1J S
188 187 A8088383169 C6Q S
189 188 A8088383170 Z5Y S
190 189 A8088383171 Z4R -
191 190 A8088383176 J6A S
192 191 A8088383176 J6C -
193 192 A8088383181 M5V S
194 193 A8088383182 D7R S
195 194 A8088383183 F6I S
196 195 A8088383184 C8I S
197 196 A8088383185 K5M S
198 197 A8088383189 S5A S
199 198 A8088383189 S5E -
200 199 A8088383189 S5M O
201 200 A8088383190 C0A S
202 201 A8088383191 D2V S
203 202 A8088389461 DUP0 S
204 203 A8129009430 B5C S
205 204 A8130212104 C8Y S
206 205 A8130218285 D0L S
207 206 A8132534722 D4U S
208 207 A8132543233 D5B O
209 208 A8132543303 D5Z O
210 209 A8132543712 D6C -
211 210 A8132565715 D7G S
212 211 A8133696776 E3Q S
213 212 A8133703916 E5J S
214 213 A8133704162 E5K -
215 214 A8133718802 F0T O
216 215 A8133728830 F4Z S
217 216 A8134836166 F6Q S
218 217 A8134836166 F6R O
219 218 A8134840666 F6T -
220 219 A8134856799 F8B S
221 220 A8134896521 F8W O
222 221 A8134902324 G0L -
223 222 A8134902324 G0T O
224 223 A8147586459 M5F S
225 224 A8150106844 Q0X S
226 225 A8218505828 A9X -
227 226 A8218592989 Q0Y S
228 227 A8218621069 S1I O
229 228 A8219533203 S1R O
230 229 A8219534112 S6G O
231 230 A8219534112 S6H O
232 231 A8219554553 S3A O
233 232 A8223795058 L1G O
234 233 A8235299888 S8E S
235 234 A8236984717 Y4J S
236 235 A8236984887 Y4W -
237 236 A8238604496 D4N O
238 237 A8238806396 E2Y S
239 238 A8238822364 E8A S
240 239 A8238849646 Q3V -
241 240 A8238851748 R0Q O
242 241 A8238871437 V5N -
243 242 A8240441229 S2B S
244 243 A8242038029 Z3H S
245 244 A8245325114 X3D S
246 245 A8245325114 X3E -
247 246 A8247709306 I8R S
248 247 A8247710572 IYY S
249 248 A8247710818 IZG S
250 249 A8249270116 M1U -
251 250 A8249270116 M1V -
252 251 A8249270116 M1W -
253 252 A8249270116 M1X -
254 253 A8249270116 M1Y -
255 254 A8249270116 M3A -
256 255 A8249270116 M3B -
257 256 A8249270116 M3C -
258 257 A8249270116 M3D -
259 258 A8249270116 M3E S
260 259 A8249270719 V2B S
261 260 A8249270825 V1A S
262 261 A8249271073 ZZT S
263 262 A8276674900 O5Q S
264 263 A8303611888 D0A O
265 264 A8387261123 U3W S
266 265 A8405138477 F8V O
267 266 A8405143036 Z3J S
268 267 A8408490681 J8O S
269 268 A8408492609 J8Q S
270 269 A8469783998 Z4J -
271 270 A8486081323 G5L S
272 271 A8565145791 U2G S
273 272 A8565155034 U2S S
274 273 A8583136039 G0K S
275 274 A8583148769 U1E S
276 275 A8583148769 U1F O
277 276 A8583224847 U9Z S
278 277 A8620459012 E3W -
279 278 A8633749842 S1G -
280 279 A8688949972 Z4K S
281 280 A8695503860 S2M O
282 281 A8718209024 M6E -
283 282 A8741776772 C8M O
284 283 A8770692605 I8M S
285 284 A8770692605 I8N -
286 285 A8770692765 I8O -
287 286 A8770692765 I8P S
288 287 A8827994616 F3Z -
289 288 A8833045633 M0C S
290 289 MB_2FT MB_2FT_A42_B64/62/4 -
291 290 MB_2FT MB_2FT_A64/62 S
292 291 MB_2FT MB_2FT_WT_A64/62 -
293 292 MB_2FT MB_2FT_WT_B64/62 -
294 293 MB_CK MB_CK_C S
295 294 MB_CMF MB_CMF_C S
296 295 MB_CMF MB_CMF_T O
297 296 MB_CMF MB_CMF_TP O
298 297 MB_DO MB_DO_C S
299 298 MB_DO MB_DO_T O
300 299 MB_EF MB_EF_C S
301 300 MB_EF MB_EF_T_A O
302 301 MB_EF MB_EF_T_B -
303 302 MB_EX MB_EX_C O
304 303 MB_EX MB_EX_ST_A O
305 304 MB_EX MB_EX_T_A O
306 305 MB_EX MB_EX_T_B -
307 306 MB_EX MB_EX_T_B_B1 O
308 307 MB_FW MB_FW_JO_6X4/6X2 S
309 308 MB_LW MB_LW_A/B_B1 O
310 309 MB_MT MB_MT_A/B O
311 310 MB_RS MB_RS_A/B O
312 311 MB_SM MB_SM_A/B -
313 312 MB_SW MB_SW_G70 O
314 313 MB_SW MB_SW_G80 O
315 314 MB_TR MB_TR_G70_6x4 O
316 315 MB_TR MB_TR_G80_6x4 S
317 316 MB_WT MB_WT_A_64/62 -
318 317 MB_WT MB_WT_B_64/62 -

BIN
data/销售配置表.xls Normal file

Binary file not shown.

View File

@ -0,0 +1,138 @@
序号,规则
1,M1W=>G1X&Z2H
2,AP-B F58MEA 0C=>R8P
3,G2B=>G5G
4,M3A=>(G2B|G2E)
5,M1X=>(G1X&M4A)
6,AP-B F58LFA 0C=>R8P
7,~(M7I&(D6C))
8,J5R=>J6A
9,E1N=>Z5E
10,S1I=>(B1B&D2E&S1W&S2M&X3D&(G1W|G1X|G5G))
11,AP-B V18MEA 0C=>R8P
12,AP-B F38MEA 0C=>R8P
13,E0D=>(E1K&(D6C|Y1X))
14,Q0Y=>(Q0R|Q4K)
15,~(E5J&(V5N))
16,K7N=>(Z2H|Z5E)
17,Z5E=>(M3A|M3B|M3C|M3D|M3E)
18,~(D6F&((D6C|D6I|D6M)))
19,M6E=>Z2H&(M5D&M7T&(M3A|M3B|M3C))
20,Q5U=>(H1J&Q4K&Q4X&Q6D)
21,B3J=>(G1W|G1X)
22,J2K=>(J5R|J6C)
23,AP-B F38MFA 0C=>R8P
24,G5L=>G5G
25,S1P=>B1U
26,Q4X=>(Q5J|Q5U)
27,AP-B F58L98 81=>R8P
28,X3E=>(M4A|M4B)
29,U2G=>Z5E
30,I8P=>Z5E
31,D6I=>D6M
32,~(E1L&((D6C|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1H&S1I
106 105 MB_EX_T_B=>B1B&R0Q&S1W&S2M&S6G&S5M&U2I&F8V&F8W&L1H&S1G
107 106 MB_EX_T_B_B1=>B1B&R0Q&S1W&S2M&S6G&S5M&U2I&F8V&F8W&L1H
108 107 MB_FW_JO_6X4/6X2=>Q5U&Q4K&Q6D&Q0W&Q0X&Q0Y&Q4X&H1J
109 108 MB_LW_A/B_B1=>Q0A&R7S
110 109 MB_MT_A/B=>L1H
111 110 MB_RS_A/B=>F0T&F5L&F6R
112 111 MB_SM_A/B=>D6C&D7A&E0D&E1K&D2E&D6G
113 112 MB_SW_G70=>R8F&R8P&AP-B F38MEA 0C
114 113 MB_SW_G80=>R8F&R8P&AP-B V18MEA 0C
115 114 MB_TR_G70_6x4=>I2E&I2F&F38MEA 0C&AP-2 F38MFA 0C&AP-3 F38MFA 0C
116 115 MB_TR_G80_6x4=>AP-2 V18MFA 0C&V18MEA 0C&I1V&I1W&AP-3 V18MFA 0C
117 116 MB_WT_A_64/62=>D6G&D6I&D6M&D7A&E1K&E3W&K8T&K8N&F3Z
118 117 MB_WT_B_64/62=>D6G&D6I&D6M&D7A&E1K&E3W&K8T&F3Z&K8L
119 118 MB_2FT_WT_A64/62=>K0W&K8T&K8N&Z4R
120 119 MB_2FT_WT_B64/62=>K0W&K8T&Z4R&K8L
121 120 MB_CK_C=>J6A&J1H&J5R&J2I&U3W
122 121 MB_2FT_A42_B64/62/4=>K0W&K8K&Z4R
123 122 MB_2FT_A64/62=>K0W&K4X
124 123 MB_CMF_C=>D4T&D4U&D8L&E2Y
125 124 MB_SW_G80=>MB_TR_G80_6x4
126 125 MB_SW_G70=>MB_TR_G70_6x4
127 126 (MB_DO_C|MB_DO_T)=>M7I
128 127 M1X|M3A=>!(B3J|A5D)
129 128 U1F<=>S1W
130 129 C8M&I2E&I2F=>MB_LW_A/B_B1
131 130 MB_CMF_T|MB_CMF_TP=>D2E
132 131 M7I=>!MB_SM_A/B
133 132 G0T=>((G2B|G2E)&G5G)|((G1W|G1X)&B3J)&Z5E
134 133 MB_EX_ST_A=>S1R
135 134 MB_MT_A/B&X3E=>A5D&B3J
136 135 MB_EX_T_A|MB_EX_ST_A|MB_EX_T_B=>MB_CMF_TP|MB_CMF_T|MB_SM_A/B
137 136 MB_EX_T_A|MB_EX_ST_A=>MB_CMF_TP|MB_CMF_T|MB_SM_A/B
138 137 MB_MT_A/B&X3D=>A5D

Binary file not shown.

BIN
encoder Normal file

Binary file not shown.

1
name_nbvar.var Normal file
View File

@ -0,0 +1 @@
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,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539

2089
result.cnf Normal file

File diff suppressed because it is too large Load Diff

21
src/Allocate.cpp Normal file
View File

@ -0,0 +1,21 @@
#include "Allocate.h"
int IDManager::id = 0;
std::map<int, std::string> IDManager::idToName;
std::map<std::string, int> IDManager::nameToID;
int IDManager::allocate() {
return ++id;
}
int IDManager::getOrAllocate(std::string name) {
if(nameToID.count(name))
return nameToID[name];
int tid = allocate();
nameToID[name] = tid;
idToName[tid] = name;
CNF::comment("MAP: " + name + " -> " + std::to_string(tid));
return tid;
}

16
src/Allocate.h Normal file
View File

@ -0,0 +1,16 @@
#pragma once
#include <string>
#include <map>
#include <iostream>
#include "CNF.h"
class IDManager {
public:
static int allocate();
static int getOrAllocate(std::string name);
static std::map<int, std::string> idToName;
static std::map<std::string, int> nameToID;
static int id;
};

37
src/CNF.cpp Normal file
View File

@ -0,0 +1,37 @@
#include "CNF.h"
std::vector<std::vector<int>> CNF::vec;
std::vector<int> CNF::tmp;
std::set<int> CNF::el;
std::queue<std::pair<int, std::string>> CNF::cq;
void CNF::add(int x) {
if(x == 0) {
vec.push_back(tmp);
tmp.clear();
} else {
el.insert(abs(x));
tmp.push_back(x);
}
}
void CNF::comment(std::string str) {
cq.push(make_pair(vec.size(), str));
}
void CNF::print() {
printf("p cnf %d %d\n", IDManager::id, vec.size());
for(int i=0; i<vec.size(); i++) {
while(!cq.empty() && i >= cq.front().first) {
printf("c %s\n", cq.front().second.c_str());
cq.pop();
}
for(auto& lit : vec[i]) {
printf("%d ", lit);
}
printf("0\n");
}
}

22
src/CNF.h Normal file
View File

@ -0,0 +1,22 @@
#pragma once
#include <vector>
#include <set>
#include <cmath>
#include <cstdio>
#include <string>
#include <queue>
#include "Allocate.h"
class CNF {
public:
static void add(int x);
static void comment(std::string str);
static void print();
private:
static std::set<int> el;
static std::vector<int> tmp;
static std::vector<std::vector<int>> vec;
static std::queue<std::pair<int, std::string>> cq;
};

28
src/Calculator.p Normal file
View File

@ -0,0 +1,28 @@
term And assoc(left) prec(4); // +
term Or assoc(left) prec(3); // -
term Entail assoc(left) prec(2); // *
term rEntail assoc(left) prec(2); // *
term Equal assoc(left) prec(1); // /
term Not;
term LeftParen; // (
term RightParen; // )
term LiteralNumber {% Clause %};
nonterm exp {% Clause %};
grammar {
exp -> LiteralNumber(value) {% return value; %};
exp -> LeftParen exp(exp) RightParen {% return exp; %};
exp -> Not exp(rhs) prec(10) {% return ~rhs; %};
exp -> exp(lhs) And exp(rhs) {% return lhs & rhs; %};
exp -> exp(lhs) Or exp(rhs) {% return lhs | rhs; %};
exp -> exp(lhs) Entail exp(rhs) {% return (~lhs)|rhs; %};
exp -> exp(lhs) rEntail exp(rhs) {% return (~rhs)|lhs; %};
exp -> exp(lhs) Equal exp(rhs) {% return ((~lhs)|rhs)&((~rhs)|lhs); %};
};
generator {%
{
"class_name": "CalculatorParser"
}
%};

344
src/CalculatorParser.cpp Normal file
View File

@ -0,0 +1,344 @@
/**
* @file
* @date 2022-09-01
*
* Auto generated code by 9chu/parser_gen.
*/
#include "CalculatorParser.hpp"
#include <cassert>
#define ACTION_ERROR 0
#define ACTION_ACCEPT 1
#define ACTION_GOTO 2
#define ACTION_REDUCE 3
namespace {
CalculatorParser::ProductionValues Reduce0(std::vector<CalculatorParser::UnionValues>& stack_)
{
// binding values
assert(stack_.size() >= 1);
auto value =
std::move(std::get<Clause>(
std::get<CalculatorParser::TokenValues>(
std::move(stack_[stack_.size() - 1])
)
));
// user code
auto ret = [&]() {
return value; }();
return CalculatorParser::ProductionValues { std::move(ret) };
}
CalculatorParser::ProductionValues Reduce1(std::vector<CalculatorParser::UnionValues>& stack_)
{
// binding values
assert(stack_.size() >= 3);
auto exp =
std::move(std::get<Clause>(
std::get<CalculatorParser::ProductionValues>(
std::move(stack_[stack_.size() - 2])
)
));
// user code
auto ret = [&]() {
return exp; }();
return CalculatorParser::ProductionValues { std::move(ret) };
}
CalculatorParser::ProductionValues Reduce2(std::vector<CalculatorParser::UnionValues>& stack_)
{
// binding values
assert(stack_.size() >= 2);
auto rhs =
std::move(std::get<Clause>(
std::get<CalculatorParser::ProductionValues>(
std::move(stack_[stack_.size() - 1])
)
));
// user code
auto ret = [&]() {
return ~rhs; }();
return CalculatorParser::ProductionValues { std::move(ret) };
}
CalculatorParser::ProductionValues Reduce3(std::vector<CalculatorParser::UnionValues>& stack_)
{
// binding values
assert(stack_.size() >= 3);
auto lhs =
std::move(std::get<Clause>(
std::get<CalculatorParser::ProductionValues>(
std::move(stack_[stack_.size() - 3])
)
));
auto rhs =
std::move(std::get<Clause>(
std::get<CalculatorParser::ProductionValues>(
std::move(stack_[stack_.size() - 1])
)
));
// user code
auto ret = [&]() {
return lhs & rhs; }();
return CalculatorParser::ProductionValues { std::move(ret) };
}
CalculatorParser::ProductionValues Reduce4(std::vector<CalculatorParser::UnionValues>& stack_)
{
// binding values
assert(stack_.size() >= 3);
auto lhs =
std::move(std::get<Clause>(
std::get<CalculatorParser::ProductionValues>(
std::move(stack_[stack_.size() - 3])
)
));
auto rhs =
std::move(std::get<Clause>(
std::get<CalculatorParser::ProductionValues>(
std::move(stack_[stack_.size() - 1])
)
));
// user code
auto ret = [&]() {
return lhs | rhs; }();
return CalculatorParser::ProductionValues { std::move(ret) };
}
CalculatorParser::ProductionValues Reduce5(std::vector<CalculatorParser::UnionValues>& stack_)
{
// binding values
assert(stack_.size() >= 3);
auto lhs =
std::move(std::get<Clause>(
std::get<CalculatorParser::ProductionValues>(
std::move(stack_[stack_.size() - 3])
)
));
auto rhs =
std::move(std::get<Clause>(
std::get<CalculatorParser::ProductionValues>(
std::move(stack_[stack_.size() - 1])
)
));
// user code
auto ret = [&]() {
return (~lhs)|rhs; }();
return CalculatorParser::ProductionValues { std::move(ret) };
}
CalculatorParser::ProductionValues Reduce6(std::vector<CalculatorParser::UnionValues>& stack_)
{
// binding values
assert(stack_.size() >= 3);
auto lhs =
std::move(std::get<Clause>(
std::get<CalculatorParser::ProductionValues>(
std::move(stack_[stack_.size() - 3])
)
));
auto rhs =
std::move(std::get<Clause>(
std::get<CalculatorParser::ProductionValues>(
std::move(stack_[stack_.size() - 1])
)
));
// user code
auto ret = [&]() {
return (~rhs)|lhs; }();
return CalculatorParser::ProductionValues { std::move(ret) };
}
CalculatorParser::ProductionValues Reduce7(std::vector<CalculatorParser::UnionValues>& stack_)
{
// binding values
assert(stack_.size() >= 3);
auto lhs =
std::move(std::get<Clause>(
std::get<CalculatorParser::ProductionValues>(
std::move(stack_[stack_.size() - 3])
)
));
auto rhs =
std::move(std::get<Clause>(
std::get<CalculatorParser::ProductionValues>(
std::move(stack_[stack_.size() - 1])
)
));
// user code
auto ret = [&]() {
return ((~lhs)|rhs)&((~rhs)|lhs); }();
return CalculatorParser::ProductionValues { std::move(ret) };
}
}
using ReduceFunction = CalculatorParser::ProductionValues(*)(std::vector<CalculatorParser::UnionValues>&);
struct ProductionInfo
{
uint32_t NonTerminal;
uint32_t SymbolCount;
ReduceFunction Callback;
};
struct ActionInfo
{
uint8_t Action;
uint32_t Arg;
};
static const ProductionInfo kProductions[8] = {
{ 10, 1, ::Reduce0 },
{ 10, 3, ::Reduce1 },
{ 10, 2, ::Reduce2 },
{ 10, 3, ::Reduce3 },
{ 10, 3, ::Reduce4 },
{ 10, 3, ::Reduce5 },
{ 10, 3, ::Reduce6 },
{ 10, 3, ::Reduce7 },
};
static const ActionInfo kActions[34][11] = {
{ { 0, 0 },{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 0 }, },
{ { 0, 0 },{ 2, 23 },{ 3, 5 },{ 3, 5 },{ 0, 0 },{ 0, 0 },{ 0, 0 },{ 2, 21 },{ 3, 5 },{ 3, 5 },{ 0, 0 }, },
{ { 0, 0 },{ 3, 3 },{ 3, 3 },{ 3, 3 },{ 0, 0 },{ 0, 0 },{ 0, 0 },{ 3, 3 },{ 3, 3 },{ 3, 3 },{ 0, 0 }, },
{ { 0, 0 },{ 2, 23 },{ 2, 22 },{ 3, 7 },{ 0, 0 },{ 0, 0 },{ 0, 0 },{ 2, 21 },{ 3, 7 },{ 2, 20 },{ 0, 0 }, },
{ { 0, 0 },{ 3, 1 },{ 3, 1 },{ 3, 1 },{ 0, 0 },{ 0, 0 },{ 0, 0 },{ 3, 1 },{ 3, 1 },{ 3, 1 },{ 0, 0 }, },
};
CalculatorParser::CalculatorParser()
{
Reset();
}
CalculatorParser::ParseResult CalculatorParser::operator()(TokenTypes token, const TokenValues& value)
{
while (true)
{
assert(!m_stStack.empty());
assert(static_cast<uint32_t>(token) < 10);
const ActionInfo& act = kActions[m_stStack.back()][static_cast<uint32_t>(token)];
if (act.Action == ACTION_ACCEPT)
{
// store the result
assert(!m_stValueStack.empty());
m_stResult =
std::move(std::get<Clause>(
std::get<ProductionValues>(std::move(m_stValueStack.back()))
));
Reset();
return ParseResult::Accepted;
}
else if (act.Action == ACTION_ERROR)
{
Reset();
return ParseResult::Rejected;
}
else if (act.Action == ACTION_GOTO)
{
m_stStack.push_back(static_cast<uint32_t>(token));
m_stStack.push_back(act.Arg);
assert(m_stStack.back() < 34);
m_stValueStack.push_back(value);
}
else
{
assert(act.Action == ACTION_REDUCE);
assert(act.Arg < 8);
const ProductionInfo& info = kProductions[act.Arg];
auto val = info.Callback(m_stValueStack);
assert(m_stStack.size() >= info.SymbolCount * 2);
m_stStack.resize(m_stStack.size() - info.SymbolCount * 2);
assert(m_stValueStack.size() >= info.SymbolCount);
m_stValueStack.resize(m_stValueStack.size() - info.SymbolCount);
m_stValueStack.emplace_back(std::move(val));
assert(!m_stStack.empty());
const ActionInfo& act2 = kActions[m_stStack.back()][info.NonTerminal];
if (act2.Action == ACTION_GOTO)
{
m_stStack.push_back(info.NonTerminal);
m_stStack.push_back(act2.Arg);
}
else
{
assert(false);
Reset();
return ParseResult::Rejected;
}
continue;
}
break;
}
return ParseResult::Undecided;
}
void CalculatorParser::Reset()noexcept
{
m_stStack.clear();
m_stValueStack.clear();
// initial state
m_stStack.push_back(0);
}

66
src/CalculatorParser.hpp Normal file
View File

@ -0,0 +1,66 @@
/**
* @file
* @date 2022-09-01
*
* Auto generated code by 9chu/parser_gen.
*/
#pragma once
#include <cstdint>
#include <vector>
#include <variant>
#include "ValueType.hpp"
// namespace {
class CalculatorParser
{
public:
enum class ParseResult
{
Undecided = 0,
Accepted = 1,
Rejected = 2,
};
enum class TokenTypes
{
_ = 0,
And = 1,
Entail = 2,
Equal = 3,
LeftParen = 4,
LiteralNumber = 5,
Not = 6,
Or = 7,
RightParen = 8,
rEntail = 9,
};
using TokenValues = std::variant<
std::monostate,
Clause
>;
using ProductionValues = std::variant<
Clause
>;
using UnionValues = std::variant<TokenValues, ProductionValues>;
public:
CalculatorParser();
public:
ParseResult operator()(TokenTypes token, const TokenValues& value);
void Reset()noexcept;
const Clause& Result()const noexcept { return m_stResult; }
Clause& Result()noexcept { return m_stResult; }
private:
std::vector<uint32_t> m_stStack;
std::vector<UnionValues> m_stValueStack;
Clause m_stResult {};
};
// }

179
src/Main.cpp Normal file
View File

@ -0,0 +1,179 @@
#include <tuple>
#include <variant>
#include <iostream>
#include <cstring>
#include <string>
#include <set>
#include "ValueType.hpp"
#include "CalculatorParser.hpp"
#include "rapidcsv.h"
#include "Allocate.h"
#include "CNF.h"
class Tokenizer {
public:
Tokenizer(const char* buffer)
: m_pBuffer(buffer) {}
public:
std::tuple<CalculatorParser::TokenTypes, CalculatorParser::TokenValues> Advance() {
using TokenTypes = CalculatorParser::TokenTypes;
using TokenValues = CalculatorParser::TokenValues;
while (true) {
if (*m_pBuffer == '\0')
return { TokenTypes::_, TokenValues {} };
char c;
switch (c = *(m_pBuffer++)) {
case '&': return { TokenTypes::And, TokenValues {} };
case '|': return { TokenTypes::Or, TokenValues {} };
case '(': return { TokenTypes::LeftParen, TokenValues {} };
case ')': return { TokenTypes::RightParen, TokenValues {} };
case '~': return { TokenTypes::Not, TokenValues {} };
case '!': return { TokenTypes::Not, TokenValues {} };
case '=':
c = *(m_pBuffer++);
if(c != '>') throw std::runtime_error("Bad input");
return { TokenTypes::Entail, TokenValues {} };
case '<':
c = *(m_pBuffer++);
if(c != '=') throw std::runtime_error("Bad input");
c = *(m_pBuffer++);
if(c != '>') {
m_pBuffer--;
return { TokenTypes::rEntail, TokenValues {} };
}
return { TokenTypes::Equal, TokenValues {} };
default:
std::string str;
str += c;
while (!isReservedSymbol(*m_pBuffer) && *m_pBuffer != '\0')
str = str + *(m_pBuffer++);
//std::cout << str << std::endl;
Clause clause;
clause.positive = true;
clause.type = Clause::TYPE::UNIT;
clause.vec.push_back(IDManager::getOrAllocate(str));
return { TokenTypes::LiteralNumber, TokenValues { clause } };
}
}
}
private:
const char* m_pBuffer;
bool isReservedSymbol(char c) {
return c == '&' || c == '|' || c == '('
|| c == ')' || c == '~' || c == '<'
|| c == '=' || c == '>' || c == '!';
}
};
int main() {
try {
rapidcsv::Document doc_1("data/是否必选特征族.csv");
std::set<std::string> familyMustChoose;
for(int i=0; i<doc_1.GetRowCount(); i++) {
auto row = doc_1.GetRow<std::string>(i);
std::string familyName = row[2];
std::string value = row[3];
if(value == "") {
familyMustChoose.insert(familyName);
}
}
rapidcsv::Document doc_2("data/销售配置表.csv");
std::map<std::string, std::vector<std::string>> valuesByFamily;
std::map<std::string, std::vector<std::string>> valuesByNotForceFamily;
for(int i=0; i<doc_2.GetRowCount(); i++) {
auto row = doc_2.GetRow<std::string>(i);
std::string familyName = row[1];
std::string valueName = row[2];
std::string chooseFlag = row[3];
if(chooseFlag == "-") {
CNF::add(-IDManager::getOrAllocate(valueName));
CNF::add(0);
}
valuesByFamily[familyName].push_back(valueName);
}
for(auto& [family, vec] : valuesByFamily) {
if(familyMustChoose.find(family) != familyMustChoose.end()) {
for(auto v : vec) {
CNF::add(IDManager::getOrAllocate(v));
}
CNF::add(0);
}
for(int i=0; i<vec.size(); i++) {
for(int j=i+1; j<vec.size(); j++) {
CNF::add(-IDManager::getOrAllocate(vec[i]));
CNF::add(-IDManager::getOrAllocate(vec[j]));
CNF::add(0);
}
}
}
rapidcsv::Document doc_3("data/销售配置表_约束规则.csv");
auto constraint = doc_3.GetColumn<std::string>(1);
for(auto& str : constraint) {
if(str == "") continue;
CNF::comment("analyze: " + str);
Tokenizer tokenizer(str.c_str());
CalculatorParser parser;
while (true) {
auto [t, v] = tokenizer.Advance();
auto ret = parser(t, v);
if (ret == CalculatorParser::ParseResult::Rejected)
throw std::runtime_error("Parse error");
else if (ret == CalculatorParser::ParseResult::Accepted) {
parser.Result().mergeIntoUNIT();
CNF::add(parser.Result().vec[0]);
CNF::add(0);
}
if (t == CalculatorParser::TokenTypes::_)
break;
}
}
std::set<std::string> list;
auto inf = doc_2.GetColumn<std::string>(7);
for(auto& family : inf) {
list.insert(family);
}
printf("c ind ");
// for(auto& [family, vec] : valuesByFamily) {
// //if(list.find(family) != list.end()) continue;
// for(auto &v : valuesByFamily[family]) {
// printf("%d ", IDManager::getOrAllocate(v));
// }
// }
for(int i=1; i<=539; i++) {
printf("%d ", i);
}
printf("0\n");
CNF::print();
}
catch (const std::exception& ex) {
std::cerr << ex.what() << std::endl;
return 1;
}
return 0;
}

109
src/ValueType.hpp Normal file
View File

@ -0,0 +1,109 @@
#pragma once
#include <vector>
#include "Allocate.h"
#include "CNF.h"
class Clause {
public:
enum class TYPE {
UNIT = 0,
AND = 1,
OR = 2,
};
std::vector<int> vec;
TYPE type;
bool positive;
Clause(): type() {
positive = true;
}
void mergeIntoUNIT() {
if(type == TYPE::UNIT) return;
int newId = IDManager::allocate();
std::string output = "MAP: ";
for(int i=0; i<vec.size()-1; i++) {
output += std::to_string(vec[i]) + (type == TYPE::AND ? " & " : " | ");
}
output += std::to_string(vec[vec.size()-1]);
output += " -> " + std::to_string(newId);
CNF::comment(output);
if(type == TYPE::AND) {
CNF::add(newId);
for(auto v : vec) {
CNF::add(-v);
}
CNF::add(0);
for(auto v : vec) {
CNF::add(v);
CNF::add(-newId);
CNF::add(0);
}
} else {
CNF::add(-newId);
for(auto v : vec) {
CNF::add(v);
}
CNF::add(0);
for(auto v : vec) {
CNF::add(-v);
CNF::add(newId);
CNF::add(0);
}
}
vec.clear();
vec.push_back(newId);
type = TYPE::UNIT;
}
friend Clause operator ~ (Clause hs) {
for(auto it=hs.vec.begin(); it!=hs.vec.end(); it++ ) {
*it = -(*it);
}
if(hs.type == TYPE::AND) hs.type = TYPE::OR;
else if(hs.type == TYPE::OR) hs.type = TYPE::AND;
//if(hs.vec.size() == 1 && hs.type != TYPE::UNIT) exit(233);
return hs;
}
friend Clause operator & (Clause lhs, Clause rhs) {
Clause res;
res.type = TYPE::AND;
if(lhs.type == TYPE::OR) lhs.mergeIntoUNIT();
if(rhs.type == TYPE::OR) rhs.mergeIntoUNIT();
for(auto v : lhs.vec) res.vec.push_back(v);
for(auto v : rhs.vec) res.vec.push_back(v);
return res;
}
friend Clause operator | (Clause lhs, Clause rhs) {
Clause res;
res.type = TYPE::OR;
if(lhs.type == TYPE::AND) lhs.mergeIntoUNIT();
if(rhs.type == TYPE::AND) rhs.mergeIntoUNIT();
for(auto v : lhs.vec) res.vec.push_back(v);
for(auto v : rhs.vec) res.vec.push_back(v);
return res;
}
};

2232
src/parser_gen.py Normal file

File diff suppressed because it is too large Load Diff

1800
src/rapidcsv.h Normal file

File diff suppressed because it is too large Load Diff

BIN
untitled/.DS_Store vendored Normal file

Binary file not shown.

3
untitled/.idea/.gitignore generated vendored Normal file
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

13
untitled/.idea/compiler.xml generated Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="untitled" />
</profile>
</annotationProcessing>
</component>
</project>

7
untitled/.idea/encodings.xml generated Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>

20
untitled/.idea/jarRepositories.xml generated Normal file
View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Central Repository" />
<option name="url" value="https://repo.maven.apache.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
</component>
</project>

14
untitled/.idea/misc.xml generated Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="MavenProjectsManager">
<option name="originalFiles">
<list>
<option value="$PROJECT_DIR$/pom.xml" />
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_18" default="true" project-jdk-name="18" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>

25
untitled/pom.xml Normal file
View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>untitled</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.logicng</groupId>
<artifactId>logicng</artifactId>
<version>2.3.2</version>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>18</maven.compiler.source>
<maven.compiler.target>18</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

2089
untitled/result.cnf Normal file

File diff suppressed because it is too large Load Diff

BIN
untitled/src/.DS_Store vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,30 @@
package org.example;
import org.logicng.formulas.Formula;
import org.logicng.formulas.FormulaFactory;
import org.logicng.formulas.Variable;
import org.logicng.io.parsers.ParserException;
import org.logicng.io.readers.DimacsReader;
import org.logicng.modelcounting.ModelCounter;
import java.io.IOException;
import java.math.BigInteger;
import java.util.*;
public class Main {
public static void main(String[] args) throws ParserException, IOException {
FormulaFactory f = new FormulaFactory();
List<Formula> formulas = DimacsReader.readCNF("result.cnf", f);
SortedSet<Variable> variables = new TreeSet<>();
for(Formula formula : formulas) {
variables.addAll(formula.variables());
}
long time = System.currentTimeMillis();
BigInteger modelcount = ModelCounter.count(formulas, variables);
System.out.println("answer:" + modelcount);
System.out.println("time: " + (System.currentTimeMillis()-time) + " ms");
}
}

Binary file not shown.

Binary file not shown.