Compare commits

...

23 Commits
main ... old

Author SHA1 Message Date
175723f66e 一些修改 2023-03-22 02:37:08 +00:00
798b266d25 同步mac数据 2023-03-21 17:14:32 +08:00
359c2e8cd1 同步代码 2023-03-21 08:36:53 +00:00
f02012ea75 修改项目结构,更新makefile 2023-03-21 08:14:37 +00:00
c3efc6aafb 引入 CCAnr 源代码 2023-03-19 06:32:08 +00:00
a48161399e 可以运行的clause LS,下一步移植到CCAnr到本程序 2023-03-17 07:11:30 +00:00
4ba4c8e82e 修改成字句ls 2023-03-17 05:37:29 +00:00
10b021e407 立即更新完工 2023-03-13 10:54:51 +00:00
34a30f5c0e 存在bug的新版 2023-03-13 05:44:49 +00:00
c8ef5ac6dd vscode自动编译调试程序 2023-03-11 07:02:02 +00:00
329f3a849f 增量 STEM-INC 实验 2023-03-09 14:54:23 +08:00
421d533c4a 动态调整STEM_INC 2023-03-09 13:49:18 +08:00
061c66e888 python脚本只统计不运行 2023-03-09 05:45:39 +00:00
8e923f249d 增加结果 2023-03-09 13:17:53 +08:00
622f0f11f9 增加结果 2023-03-09 12:58:14 +08:00
2337c138d2 增加测试脚本 2023-03-09 03:31:16 +00:00
77a4984f3a gate 增加了 level 字段 2023-03-09 02:51:10 +00:00
8f2262eaee 删除所有txt 2023-03-08 07:24:08 +00:00
041ff6c2e3 修复BUG,现在可以统计错误传播层数了 2023-03-08 07:22:28 +00:00
6be4d80653 计算出错误传播的长度 2023-03-06 11:05:30 +00:00
c15186ad01 修改了一些参数 2023-03-05 06:24:10 +00:00
17e95ded9b 修复了旧版的BUG 2023-03-03 07:33:14 +00:00
1a93b8a8a3 修复了所有问题 2023-03-02 08:17:53 +00:00
82 changed files with 4163 additions and 43956 deletions

4
.gitignore vendored
View File

@ -1,3 +1,3 @@
*.o
*.d
.vscode
output.txt
build

17
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64",
"configurationProvider": "ms-vscode.makefile-tools"
}
],
"version": 4
}

34
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,34 @@
{
// 使 IntelliSense
//
// 访: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) 启动",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/atpg",
"args": ["${workspaceFolder}/benchmark/c432.bench"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "为 gdb 启用整齐打印",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "将反汇编风格设置为 Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "build"
}
]
}

34
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,34 @@
{
"files.associations": {
"*.ejs": "html",
"*.tcc": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"compare": "cpp",
"concepts": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cwchar": "cpp",
"deque": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"limits": "cpp",
"new": "cpp",
"numbers": "cpp",
"string": "cpp",
"string_view": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"sstream": "cpp",
"ostream": "cpp",
"iostream": "cpp",
"stack": "cpp"
}
}

12
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,12 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "make -j 8"
}
]
}

515
.vscode/test.cnf vendored Normal file
View File

@ -0,0 +1,515 @@
p cnf 196 514
-37 -1 0
37 1 0
-38 -2 0
38 2 0
-39 -4 0
39 4 0
-40 -6 0
40 6 0
-41 -8 0
41 8 0
-42 -10 0
42 10 0
-43 -12 0
43 12 0
-44 -14 0
44 14 0
-45 -16 0
45 16 0
-46 -18 0
46 18 0
-47 -20 0
47 20 0
-48 -22 0
48 22 0
-49 -24 0
49 24 0
-50 -26 0
50 26 0
-51 -28 0
51 28 0
-52 -30 0
52 30 0
-53 -32 0
53 32 0
-54 -34 0
54 34 0
55 37 0
55 2 0
-37 -2 -55 0
3 38 56 0
-56 -3 0
-56 -38 0
5 38 57 0
-57 -5 0
-57 -38 0
58 39 0
58 6 0
-39 -6 -58 0
61 41 0
61 10 0
-41 -10 -61 0
64 43 0
64 14 0
-43 -14 -64 0
67 45 0
67 18 0
-45 -18 -67 0
70 47 0
70 22 0
-47 -22 -70 0
73 49 0
73 26 0
-49 -26 -73 0
76 51 0
76 30 0
-51 -30 -76 0
79 53 0
79 34 0
-53 -34 -79 0
7 40 59 0
-59 -7 0
-59 -40 0
9 40 60 0
-60 -9 0
-60 -40 0
11 42 62 0
-62 -11 0
-62 -42 0
13 42 63 0
-63 -13 0
-63 -42 0
15 44 65 0
-65 -15 0
-65 -44 0
17 44 66 0
-66 -17 0
-66 -44 0
19 46 68 0
-68 -19 0
-68 -46 0
21 46 69 0
-69 -21 0
-69 -46 0
23 48 71 0
-71 -23 0
-71 -48 0
25 48 72 0
-72 -25 0
-72 -48 0
27 50 74 0
-74 -27 0
-74 -50 0
29 50 75 0
-75 -29 0
-75 -50 0
31 52 77 0
-77 -31 0
-77 -52 0
33 52 78 0
-78 -33 0
-78 -52 0
35 54 80 0
-80 -35 0
-80 -54 0
36 54 81 0
-81 -36 0
-81 -54 0
-82 55 0
-82 58 0
-82 61 0
-82 64 0
-82 67 0
-82 70 0
-82 73 0
-82 76 0
-82 79 0
-55 -58 -61 -64 -67 -70 -73 -76 -79 82 0
-83 -82 0
83 82 0
-84 -82 0
84 82 0
-85 -82 0
85 82 0
-86 -83 -55 0
-86 83 55 0
86 -83 55 0
86 83 -55 0
-87 -83 -58 0
-87 83 58 0
87 -83 58 0
87 83 -58 0
-88 -83 -61 0
-88 83 61 0
88 -83 61 0
88 83 -61 0
-89 -83 -64 0
-89 83 64 0
89 -83 64 0
89 83 -64 0
-90 -83 -67 0
-90 83 67 0
90 -83 67 0
90 83 -67 0
-91 -83 -70 0
-91 83 70 0
91 -83 70 0
91 83 -70 0
95 1 0
95 84 0
-1 -84 -95 0
-92 -83 -73 0
-92 83 73 0
92 -83 73 0
92 83 -73 0
96 84 0
96 4 0
-84 -4 -96 0
-93 -83 -76 0
-93 83 76 0
93 -83 76 0
93 83 -76 0
97 84 0
97 8 0
-84 -8 -97 0
-94 -83 -79 0
-94 83 79 0
94 -83 79 0
94 83 -79 0
98 84 0
98 12 0
-84 -12 -98 0
99 84 0
99 16 0
-84 -16 -99 0
100 84 0
100 20 0
-84 -20 -100 0
101 84 0
101 24 0
-84 -24 -101 0
102 84 0
102 28 0
-84 -28 -102 0
103 84 0
103 32 0
-84 -32 -103 0
104 86 0
104 56 0
-86 -56 -104 0
105 86 0
105 57 0
-86 -57 -105 0
106 87 0
106 59 0
-87 -59 -106 0
108 88 0
108 62 0
-88 -62 -108 0
110 89 0
110 65 0
-89 -65 -110 0
112 90 0
112 68 0
-90 -68 -112 0
114 91 0
114 71 0
-91 -71 -114 0
116 92 0
116 74 0
-92 -74 -116 0
118 93 0
118 77 0
-93 -77 -118 0
120 94 0
120 80 0
-94 -80 -120 0
107 87 0
107 60 0
-87 -60 -107 0
109 88 0
109 63 0
-88 -63 -109 0
111 89 0
111 66 0
-89 -66 -111 0
113 90 0
113 69 0
-90 -69 -113 0
115 91 0
115 72 0
-91 -72 -115 0
117 92 0
117 75 0
-92 -75 -117 0
119 93 0
119 78 0
-93 -78 -119 0
121 94 0
121 81 0
-94 -81 -121 0
-130 104 0
-130 106 0
-130 108 0
-130 110 0
-130 112 0
-130 114 0
-130 116 0
-130 118 0
-130 120 0
-104 -106 -108 -110 -112 -114 -116 -118 -120 130 0
-122 -105 0
122 105 0
-123 -107 0
123 107 0
-124 -109 0
124 109 0
-125 -111 0
125 111 0
-126 -113 0
126 113 0
-127 -115 0
127 115 0
-128 -117 0
128 117 0
-129 -119 0
129 119 0
-131 -121 0
131 121 0
-132 -130 0
132 130 0
-133 -130 0
133 130 0
-134 -130 0
134 130 0
-135 -132 -104 0
-135 132 104 0
135 -132 104 0
135 132 -104 0
-136 -132 -106 0
-136 132 106 0
136 -132 106 0
136 132 -106 0
-137 -132 -108 0
-137 132 108 0
137 -132 108 0
137 132 -108 0
-138 -132 -110 0
-138 132 110 0
138 -132 110 0
138 132 -110 0
144 3 0
144 133 0
-3 -133 -144 0
-139 -132 -112 0
-139 132 112 0
139 -132 112 0
139 132 -112 0
145 133 0
145 7 0
-133 -7 -145 0
-140 -132 -114 0
-140 132 114 0
140 -132 114 0
140 132 -114 0
146 133 0
146 11 0
-133 -11 -146 0
-141 -132 -116 0
-141 132 116 0
141 -132 116 0
141 132 -116 0
147 133 0
147 15 0
-133 -15 -147 0
-142 -132 -118 0
-142 132 118 0
142 -132 118 0
142 132 -118 0
148 133 0
148 19 0
-133 -19 -148 0
-143 -132 -120 0
-143 132 120 0
143 -132 120 0
143 132 -120 0
149 133 0
149 23 0
-133 -23 -149 0
150 133 0
150 27 0
-133 -27 -150 0
151 133 0
151 31 0
-133 -31 -151 0
152 133 0
152 35 0
-133 -35 -152 0
153 135 0
153 122 0
-135 -122 -153 0
154 136 0
154 123 0
-136 -123 -154 0
155 137 0
155 124 0
-137 -124 -155 0
156 138 0
156 125 0
-138 -125 -156 0
157 139 0
157 126 0
-139 -126 -157 0
158 140 0
158 127 0
-140 -127 -158 0
159 141 0
159 128 0
-141 -128 -159 0
160 142 0
160 129 0
-142 -129 -160 0
161 143 0
161 131 0
-143 -131 -161 0
-162 153 0
-162 154 0
-162 155 0
-162 156 0
-162 157 0
-162 158 0
-162 159 0
-162 160 0
-162 161 0
-153 -154 -155 -156 -157 -158 -159 -160 -161 162 0
-163 -162 0
163 162 0
-164 -162 0
164 162 0
165 5 0
165 163 0
-5 -163 -165 0
166 163 0
166 9 0
-163 -9 -166 0
167 163 0
167 13 0
-163 -13 -167 0
168 163 0
168 17 0
-163 -17 -168 0
169 163 0
169 21 0
-163 -21 -169 0
170 163 0
170 25 0
-163 -25 -170 0
171 163 0
171 29 0
-163 -29 -171 0
172 163 0
172 33 0
-163 -33 -172 0
173 163 0
173 36 0
-163 -36 -173 0
174 2 0
174 95 0
174 144 0
174 165 0
-2 -95 -144 -165 -174 0
175 96 0
175 145 0
175 166 0
175 6 0
-96 -145 -166 -6 -175 0
176 97 0
176 146 0
176 167 0
176 10 0
-97 -146 -167 -10 -176 0
177 98 0
177 147 0
177 168 0
177 14 0
-98 -147 -168 -14 -177 0
178 99 0
178 148 0
178 169 0
178 18 0
-99 -148 -169 -18 -178 0
179 100 0
179 149 0
179 170 0
179 22 0
-100 -149 -170 -22 -179 0
180 101 0
180 150 0
180 171 0
180 26 0
-101 -150 -171 -26 -180 0
181 102 0
181 151 0
181 172 0
181 30 0
-102 -151 -172 -30 -181 0
182 103 0
182 152 0
182 173 0
182 34 0
-103 -152 -173 -34 -182 0
-183 -174 0
183 174 0
-188 175 0
-188 176 0
-188 177 0
-188 178 0
-188 179 0
-188 180 0
-188 181 0
-188 182 0
-175 -176 -177 -178 -179 -180 -181 -182 188 0
-184 -177 0
184 177 0
-185 -179 0
185 179 0
-186 -180 0
186 180 0
-187 -181 0
187 181 0
183 188 193 0
-193 -183 0
-193 -188 0
189 176 0
189 184 0
-176 -184 -189 0
190 176 0
190 177 0
190 185 0
190 178 0
-176 -177 -185 -178 -190 0
191 178 0
191 177 0
191 186 0
-178 -177 -186 -191 0
192 176 0
192 177 0
192 180 0
192 187 0
-176 -177 -180 -187 -192 0
194 175 0
194 176 0
194 189 0
194 178 0
-175 -176 -189 -178 -194 0
195 175 0
195 176 0
195 190 0
195 191 0
-175 -176 -190 -191 -195 0
196 175 0
196 189 0
196 190 0
196 192 0
-175 -189 -190 -192 -196 0

BIN
CCAnr/CCAnr Executable file

Binary file not shown.

2
CCAnr/Makefile Normal file
View File

@ -0,0 +1,2 @@
CCAnr: cca.cpp cca.h basis.h cw.h preprocessor.h
g++ cca.cpp -O3 -static -o CCAnr

377
CCAnr/basis.h Normal file
View File

@ -0,0 +1,377 @@
#ifndef _BASIS_H_
#define _BASIS_H_
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <cmath>
using namespace std;
enum type{SAT3, SAT5, SAT7, strSAT} probtype;
/* limits on the size of the problem. */
#define MAX_VARS 4000010
#define MAX_CLAUSES 20000000
// Define a data structure for a literal in the SAT problem.
struct lit {
int clause_num; //clause num, begin with 0
int var_num; //variable num, begin with 1
int sense; //is 1 for true literals, 0 for false literals.
};
/*parameters of the instance*/
int num_vars; //var index from 1 to num_vars
int num_clauses; //clause index from 0 to num_clauses-1
int max_clause_len;
int min_clause_len;
int formula_len=0;
double avg_clause_len;
double ratio;
/* literal arrays */
lit* var_lit[MAX_VARS]; //var_lit[i][j] means the j'th literal of var i.
int var_lit_count[MAX_VARS]; //amount of literals of each var
lit* clause_lit[MAX_CLAUSES]; //clause_lit[i][j] means the j'th literal of clause i.
int clause_lit_count[MAX_CLAUSES]; // amount of literals in each clause
lit* org_clause_lit[MAX_CLAUSES]; //clause_lit[i][j] means the j'th literal of clause i.
int org_clause_lit_count[MAX_CLAUSES]; // amount of literals in each clause
int simplify=0;
/* Information about the variables. */
int score[MAX_VARS];
int time_stamp[MAX_VARS];
int conf_change[MAX_VARS];
int* var_neighbor[MAX_VARS];
int var_neighbor_count[MAX_VARS];
//int pscore[MAX_VARS];
int fix[MAX_VARS];
/* Information about the clauses */
int clause_weight[MAX_CLAUSES];
int sat_count[MAX_CLAUSES];
int sat_var[MAX_CLAUSES];
//int sat_var2[MAX_CLAUSES];
//unsat clauses stack
int unsat_stack[MAX_CLAUSES]; //store the unsat clause number
int unsat_stack_fill_pointer;
int index_in_unsat_stack[MAX_CLAUSES];//which position is a clause in the unsat_stack
int this_try_best_unsat_stack_fill_pointer;
//variables in unsat clauses
int unsatvar_stack[MAX_VARS];
int unsatvar_stack_fill_pointer;
int index_in_unsatvar_stack[MAX_VARS];
int unsat_app_count[MAX_VARS]; //a varible appears in how many unsat clauses
//configuration changed decreasing variables (score>0 and confchange=1)
int goodvar_stack[MAX_VARS];
int goodvar_stack_fill_pointer;
int already_in_goodvar_stack[MAX_VARS];
//unit clauses preprocess
lit unitclause_queue[MAX_VARS];
int unitclause_queue_beg_pointer=0;
int unitclause_queue_end_pointer=0;
int clause_delete[MAX_CLAUSES];
/* Information about solution */
int cur_soln[MAX_VARS]; //the current solution, with 1's for True variables, and 0's for False variables
//cutoff
int max_tries = 10000;
int tries;
int max_flips = 2000000000;
int step;
void setup_datastructure();
void free_memory();
int build_instance(char *filename);
void build_neighbor_relation();
void free_memory()
{
int i;
for (i = 0; i < num_clauses; i++)
{
delete[] clause_lit[i];
}
for(i=1; i<=num_vars; ++i)
{
delete[] var_lit[i];
delete[] var_neighbor[i];
}
}
/*
* Read in the problem.
*/
int temp_lit[MAX_VARS]; //the max length of a clause can be MAX_VARS
int build_instance(char *filename)
{
char line[1000000];
char tempstr1[10];
char tempstr2[10];
int cur_lit;
int i,j;
int v,c;//var, clause
ifstream infile(filename);
if(!infile.is_open())
return 0;
/*** build problem data structures of the instance ***/
infile.getline(line,1000000);
while (line[0] != 'p')
infile.getline(line,1000000);
sscanf(line, "%s %s %d %d", tempstr1, tempstr2, &num_vars, &num_clauses);
::ratio = double(num_clauses) / num_vars;
if(num_vars>=MAX_VARS || num_clauses>=MAX_CLAUSES)
{
cout<<"the size of instance exceeds out limitation, please enlarge MAX_VARS and (or) MAX_CLAUSES."<<endl;
exit(-1);
}
for (c = 0; c < num_clauses; c++)
{
clause_lit_count[c] = 0;
clause_delete[c] = 0;
}
for (v=1; v<=num_vars; ++v)
{
var_lit_count[v] = 0;
fix[v] = 0;
}
max_clause_len = 0;
min_clause_len = num_vars;
//Now, read the clauses, one at a time.
for (c = 0; c < num_clauses; c++)
{
infile>>cur_lit;
while (cur_lit != 0) {
temp_lit[clause_lit_count[c]] = cur_lit;
clause_lit_count[c]++;
infile>>cur_lit;
}
clause_lit[c] = new lit[clause_lit_count[c]+1];
for(i=0; i<clause_lit_count[c]; ++i)
{
clause_lit[c][i].clause_num = c;
clause_lit[c][i].var_num = abs(temp_lit[i]);
if (temp_lit[i] > 0) clause_lit[c][i].sense = 1;
else clause_lit[c][i].sense = 0;
var_lit_count[clause_lit[c][i].var_num]++;
}
clause_lit[c][i].var_num=0;
clause_lit[c][i].clause_num = -1;
//unit clause
if(clause_lit_count[c]==1)
{
unitclause_queue[unitclause_queue_end_pointer++] = clause_lit[c][0];
clause_delete[c]=1;
}
if(clause_lit_count[c] > max_clause_len)
max_clause_len = clause_lit_count[c];
else if(clause_lit_count[c] < min_clause_len)
min_clause_len = clause_lit_count[c];
formula_len += clause_lit_count[c];
}
infile.close();
avg_clause_len = (double)formula_len/num_clauses;
if(unitclause_queue_end_pointer>0)
{
simplify = 1;
for (c = 0; c < num_clauses; c++)
{
org_clause_lit_count[c] = clause_lit_count[c];
org_clause_lit[c] = new lit[clause_lit_count[c]+1];
for(i=0; i<org_clause_lit_count[c]; ++i)
{
org_clause_lit[c][i] = clause_lit[c][i];
}
}
}
//creat var literal arrays
for (v=1; v<=num_vars; ++v)
{
var_lit[v] = new lit[var_lit_count[v]+1];
var_lit_count[v] = 0; //reset to 0, for build up the array
}
//scan all clauses to build up var literal arrays
for (c = 0; c < num_clauses; ++c)
{
for(i=0; i<clause_lit_count[c]; ++i)
{
v = clause_lit[c][i].var_num;
var_lit[v][var_lit_count[v]] = clause_lit[c][i];
++var_lit_count[v];
}
}
for (v=1; v<=num_vars; ++v) //set boundary
var_lit[v][var_lit_count[v]].clause_num=-1;
return 1;
}
void build_neighbor_relation()
{
int* neighbor_flag = new int[num_vars+1];
int i,j,count;
int v,c;
for(v=1; v<=num_vars; ++v)
{
var_neighbor_count[v] = 0;
if(fix[v]==1) continue;
for(i=1; i<=num_vars; ++i)
neighbor_flag[i] = 0;
neighbor_flag[v] = 1;
for(i=0; i<var_lit_count[v]; ++i)
{
c = var_lit[v][i].clause_num;
if(clause_delete[c]==1) continue;
for(j=0; j<clause_lit_count[c]; ++j)
{
if(neighbor_flag[clause_lit[c][j].var_num]==0)
{
var_neighbor_count[v]++;
neighbor_flag[clause_lit[c][j].var_num] = 1;
}
}
}
neighbor_flag[v] = 0;
var_neighbor[v] = new int[var_neighbor_count[v]+1];
count = 0;
for(i=1; i<=num_vars; ++i)
{
if(fix[i]==1) continue;
if(neighbor_flag[i]==1)
{
var_neighbor[v][count] = i;
count++;
}
}
var_neighbor[v][count]=0;
}
delete[] neighbor_flag; neighbor_flag=NULL;
}
void print_solution()
{
int i;
cout<<"v ";
for (i=1; i<=num_vars; i++) {
if(cur_soln[i]==0) cout<<"-";
cout<<i;
if(i%10==0) cout<<endl<<"v ";
else cout<<' ';
}
cout<<"0"<<endl;
}
int verify_sol()
{
int c,j;
int flag;
if(simplify==0)
{
for (c = 0; c<num_clauses; ++c)
{
flag = 0;
for(j=0; j<clause_lit_count[c]; ++j)
if (cur_soln[clause_lit[c][j].var_num] == clause_lit[c][j].sense) {flag = 1; break;}
if(flag ==0){//output the clause unsatisfied by the solution
cout<<"c clause "<<c<<" is not satisfied"<<endl;
cout<<"c ";
for(j=0; j<clause_lit_count[c]; ++j)
{
if(clause_lit[c][j].sense==0)cout<<"-";
cout<<clause_lit[c][j].var_num<<" ";
}
cout<<endl;
for(j=0; j<clause_lit_count[c]; ++j)
cout<<cur_soln[clause_lit[c][j].var_num]<<" ";
cout<<endl;
return 0;
}
}
}
if(simplify==1)
{
for (c = 0; c<num_clauses; ++c)
{
flag = 0;
for(j=0; j<org_clause_lit_count[c]; ++j)
if (cur_soln[org_clause_lit[c][j].var_num] == org_clause_lit[c][j].sense) {flag = 1; break;}
if(flag ==0){//output the clause unsatisfied by the solution
cout<<"c clause "<<c<<" is not satisfied"<<endl;
if(clause_delete[c]==1)cout<<"c this clause is deleted by UP."<<endl;
cout<<"c ";
for(j=0; j<org_clause_lit_count[c]; ++j)
{
if(org_clause_lit[c][j].sense==0)cout<<"-";
cout<<org_clause_lit[c][j].var_num<<" ";
}
cout<<endl;
for(j=0; j<org_clause_lit_count[c]; ++j)
cout<<cur_soln[org_clause_lit[c][j].var_num]<<" ";
cout<<endl;
return 0;
}
}
}
return 1;
}
#endif

292
CCAnr/cca.cpp Normal file
View File

@ -0,0 +1,292 @@
#include "basis.h"
#include "cca.h"
#include "cw.h"
#include "preprocessor.h"
#include <string.h>
#include <sys/times.h> //these two h files are for linux
#include <unistd.h>
#include "ccanr.h"
char * inst;
int seed;
long long ls_no_improv_times;
bool aspiration_active;
static int pick_var(void)
{
int i,k,c,v;
int best_var;
lit* clause_c;
/**Greedy Mode**/
/*CCD (configuration changed decreasing) mode, the level with configuation chekcing*/
if(goodvar_stack_fill_pointer>0)
{
//if(goodvar_stack_fill_pointer<balancePar)
//{
best_var = goodvar_stack[0];
for(i=1; i<goodvar_stack_fill_pointer; ++i)
{
v=goodvar_stack[i];
if(score[v]>score[best_var]) best_var = v;
else if(score[v]==score[best_var])
{
//if(unsat_app_count[v]>unsat_app_count[best_var]) best_var = v;
//else if(unsat_app_count[v]==unsat_app_count[best_var]&&time_stamp[v]<time_stamp[best_var]) best_var = v;
if(time_stamp[v]<time_stamp[best_var]) best_var = v;
}
}
return best_var;
//}
/*else
{
best_var = goodvar_stack[rand()%goodvar_stack_fill_pointer];
for(int j=1;j<balancePar;++j)
{
v = goodvar_stack[rand()%goodvar_stack_fill_pointer];
if(score[v]>score[best_var]) best_var = v;
else if(score[v]==score[best_var])
{
//if(unsat_app_count[v]>unsat_app_count[best_var]) best_var = v;
//else if(unsat_app_count[v]==unsat_app_count[best_var]&&time_stamp[v]<time_stamp[best_var]) best_var = v;
if(time_stamp[v]<time_stamp[best_var]) best_var = v;
}
}
return best_var;
}*/
}
/*aspiration*/
if (aspiration_active)
{
best_var = 0;
for(i=0; i<unsatvar_stack_fill_pointer; ++i)
{
if(score[unsatvar_stack[i]]>ave_weight)
{
best_var = unsatvar_stack[i];
break;
}
}
for(++i; i<unsatvar_stack_fill_pointer; ++i)
{
v=unsatvar_stack[i];
if(score[v]>score[best_var]) best_var = v;
else if(score[v]==score[best_var] && time_stamp[v]<time_stamp[best_var]) best_var = v;
}
if(best_var!=0) return best_var;
}
/*****end aspiration*******************/
update_clause_weights();
/*focused random walk*/
c = unsat_stack[rand()%unsat_stack_fill_pointer];
clause_c = clause_lit[c];
best_var = clause_c[0].var_num;
for(k=1; k<clause_lit_count[c]; ++k)
{
v=clause_c[k].var_num;
//using score
//if(score[v]>score[best_var]) best_var = v;
//else if(score[v]==score[best_var]&&time_stamp[v]<time_stamp[best_var]) best_var = v;
//using unweighted make
if(unsat_app_count[v]>unsat_app_count[best_var]) best_var = v;
//else if(unsat_app_count[v]==unsat_app_count[best_var] && time_stamp[v]<time_stamp[best_var]) best_var = v;
else if(unsat_app_count[v]==unsat_app_count[best_var])
{
if(score[v]>score[best_var]) best_var = v;
else if(score[v]==score[best_var]&&time_stamp[v]<time_stamp[best_var]) best_var = v;
}
}
return best_var;
}
//set functions in the algorithm
void settings()
{
//set_clause_weighting();
//aspiration_active = false; //
}
/*
void local_search(int max_flips)
{
int flipvar;
for (step = 0; step<max_flips; step++)
{
//find a solution
if(unsat_stack_fill_pointer==0) return;
flipvar = pick_var();
flip(flipvar);
time_stamp[flipvar] = step;
}
}
*/
void local_search(long long no_improv_times)
{
int flipvar;
long long notime = 1 + no_improv_times;
// printf("cur_sol: ");
// for(int i=1; i<=num_vars; i++) {
// printf("%d ", cur_soln[i]);
// }
// printf("\n");
while(--notime)
{
flipvar = pick_var();
flip(flipvar);
time_stamp[flipvar] = step;
step++;
if(unsat_stack_fill_pointer < this_try_best_unsat_stack_fill_pointer)
{
this_try_best_unsat_stack_fill_pointer = unsat_stack_fill_pointer;
notime = 1 + no_improv_times;
}
if(unsat_stack_fill_pointer == 0)
{
return;
}
}
return;
}
void default_settings()
{
seed = 1;
ls_no_improv_times = 200000;
p_scale = 0.3;
q_scale = 0.7;
threshold = 50;
aspiration_active = false; //
}
int CCAnr::module_pick_var() {
return pick_var();
}
void CCAnr::module_flip_var(int flipvar) {
flip(flipvar);
time_stamp[flipvar] = step;
step++;
if(unsat_stack_fill_pointer < this_try_best_unsat_stack_fill_pointer)
{
this_try_best_unsat_stack_fill_pointer = unsat_stack_fill_pointer;
}
if(unsat_stack_fill_pointer == 0)
{
printf("[CCAnr] find solution!\n");
if(verify_sol()!=1) {
cout<<"c Sorry, something is wrong."<<endl;
exit(-1);
}
}
}
int* CCAnr::module_cur_soln() {
return cur_soln;
}
void CCAnr::module_reset() {
settings();
init();
}
void CCAnr::module_init()
{
int seed,i;
int satisfy_flag=0;
struct tms start, stop;
cout<<"c This is CCAnr 2.0 [Version: 2018.01.28] [Author: Shaowei Cai]."<<endl;
times(&start);
default_settings();
build_instance("test.cnf");
srand(seed);
//if(unitclause_queue_end_pointer > 0) preprocess();
build_neighbor_relation();
scale_ave=(threshold+1)*q_scale; //
cout<<"c Instance: Number of variables = "<<num_vars<<endl;
cout<<"c Instance: Number of clauses = "<<num_clauses<<endl;
cout<<"c Instance: Ratio = "<<::ratio<<endl;
cout<<"c Instance: Formula length = "<<formula_len<<endl;
cout<<"c Instance: Avg (Min,Max) clause length = "<<avg_clause_len<<" ("<<min_clause_len<<","<<max_clause_len<<")"<<endl;
cout<<"c Algorithmic: Random seed = "<<seed<<endl;
cout<<"c Algorithmic: ls_no_improv_steps = " << ls_no_improv_times << endl;
cout<<"c Algorithmic: swt_p = " << p_scale << endl;
cout<<"c Algorithmic: swt_q = " << q_scale << endl;
cout<<"c Algorithmic: swt_threshold = " << threshold << endl;
cout<<"c Algorithmic: scale_ave = " << scale_ave << endl;
if(aspiration_active) cout<<"c Algorithmic: aspiration_active = true" << endl;
else cout<<"c Algorithmic: aspiration_active = false" << endl;
// for (tries = 0; tries <= max_tries; tries++)
// {
// settings();
// init();
// local_search(ls_no_improv_times);
// if (unsat_stack_fill_pointer==0)
// {
// if(verify_sol()==1) {satisfy_flag = 1; break;}
// else cout<<"c Sorry, something is wrong."<<endl;/////
// }
// }
// times(&stop);
// double comp_time = double(stop.tms_utime - start.tms_utime +stop.tms_stime - start.tms_stime) / sysconf(_SC_CLK_TCK);
// if(satisfy_flag==1)
// {
// cout<<"s SATISFIABLE"<<endl;
// //print_solution();
// }
// else cout<<"s UNKNOWN"<<endl;
// cout<<"c solveSteps = "<<tries<<" tries + "<<step<<" steps (each try has "<<max_flips<<" steps)."<<endl;
// cout<<"c solveTime = "<<comp_time<<endl;
// free_memory();
return;
}

295
CCAnr/cca.h Normal file
View File

@ -0,0 +1,295 @@
/************************************=== CCAnr ===***************************************
** CCAnr is a local search solver for the Boolean Satisfiability (SAT) problem,
** which is especially designed for non-random instances.
** CCAnr is designed and implemented by Shaowei Cai (email: shaoweicai.cs@gmail.com),
*****************************************************************************************/
/*****************************=== Develpment history ===*************************************
** 2011.5
** SWCC (Smoothed Weighting and Configuration Checking) by Shaowei Cai
** New Idea: Configuration Checking (CC)
** A variable is configuration changed, if since its last flip, at least one of its
** neighboring var has been flipped.
** In the greedy mode, Swcc picks the best Configuration Changed Decreasing var to flip.
** In the random mode, it updates weights, and flips the oldest var in a random unsat clause.
** 2011.9
** SWCCA (Smoothed Weighting and Configuration Checking with Aspiration) by Shaowei Cai
** New Idea: CC with Aspiration (CCA)
** Modification: in greedy mode, it first prefers to flip the best CCD var. If there is
** no CCD variable, then flip the best significant decreasing var, i.e., with a great
** positive score (in Swcca, bigger than averaged clause weight), if there exsit such vars.
** 2013.4
** CCAnr (CCA for non-random SAT)
** Modifications: Generalize the smoothig fomula as w(ci)=w(ci)*p+ave_w*q; pick the greediest
** variable in the diversification mode.
************************************************************************************************/
#ifndef _CCA_H_
#define _CCA_H_
#include "basis.h"
#define pop(stack) stack[--stack ## _fill_pointer]
#define push(item, stack) stack[stack ## _fill_pointer++] = item
inline void unsat(int clause)
{
index_in_unsat_stack[clause] = unsat_stack_fill_pointer;
push(clause,unsat_stack);
//update appreance count of each var in unsat clause and update stack of vars in unsat clauses
int v;
for(lit* p=clause_lit[clause]; (v=p->var_num)!=0; p++)
{
unsat_app_count[v]++;
if(unsat_app_count[v]==1)
{
index_in_unsatvar_stack[v] = unsatvar_stack_fill_pointer;
push(v,unsatvar_stack);
}
}
}
inline void sat(int clause)
{
int index,last_unsat_clause;
//since the clause is satisfied, its position can be reused to store the last_unsat_clause
last_unsat_clause = pop(unsat_stack);
index = index_in_unsat_stack[clause];
unsat_stack[index] = last_unsat_clause;
index_in_unsat_stack[last_unsat_clause] = index;
//update appreance count of each var in unsat clause and update stack of vars in unsat clauses
int v,last_unsat_var;
for(lit* p=clause_lit[clause]; (v=p->var_num)!=0; p++)
{
unsat_app_count[v]--;
if(unsat_app_count[v]==0)
{
last_unsat_var = pop(unsatvar_stack);
index = index_in_unsatvar_stack[v];
unsatvar_stack[index] = last_unsat_var;
index_in_unsatvar_stack[last_unsat_var] = index;
}
}
}
//initiation of the algorithm
void init()
{
int v,c;
int i,j;
int clause;
//Initialize edge weights
for (c = 0; c<num_clauses; c++)
clause_weight[c] = 1;
//init unsat_stack
unsat_stack_fill_pointer = 0;
unsatvar_stack_fill_pointer = 0;
//init solution
for (v = 1; v <= num_vars; v++) {
if(fix[v]==0){
if(rand()%2==1) cur_soln[v] = 1;
else cur_soln[v] = 0;
time_stamp[v] = 0;
conf_change[v] = 1;
unsat_app_count[v] = 0;
//pscore[v] = 0;
}
}
/* figure out sat_count, and init unsat_stack */
for (c=0; c<num_clauses; ++c)
{
if(clause_delete[c]==1) continue;
sat_count[c] = 0;
for(j=0; j<clause_lit_count[c]; ++j)
{
if (cur_soln[clause_lit[c][j].var_num] == clause_lit[c][j].sense)
{
sat_count[c]++;
sat_var[c] = clause_lit[c][j].var_num;
}
}
if (sat_count[c] == 0)
unsat(c);
}
/*figure out var score*/
int lit_count;
for (v=1; v<=num_vars; v++)
{
if(fix[v]==1)
{
score[v] = -100000;
continue;
}
score[v] = 0;
lit_count = var_lit_count[v];
for(i=0; i<lit_count; ++i)
{
c = var_lit[v][i].clause_num;
if (sat_count[c]==0) score[v]++;
else if (sat_count[c]==1 && var_lit[v][i].sense==cur_soln[v]) score[v]--;
}
}
/*
int flag;
//compute pscore and record sat_var and sat_var2 for 2sat clauses
for (c=0; c<num_clauses; ++c)
{
if(clause_delete[c]==1) continue;
if (sat_count[c]==1)
{
for(j=0;j<clause_lit_count[c];++j)
{
v=clause_lit[c][j].var_num;
if(v!=sat_var[c])pscore[v]++;
}
}
else if(sat_count[c]==2)
{
flag=0;
for(j=0;j<clause_lit_count[c];++j)
{
v=clause_lit[c][j].var_num;
if(clause_lit[c][j].sense == cur_soln[v])
{
pscore[v]--;
if(flag==0){sat_var[c] = v; flag=1;}
else {sat_var2[c] = v; break;}
}
}
}
}
*/
//init goodvars stack
goodvar_stack_fill_pointer = 0;
for (v=1; v<=num_vars; v++)
{
if(fix[v]==1) continue;
if(score[v]>0)// && conf_change[v]==1)
{
already_in_goodvar_stack[v] = 1;
push(v,goodvar_stack);
}
else already_in_goodvar_stack[v] = 0;
}
//setting for the virtual var 0
time_stamp[0]=0;
//pscore[0]=0;
this_try_best_unsat_stack_fill_pointer = unsat_stack_fill_pointer;
}
void flip(int flipvar)
{
cur_soln[flipvar] = 1 - cur_soln[flipvar];
int i,j;
int v,c;
lit* clause_c;
int org_flipvar_score = score[flipvar];
//update related clauses and neighbor vars
for(lit *q = var_lit[flipvar]; (c=q->clause_num)>=0; q++)
{
clause_c = clause_lit[c];
if(cur_soln[flipvar] == q->sense)
{
++sat_count[c];
if (sat_count[c] == 2) //sat_count from 1 to 2
score[sat_var[c]] += clause_weight[c];
else if (sat_count[c] == 1) // sat_count from 0 to 1
{
sat_var[c] = flipvar;//record the only true lit's var
for(lit* p=clause_c; (v=p->var_num)!=0; p++) score[v] -= clause_weight[c];
sat(c);
}
}
else // cur_soln[flipvar] != cur_lit.sense
{
--sat_count[c];
if (sat_count[c] == 1) //sat_count from 2 to 1
{
for(lit* p=clause_c; (v=p->var_num)!=0; p++)
{
if(p->sense == cur_soln[v] )
{
score[v] -= clause_weight[c];
sat_var[c] = v;
break;
}
}
}
else if (sat_count[c] == 0) //sat_count from 1 to 0
{
for(lit* p=clause_c; (v=p->var_num)!=0; p++) score[v] += clause_weight[c];
unsat(c);
}//end else if
}//end else
}
score[flipvar] = -org_flipvar_score;
/*update CCD */
int index;
conf_change[flipvar] = 0;
//remove the vars no longer goodvar in goodvar stack
for(index=goodvar_stack_fill_pointer-1; index>=0; index--)
{
v = goodvar_stack[index];
if(score[v]<=0)
{
goodvar_stack[index] = pop(goodvar_stack);
already_in_goodvar_stack[v] = 0;
}
}
//update all flipvar's neighbor's conf_change to be 1, add goodvar
int* p;
for(p=var_neighbor[flipvar]; (v=*p)!=0; p++)
{
conf_change[v] = 1;
if(score[v]>0 && already_in_goodvar_stack[v] ==0)
{
push(v,goodvar_stack);
already_in_goodvar_stack[v] = 1;
}
}
}
#endif

9
CCAnr/ccanr.h Normal file
View File

@ -0,0 +1,9 @@
namespace CCAnr {
void module_init();
int module_pick_var();
void module_flip_var(int var);
void module_reset();
int* module_cur_soln();
}

103
CCAnr/cw.h Normal file
View File

@ -0,0 +1,103 @@
#ifndef _CW_H_
#define _CW_H_
#include "basis.h"
#define sigscore ave_weight //significant score needed for aspiration
int ave_weight=1;
int delta_total_weight=0;
/**************************************** clause weighting for 3sat **************************************************/
int threshold;
float p_scale;//w=w*p+ave_w*q
float q_scale=0;
int scale_ave;//scale_ave==ave_weight*q_scale
int q_init=0;
void smooth_clause_weights()
{
int i,j,c,v;
int new_total_weight=0;
for (v=1; v<=num_vars; ++v)
score[v] = 0;
//smooth clause score and update score of variables
for (c = 0; c<num_clauses; ++c)
{
clause_weight[c] = clause_weight[c]*p_scale+scale_ave;
if(clause_weight[c]<1) clause_weight[c] = 1;
new_total_weight+=clause_weight[c];
//update score of variables in this clause
if (sat_count[c]==0)
{
for(j=0; j<clause_lit_count[c]; ++j)
{
score[clause_lit[c][j].var_num] += clause_weight[c];
}
}
else if(sat_count[c]==1)
score[sat_var[c]]-=clause_weight[c];
}
ave_weight=new_total_weight/num_clauses;
}
void update_clause_weights()
{
int i,v;
for(i=0; i < unsat_stack_fill_pointer; ++i)
clause_weight[unsat_stack[i]]++;
for(i=0; i<unsatvar_stack_fill_pointer; ++i)
{
v = unsatvar_stack[i];
score[v] += unsat_app_count[v];
if(score[v]>0 && conf_change[v]==1 && already_in_goodvar_stack[v] ==0)
{
push(v,goodvar_stack);
already_in_goodvar_stack[v] =1;
}
}
delta_total_weight+=unsat_stack_fill_pointer;
if(delta_total_weight>=num_clauses)
{
ave_weight+=1;
delta_total_weight -= num_clauses;
//smooth weights
if(ave_weight>threshold)
smooth_clause_weights();
}
}
void set_clause_weighting()
{
threshold=300;
p_scale=0.3;
if(q_init==0)
{
if(::ratio<=15) q_scale=0;
else q_scale=0.7;
}
else
{
if(q_scale<0.5) //0
q_scale = 0.7;
else
q_scale = 0;
}
scale_ave=(threshold+1)*q_scale;
q_init = 1;
}
#endif

133
CCAnr/preprocessor.h Normal file
View File

@ -0,0 +1,133 @@
#include "basis.h"
//preprocess
void unit_propagation()
{
lit uc_lit;
int uc_clause;
int uc_var;
bool uc_sense;
int c,v;
int i,j;
lit cur, cur_c;
//while (unitclause_queue_beg_pointer < unitclause_queue_end_pointer)
for(unitclause_queue_beg_pointer=0; unitclause_queue_beg_pointer < unitclause_queue_end_pointer; unitclause_queue_beg_pointer++)
{
uc_lit = unitclause_queue[unitclause_queue_beg_pointer];
uc_var = uc_lit.var_num;
uc_sense = uc_lit.sense;
if(fix[uc_var]==1) {if(uc_sense!=cur_soln[uc_var])cout<<"c wants to fix a variable twice, forbid."<<endl; continue;}
cur_soln[uc_var] = uc_sense;//fix the variable in unit clause
fix[uc_var] = 1;
for(i = 0; i<var_lit_count[uc_var]; ++i)
{
cur = var_lit[uc_var][i];
c = cur.clause_num;
if(clause_delete[c]==1) continue;
if(cur.sense == uc_sense)//then remove the clause from var's var_lit[] array
{
clause_delete[c]=1;
}
else
{
if(clause_lit_count[c]==2)
{
if(clause_lit[c][0].var_num == uc_var)
{
unitclause_queue[unitclause_queue_end_pointer++] = clause_lit[c][1];
}
else
{
unitclause_queue[unitclause_queue_end_pointer++] = clause_lit[c][0];
}
clause_delete[c]=1;
}
else
{
for(j=0; j<clause_lit_count[c]; ++j)
{
if(clause_lit[c][j].var_num == uc_var)
{
clause_lit[c][j]=clause_lit[c][clause_lit_count[c]-1];
clause_lit_count[c]--;
break;
}
}//for
}
}
}//for
}//begpointer to endpointer for
}
void preprocess()
{
int c,v,i;
int delete_clause_count=0;
int fix_var_count=0;
unit_propagation();
//rescan all clauses to build up var literal arrays
for (v=1; v<=num_vars; ++v)
var_lit_count[v] = 0;
max_clause_len = 0;
min_clause_len = num_vars;
int formula_len=0;
for (c = 0; c < num_clauses; ++c)
{
if(clause_delete[c]==1) {
delete_clause_count++;
continue;
}
for(i=0; i<clause_lit_count[c]; ++i)
{
v = clause_lit[c][i].var_num;
var_lit[v][var_lit_count[v]] = clause_lit[c][i];
++var_lit_count[v];
}
clause_lit[c][i].var_num=0; //new clause boundary
clause_lit[c][i].clause_num = -1;
//about clause length
formula_len += clause_lit_count[c];
if(clause_lit_count[c] > max_clause_len)
max_clause_len = clause_lit_count[c];
else if(clause_lit_count[c] < min_clause_len)
min_clause_len = clause_lit_count[c];
}
avg_clause_len = (double)formula_len/num_clauses;
for (v=1; v<=num_vars; ++v)
{
if(fix[v]==1)
{
fix_var_count++;
}
var_lit[v][var_lit_count[v]].clause_num=-1;//new var_lit boundary
}
cout<<"c unit propagation fixes "<<fix_var_count<<" variables, and delets "<<delete_clause_count<<" clauses"<<endl;
}

515
CCAnr/test.cnf Normal file
View File

@ -0,0 +1,515 @@
p cnf 196 514
-37 -1 0
37 1 0
-38 -2 0
38 2 0
-39 -4 0
39 4 0
-40 -6 0
40 6 0
-41 -8 0
41 8 0
-42 -10 0
42 10 0
-43 -12 0
43 12 0
-44 -14 0
44 14 0
-45 -16 0
45 16 0
-46 -18 0
46 18 0
-47 -20 0
47 20 0
-48 -22 0
48 22 0
-49 -24 0
49 24 0
-50 -26 0
50 26 0
-51 -28 0
51 28 0
-52 -30 0
52 30 0
-53 -32 0
53 32 0
-54 -34 0
54 34 0
55 37 0
55 2 0
-37 -2 -55 0
3 38 56 0
-56 -3 0
-56 -38 0
5 38 57 0
-57 -5 0
-57 -38 0
58 39 0
58 6 0
-39 -6 -58 0
61 41 0
61 10 0
-41 -10 -61 0
64 43 0
64 14 0
-43 -14 -64 0
67 45 0
67 18 0
-45 -18 -67 0
70 47 0
70 22 0
-47 -22 -70 0
73 49 0
73 26 0
-49 -26 -73 0
76 51 0
76 30 0
-51 -30 -76 0
79 53 0
79 34 0
-53 -34 -79 0
7 40 59 0
-59 -7 0
-59 -40 0
9 40 60 0
-60 -9 0
-60 -40 0
11 42 62 0
-62 -11 0
-62 -42 0
13 42 63 0
-63 -13 0
-63 -42 0
15 44 65 0
-65 -15 0
-65 -44 0
17 44 66 0
-66 -17 0
-66 -44 0
19 46 68 0
-68 -19 0
-68 -46 0
21 46 69 0
-69 -21 0
-69 -46 0
23 48 71 0
-71 -23 0
-71 -48 0
25 48 72 0
-72 -25 0
-72 -48 0
27 50 74 0
-74 -27 0
-74 -50 0
29 50 75 0
-75 -29 0
-75 -50 0
31 52 77 0
-77 -31 0
-77 -52 0
33 52 78 0
-78 -33 0
-78 -52 0
35 54 80 0
-80 -35 0
-80 -54 0
36 54 81 0
-81 -36 0
-81 -54 0
-82 55 0
-82 58 0
-82 61 0
-82 64 0
-82 67 0
-82 70 0
-82 73 0
-82 76 0
-82 79 0
-55 -58 -61 -64 -67 -70 -73 -76 -79 82 0
-83 -82 0
83 82 0
-84 -82 0
84 82 0
-85 -82 0
85 82 0
-86 -83 -55 0
-86 83 55 0
86 -83 55 0
86 83 -55 0
-87 -83 -58 0
-87 83 58 0
87 -83 58 0
87 83 -58 0
-88 -83 -61 0
-88 83 61 0
88 -83 61 0
88 83 -61 0
-89 -83 -64 0
-89 83 64 0
89 -83 64 0
89 83 -64 0
-90 -83 -67 0
-90 83 67 0
90 -83 67 0
90 83 -67 0
-91 -83 -70 0
-91 83 70 0
91 -83 70 0
91 83 -70 0
95 1 0
95 84 0
-1 -84 -95 0
-92 -83 -73 0
-92 83 73 0
92 -83 73 0
92 83 -73 0
96 84 0
96 4 0
-84 -4 -96 0
-93 -83 -76 0
-93 83 76 0
93 -83 76 0
93 83 -76 0
97 84 0
97 8 0
-84 -8 -97 0
-94 -83 -79 0
-94 83 79 0
94 -83 79 0
94 83 -79 0
98 84 0
98 12 0
-84 -12 -98 0
99 84 0
99 16 0
-84 -16 -99 0
100 84 0
100 20 0
-84 -20 -100 0
101 84 0
101 24 0
-84 -24 -101 0
102 84 0
102 28 0
-84 -28 -102 0
103 84 0
103 32 0
-84 -32 -103 0
104 86 0
104 56 0
-86 -56 -104 0
105 86 0
105 57 0
-86 -57 -105 0
106 87 0
106 59 0
-87 -59 -106 0
108 88 0
108 62 0
-88 -62 -108 0
110 89 0
110 65 0
-89 -65 -110 0
112 90 0
112 68 0
-90 -68 -112 0
114 91 0
114 71 0
-91 -71 -114 0
116 92 0
116 74 0
-92 -74 -116 0
118 93 0
118 77 0
-93 -77 -118 0
120 94 0
120 80 0
-94 -80 -120 0
107 87 0
107 60 0
-87 -60 -107 0
109 88 0
109 63 0
-88 -63 -109 0
111 89 0
111 66 0
-89 -66 -111 0
113 90 0
113 69 0
-90 -69 -113 0
115 91 0
115 72 0
-91 -72 -115 0
117 92 0
117 75 0
-92 -75 -117 0
119 93 0
119 78 0
-93 -78 -119 0
121 94 0
121 81 0
-94 -81 -121 0
-130 104 0
-130 106 0
-130 108 0
-130 110 0
-130 112 0
-130 114 0
-130 116 0
-130 118 0
-130 120 0
-104 -106 -108 -110 -112 -114 -116 -118 -120 130 0
-122 -105 0
122 105 0
-123 -107 0
123 107 0
-124 -109 0
124 109 0
-125 -111 0
125 111 0
-126 -113 0
126 113 0
-127 -115 0
127 115 0
-128 -117 0
128 117 0
-129 -119 0
129 119 0
-131 -121 0
131 121 0
-132 -130 0
132 130 0
-133 -130 0
133 130 0
-134 -130 0
134 130 0
-135 -132 -104 0
-135 132 104 0
135 -132 104 0
135 132 -104 0
-136 -132 -106 0
-136 132 106 0
136 -132 106 0
136 132 -106 0
-137 -132 -108 0
-137 132 108 0
137 -132 108 0
137 132 -108 0
-138 -132 -110 0
-138 132 110 0
138 -132 110 0
138 132 -110 0
144 3 0
144 133 0
-3 -133 -144 0
-139 -132 -112 0
-139 132 112 0
139 -132 112 0
139 132 -112 0
145 133 0
145 7 0
-133 -7 -145 0
-140 -132 -114 0
-140 132 114 0
140 -132 114 0
140 132 -114 0
146 133 0
146 11 0
-133 -11 -146 0
-141 -132 -116 0
-141 132 116 0
141 -132 116 0
141 132 -116 0
147 133 0
147 15 0
-133 -15 -147 0
-142 -132 -118 0
-142 132 118 0
142 -132 118 0
142 132 -118 0
148 133 0
148 19 0
-133 -19 -148 0
-143 -132 -120 0
-143 132 120 0
143 -132 120 0
143 132 -120 0
149 133 0
149 23 0
-133 -23 -149 0
150 133 0
150 27 0
-133 -27 -150 0
151 133 0
151 31 0
-133 -31 -151 0
152 133 0
152 35 0
-133 -35 -152 0
153 135 0
153 122 0
-135 -122 -153 0
154 136 0
154 123 0
-136 -123 -154 0
155 137 0
155 124 0
-137 -124 -155 0
156 138 0
156 125 0
-138 -125 -156 0
157 139 0
157 126 0
-139 -126 -157 0
158 140 0
158 127 0
-140 -127 -158 0
159 141 0
159 128 0
-141 -128 -159 0
160 142 0
160 129 0
-142 -129 -160 0
161 143 0
161 131 0
-143 -131 -161 0
-162 153 0
-162 154 0
-162 155 0
-162 156 0
-162 157 0
-162 158 0
-162 159 0
-162 160 0
-162 161 0
-153 -154 -155 -156 -157 -158 -159 -160 -161 162 0
-163 -162 0
163 162 0
-164 -162 0
164 162 0
165 5 0
165 163 0
-5 -163 -165 0
166 163 0
166 9 0
-163 -9 -166 0
167 163 0
167 13 0
-163 -13 -167 0
168 163 0
168 17 0
-163 -17 -168 0
169 163 0
169 21 0
-163 -21 -169 0
170 163 0
170 25 0
-163 -25 -170 0
171 163 0
171 29 0
-163 -29 -171 0
172 163 0
172 33 0
-163 -33 -172 0
173 163 0
173 36 0
-163 -36 -173 0
174 2 0
174 95 0
174 144 0
174 165 0
-2 -95 -144 -165 -174 0
175 96 0
175 145 0
175 166 0
175 6 0
-96 -145 -166 -6 -175 0
176 97 0
176 146 0
176 167 0
176 10 0
-97 -146 -167 -10 -176 0
177 98 0
177 147 0
177 168 0
177 14 0
-98 -147 -168 -14 -177 0
178 99 0
178 148 0
178 169 0
178 18 0
-99 -148 -169 -18 -178 0
179 100 0
179 149 0
179 170 0
179 22 0
-100 -149 -170 -22 -179 0
180 101 0
180 150 0
180 171 0
180 26 0
-101 -150 -171 -26 -180 0
181 102 0
181 151 0
181 172 0
181 30 0
-102 -151 -172 -30 -181 0
182 103 0
182 152 0
182 173 0
182 34 0
-103 -152 -173 -34 -182 0
-183 -174 0
183 174 0
-188 175 0
-188 176 0
-188 177 0
-188 178 0
-188 179 0
-188 180 0
-188 181 0
-188 182 0
-175 -176 -177 -178 -179 -180 -181 -182 188 0
-184 -177 0
184 177 0
-185 -179 0
185 179 0
-186 -180 0
186 180 0
-187 -181 0
187 181 0
183 188 193 0
-193 -183 0
-193 -188 0
189 176 0
189 184 0
-176 -184 -189 0
190 176 0
190 177 0
190 185 0
190 178 0
-176 -177 -185 -178 -190 0
191 178 0
191 177 0
191 186 0
-178 -177 -186 -191 0
192 176 0
192 177 0
192 180 0
192 187 0
-176 -177 -180 -187 -192 0
194 175 0
194 176 0
194 189 0
194 178 0
-175 -176 -189 -178 -194 0
195 175 0
195 176 0
195 190 0
195 191 0
-175 -176 -190 -191 -195 0
196 175 0
196 189 0
196 190 0
196 192 0
-175 -189 -190 -192 -196 0

View File

@ -1,109 +0,0 @@
library(demo) {
cell(NAND4) {
area: 15;
pin(A) { direction: input; }
pin(B) { direction: input; }
pin(C) { direction: input; }
pin(D) { direction: input; }
pin(Y) { direction: output; function: "(A*B*C*D)'"; } }
cell(NAND3) {
area: 12;
pin(A) { direction: input; }
pin(B) { direction: input; }
pin(C) { direction: input; }
pin(Y) { direction: output; function: "(A*B*C)'"; } }
cell(NAND2) {
area: 10;
pin(A) { direction: input; }
pin(B) { direction: input; }
pin(Y) { direction: output; function: "(A*B)'"; } }
cell(AND4) {
area: 20;
pin(A) { direction: input; }
pin(B) { direction: input; }
pin(C) { direction: input; }
pin(D) { direction: input; }
pin(Y) { direction: output; function: "(A*B*C*D)"; } }
cell(AND3) {
area: 15;
pin(A) { direction: input; }
pin(B) { direction: input; }
pin(C) { direction: input; }
pin(Y) { direction: output; function: "(A*B*C)"; } }
cell(AND2) {
area: 12;
pin(A) { direction: input; }
pin(B) { direction: input; }
pin(Y) { direction: output; function: "(A*B)"; } }
cell(NOR4) {
area: 20;
pin(A) { direction: input; }
pin(B) { direction: input; }
pin(C) { direction: input; }
pin(D) { direction: input; }
pin(Y) { direction: output; function: "(A+B+C+D)'"; } }
cell(NOR3) {
area: 15;
pin(A) { direction: input; }
pin(B) { direction: input; }
pin(C) { direction: input; }
pin(Y) { direction: output; function: "(A+B+C)'"; } }
cell(NOR2) {
area: 10;
pin(A) { direction: input; }
pin(B) { direction: input; }
pin(Y) { direction: output; function: "(A+B)'"; } }
cell(OR4) {
area: 20;
pin(A) { direction: input; }
pin(B) { direction: input; }
pin(C) { direction: input; }
pin(D) { direction: input; }
pin(Y) { direction: output; function: "(A+B+C+D)"; } }
cell(OR3) {
area: 15;
pin(A) { direction: input; }
pin(B) { direction: input; }
pin(C) { direction: input; }
pin(Y) { direction: output; function: "(A+B+C)"; } }
cell(OR2) {
area: 10;
pin(A) { direction: input; }
pin(B) { direction: input; }
pin(Y) { direction: output; function: "(A+B)"; } }
cell(XNOR2) {
area: 25;
pin(A) { direction: input; }
pin(B) { direction: input; }
pin(Y) { direction: output; function: "(A^B)'"; } }
cell(XOR2) {
area: 25;
pin(A) { direction: input; }
pin(B) { direction: input; }
pin(Y) { direction: output; function: "(A^B)"; } }
cell(BUF) {
area: 12;
pin(A) { direction: input; }
pin(Y) { direction: output; function: "A"; } }
cell(NOT) {
area: 6;
pin(A) { direction: input; }
pin(Y) { direction: output; function: "A'"; } }
}

View File

View File

View File

@ -1,17 +0,0 @@
import os
import re
for file in os.listdir("."):
if not file.endswith(".bench"): continue
content = open(file, "r").read()
content = re.sub(r"(\d+)", r"\\\1", content)
print(content)
f = open("new/" + file, "w")
f.write(content)
f.close()

View File

@ -1,623 +0,0 @@
# c\1355
INPUT(\1)
INPUT(\8)
INPUT(\15)
INPUT(\22)
INPUT(\29)
INPUT(\36)
INPUT(\43)
INPUT(\50)
INPUT(\57)
INPUT(\64)
INPUT(\71)
INPUT(\78)
INPUT(\85)
INPUT(\92)
INPUT(\99)
INPUT(\106)
INPUT(\113)
INPUT(\120)
INPUT(\127)
INPUT(\134)
INPUT(\141)
INPUT(\148)
INPUT(\155)
INPUT(\162)
INPUT(\169)
INPUT(\176)
INPUT(\183)
INPUT(\190)
INPUT(\197)
INPUT(\204)
INPUT(\211)
INPUT(\218)
INPUT(\225)
INPUT(\226)
INPUT(\227)
INPUT(\228)
INPUT(\229)
INPUT(\230)
INPUT(\231)
INPUT(\232)
INPUT(\233)
OUTPUT(\1324)
OUTPUT(\1325)
OUTPUT(\1326)
OUTPUT(\1327)
OUTPUT(\1328)
OUTPUT(\1329)
OUTPUT(\1330)
OUTPUT(\1331)
OUTPUT(\1332)
OUTPUT(\1333)
OUTPUT(\1334)
OUTPUT(\1335)
OUTPUT(\1336)
OUTPUT(\1337)
OUTPUT(\1338)
OUTPUT(\1339)
OUTPUT(\1340)
OUTPUT(\1341)
OUTPUT(\1342)
OUTPUT(\1343)
OUTPUT(\1344)
OUTPUT(\1345)
OUTPUT(\1346)
OUTPUT(\1347)
OUTPUT(\1348)
OUTPUT(\1349)
OUTPUT(\1350)
OUTPUT(\1351)
OUTPUT(\1352)
OUTPUT(\1353)
OUTPUT(\1354)
OUTPUT(\1355)
\242 = AND(\225, \233)
\245 = AND(\226, \233)
\248 = AND(\227, \233)
\251 = AND(\228, \233)
\254 = AND(\229, \233)
\257 = AND(\230, \233)
\260 = AND(\231, \233)
\263 = AND(\232, \233)
\266 = NAND(\1, \8)
\269 = NAND(\15, \22)
\272 = NAND(\29, \36)
\275 = NAND(\43, \50)
\278 = NAND(\57, \64)
\281 = NAND(\71, \78)
\284 = NAND(\85, \92)
\287 = NAND(\99, \106)
\290 = NAND(\113, \120)
\293 = NAND(\127, \134)
\296 = NAND(\141, \148)
\299 = NAND(\155, \162)
\302 = NAND(\169, \176)
\305 = NAND(\183, \190)
\308 = NAND(\197, \204)
\311 = NAND(\211, \218)
\314 = NAND(\1, \29)
\317 = NAND(\57, \85)
\320 = NAND(\8, \36)
\323 = NAND(\64, \92)
\326 = NAND(\15, \43)
\329 = NAND(\71, \99)
\332 = NAND(\22, \50)
\335 = NAND(\78, \106)
\338 = NAND(\113, \141)
\341 = NAND(\169, \197)
\344 = NAND(\120, \148)
\347 = NAND(\176, \204)
\350 = NAND(\127, \155)
\353 = NAND(\183, \211)
\356 = NAND(\134, \162)
\359 = NAND(\190, \218)
\362 = NAND(\1, \266)
\363 = NAND(\8, \266)
\364 = NAND(\15, \269)
\365 = NAND(\22, \269)
\366 = NAND(\29, \272)
\367 = NAND(\36, \272)
\368 = NAND(\43, \275)
\369 = NAND(\50, \275)
\370 = NAND(\57, \278)
\371 = NAND(\64, \278)
\372 = NAND(\71, \281)
\373 = NAND(\78, \281)
\374 = NAND(\85, \284)
\375 = NAND(\92, \284)
\376 = NAND(\99, \287)
\377 = NAND(\106, \287)
\378 = NAND(\113, \290)
\379 = NAND(\120, \290)
\380 = NAND(\127, \293)
\381 = NAND(\134, \293)
\382 = NAND(\141, \296)
\383 = NAND(\148, \296)
\384 = NAND(\155, \299)
\385 = NAND(\162, \299)
\386 = NAND(\169, \302)
\387 = NAND(\176, \302)
\388 = NAND(\183, \305)
\389 = NAND(\190, \305)
\390 = NAND(\197, \308)
\391 = NAND(\204, \308)
\392 = NAND(\211, \311)
\393 = NAND(\218, \311)
\394 = NAND(\1, \314)
\395 = NAND(\29, \314)
\396 = NAND(\57, \317)
\397 = NAND(\85, \317)
\398 = NAND(\8, \320)
\399 = NAND(\36, \320)
\400 = NAND(\64, \323)
\401 = NAND(\92, \323)
\402 = NAND(\15, \326)
\403 = NAND(\43, \326)
\404 = NAND(\71, \329)
\405 = NAND(\99, \329)
\406 = NAND(\22, \332)
\407 = NAND(\50, \332)
\408 = NAND(\78, \335)
\409 = NAND(\106, \335)
\410 = NAND(\113, \338)
\411 = NAND(\141, \338)
\412 = NAND(\169, \341)
\413 = NAND(\197, \341)
\414 = NAND(\120, \344)
\415 = NAND(\148, \344)
\416 = NAND(\176, \347)
\417 = NAND(\204, \347)
\418 = NAND(\127, \350)
\419 = NAND(\155, \350)
\420 = NAND(\183, \353)
\421 = NAND(\211, \353)
\422 = NAND(\134, \356)
\423 = NAND(\162, \356)
\424 = NAND(\190, \359)
\425 = NAND(\218, \359)
\426 = NAND(\362, \363)
\429 = NAND(\364, \365)
\432 = NAND(\366, \367)
\435 = NAND(\368, \369)
\438 = NAND(\370, \371)
\441 = NAND(\372, \373)
\444 = NAND(\374, \375)
\447 = NAND(\376, \377)
\450 = NAND(\378, \379)
\453 = NAND(\380, \381)
\456 = NAND(\382, \383)
\459 = NAND(\384, \385)
\462 = NAND(\386, \387)
\465 = NAND(\388, \389)
\468 = NAND(\390, \391)
\471 = NAND(\392, \393)
\474 = NAND(\394, \395)
\477 = NAND(\396, \397)
\480 = NAND(\398, \399)
\483 = NAND(\400, \401)
\486 = NAND(\402, \403)
\489 = NAND(\404, \405)
\492 = NAND(\406, \407)
\495 = NAND(\408, \409)
\498 = NAND(\410, \411)
\501 = NAND(\412, \413)
\504 = NAND(\414, \415)
\507 = NAND(\416, \417)
\510 = NAND(\418, \419)
\513 = NAND(\420, \421)
\516 = NAND(\422, \423)
\519 = NAND(\424, \425)
\522 = NAND(\426, \429)
\525 = NAND(\432, \435)
\528 = NAND(\438, \441)
\531 = NAND(\444, \447)
\534 = NAND(\450, \453)
\537 = NAND(\456, \459)
\540 = NAND(\462, \465)
\543 = NAND(\468, \471)
\546 = NAND(\474, \477)
\549 = NAND(\480, \483)
\552 = NAND(\486, \489)
\555 = NAND(\492, \495)
\558 = NAND(\498, \501)
\561 = NAND(\504, \507)
\564 = NAND(\510, \513)
\567 = NAND(\516, \519)
\570 = NAND(\426, \522)
\571 = NAND(\429, \522)
\572 = NAND(\432, \525)
\573 = NAND(\435, \525)
\574 = NAND(\438, \528)
\575 = NAND(\441, \528)
\576 = NAND(\444, \531)
\577 = NAND(\447, \531)
\578 = NAND(\450, \534)
\579 = NAND(\453, \534)
\580 = NAND(\456, \537)
\581 = NAND(\459, \537)
\582 = NAND(\462, \540)
\583 = NAND(\465, \540)
\584 = NAND(\468, \543)
\585 = NAND(\471, \543)
\586 = NAND(\474, \546)
\587 = NAND(\477, \546)
\588 = NAND(\480, \549)
\589 = NAND(\483, \549)
\590 = NAND(\486, \552)
\591 = NAND(\489, \552)
\592 = NAND(\492, \555)
\593 = NAND(\495, \555)
\594 = NAND(\498, \558)
\595 = NAND(\501, \558)
\596 = NAND(\504, \561)
\597 = NAND(\507, \561)
\598 = NAND(\510, \564)
\599 = NAND(\513, \564)
\600 = NAND(\516, \567)
\601 = NAND(\519, \567)
\602 = NAND(\570, \571)
\607 = NAND(\572, \573)
\612 = NAND(\574, \575)
\617 = NAND(\576, \577)
\622 = NAND(\578, \579)
\627 = NAND(\580, \581)
\632 = NAND(\582, \583)
\637 = NAND(\584, \585)
\642 = NAND(\586, \587)
\645 = NAND(\588, \589)
\648 = NAND(\590, \591)
\651 = NAND(\592, \593)
\654 = NAND(\594, \595)
\657 = NAND(\596, \597)
\660 = NAND(\598, \599)
\663 = NAND(\600, \601)
\666 = NAND(\602, \607)
\669 = NAND(\612, \617)
\672 = NAND(\602, \612)
\675 = NAND(\607, \617)
\678 = NAND(\622, \627)
\681 = NAND(\632, \637)
\684 = NAND(\622, \632)
\687 = NAND(\627, \637)
\690 = NAND(\602, \666)
\691 = NAND(\607, \666)
\692 = NAND(\612, \669)
\693 = NAND(\617, \669)
\694 = NAND(\602, \672)
\695 = NAND(\612, \672)
\696 = NAND(\607, \675)
\697 = NAND(\617, \675)
\698 = NAND(\622, \678)
\699 = NAND(\627, \678)
\700 = NAND(\632, \681)
\701 = NAND(\637, \681)
\702 = NAND(\622, \684)
\703 = NAND(\632, \684)
\704 = NAND(\627, \687)
\705 = NAND(\637, \687)
\706 = NAND(\690, \691)
\709 = NAND(\692, \693)
\712 = NAND(\694, \695)
\715 = NAND(\696, \697)
\718 = NAND(\698, \699)
\721 = NAND(\700, \701)
\724 = NAND(\702, \703)
\727 = NAND(\704, \705)
\730 = NAND(\242, \718)
\733 = NAND(\245, \721)
\736 = NAND(\248, \724)
\739 = NAND(\251, \727)
\742 = NAND(\254, \706)
\745 = NAND(\257, \709)
\748 = NAND(\260, \712)
\751 = NAND(\263, \715)
\754 = NAND(\242, \730)
\755 = NAND(\718, \730)
\756 = NAND(\245, \733)
\757 = NAND(\721, \733)
\758 = NAND(\248, \736)
\759 = NAND(\724, \736)
\760 = NAND(\251, \739)
\761 = NAND(\727, \739)
\762 = NAND(\254, \742)
\763 = NAND(\706, \742)
\764 = NAND(\257, \745)
\765 = NAND(\709, \745)
\766 = NAND(\260, \748)
\767 = NAND(\712, \748)
\768 = NAND(\263, \751)
\769 = NAND(\715, \751)
\770 = NAND(\754, \755)
\773 = NAND(\756, \757)
\776 = NAND(\758, \759)
\779 = NAND(\760, \761)
\782 = NAND(\762, \763)
\785 = NAND(\764, \765)
\788 = NAND(\766, \767)
\791 = NAND(\768, \769)
\794 = NAND(\642, \770)
\797 = NAND(\645, \773)
\800 = NAND(\648, \776)
\803 = NAND(\651, \779)
\806 = NAND(\654, \782)
\809 = NAND(\657, \785)
\812 = NAND(\660, \788)
\815 = NAND(\663, \791)
\818 = NAND(\642, \794)
\819 = NAND(\770, \794)
\820 = NAND(\645, \797)
\821 = NAND(\773, \797)
\822 = NAND(\648, \800)
\823 = NAND(\776, \800)
\824 = NAND(\651, \803)
\825 = NAND(\779, \803)
\826 = NAND(\654, \806)
\827 = NAND(\782, \806)
\828 = NAND(\657, \809)
\829 = NAND(\785, \809)
\830 = NAND(\660, \812)
\831 = NAND(\788, \812)
\832 = NAND(\663, \815)
\833 = NAND(\791, \815)
\834 = NAND(\818, \819)
\847 = NAND(\820, \821)
\860 = NAND(\822, \823)
\873 = NAND(\824, \825)
\886 = NAND(\828, \829)
\899 = NAND(\832, \833)
\912 = NAND(\830, \831)
\925 = NAND(\826, \827)
\938 = NOT(\834)
\939 = NOT(\847)
\940 = NOT(\860)
\941 = NOT(\834)
\942 = NOT(\847)
\943 = NOT(\873)
\944 = NOT(\834)
\945 = NOT(\860)
\946 = NOT(\873)
\947 = NOT(\847)
\948 = NOT(\860)
\949 = NOT(\873)
\950 = NOT(\886)
\951 = NOT(\899)
\952 = NOT(\886)
\953 = NOT(\912)
\954 = NOT(\925)
\955 = NOT(\899)
\956 = NOT(\925)
\957 = NOT(\912)
\958 = NOT(\925)
\959 = NOT(\886)
\960 = NOT(\912)
\961 = NOT(\925)
\962 = NOT(\886)
\963 = NOT(\899)
\964 = NOT(\925)
\965 = NOT(\912)
\966 = NOT(\899)
\967 = NOT(\886)
\968 = NOT(\912)
\969 = NOT(\899)
\970 = NOT(\847)
\971 = NOT(\873)
\972 = NOT(\847)
\973 = NOT(\860)
\974 = NOT(\834)
\975 = NOT(\873)
\976 = NOT(\834)
\977 = NOT(\860)
\978 = AND(\938, \939, \940, \873)
\979 = AND(\941, \942, \860, \943)
\980 = AND(\944, \847, \945, \946)
\981 = AND(\834, \947, \948, \949)
\982 = AND(\958, \959, \960, \899)
\983 = AND(\961, \962, \912, \963)
\984 = AND(\964, \886, \965, \966)
\985 = AND(\925, \967, \968, \969)
\986 = OR(\978, \979, \980, \981)
\991 = OR(\982, \983, \984, \985)
\996 = AND(\925, \950, \912, \951, \986)
\1001 = AND(\925, \952, \953, \899, \986)
\1006 = AND(\954, \886, \912, \955, \986)
\1011 = AND(\956, \886, \957, \899, \986)
\1016 = AND(\834, \970, \860, \971, \991)
\1021 = AND(\834, \972, \973, \873, \991)
\1026 = AND(\974, \847, \860, \975, \991)
\1031 = AND(\976, \847, \977, \873, \991)
\1036 = AND(\834, \996)
\1039 = AND(\847, \996)
\1042 = AND(\860, \996)
\1045 = AND(\873, \996)
\1048 = AND(\834, \1001)
\1051 = AND(\847, \1001)
\1054 = AND(\860, \1001)
\1057 = AND(\873, \1001)
\1060 = AND(\834, \1006)
\1063 = AND(\847, \1006)
\1066 = AND(\860, \1006)
\1069 = AND(\873, \1006)
\1072 = AND(\834, \1011)
\1075 = AND(\847, \1011)
\1078 = AND(\860, \1011)
\1081 = AND(\873, \1011)
\1084 = AND(\925, \1016)
\1087 = AND(\886, \1016)
\1090 = AND(\912, \1016)
\1093 = AND(\899, \1016)
\1096 = AND(\925, \1021)
\1099 = AND(\886, \1021)
\1102 = AND(\912, \1021)
\1105 = AND(\899, \1021)
\1108 = AND(\925, \1026)
\1111 = AND(\886, \1026)
\1114 = AND(\912, \1026)
\1117 = AND(\899, \1026)
\1120 = AND(\925, \1031)
\1123 = AND(\886, \1031)
\1126 = AND(\912, \1031)
\1129 = AND(\899, \1031)
\1132 = NAND(\1, \1036)
\1135 = NAND(\8, \1039)
\1138 = NAND(\15, \1042)
\1141 = NAND(\22, \1045)
\1144 = NAND(\29, \1048)
\1147 = NAND(\36, \1051)
\1150 = NAND(\43, \1054)
\1153 = NAND(\50, \1057)
\1156 = NAND(\57, \1060)
\1159 = NAND(\64, \1063)
\1162 = NAND(\71, \1066)
\1165 = NAND(\78, \1069)
\1168 = NAND(\85, \1072)
\1171 = NAND(\92, \1075)
\1174 = NAND(\99, \1078)
\1177 = NAND(\106, \1081)
\1180 = NAND(\113, \1084)
\1183 = NAND(\120, \1087)
\1186 = NAND(\127, \1090)
\1189 = NAND(\134, \1093)
\1192 = NAND(\141, \1096)
\1195 = NAND(\148, \1099)
\1198 = NAND(\155, \1102)
\1201 = NAND(\162, \1105)
\1204 = NAND(\169, \1108)
\1207 = NAND(\176, \1111)
\1210 = NAND(\183, \1114)
\1213 = NAND(\190, \1117)
\1216 = NAND(\197, \1120)
\1219 = NAND(\204, \1123)
\1222 = NAND(\211, \1126)
\1225 = NAND(\218, \1129)
\1228 = NAND(\1, \1132)
\1229 = NAND(\1036, \1132)
\1230 = NAND(\8, \1135)
\1231 = NAND(\1039, \1135)
\1232 = NAND(\15, \1138)
\1233 = NAND(\1042, \1138)
\1234 = NAND(\22, \1141)
\1235 = NAND(\1045, \1141)
\1236 = NAND(\29, \1144)
\1237 = NAND(\1048, \1144)
\1238 = NAND(\36, \1147)
\1239 = NAND(\1051, \1147)
\1240 = NAND(\43, \1150)
\1241 = NAND(\1054, \1150)
\1242 = NAND(\50, \1153)
\1243 = NAND(\1057, \1153)
\1244 = NAND(\57, \1156)
\1245 = NAND(\1060, \1156)
\1246 = NAND(\64, \1159)
\1247 = NAND(\1063, \1159)
\1248 = NAND(\71, \1162)
\1249 = NAND(\1066, \1162)
\1250 = NAND(\78, \1165)
\1251 = NAND(\1069, \1165)
\1252 = NAND(\85, \1168)
\1253 = NAND(\1072, \1168)
\1254 = NAND(\92, \1171)
\1255 = NAND(\1075, \1171)
\1256 = NAND(\99, \1174)
\1257 = NAND(\1078, \1174)
\1258 = NAND(\106, \1177)
\1259 = NAND(\1081, \1177)
\1260 = NAND(\113, \1180)
\1261 = NAND(\1084, \1180)
\1262 = NAND(\120, \1183)
\1263 = NAND(\1087, \1183)
\1264 = NAND(\127, \1186)
\1265 = NAND(\1090, \1186)
\1266 = NAND(\134, \1189)
\1267 = NAND(\1093, \1189)
\1268 = NAND(\141, \1192)
\1269 = NAND(\1096, \1192)
\1270 = NAND(\148, \1195)
\1271 = NAND(\1099, \1195)
\1272 = NAND(\155, \1198)
\1273 = NAND(\1102, \1198)
\1274 = NAND(\162, \1201)
\1275 = NAND(\1105, \1201)
\1276 = NAND(\169, \1204)
\1277 = NAND(\1108, \1204)
\1278 = NAND(\176, \1207)
\1279 = NAND(\1111, \1207)
\1280 = NAND(\183, \1210)
\1281 = NAND(\1114, \1210)
\1282 = NAND(\190, \1213)
\1283 = NAND(\1117, \1213)
\1284 = NAND(\197, \1216)
\1285 = NAND(\1120, \1216)
\1286 = NAND(\204, \1219)
\1287 = NAND(\1123, \1219)
\1288 = NAND(\211, \1222)
\1289 = NAND(\1126, \1222)
\1290 = NAND(\218, \1225)
\1291 = NAND(\1129, \1225)
\1292 = NAND(\1228, \1229)
\1293 = NAND(\1230, \1231)
\1294 = NAND(\1232, \1233)
\1295 = NAND(\1234, \1235)
\1296 = NAND(\1236, \1237)
\1297 = NAND(\1238, \1239)
\1298 = NAND(\1240, \1241)
\1299 = NAND(\1242, \1243)
\1300 = NAND(\1244, \1245)
\1301 = NAND(\1246, \1247)
\1302 = NAND(\1248, \1249)
\1303 = NAND(\1250, \1251)
\1304 = NAND(\1252, \1253)
\1305 = NAND(\1254, \1255)
\1306 = NAND(\1256, \1257)
\1307 = NAND(\1258, \1259)
\1308 = NAND(\1260, \1261)
\1309 = NAND(\1262, \1263)
\1310 = NAND(\1264, \1265)
\1311 = NAND(\1266, \1267)
\1312 = NAND(\1268, \1269)
\1313 = NAND(\1270, \1271)
\1314 = NAND(\1272, \1273)
\1315 = NAND(\1274, \1275)
\1316 = NAND(\1276, \1277)
\1317 = NAND(\1278, \1279)
\1318 = NAND(\1280, \1281)
\1319 = NAND(\1282, \1283)
\1320 = NAND(\1284, \1285)
\1321 = NAND(\1286, \1287)
\1322 = NAND(\1288, \1289)
\1323 = NAND(\1290, \1291)
\1324 = BUFF(\1292)
\1325 = BUFF(\1293)
\1326 = BUFF(\1294)
\1327 = BUFF(\1295)
\1328 = BUFF(\1296)
\1329 = BUFF(\1297)
\1330 = BUFF(\1298)
\1331 = BUFF(\1299)
\1332 = BUFF(\1300)
\1333 = BUFF(\1301)
\1334 = BUFF(\1302)
\1335 = BUFF(\1303)
\1336 = BUFF(\1304)
\1337 = BUFF(\1305)
\1338 = BUFF(\1306)
\1339 = BUFF(\1307)
\1340 = BUFF(\1308)
\1341 = BUFF(\1309)
\1342 = BUFF(\1310)
\1343 = BUFF(\1311)
\1344 = BUFF(\1312)
\1345 = BUFF(\1313)
\1346 = BUFF(\1314)
\1347 = BUFF(\1315)
\1348 = BUFF(\1316)
\1349 = BUFF(\1317)
\1350 = BUFF(\1318)
\1351 = BUFF(\1319)
\1352 = BUFF(\1320)
\1353 = BUFF(\1321)
\1354 = BUFF(\1322)
\1355 = BUFF(\1323)

View File

@ -1,17 +0,0 @@
# c\17
INPUT(\1)
INPUT(\2)
INPUT(\3)
INPUT(\6)
INPUT(\7)
OUTPUT(\22)
OUTPUT(\23)
\10 = NAND(\1, \3)
\11 = NAND(\3, \6)
\16 = NAND(\2, \11)
\19 = NAND(\11, \7)
\22 = NAND(\10, \16)
\23 = NAND(\16, \19)

View File

@ -1,16 +0,0 @@
* Name of circuit: c17.bench
* Primary inputs :
\1 \2 \3 \6 \7
* Primary outputs:
\22 \23
* Test patterns and fault free responses:
1: 01100 11
2: 10000 00
3: 00001 01
4: 00111 00
5: 01110 00
6: 01010 11
7: 10100 10

View File

@ -1,8 +0,0 @@
01100
10000
00001
00111
01110
01010
10100
END

View File

@ -1,942 +0,0 @@
# c\1908
INPUT(\1)
INPUT(\4)
INPUT(\7)
INPUT(\10)
INPUT(\13)
INPUT(\16)
INPUT(\19)
INPUT(\22)
INPUT(\25)
INPUT(\28)
INPUT(\31)
INPUT(\34)
INPUT(\37)
INPUT(\40)
INPUT(\43)
INPUT(\46)
INPUT(\49)
INPUT(\53)
INPUT(\56)
INPUT(\60)
INPUT(\63)
INPUT(\66)
INPUT(\69)
INPUT(\72)
INPUT(\76)
INPUT(\79)
INPUT(\82)
INPUT(\85)
INPUT(\88)
INPUT(\91)
INPUT(\94)
INPUT(\99)
INPUT(\104)
OUTPUT(\2753)
OUTPUT(\2754)
OUTPUT(\2755)
OUTPUT(\2756)
OUTPUT(\2762)
OUTPUT(\2767)
OUTPUT(\2768)
OUTPUT(\2779)
OUTPUT(\2780)
OUTPUT(\2781)
OUTPUT(\2782)
OUTPUT(\2783)
OUTPUT(\2784)
OUTPUT(\2785)
OUTPUT(\2786)
OUTPUT(\2787)
OUTPUT(\2811)
OUTPUT(\2886)
OUTPUT(\2887)
OUTPUT(\2888)
OUTPUT(\2889)
OUTPUT(\2890)
OUTPUT(\2891)
OUTPUT(\2892)
OUTPUT(\2899)
\190 = NOT(\1)
\194 = NOT(\4)
\197 = NOT(\7)
\201 = NOT(\10)
\206 = NOT(\13)
\209 = NOT(\16)
\212 = NOT(\19)
\216 = NOT(\22)
\220 = NOT(\25)
\225 = NOT(\28)
\229 = NOT(\31)
\232 = NOT(\34)
\235 = NOT(\37)
\239 = NOT(\40)
\243 = NOT(\43)
\247 = NOT(\46)
\251 = NAND(\63, \88)
\252 = NAND(\66, \91)
\253 = NOT(\72)
\256 = NOT(\72)
\257 = BUFF(\69)
\260 = BUFF(\69)
\263 = NOT(\76)
\266 = NOT(\79)
\269 = NOT(\82)
\272 = NOT(\85)
\275 = NOT(\104)
\276 = NOT(\104)
\277 = NOT(\88)
\280 = NOT(\91)
\283 = BUFF(\94)
\290 = NOT(\94)
\297 = BUFF(\94)
\300 = NOT(\94)
\303 = BUFF(\99)
\306 = NOT(\99)
\313 = NOT(\99)
\316 = BUFF(\104)
\319 = NOT(\104)
\326 = BUFF(\104)
\331 = BUFF(\104)
\338 = NOT(\104)
\343 = BUFF(\1)
\346 = BUFF(\4)
\349 = BUFF(\7)
\352 = BUFF(\10)
\355 = BUFF(\13)
\358 = BUFF(\16)
\361 = BUFF(\19)
\364 = BUFF(\22)
\367 = BUFF(\25)
\370 = BUFF(\28)
\373 = BUFF(\31)
\376 = BUFF(\34)
\379 = BUFF(\37)
\382 = BUFF(\40)
\385 = BUFF(\43)
\388 = BUFF(\46)
\534 = NOT(\343)
\535 = NOT(\346)
\536 = NOT(\349)
\537 = NOT(\352)
\538 = NOT(\355)
\539 = NOT(\358)
\540 = NOT(\361)
\541 = NOT(\364)
\542 = NOT(\367)
\543 = NOT(\370)
\544 = NOT(\373)
\545 = NOT(\376)
\546 = NOT(\379)
\547 = NOT(\382)
\548 = NOT(\385)
\549 = NOT(\388)
\550 = NAND(\306, \331)
\551 = NAND(\306, \331)
\552 = NAND(\306, \331)
\553 = NAND(\306, \331)
\554 = NAND(\306, \331)
\555 = NAND(\306, \331)
\556 = BUFF(\190)
\559 = BUFF(\194)
\562 = BUFF(\206)
\565 = BUFF(\209)
\568 = BUFF(\225)
\571 = BUFF(\243)
\574 = AND(\63, \319)
\577 = BUFF(\220)
\580 = BUFF(\229)
\583 = BUFF(\232)
\586 = AND(\66, \319)
\589 = BUFF(\239)
\592 = AND(\49, \253, \319)
\595 = BUFF(\247)
\598 = BUFF(\239)
\601 = NAND(\326, \277)
\602 = NAND(\326, \280)
\603 = NAND(\260, \72)
\608 = NAND(\260, \300)
\612 = NAND(\256, \300)
\616 = BUFF(\201)
\619 = BUFF(\216)
\622 = BUFF(\220)
\625 = BUFF(\239)
\628 = BUFF(\190)
\631 = BUFF(\190)
\634 = BUFF(\194)
\637 = BUFF(\229)
\640 = BUFF(\197)
\643 = AND(\56, \257, \319)
\646 = BUFF(\232)
\649 = BUFF(\201)
\652 = BUFF(\235)
\655 = AND(\60, \257, \319)
\658 = BUFF(\263)
\661 = BUFF(\263)
\664 = BUFF(\266)
\667 = BUFF(\266)
\670 = BUFF(\269)
\673 = BUFF(\269)
\676 = BUFF(\272)
\679 = BUFF(\272)
\682 = AND(\251, \316)
\685 = AND(\252, \316)
\688 = BUFF(\197)
\691 = BUFF(\197)
\694 = BUFF(\212)
\697 = BUFF(\212)
\700 = BUFF(\247)
\703 = BUFF(\247)
\706 = BUFF(\235)
\709 = BUFF(\235)
\712 = BUFF(\201)
\715 = BUFF(\201)
\718 = BUFF(\206)
\721 = BUFF(\216)
\724 = AND(\53, \253, \319)
\727 = BUFF(\243)
\730 = BUFF(\220)
\733 = BUFF(\220)
\736 = BUFF(\209)
\739 = BUFF(\216)
\742 = BUFF(\225)
\745 = BUFF(\243)
\748 = BUFF(\212)
\751 = BUFF(\225)
\886 = NOT(\682)
\887 = NOT(\685)
\888 = NOT(\616)
\889 = NOT(\619)
\890 = NOT(\622)
\891 = NOT(\625)
\892 = NOT(\631)
\893 = NOT(\643)
\894 = NOT(\649)
\895 = NOT(\652)
\896 = NOT(\655)
\897 = AND(\49, \612)
\898 = AND(\56, \608)
\899 = NAND(\53, \612)
\903 = NAND(\60, \608)
\907 = NAND(\49, \612)
\910 = NAND(\56, \608)
\913 = NOT(\661)
\914 = NOT(\658)
\915 = NOT(\667)
\916 = NOT(\664)
\917 = NOT(\673)
\918 = NOT(\670)
\919 = NOT(\679)
\920 = NOT(\676)
\921 = NAND(\277, \297, \326, \603)
\922 = NAND(\280, \297, \326, \603)
\923 = NAND(\303, \338, \603)
\926 = AND(\303, \338, \603)
\935 = BUFF(\556)
\938 = NOT(\688)
\939 = BUFF(\556)
\942 = NOT(\691)
\943 = BUFF(\562)
\946 = NOT(\694)
\947 = BUFF(\562)
\950 = NOT(\697)
\951 = BUFF(\568)
\954 = NOT(\700)
\955 = BUFF(\568)
\958 = NOT(\703)
\959 = BUFF(\574)
\962 = BUFF(\574)
\965 = BUFF(\580)
\968 = NOT(\706)
\969 = BUFF(\580)
\972 = NOT(\709)
\973 = BUFF(\586)
\976 = NOT(\712)
\977 = BUFF(\586)
\980 = NOT(\715)
\981 = BUFF(\592)
\984 = NOT(\628)
\985 = BUFF(\592)
\988 = NOT(\718)
\989 = NOT(\721)
\990 = NOT(\634)
\991 = NOT(\724)
\992 = NOT(\727)
\993 = NOT(\637)
\994 = BUFF(\595)
\997 = NOT(\730)
\998 = BUFF(\595)
\1001 = NOT(\733)
\1002 = NOT(\736)
\1003 = NOT(\739)
\1004 = NOT(\640)
\1005 = NOT(\742)
\1006 = NOT(\745)
\1007 = NOT(\646)
\1008 = NOT(\748)
\1009 = NOT(\751)
\1010 = BUFF(\559)
\1013 = BUFF(\559)
\1016 = BUFF(\565)
\1019 = BUFF(\565)
\1022 = BUFF(\571)
\1025 = BUFF(\571)
\1028 = BUFF(\577)
\1031 = BUFF(\577)
\1034 = BUFF(\583)
\1037 = BUFF(\583)
\1040 = BUFF(\589)
\1043 = BUFF(\589)
\1046 = BUFF(\598)
\1049 = BUFF(\598)
\1054 = NAND(\619, \888)
\1055 = NAND(\616, \889)
\1063 = NAND(\625, \890)
\1064 = NAND(\622, \891)
\1067 = NAND(\655, \895)
\1068 = NAND(\652, \896)
\1119 = NAND(\721, \988)
\1120 = NAND(\718, \989)
\1121 = NAND(\727, \991)
\1122 = NAND(\724, \992)
\1128 = NAND(\739, \1002)
\1129 = NAND(\736, \1003)
\1130 = NAND(\745, \1005)
\1131 = NAND(\742, \1006)
\1132 = NAND(\751, \1008)
\1133 = NAND(\748, \1009)
\1148 = NOT(\939)
\1149 = NOT(\935)
\1150 = NAND(\1054, \1055)
\1151 = NOT(\943)
\1152 = NOT(\947)
\1153 = NOT(\955)
\1154 = NOT(\951)
\1155 = NOT(\962)
\1156 = NOT(\969)
\1157 = NOT(\977)
\1158 = NAND(\1063, \1064)
\1159 = NOT(\985)
\1160 = NAND(\985, \892)
\1161 = NOT(\998)
\1162 = NAND(\1067, \1068)
\1163 = NOT(\899)
\1164 = BUFF(\899)
\1167 = NOT(\903)
\1168 = BUFF(\903)
\1171 = NAND(\921, \923)
\1188 = NAND(\922, \923)
\1205 = NOT(\1010)
\1206 = NAND(\1010, \938)
\1207 = NOT(\1013)
\1208 = NAND(\1013, \942)
\1209 = NOT(\1016)
\1210 = NAND(\1016, \946)
\1211 = NOT(\1019)
\1212 = NAND(\1019, \950)
\1213 = NOT(\1022)
\1214 = NAND(\1022, \954)
\1215 = NOT(\1025)
\1216 = NAND(\1025, \958)
\1217 = NOT(\1028)
\1218 = NOT(\959)
\1219 = NOT(\1031)
\1220 = NOT(\1034)
\1221 = NAND(\1034, \968)
\1222 = NOT(\965)
\1223 = NOT(\1037)
\1224 = NAND(\1037, \972)
\1225 = NOT(\1040)
\1226 = NAND(\1040, \976)
\1227 = NOT(\973)
\1228 = NOT(\1043)
\1229 = NAND(\1043, \980)
\1230 = NOT(\981)
\1231 = NAND(\981, \984)
\1232 = NAND(\1119, \1120)
\1235 = NAND(\1121, \1122)
\1238 = NOT(\1046)
\1239 = NAND(\1046, \997)
\1240 = NOT(\994)
\1241 = NOT(\1049)
\1242 = NAND(\1049, \1001)
\1243 = NAND(\1128, \1129)
\1246 = NAND(\1130, \1131)
\1249 = NAND(\1132, \1133)
\1252 = BUFF(\907)
\1255 = BUFF(\907)
\1258 = BUFF(\910)
\1261 = BUFF(\910)
\1264 = NOT(\1150)
\1267 = NAND(\631, \1159)
\1309 = NAND(\688, \1205)
\1310 = NAND(\691, \1207)
\1311 = NAND(\694, \1209)
\1312 = NAND(\697, \1211)
\1313 = NAND(\700, \1213)
\1314 = NAND(\703, \1215)
\1315 = NAND(\706, \1220)
\1316 = NAND(\709, \1223)
\1317 = NAND(\712, \1225)
\1318 = NAND(\715, \1228)
\1319 = NOT(\1158)
\1322 = NAND(\628, \1230)
\1327 = NAND(\730, \1238)
\1328 = NAND(\733, \1241)
\1334 = NOT(\1162)
\1344 = NAND(\1267, \1160)
\1345 = NAND(\1249, \894)
\1346 = NOT(\1249)
\1348 = NOT(\1255)
\1349 = NOT(\1252)
\1350 = NOT(\1261)
\1351 = NOT(\1258)
\1352 = NAND(\1309, \1206)
\1355 = NAND(\1310, \1208)
\1358 = NAND(\1311, \1210)
\1361 = NAND(\1312, \1212)
\1364 = NAND(\1313, \1214)
\1367 = NAND(\1314, \1216)
\1370 = NAND(\1315, \1221)
\1373 = NAND(\1316, \1224)
\1376 = NAND(\1317, \1226)
\1379 = NAND(\1318, \1229)
\1383 = NAND(\1322, \1231)
\1386 = NOT(\1232)
\1387 = NAND(\1232, \990)
\1388 = NOT(\1235)
\1389 = NAND(\1235, \993)
\1390 = NAND(\1327, \1239)
\1393 = NAND(\1328, \1242)
\1396 = NOT(\1243)
\1397 = NAND(\1243, \1004)
\1398 = NOT(\1246)
\1399 = NAND(\1246, \1007)
\1409 = NOT(\1319)
\1412 = NAND(\649, \1346)
\1413 = NOT(\1334)
\1416 = BUFF(\1264)
\1419 = BUFF(\1264)
\1433 = NAND(\634, \1386)
\1434 = NAND(\637, \1388)
\1438 = NAND(\640, \1396)
\1439 = NAND(\646, \1398)
\1440 = NOT(\1344)
\1443 = NAND(\1355, \1148)
\1444 = NOT(\1355)
\1445 = NAND(\1352, \1149)
\1446 = NOT(\1352)
\1447 = NAND(\1358, \1151)
\1448 = NOT(\1358)
\1451 = NAND(\1361, \1152)
\1452 = NOT(\1361)
\1453 = NAND(\1367, \1153)
\1454 = NOT(\1367)
\1455 = NAND(\1364, \1154)
\1456 = NOT(\1364)
\1457 = NAND(\1373, \1156)
\1458 = NOT(\1373)
\1459 = NAND(\1379, \1157)
\1460 = NOT(\1379)
\1461 = NOT(\1383)
\1462 = NAND(\1393, \1161)
\1463 = NOT(\1393)
\1464 = NAND(\1345, \1412)
\1468 = NOT(\1370)
\1469 = NAND(\1370, \1222)
\1470 = NOT(\1376)
\1471 = NAND(\1376, \1227)
\1472 = NAND(\1387, \1433)
\1475 = NOT(\1390)
\1476 = NAND(\1390, \1240)
\1478 = NAND(\1389, \1434)
\1481 = NAND(\1399, \1439)
\1484 = NAND(\1397, \1438)
\1487 = NAND(\939, \1444)
\1488 = NAND(\935, \1446)
\1489 = NAND(\943, \1448)
\1490 = NOT(\1419)
\1491 = NOT(\1416)
\1492 = NAND(\947, \1452)
\1493 = NAND(\955, \1454)
\1494 = NAND(\951, \1456)
\1495 = NAND(\969, \1458)
\1496 = NAND(\977, \1460)
\1498 = NAND(\998, \1463)
\1499 = NOT(\1440)
\1500 = NAND(\965, \1468)
\1501 = NAND(\973, \1470)
\1504 = NAND(\994, \1475)
\1510 = NOT(\1464)
\1513 = NAND(\1443, \1487)
\1514 = NAND(\1445, \1488)
\1517 = NAND(\1447, \1489)
\1520 = NAND(\1451, \1492)
\1521 = NAND(\1453, \1493)
\1522 = NAND(\1455, \1494)
\1526 = NAND(\1457, \1495)
\1527 = NAND(\1459, \1496)
\1528 = NOT(\1472)
\1529 = NAND(\1462, \1498)
\1530 = NOT(\1478)
\1531 = NOT(\1481)
\1532 = NOT(\1484)
\1534 = NAND(\1471, \1501)
\1537 = NAND(\1469, \1500)
\1540 = NAND(\1476, \1504)
\1546 = NOT(\1513)
\1554 = NOT(\1521)
\1557 = NOT(\1526)
\1561 = NOT(\1520)
\1567 = NAND(\1484, \1531)
\1568 = NAND(\1481, \1532)
\1569 = NOT(\1510)
\1571 = NOT(\1527)
\1576 = NOT(\1529)
\1588 = BUFF(\1522)
\1591 = NOT(\1534)
\1593 = NOT(\1537)
\1594 = NAND(\1540, \1530)
\1595 = NOT(\1540)
\1596 = NAND(\1567, \1568)
\1600 = BUFF(\1517)
\1603 = BUFF(\1517)
\1606 = BUFF(\1522)
\1609 = BUFF(\1522)
\1612 = BUFF(\1514)
\1615 = BUFF(\1514)
\1620 = BUFF(\1557)
\1623 = BUFF(\1554)
\1635 = NOT(\1571)
\1636 = NAND(\1478, \1595)
\1638 = NAND(\1576, \1569)
\1639 = NOT(\1576)
\1640 = BUFF(\1561)
\1643 = BUFF(\1561)
\1647 = BUFF(\1546)
\1651 = BUFF(\1546)
\1658 = BUFF(\1554)
\1661 = BUFF(\1557)
\1664 = BUFF(\1557)
\1671 = NAND(\1596, \893)
\1672 = NOT(\1596)
\1675 = NOT(\1600)
\1677 = NOT(\1603)
\1678 = NAND(\1606, \1217)
\1679 = NOT(\1606)
\1680 = NAND(\1609, \1219)
\1681 = NOT(\1609)
\1682 = NOT(\1612)
\1683 = NOT(\1615)
\1685 = NAND(\1594, \1636)
\1688 = NAND(\1510, \1639)
\1697 = BUFF(\1588)
\1701 = BUFF(\1588)
\1706 = NAND(\643, \1672)
\1707 = NOT(\1643)
\1708 = NAND(\1647, \1675)
\1709 = NOT(\1647)
\1710 = NAND(\1651, \1677)
\1711 = NOT(\1651)
\1712 = NAND(\1028, \1679)
\1713 = NAND(\1031, \1681)
\1714 = BUFF(\1620)
\1717 = BUFF(\1620)
\1720 = NAND(\1658, \1593)
\1721 = NOT(\1658)
\1723 = NAND(\1638, \1688)
\1727 = NOT(\1661)
\1728 = NOT(\1640)
\1730 = NOT(\1664)
\1731 = BUFF(\1623)
\1734 = BUFF(\1623)
\1740 = NAND(\1685, \1528)
\1741 = NOT(\1685)
\1742 = NAND(\1671, \1706)
\1746 = NAND(\1600, \1709)
\1747 = NAND(\1603, \1711)
\1748 = NAND(\1678, \1712)
\1751 = NAND(\1680, \1713)
\1759 = NAND(\1537, \1721)
\1761 = NOT(\1697)
\1762 = NAND(\1697, \1727)
\1763 = NOT(\1701)
\1764 = NAND(\1701, \1730)
\1768 = NOT(\1717)
\1769 = NAND(\1472, \1741)
\1772 = NAND(\1723, \1413)
\1773 = NOT(\1723)
\1774 = NAND(\1708, \1746)
\1777 = NAND(\1710, \1747)
\1783 = NOT(\1731)
\1784 = NAND(\1731, \1682)
\1785 = NOT(\1714)
\1786 = NOT(\1734)
\1787 = NAND(\1734, \1683)
\1788 = NAND(\1720, \1759)
\1791 = NAND(\1661, \1761)
\1792 = NAND(\1664, \1763)
\1795 = NAND(\1751, \1155)
\1796 = NOT(\1751)
\1798 = NAND(\1740, \1769)
\1801 = NAND(\1334, \1773)
\1802 = NAND(\1742, \290)
\1807 = NOT(\1748)
\1808 = NAND(\1748, \1218)
\1809 = NAND(\1612, \1783)
\1810 = NAND(\1615, \1786)
\1812 = NAND(\1791, \1762)
\1815 = NAND(\1792, \1764)
\1818 = BUFF(\1742)
\1821 = NAND(\1777, \1490)
\1822 = NOT(\1777)
\1823 = NAND(\1774, \1491)
\1824 = NOT(\1774)
\1825 = NAND(\962, \1796)
\1826 = NAND(\1788, \1409)
\1827 = NOT(\1788)
\1830 = NAND(\1772, \1801)
\1837 = NAND(\959, \1807)
\1838 = NAND(\1809, \1784)
\1841 = NAND(\1810, \1787)
\1848 = NAND(\1419, \1822)
\1849 = NAND(\1416, \1824)
\1850 = NAND(\1795, \1825)
\1852 = NAND(\1319, \1827)
\1855 = NAND(\1815, \1707)
\1856 = NOT(\1815)
\1857 = NOT(\1818)
\1858 = NAND(\1798, \290)
\1864 = NOT(\1812)
\1865 = NAND(\1812, \1728)
\1866 = BUFF(\1798)
\1869 = BUFF(\1802)
\1872 = BUFF(\1802)
\1875 = NAND(\1808, \1837)
\1878 = NAND(\1821, \1848)
\1879 = NAND(\1823, \1849)
\1882 = NAND(\1841, \1768)
\1883 = NOT(\1841)
\1884 = NAND(\1826, \1852)
\1885 = NAND(\1643, \1856)
\1889 = NAND(\1830, \290)
\1895 = NOT(\1838)
\1896 = NAND(\1838, \1785)
\1897 = NAND(\1640, \1864)
\1898 = NOT(\1850)
\1902 = BUFF(\1830)
\1910 = NOT(\1878)
\1911 = NAND(\1717, \1883)
\1912 = NOT(\1884)
\1913 = NAND(\1855, \1885)
\1915 = NOT(\1866)
\1919 = NAND(\1872, \919)
\1920 = NOT(\1872)
\1921 = NAND(\1869, \920)
\1922 = NOT(\1869)
\1923 = NOT(\1875)
\1924 = NAND(\1714, \1895)
\1927 = BUFF(\1858)
\1930 = BUFF(\1858)
\1933 = NAND(\1865, \1897)
\1936 = NAND(\1882, \1911)
\1937 = NOT(\1898)
\1938 = NOT(\1902)
\1941 = NAND(\679, \1920)
\1942 = NAND(\676, \1922)
\1944 = BUFF(\1879)
\1947 = NOT(\1913)
\1950 = BUFF(\1889)
\1953 = BUFF(\1889)
\1958 = BUFF(\1879)
\1961 = NAND(\1896, \1924)
\1965 = AND(\1910, \601)
\1968 = AND(\602, \1912)
\1975 = NAND(\1930, \917)
\1976 = NOT(\1930)
\1977 = NAND(\1927, \918)
\1978 = NOT(\1927)
\1979 = NAND(\1919, \1941)
\1980 = NAND(\1921, \1942)
\1985 = NOT(\1933)
\1987 = NOT(\1936)
\1999 = NOT(\1944)
\2000 = NAND(\1944, \1937)
\2002 = NOT(\1947)
\2003 = NAND(\1947, \1499)
\2004 = NAND(\1953, \1350)
\2005 = NOT(\1953)
\2006 = NAND(\1950, \1351)
\2007 = NOT(\1950)
\2008 = NAND(\673, \1976)
\2009 = NAND(\670, \1978)
\2012 = NOT(\1979)
\2013 = NOT(\1958)
\2014 = NAND(\1958, \1923)
\2015 = NOT(\1961)
\2016 = NAND(\1961, \1635)
\2018 = NOT(\1965)
\2019 = NOT(\1968)
\2020 = NAND(\1898, \1999)
\2021 = NOT(\1987)
\2022 = NAND(\1987, \1591)
\2023 = NAND(\1440, \2002)
\2024 = NAND(\1261, \2005)
\2025 = NAND(\1258, \2007)
\2026 = NAND(\1975, \2008)
\2027 = NAND(\1977, \2009)
\2030 = NOT(\1980)
\2033 = BUFF(\1980)
\2036 = NAND(\1875, \2013)
\2037 = NAND(\1571, \2015)
\2038 = NAND(\2020, \2000)
\2039 = NAND(\1534, \2021)
\2040 = NAND(\2023, \2003)
\2041 = NAND(\2004, \2024)
\2042 = NAND(\2006, \2025)
\2047 = NOT(\2026)
\2052 = NAND(\2036, \2014)
\2055 = NAND(\2037, \2016)
\2060 = NOT(\2038)
\2061 = NAND(\2039, \2022)
\2062 = NAND(\2040, \290)
\2067 = NOT(\2041)
\2068 = NOT(\2027)
\2071 = BUFF(\2027)
\2076 = NOT(\2052)
\2077 = NOT(\2055)
\2078 = NAND(\2060, \290)
\2081 = NAND(\2061, \290)
\2086 = NOT(\2042)
\2089 = BUFF(\2042)
\2104 = AND(\2030, \2068)
\2119 = AND(\2033, \2068)
\2129 = AND(\2030, \2071)
\2143 = AND(\2033, \2071)
\2148 = BUFF(\2062)
\2151 = BUFF(\2062)
\2196 = BUFF(\2078)
\2199 = BUFF(\2078)
\2202 = BUFF(\2081)
\2205 = BUFF(\2081)
\2214 = NAND(\2151, \915)
\2215 = NOT(\2151)
\2216 = NAND(\2148, \916)
\2217 = NOT(\2148)
\2222 = NAND(\2199, \1348)
\2223 = NOT(\2199)
\2224 = NAND(\2196, \1349)
\2225 = NOT(\2196)
\2226 = NAND(\2205, \913)
\2227 = NOT(\2205)
\2228 = NAND(\2202, \914)
\2229 = NOT(\2202)
\2230 = NAND(\667, \2215)
\2231 = NAND(\664, \2217)
\2232 = NAND(\1255, \2223)
\2233 = NAND(\1252, \2225)
\2234 = NAND(\661, \2227)
\2235 = NAND(\658, \2229)
\2236 = NAND(\2214, \2230)
\2237 = NAND(\2216, \2231)
\2240 = NAND(\2222, \2232)
\2241 = NAND(\2224, \2233)
\2244 = NAND(\2226, \2234)
\2245 = NAND(\2228, \2235)
\2250 = NOT(\2236)
\2253 = NOT(\2240)
\2256 = NOT(\2244)
\2257 = NOT(\2237)
\2260 = BUFF(\2237)
\2263 = NOT(\2241)
\2266 = AND(\1164, \2241)
\2269 = NOT(\2245)
\2272 = AND(\1168, \2245)
\2279 = NAND(\2067, \2012, \2047, \2250, \899, \2256, \2253, \903)
\2286 = BUFF(\2266)
\2297 = BUFF(\2266)
\2315 = BUFF(\2272)
\2326 = BUFF(\2272)
\2340 = AND(\2086, \2257)
\2353 = AND(\2089, \2257)
\2361 = AND(\2086, \2260)
\2375 = AND(\2089, \2260)
\2384 = AND(\338, \2279, \313, \313)
\2385 = AND(\1163, \2263)
\2386 = AND(\1164, \2263)
\2426 = AND(\1167, \2269)
\2427 = AND(\1168, \2269)
\2537 = NAND(\2286, \2315, \2361, \2104, \1171)
\2540 = NAND(\2286, \2315, \2340, \2129, \1171)
\2543 = NAND(\2286, \2315, \2340, \2119, \1171)
\2546 = NAND(\2286, \2315, \2353, \2104, \1171)
\2549 = NAND(\2297, \2315, \2375, \2119, \1188)
\2552 = NAND(\2297, \2326, \2361, \2143, \1188)
\2555 = NAND(\2297, \2326, \2375, \2129, \1188)
\2558 = AND(\2286, \2315, \2361, \2104, \1171)
\2561 = AND(\2286, \2315, \2340, \2129, \1171)
\2564 = AND(\2286, \2315, \2340, \2119, \1171)
\2567 = AND(\2286, \2315, \2353, \2104, \1171)
\2570 = AND(\2297, \2315, \2375, \2119, \1188)
\2573 = AND(\2297, \2326, \2361, \2143, \1188)
\2576 = AND(\2297, \2326, \2375, \2129, \1188)
\2594 = NAND(\2286, \2427, \2361, \2129, \1171)
\2597 = NAND(\2297, \2427, \2361, \2119, \1171)
\2600 = NAND(\2297, \2427, \2375, \2104, \1171)
\2603 = NAND(\2297, \2427, \2340, \2143, \1171)
\2606 = NAND(\2297, \2427, \2353, \2129, \1188)
\2611 = NAND(\2386, \2326, \2361, \2129, \1188)
\2614 = NAND(\2386, \2326, \2361, \2119, \1188)
\2617 = NAND(\2386, \2326, \2375, \2104, \1188)
\2620 = NAND(\2386, \2326, \2353, \2129, \1188)
\2627 = NAND(\2297, \2427, \2340, \2104, \926)
\2628 = NAND(\2386, \2326, \2340, \2104, \926)
\2629 = NAND(\2386, \2427, \2361, \2104, \926)
\2630 = NAND(\2386, \2427, \2340, \2129, \926)
\2631 = NAND(\2386, \2427, \2340, \2119, \926)
\2632 = NAND(\2386, \2427, \2353, \2104, \926)
\2633 = NAND(\2386, \2426, \2340, \2104, \926)
\2634 = NAND(\2385, \2427, \2340, \2104, \926)
\2639 = AND(\2286, \2427, \2361, \2129, \1171)
\2642 = AND(\2297, \2427, \2361, \2119, \1171)
\2645 = AND(\2297, \2427, \2375, \2104, \1171)
\2648 = AND(\2297, \2427, \2340, \2143, \1171)
\2651 = AND(\2297, \2427, \2353, \2129, \1188)
\2655 = AND(\2386, \2326, \2361, \2129, \1188)
\2658 = AND(\2386, \2326, \2361, \2119, \1188)
\2661 = AND(\2386, \2326, \2375, \2104, \1188)
\2664 = AND(\2386, \2326, \2353, \2129, \1188)
\2669 = NAND(\2558, \534)
\2670 = NOT(\2558)
\2671 = NAND(\2561, \535)
\2672 = NOT(\2561)
\2673 = NAND(\2564, \536)
\2674 = NOT(\2564)
\2675 = NAND(\2567, \537)
\2676 = NOT(\2567)
\2682 = NAND(\2570, \543)
\2683 = NOT(\2570)
\2688 = NAND(\2573, \548)
\2689 = NOT(\2573)
\2690 = NAND(\2576, \549)
\2691 = NOT(\2576)
\2710 = AND(\2627, \2628, \2629, \2630, \2631, \2632, \2633, \2634)
\2720 = NAND(\343, \2670)
\2721 = NAND(\346, \2672)
\2722 = NAND(\349, \2674)
\2723 = NAND(\352, \2676)
\2724 = NAND(\2639, \538)
\2725 = NOT(\2639)
\2726 = NAND(\2642, \539)
\2727 = NOT(\2642)
\2728 = NAND(\2645, \540)
\2729 = NOT(\2645)
\2730 = NAND(\2648, \541)
\2731 = NOT(\2648)
\2732 = NAND(\2651, \542)
\2733 = NOT(\2651)
\2734 = NAND(\370, \2683)
\2735 = NAND(\2655, \544)
\2736 = NOT(\2655)
\2737 = NAND(\2658, \545)
\2738 = NOT(\2658)
\2739 = NAND(\2661, \546)
\2740 = NOT(\2661)
\2741 = NAND(\2664, \547)
\2742 = NOT(\2664)
\2743 = NAND(\385, \2689)
\2744 = NAND(\388, \2691)
\2745 = NAND(\2537, \2540, \2543, \2546, \2594, \2597, \2600, \2603)
\2746 = NAND(\2606, \2549, \2611, \2614, \2617, \2620, \2552, \2555)
\2747 = AND(\2537, \2540, \2543, \2546, \2594, \2597, \2600, \2603)
\2750 = AND(\2606, \2549, \2611, \2614, \2617, \2620, \2552, \2555)
\2753 = NAND(\2669, \2720)
\2754 = NAND(\2671, \2721)
\2755 = NAND(\2673, \2722)
\2756 = NAND(\2675, \2723)
\2757 = NAND(\355, \2725)
\2758 = NAND(\358, \2727)
\2759 = NAND(\361, \2729)
\2760 = NAND(\364, \2731)
\2761 = NAND(\367, \2733)
\2762 = NAND(\2682, \2734)
\2763 = NAND(\373, \2736)
\2764 = NAND(\376, \2738)
\2765 = NAND(\379, \2740)
\2766 = NAND(\382, \2742)
\2767 = NAND(\2688, \2743)
\2768 = NAND(\2690, \2744)
\2773 = AND(\2745, \275)
\2776 = AND(\2746, \276)
\2779 = NAND(\2724, \2757)
\2780 = NAND(\2726, \2758)
\2781 = NAND(\2728, \2759)
\2782 = NAND(\2730, \2760)
\2783 = NAND(\2732, \2761)
\2784 = NAND(\2735, \2763)
\2785 = NAND(\2737, \2764)
\2786 = NAND(\2739, \2765)
\2787 = NAND(\2741, \2766)
\2788 = AND(\2747, \2750, \2710)
\2789 = NAND(\2747, \2750)
\2800 = AND(\338, \2279, \99, \2788)
\2807 = NAND(\2773, \2018)
\2808 = NOT(\2773)
\2809 = NAND(\2776, \2019)
\2810 = NOT(\2776)
\2811 = NOR(\2384, \2800)
\2812 = AND(\897, \283, \2789)
\2815 = AND(\76, \283, \2789)
\2818 = AND(\82, \283, \2789)
\2821 = AND(\85, \283, \2789)
\2824 = AND(\898, \283, \2789)
\2827 = NAND(\1965, \2808)
\2828 = NAND(\1968, \2810)
\2829 = AND(\79, \283, \2789)
\2843 = NAND(\2807, \2827)
\2846 = NAND(\2809, \2828)
\2850 = NAND(\2812, \2076)
\2851 = NAND(\2815, \2077)
\2852 = NAND(\2818, \1915)
\2853 = NAND(\2821, \1857)
\2854 = NAND(\2824, \1938)
\2857 = NOT(\2812)
\2858 = NOT(\2815)
\2859 = NOT(\2818)
\2860 = NOT(\2821)
\2861 = NOT(\2824)
\2862 = NOT(\2829)
\2863 = NAND(\2829, \1985)
\2866 = NAND(\2052, \2857)
\2867 = NAND(\2055, \2858)
\2868 = NAND(\1866, \2859)
\2869 = NAND(\1818, \2860)
\2870 = NAND(\1902, \2861)
\2871 = NAND(\2843, \886)
\2872 = NOT(\2843)
\2873 = NAND(\2846, \887)
\2874 = NOT(\2846)
\2875 = NAND(\1933, \2862)
\2876 = NAND(\2866, \2850)
\2877 = NAND(\2867, \2851)
\2878 = NAND(\2868, \2852)
\2879 = NAND(\2869, \2853)
\2880 = NAND(\2870, \2854)
\2881 = NAND(\682, \2872)
\2882 = NAND(\685, \2874)
\2883 = NAND(\2875, \2863)
\2886 = AND(\2876, \550)
\2887 = AND(\551, \2877)
\2888 = AND(\553, \2878)
\2889 = AND(\2879, \554)
\2890 = AND(\555, \2880)
\2891 = NAND(\2871, \2881)
\2892 = NAND(\2873, \2882)
\2895 = NAND(\2883, \1461)
\2896 = NOT(\2883)
\2897 = NAND(\1383, \2896)
\2898 = NAND(\2895, \2897)
\2899 = AND(\2898, \552)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,207 +0,0 @@
# c\432
INPUT(\1)
INPUT(\4)
INPUT(\8)
INPUT(\11)
INPUT(\14)
INPUT(\17)
INPUT(\21)
INPUT(\24)
INPUT(\27)
INPUT(\30)
INPUT(\34)
INPUT(\37)
INPUT(\40)
INPUT(\43)
INPUT(\47)
INPUT(\50)
INPUT(\53)
INPUT(\56)
INPUT(\60)
INPUT(\63)
INPUT(\66)
INPUT(\69)
INPUT(\73)
INPUT(\76)
INPUT(\79)
INPUT(\82)
INPUT(\86)
INPUT(\89)
INPUT(\92)
INPUT(\95)
INPUT(\99)
INPUT(\102)
INPUT(\105)
INPUT(\108)
INPUT(\112)
INPUT(\115)
OUTPUT(\223)
OUTPUT(\329)
OUTPUT(\370)
OUTPUT(\421)
OUTPUT(\430)
OUTPUT(\431)
OUTPUT(\432)
\118 = NOT(\1)
\119 = NOT(\4)
\122 = NOT(\11)
\123 = NOT(\17)
\126 = NOT(\24)
\127 = NOT(\30)
\130 = NOT(\37)
\131 = NOT(\43)
\134 = NOT(\50)
\135 = NOT(\56)
\138 = NOT(\63)
\139 = NOT(\69)
\142 = NOT(\76)
\143 = NOT(\82)
\146 = NOT(\89)
\147 = NOT(\95)
\150 = NOT(\102)
\151 = NOT(\108)
\154 = NAND(\118, \4)
\157 = NOR(\8, \119)
\158 = NOR(\14, \119)
\159 = NAND(\122, \17)
\162 = NAND(\126, \30)
\165 = NAND(\130, \43)
\168 = NAND(\134, \56)
\171 = NAND(\138, \69)
\174 = NAND(\142, \82)
\177 = NAND(\146, \95)
\180 = NAND(\150, \108)
\183 = NOR(\21, \123)
\184 = NOR(\27, \123)
\185 = NOR(\34, \127)
\186 = NOR(\40, \127)
\187 = NOR(\47, \131)
\188 = NOR(\53, \131)
\189 = NOR(\60, \135)
\190 = NOR(\66, \135)
\191 = NOR(\73, \139)
\192 = NOR(\79, \139)
\193 = NOR(\86, \143)
\194 = NOR(\92, \143)
\195 = NOR(\99, \147)
\196 = NOR(\105, \147)
\197 = NOR(\112, \151)
\198 = NOR(\115, \151)
\199 = AND(\154, \159, \162, \165, \168, \171, \174, \177, \180)
\203 = NOT(\199)
\213 = NOT(\199)
\223 = NOT(\199)
\224 = XOR(\203, \154)
\227 = XOR(\203, \159)
\230 = XOR(\203, \162)
\233 = XOR(\203, \165)
\236 = XOR(\203, \168)
\239 = XOR(\203, \171)
\242 = NAND(\1, \213)
\243 = XOR(\203, \174)
\246 = NAND(\213, \11)
\247 = XOR(\203, \177)
\250 = NAND(\213, \24)
\251 = XOR(\203, \180)
\254 = NAND(\213, \37)
\255 = NAND(\213, \50)
\256 = NAND(\213, \63)
\257 = NAND(\213, \76)
\258 = NAND(\213, \89)
\259 = NAND(\213, \102)
\260 = NAND(\224, \157)
\263 = NAND(\224, \158)
\264 = NAND(\227, \183)
\267 = NAND(\230, \185)
\270 = NAND(\233, \187)
\273 = NAND(\236, \189)
\276 = NAND(\239, \191)
\279 = NAND(\243, \193)
\282 = NAND(\247, \195)
\285 = NAND(\251, \197)
\288 = NAND(\227, \184)
\289 = NAND(\230, \186)
\290 = NAND(\233, \188)
\291 = NAND(\236, \190)
\292 = NAND(\239, \192)
\293 = NAND(\243, \194)
\294 = NAND(\247, \196)
\295 = NAND(\251, \198)
\296 = AND(\260, \264, \267, \270, \273, \276, \279, \282, \285)
\300 = NOT(\263)
\301 = NOT(\288)
\302 = NOT(\289)
\303 = NOT(\290)
\304 = NOT(\291)
\305 = NOT(\292)
\306 = NOT(\293)
\307 = NOT(\294)
\308 = NOT(\295)
\309 = NOT(\296)
\319 = NOT(\296)
\329 = NOT(\296)
\330 = XOR(\309, \260)
\331 = XOR(\309, \264)
\332 = XOR(\309, \267)
\333 = XOR(\309, \270)
\334 = NAND(\8, \319)
\335 = XOR(\309, \273)
\336 = NAND(\319, \21)
\337 = XOR(\309, \276)
\338 = NAND(\319, \34)
\339 = XOR(\309, \279)
\340 = NAND(\319, \47)
\341 = XOR(\309, \282)
\342 = NAND(\319, \60)
\343 = XOR(\309, \285)
\344 = NAND(\319, \73)
\345 = NAND(\319, \86)
\346 = NAND(\319, \99)
\347 = NAND(\319, \112)
\348 = NAND(\330, \300)
\349 = NAND(\331, \301)
\350 = NAND(\332, \302)
\351 = NAND(\333, \303)
\352 = NAND(\335, \304)
\353 = NAND(\337, \305)
\354 = NAND(\339, \306)
\355 = NAND(\341, \307)
\356 = NAND(\343, \308)
\357 = AND(\348, \349, \350, \351, \352, \353, \354, \355, \356)
\360 = NOT(\357)
\370 = NOT(\357)
\371 = NAND(\14, \360)
\372 = NAND(\360, \27)
\373 = NAND(\360, \40)
\374 = NAND(\360, \53)
\375 = NAND(\360, \66)
\376 = NAND(\360, \79)
\377 = NAND(\360, \92)
\378 = NAND(\360, \105)
\379 = NAND(\360, \115)
\380 = NAND(\4, \242, \334, \371)
\381 = NAND(\246, \336, \372, \17)
\386 = NAND(\250, \338, \373, \30)
\393 = NAND(\254, \340, \374, \43)
\399 = NAND(\255, \342, \375, \56)
\404 = NAND(\256, \344, \376, \69)
\407 = NAND(\257, \345, \377, \82)
\411 = NAND(\258, \346, \378, \95)
\414 = NAND(\259, \347, \379, \108)
\415 = NOT(\380)
\416 = AND(\381, \386, \393, \399, \404, \407, \411, \414)
\417 = NOT(\393)
\418 = NOT(\404)
\419 = NOT(\407)
\420 = NOT(\411)
\421 = NOR(\415, \416)
\422 = NAND(\386, \417)
\425 = NAND(\386, \393, \418, \399)
\428 = NAND(\399, \393, \419)
\429 = NAND(\386, \393, \407, \420)
\430 = NAND(\381, \386, \422, \399)
\431 = NAND(\381, \386, \425, \428)
\432 = NAND(\381, \422, \425, \429)

View File

@ -1,279 +0,0 @@
# c\499
INPUT(\1)
INPUT(\5)
INPUT(\9)
INPUT(\13)
INPUT(\17)
INPUT(\21)
INPUT(\25)
INPUT(\29)
INPUT(\33)
INPUT(\37)
INPUT(\41)
INPUT(\45)
INPUT(\49)
INPUT(\53)
INPUT(\57)
INPUT(\61)
INPUT(\65)
INPUT(\69)
INPUT(\73)
INPUT(\77)
INPUT(\81)
INPUT(\85)
INPUT(\89)
INPUT(\93)
INPUT(\97)
INPUT(\101)
INPUT(\105)
INPUT(\109)
INPUT(\113)
INPUT(\117)
INPUT(\121)
INPUT(\125)
INPUT(\129)
INPUT(\130)
INPUT(\131)
INPUT(\132)
INPUT(\133)
INPUT(\134)
INPUT(\135)
INPUT(\136)
INPUT(\137)
OUTPUT(\724)
OUTPUT(\725)
OUTPUT(\726)
OUTPUT(\727)
OUTPUT(\728)
OUTPUT(\729)
OUTPUT(\730)
OUTPUT(\731)
OUTPUT(\732)
OUTPUT(\733)
OUTPUT(\734)
OUTPUT(\735)
OUTPUT(\736)
OUTPUT(\737)
OUTPUT(\738)
OUTPUT(\739)
OUTPUT(\740)
OUTPUT(\741)
OUTPUT(\742)
OUTPUT(\743)
OUTPUT(\744)
OUTPUT(\745)
OUTPUT(\746)
OUTPUT(\747)
OUTPUT(\748)
OUTPUT(\749)
OUTPUT(\750)
OUTPUT(\751)
OUTPUT(\752)
OUTPUT(\753)
OUTPUT(\754)
OUTPUT(\755)
\250 = XOR(\1, \5)
\251 = XOR(\9, \13)
\252 = XOR(\17, \21)
\253 = XOR(\25, \29)
\254 = XOR(\33, \37)
\255 = XOR(\41, \45)
\256 = XOR(\49, \53)
\257 = XOR(\57, \61)
\258 = XOR(\65, \69)
\259 = XOR(\73, \77)
\260 = XOR(\81, \85)
\261 = XOR(\89, \93)
\262 = XOR(\97, \101)
\263 = XOR(\105, \109)
\264 = XOR(\113, \117)
\265 = XOR(\121, \125)
\266 = AND(\129, \137)
\267 = AND(\130, \137)
\268 = AND(\131, \137)
\269 = AND(\132, \137)
\270 = AND(\133, \137)
\271 = AND(\134, \137)
\272 = AND(\135, \137)
\273 = AND(\136, \137)
\274 = XOR(\1, \17)
\275 = XOR(\33, \49)
\276 = XOR(\5, \21)
\277 = XOR(\37, \53)
\278 = XOR(\9, \25)
\279 = XOR(\41, \57)
\280 = XOR(\13, \29)
\281 = XOR(\45, \61)
\282 = XOR(\65, \81)
\283 = XOR(\97, \113)
\284 = XOR(\69, \85)
\285 = XOR(\101, \117)
\286 = XOR(\73, \89)
\287 = XOR(\105, \121)
\288 = XOR(\77, \93)
\289 = XOR(\109, \125)
\290 = XOR(\250, \251)
\293 = XOR(\252, \253)
\296 = XOR(\254, \255)
\299 = XOR(\256, \257)
\302 = XOR(\258, \259)
\305 = XOR(\260, \261)
\308 = XOR(\262, \263)
\311 = XOR(\264, \265)
\314 = XOR(\274, \275)
\315 = XOR(\276, \277)
\316 = XOR(\278, \279)
\317 = XOR(\280, \281)
\318 = XOR(\282, \283)
\319 = XOR(\284, \285)
\320 = XOR(\286, \287)
\321 = XOR(\288, \289)
\338 = XOR(\290, \293)
\339 = XOR(\296, \299)
\340 = XOR(\290, \296)
\341 = XOR(\293, \299)
\342 = XOR(\302, \305)
\343 = XOR(\308, \311)
\344 = XOR(\302, \308)
\345 = XOR(\305, \311)
\346 = XOR(\266, \342)
\347 = XOR(\267, \343)
\348 = XOR(\268, \344)
\349 = XOR(\269, \345)
\350 = XOR(\270, \338)
\351 = XOR(\271, \339)
\352 = XOR(\272, \340)
\353 = XOR(\273, \341)
\354 = XOR(\314, \346)
\367 = XOR(\315, \347)
\380 = XOR(\316, \348)
\393 = XOR(\317, \349)
\406 = XOR(\318, \350)
\419 = XOR(\319, \351)
\432 = XOR(\320, \352)
\445 = XOR(\321, \353)
\554 = NOT(\354)
\555 = NOT(\367)
\556 = NOT(\380)
\557 = NOT(\354)
\558 = NOT(\367)
\559 = NOT(\393)
\560 = NOT(\354)
\561 = NOT(\380)
\562 = NOT(\393)
\563 = NOT(\367)
\564 = NOT(\380)
\565 = NOT(\393)
\566 = NOT(\419)
\567 = NOT(\445)
\568 = NOT(\419)
\569 = NOT(\432)
\570 = NOT(\406)
\571 = NOT(\445)
\572 = NOT(\406)
\573 = NOT(\432)
\574 = NOT(\406)
\575 = NOT(\419)
\576 = NOT(\432)
\577 = NOT(\406)
\578 = NOT(\419)
\579 = NOT(\445)
\580 = NOT(\406)
\581 = NOT(\432)
\582 = NOT(\445)
\583 = NOT(\419)
\584 = NOT(\432)
\585 = NOT(\445)
\586 = NOT(\367)
\587 = NOT(\393)
\588 = NOT(\367)
\589 = NOT(\380)
\590 = NOT(\354)
\591 = NOT(\393)
\592 = NOT(\354)
\593 = NOT(\380)
\594 = AND(\554, \555, \556, \393)
\595 = AND(\557, \558, \380, \559)
\596 = AND(\560, \367, \561, \562)
\597 = AND(\354, \563, \564, \565)
\598 = AND(\574, \575, \576, \445)
\599 = AND(\577, \578, \432, \579)
\600 = AND(\580, \419, \581, \582)
\601 = AND(\406, \583, \584, \585)
\602 = OR(\594, \595, \596, \597)
\607 = OR(\598, \599, \600, \601)
\620 = AND(\406, \566, \432, \567, \602)
\625 = AND(\406, \568, \569, \445, \602)
\630 = AND(\570, \419, \432, \571, \602)
\635 = AND(\572, \419, \573, \445, \602)
\640 = AND(\354, \586, \380, \587, \607)
\645 = AND(\354, \588, \589, \393, \607)
\650 = AND(\590, \367, \380, \591, \607)
\655 = AND(\592, \367, \593, \393, \607)
\692 = AND(\354, \620)
\693 = AND(\367, \620)
\694 = AND(\380, \620)
\695 = AND(\393, \620)
\696 = AND(\354, \625)
\697 = AND(\367, \625)
\698 = AND(\380, \625)
\699 = AND(\393, \625)
\700 = AND(\354, \630)
\701 = AND(\367, \630)
\702 = AND(\380, \630)
\703 = AND(\393, \630)
\704 = AND(\354, \635)
\705 = AND(\367, \635)
\706 = AND(\380, \635)
\707 = AND(\393, \635)
\708 = AND(\406, \640)
\709 = AND(\419, \640)
\710 = AND(\432, \640)
\711 = AND(\445, \640)
\712 = AND(\406, \645)
\713 = AND(\419, \645)
\714 = AND(\432, \645)
\715 = AND(\445, \645)
\716 = AND(\406, \650)
\717 = AND(\419, \650)
\718 = AND(\432, \650)
\719 = AND(\445, \650)
\720 = AND(\406, \655)
\721 = AND(\419, \655)
\722 = AND(\432, \655)
\723 = AND(\445, \655)
\724 = XOR(\1, \692)
\725 = XOR(\5, \693)
\726 = XOR(\9, \694)
\727 = XOR(\13, \695)
\728 = XOR(\17, \696)
\729 = XOR(\21, \697)
\730 = XOR(\25, \698)
\731 = XOR(\29, \699)
\732 = XOR(\33, \700)
\733 = XOR(\37, \701)
\734 = XOR(\41, \702)
\735 = XOR(\45, \703)
\736 = XOR(\49, \704)
\737 = XOR(\53, \705)
\738 = XOR(\57, \706)
\739 = XOR(\61, \707)
\740 = XOR(\65, \708)
\741 = XOR(\69, \709)
\742 = XOR(\73, \710)
\743 = XOR(\77, \711)
\744 = XOR(\81, \712)
\745 = XOR(\85, \713)
\746 = XOR(\89, \714)
\747 = XOR(\93, \715)
\748 = XOR(\97, \716)
\749 = XOR(\101, \717)
\750 = XOR(\105, \718)
\751 = XOR(\109, \719)
\752 = XOR(\113, \720)
\753 = XOR(\117, \721)
\754 = XOR(\121, \722)
\755 = XOR(\125, \723)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,473 +0,0 @@
# c\880
INPUT(\1)
INPUT(\8)
INPUT(\13)
INPUT(\17)
INPUT(\26)
INPUT(\29)
INPUT(\36)
INPUT(\42)
INPUT(\51)
INPUT(\55)
INPUT(\59)
INPUT(\68)
INPUT(\72)
INPUT(\73)
INPUT(\74)
INPUT(\75)
INPUT(\80)
INPUT(\85)
INPUT(\86)
INPUT(\87)
INPUT(\88)
INPUT(\89)
INPUT(\90)
INPUT(\91)
INPUT(\96)
INPUT(\101)
INPUT(\106)
INPUT(\111)
INPUT(\116)
INPUT(\121)
INPUT(\126)
INPUT(\130)
INPUT(\135)
INPUT(\138)
INPUT(\143)
INPUT(\146)
INPUT(\149)
INPUT(\152)
INPUT(\153)
INPUT(\156)
INPUT(\159)
INPUT(\165)
INPUT(\171)
INPUT(\177)
INPUT(\183)
INPUT(\189)
INPUT(\195)
INPUT(\201)
INPUT(\207)
INPUT(\210)
INPUT(\219)
INPUT(\228)
INPUT(\237)
INPUT(\246)
INPUT(\255)
INPUT(\259)
INPUT(\260)
INPUT(\261)
INPUT(\267)
INPUT(\268)
OUTPUT(\388)
OUTPUT(\389)
OUTPUT(\390)
OUTPUT(\391)
OUTPUT(\418)
OUTPUT(\419)
OUTPUT(\420)
OUTPUT(\421)
OUTPUT(\422)
OUTPUT(\423)
OUTPUT(\446)
OUTPUT(\447)
OUTPUT(\448)
OUTPUT(\449)
OUTPUT(\450)
OUTPUT(\767)
OUTPUT(\768)
OUTPUT(\850)
OUTPUT(\863)
OUTPUT(\864)
OUTPUT(\865)
OUTPUT(\866)
OUTPUT(\874)
OUTPUT(\878)
OUTPUT(\879)
OUTPUT(\880)
\269 = NAND(\1, \8, \13, \17)
\270 = NAND(\1, \26, \13, \17)
\273 = AND(\29, \36, \42)
\276 = AND(\1, \26, \51)
\279 = NAND(\1, \8, \51, \17)
\280 = NAND(\1, \8, \13, \55)
\284 = NAND(\59, \42, \68, \72)
\285 = NAND(\29, \68)
\286 = NAND(\59, \68, \74)
\287 = AND(\29, \75, \80)
\290 = AND(\29, \75, \42)
\291 = AND(\29, \36, \80)
\292 = AND(\29, \36, \42)
\293 = AND(\59, \75, \80)
\294 = AND(\59, \75, \42)
\295 = AND(\59, \36, \80)
\296 = AND(\59, \36, \42)
\297 = AND(\85, \86)
\298 = OR(\87, \88)
\301 = NAND(\91, \96)
\302 = OR(\91, \96)
\303 = NAND(\101, \106)
\304 = OR(\101, \106)
\305 = NAND(\111, \116)
\306 = OR(\111, \116)
\307 = NAND(\121, \126)
\308 = OR(\121, \126)
\309 = AND(\8, \138)
\310 = NOT(\268)
\316 = AND(\51, \138)
\317 = AND(\17, \138)
\318 = AND(\152, \138)
\319 = NAND(\59, \156)
\322 = NOR(\17, \42)
\323 = AND(\17, \42)
\324 = NAND(\159, \165)
\325 = OR(\159, \165)
\326 = NAND(\171, \177)
\327 = OR(\171, \177)
\328 = NAND(\183, \189)
\329 = OR(\183, \189)
\330 = NAND(\195, \201)
\331 = OR(\195, \201)
\332 = AND(\210, \91)
\333 = AND(\210, \96)
\334 = AND(\210, \101)
\335 = AND(\210, \106)
\336 = AND(\210, \111)
\337 = AND(\255, \259)
\338 = AND(\210, \116)
\339 = AND(\255, \260)
\340 = AND(\210, \121)
\341 = AND(\255, \267)
\342 = NOT(\269)
\343 = NOT(\273)
\344 = OR(\270, \273)
\345 = NOT(\276)
\346 = NOT(\276)
\347 = NOT(\279)
\348 = NOR(\280, \284)
\349 = OR(\280, \285)
\350 = OR(\280, \286)
\351 = NOT(\293)
\352 = NOT(\294)
\353 = NOT(\295)
\354 = NOT(\296)
\355 = NAND(\89, \298)
\356 = AND(\90, \298)
\357 = NAND(\301, \302)
\360 = NAND(\303, \304)
\363 = NAND(\305, \306)
\366 = NAND(\307, \308)
\369 = NOT(\310)
\375 = NOR(\322, \323)
\376 = NAND(\324, \325)
\379 = NAND(\326, \327)
\382 = NAND(\328, \329)
\385 = NAND(\330, \331)
\388 = BUFF(\290)
\389 = BUFF(\291)
\390 = BUFF(\292)
\391 = BUFF(\297)
\392 = OR(\270, \343)
\393 = NOT(\345)
\399 = NOT(\346)
\400 = AND(\348, \73)
\401 = NOT(\349)
\402 = NOT(\350)
\403 = NOT(\355)
\404 = NOT(\357)
\405 = NOT(\360)
\406 = AND(\357, \360)
\407 = NOT(\363)
\408 = NOT(\366)
\409 = AND(\363, \366)
\410 = NAND(\347, \352)
\411 = NOT(\376)
\412 = NOT(\379)
\413 = AND(\376, \379)
\414 = NOT(\382)
\415 = NOT(\385)
\416 = AND(\382, \385)
\417 = AND(\210, \369)
\418 = BUFF(\342)
\419 = BUFF(\344)
\420 = BUFF(\351)
\421 = BUFF(\353)
\422 = BUFF(\354)
\423 = BUFF(\356)
\424 = NOT(\400)
\425 = AND(\404, \405)
\426 = AND(\407, \408)
\427 = AND(\319, \393, \55)
\432 = AND(\393, \17, \287)
\437 = NAND(\393, \287, \55)
\442 = NAND(\375, \59, \156, \393)
\443 = NAND(\393, \319, \17)
\444 = AND(\411, \412)
\445 = AND(\414, \415)
\446 = BUFF(\392)
\447 = BUFF(\399)
\448 = BUFF(\401)
\449 = BUFF(\402)
\450 = BUFF(\403)
\451 = NOT(\424)
\460 = NOR(\406, \425)
\463 = NOR(\409, \426)
\466 = NAND(\442, \410)
\475 = AND(\143, \427)
\476 = AND(\310, \432)
\477 = AND(\146, \427)
\478 = AND(\310, \432)
\479 = AND(\149, \427)
\480 = AND(\310, \432)
\481 = AND(\153, \427)
\482 = AND(\310, \432)
\483 = NAND(\443, \1)
\488 = OR(\369, \437)
\489 = OR(\369, \437)
\490 = OR(\369, \437)
\491 = OR(\369, \437)
\492 = NOR(\413, \444)
\495 = NOR(\416, \445)
\498 = NAND(\130, \460)
\499 = OR(\130, \460)
\500 = NAND(\463, \135)
\501 = OR(\463, \135)
\502 = AND(\91, \466)
\503 = NOR(\475, \476)
\504 = AND(\96, \466)
\505 = NOR(\477, \478)
\506 = AND(\101, \466)
\507 = NOR(\479, \480)
\508 = AND(\106, \466)
\509 = NOR(\481, \482)
\510 = AND(\143, \483)
\511 = AND(\111, \466)
\512 = AND(\146, \483)
\513 = AND(\116, \466)
\514 = AND(\149, \483)
\515 = AND(\121, \466)
\516 = AND(\153, \483)
\517 = AND(\126, \466)
\518 = NAND(\130, \492)
\519 = OR(\130, \492)
\520 = NAND(\495, \207)
\521 = OR(\495, \207)
\522 = AND(\451, \159)
\523 = AND(\451, \165)
\524 = AND(\451, \171)
\525 = AND(\451, \177)
\526 = AND(\451, \183)
\527 = NAND(\451, \189)
\528 = NAND(\451, \195)
\529 = NAND(\451, \201)
\530 = NAND(\498, \499)
\533 = NAND(\500, \501)
\536 = NOR(\309, \502)
\537 = NOR(\316, \504)
\538 = NOR(\317, \506)
\539 = NOR(\318, \508)
\540 = NOR(\510, \511)
\541 = NOR(\512, \513)
\542 = NOR(\514, \515)
\543 = NOR(\516, \517)
\544 = NAND(\518, \519)
\547 = NAND(\520, \521)
\550 = NOT(\530)
\551 = NOT(\533)
\552 = AND(\530, \533)
\553 = NAND(\536, \503)
\557 = NAND(\537, \505)
\561 = NAND(\538, \507)
\565 = NAND(\539, \509)
\569 = NAND(\488, \540)
\573 = NAND(\489, \541)
\577 = NAND(\490, \542)
\581 = NAND(\491, \543)
\585 = NOT(\544)
\586 = NOT(\547)
\587 = AND(\544, \547)
\588 = AND(\550, \551)
\589 = AND(\585, \586)
\590 = NAND(\553, \159)
\593 = OR(\553, \159)
\596 = AND(\246, \553)
\597 = NAND(\557, \165)
\600 = OR(\557, \165)
\605 = AND(\246, \557)
\606 = NAND(\561, \171)
\609 = OR(\561, \171)
\615 = AND(\246, \561)
\616 = NAND(\565, \177)
\619 = OR(\565, \177)
\624 = AND(\246, \565)
\625 = NAND(\569, \183)
\628 = OR(\569, \183)
\631 = AND(\246, \569)
\632 = NAND(\573, \189)
\635 = OR(\573, \189)
\640 = AND(\246, \573)
\641 = NAND(\577, \195)
\644 = OR(\577, \195)
\650 = AND(\246, \577)
\651 = NAND(\581, \201)
\654 = OR(\581, \201)
\659 = AND(\246, \581)
\660 = NOR(\552, \588)
\661 = NOR(\587, \589)
\662 = NOT(\590)
\665 = AND(\593, \590)
\669 = NOR(\596, \522)
\670 = NOT(\597)
\673 = AND(\600, \597)
\677 = NOR(\605, \523)
\678 = NOT(\606)
\682 = AND(\609, \606)
\686 = NOR(\615, \524)
\687 = NOT(\616)
\692 = AND(\619, \616)
\696 = NOR(\624, \525)
\697 = NOT(\625)
\700 = AND(\628, \625)
\704 = NOR(\631, \526)
\705 = NOT(\632)
\708 = AND(\635, \632)
\712 = NOR(\337, \640)
\713 = NOT(\641)
\717 = AND(\644, \641)
\721 = NOR(\339, \650)
\722 = NOT(\651)
\727 = AND(\654, \651)
\731 = NOR(\341, \659)
\732 = NAND(\654, \261)
\733 = NAND(\644, \654, \261)
\734 = NAND(\635, \644, \654, \261)
\735 = NOT(\662)
\736 = AND(\228, \665)
\737 = AND(\237, \662)
\738 = NOT(\670)
\739 = AND(\228, \673)
\740 = AND(\237, \670)
\741 = NOT(\678)
\742 = AND(\228, \682)
\743 = AND(\237, \678)
\744 = NOT(\687)
\745 = AND(\228, \692)
\746 = AND(\237, \687)
\747 = NOT(\697)
\748 = AND(\228, \700)
\749 = AND(\237, \697)
\750 = NOT(\705)
\751 = AND(\228, \708)
\752 = AND(\237, \705)
\753 = NOT(\713)
\754 = AND(\228, \717)
\755 = AND(\237, \713)
\756 = NOT(\722)
\757 = NOR(\727, \261)
\758 = AND(\727, \261)
\759 = AND(\228, \727)
\760 = AND(\237, \722)
\761 = NAND(\644, \722)
\762 = NAND(\635, \713)
\763 = NAND(\635, \644, \722)
\764 = NAND(\609, \687)
\765 = NAND(\600, \678)
\766 = NAND(\600, \609, \687)
\767 = BUFF(\660)
\768 = BUFF(\661)
\769 = NOR(\736, \737)
\770 = NOR(\739, \740)
\771 = NOR(\742, \743)
\772 = NOR(\745, \746)
\773 = NAND(\750, \762, \763, \734)
\777 = NOR(\748, \749)
\778 = NAND(\753, \761, \733)
\781 = NOR(\751, \752)
\782 = NAND(\756, \732)
\785 = NOR(\754, \755)
\786 = NOR(\757, \758)
\787 = NOR(\759, \760)
\788 = NOR(\700, \773)
\789 = AND(\700, \773)
\790 = NOR(\708, \778)
\791 = AND(\708, \778)
\792 = NOR(\717, \782)
\793 = AND(\717, \782)
\794 = AND(\219, \786)
\795 = NAND(\628, \773)
\796 = NAND(\795, \747)
\802 = NOR(\788, \789)
\803 = NOR(\790, \791)
\804 = NOR(\792, \793)
\805 = NOR(\340, \794)
\806 = NOR(\692, \796)
\807 = AND(\692, \796)
\808 = AND(\219, \802)
\809 = AND(\219, \803)
\810 = AND(\219, \804)
\811 = NAND(\805, \787, \731, \529)
\812 = NAND(\619, \796)
\813 = NAND(\609, \619, \796)
\814 = NAND(\600, \609, \619, \796)
\815 = NAND(\738, \765, \766, \814)
\819 = NAND(\741, \764, \813)
\822 = NAND(\744, \812)
\825 = NOR(\806, \807)
\826 = NOR(\335, \808)
\827 = NOR(\336, \809)
\828 = NOR(\338, \810)
\829 = NOT(\811)
\830 = NOR(\665, \815)
\831 = AND(\665, \815)
\832 = NOR(\673, \819)
\833 = AND(\673, \819)
\834 = NOR(\682, \822)
\835 = AND(\682, \822)
\836 = AND(\219, \825)
\837 = NAND(\826, \777, \704)
\838 = NAND(\827, \781, \712, \527)
\839 = NAND(\828, \785, \721, \528)
\840 = NOT(\829)
\841 = NAND(\815, \593)
\842 = NOR(\830, \831)
\843 = NOR(\832, \833)
\844 = NOR(\834, \835)
\845 = NOR(\334, \836)
\846 = NOT(\837)
\847 = NOT(\838)
\848 = NOT(\839)
\849 = AND(\735, \841)
\850 = BUFF(\840)
\851 = AND(\219, \842)
\852 = AND(\219, \843)
\853 = AND(\219, \844)
\854 = NAND(\845, \772, \696)
\855 = NOT(\846)
\856 = NOT(\847)
\857 = NOT(\848)
\858 = NOT(\849)
\859 = NOR(\417, \851)
\860 = NOR(\332, \852)
\861 = NOR(\333, \853)
\862 = NOT(\854)
\863 = BUFF(\855)
\864 = BUFF(\856)
\865 = BUFF(\857)
\866 = BUFF(\858)
\867 = NAND(\859, \769, \669)
\868 = NAND(\860, \770, \677)
\869 = NAND(\861, \771, \686)
\870 = NOT(\862)
\871 = NOT(\867)
\872 = NOT(\868)
\873 = NOT(\869)
\874 = BUFF(\870)
\875 = NOT(\871)
\876 = NOT(\872)
\877 = NOT(\873)
\878 = BUFF(\875)
\879 = BUFF(\876)
\880 = BUFF(\877)

View File

@ -1,604 +0,0 @@
// Benchmark "c2670" written by ABC on Sun Jan 8 23:46:44 2023
module c2670 (
\1 , \2 , \3 , \4 , \5 , \6 , \7 , \8 , \11 , \14 , \15 , \16 , \19 ,
\20 , \21 , \22 , \23 , \24 , \25 , \26 , \27 , \28 , \29 , \32 , \33 ,
\34 , \35 , \36 , \37 , \40 , \43 , \44 , \47 , \48 , \49 , \50 , \51 ,
\52 , \53 , \54 , \55 , \56 , \57 , \60 , \61 , \62 , \63 , \64 , \65 ,
\66 , \67 , \68 , \69 , \72 , \73 , \74 , \75 , \76 , \77 , \78 , \79 ,
\80 , \81 , \82 , \85 , \86 , \87 , \88 , \89 , \90 , \91 , \92 , \93 ,
\94 , \95 , \96 , \99 , \100 , \101 , \102 , \103 , \104 , \105 ,
\106 , \107 , \108 , \111 , \112 , \113 , \114 , \115 , \116 , \117 ,
\118 , \119 , \120 , \123 , \124 , \125 , \126 , \127 , \128 , \129 ,
\130 , \131 , \132 , \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 , \224 , \227 ,
\230 , \231 , \234 , \237 , \241 , \246 , \253 , \256 , \259 , \262 ,
\263 , \266 , \269 , \272 , \275 , \278 , \281 , \284 , \287 , \290 ,
\294 , \297 , \301 , \305 , \309 , \313 , \316 , \319 , \322 , \325 ,
\328 , \331 , \334 , \337 , \340 , \343 , \346 , \349 , \352 , \355 ,
\398 , \400 , \401 , \419 , \420 , \456 , \457 , \458 , \487 , \488 ,
\489 , \490 , \491 , \492 , \493 , \494 , \792 , \799 , \805 , \1026 ,
\1028 , \1029 , \1269 , \1277 , \1448 , \1726 , \1816 , \1817 , \1818 ,
\1819 , \1820 , \1821 , \1969 , \1970 , \1971 , \2010 , \2012 , \2014 ,
\2016 , \2018 , \2020 , \2022 , \2387 , \2388 , \2389 , \2390 , \2496 ,
\2643 , \2644 , \2891 , \2925 , \2970 , \2971 , \3038 , \3079 , \3546 ,
\3671 , \3803 , \3804 , \3809 , \3851 , \3875 , \3881 , \3882 );
input \1 , \2 , \3 , \4 , \5 , \6 , \7 , \8 , \11 , \14 , \15 , \16 ,
\19 , \20 , \21 , \22 , \23 , \24 , \25 , \26 , \27 , \28 , \29 , \32 ,
\33 , \34 , \35 , \36 , \37 , \40 , \43 , \44 , \47 , \48 , \49 , \50 ,
\51 , \52 , \53 , \54 , \55 , \56 , \57 , \60 , \61 , \62 , \63 , \64 ,
\65 , \66 , \67 , \68 , \69 , \72 , \73 , \74 , \75 , \76 , \77 , \78 ,
\79 , \80 , \81 , \82 , \85 , \86 , \87 , \88 , \89 , \90 , \91 , \92 ,
\93 , \94 , \95 , \96 , \99 , \100 , \101 , \102 , \103 , \104 , \105 ,
\106 , \107 , \108 , \111 , \112 , \113 , \114 , \115 , \116 , \117 ,
\118 , \119 , \120 , \123 , \124 , \125 , \126 , \127 , \128 , \129 ,
\130 , \131 , \132 , \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 , \224 , \227 ,
\230 , \231 , \234 , \237 , \241 , \246 , \253 , \256 , \259 , \262 ,
\263 , \266 , \269 , \272 , \275 , \278 , \281 , \284 , \287 , \290 ,
\294 , \297 , \301 , \305 , \309 , \313 , \316 , \319 , \322 , \325 ,
\328 , \331 , \334 , \337 , \340 , \343 , \346 , \349 , \352 , \355 ;
output \398 , \400 , \401 , \419 , \420 , \456 , \457 , \458 , \487 , \488 ,
\489 , \490 , \491 , \492 , \493 , \494 , \792 , \799 , \805 , \1026 ,
\1028 , \1029 , \1269 , \1277 , \1448 , \1726 , \1816 , \1817 , \1818 ,
\1819 , \1820 , \1821 , \1969 , \1970 , \1971 , \2010 , \2012 , \2014 ,
\2016 , \2018 , \2020 , \2022 , \2387 , \2388 , \2389 , \2390 , \2496 ,
\2643 , \2644 , \2891 , \2925 , \2970 , \2971 , \3038 , \3079 , \3546 ,
\3671 , \3803 , \3804 , \3809 , \3851 , \3875 , \3881 , \3882 ;
wire new_n388_, new_n389_, new_n392_, new_n393_, new_n394_, new_n396_,
new_n397_, new_n398_, new_n399_, new_n400_, new_n401_, new_n403_,
new_n404_, new_n405_, new_n406_, new_n407_, new_n409_, new_n410_,
new_n411_, new_n412_, new_n413_, new_n415_, new_n416_, new_n417_,
new_n418_, new_n419_, new_n420_, new_n423_, new_n424_, new_n425_,
new_n426_, new_n429_, new_n430_, new_n431_, new_n432_, new_n435_,
new_n436_, new_n437_, new_n438_, new_n439_, new_n440_, new_n443_,
new_n445_, new_n446_, new_n447_, new_n448_, new_n450_, new_n451_,
new_n452_, new_n453_, new_n455_, new_n456_, new_n457_, new_n458_,
new_n460_, new_n461_, new_n462_, new_n463_, new_n465_, new_n466_,
new_n467_, new_n468_, new_n469_, new_n470_, new_n471_, new_n472_,
new_n474_, new_n475_, new_n477_, new_n478_, new_n479_, new_n481_,
new_n482_, new_n484_, new_n485_, new_n486_, new_n487_, new_n488_,
new_n489_, new_n490_, new_n491_, new_n492_, new_n493_, new_n494_,
new_n495_, new_n496_, new_n497_, new_n499_, new_n500_, new_n501_,
new_n502_, new_n503_, new_n504_, new_n505_, new_n506_, new_n507_,
new_n508_, new_n509_, new_n510_, new_n511_, new_n512_, new_n513_,
new_n514_, new_n515_, new_n517_, new_n518_, new_n519_, new_n520_,
new_n521_, new_n522_, new_n523_, new_n524_, new_n525_, new_n526_,
new_n527_, new_n528_, new_n530_, new_n531_, new_n532_, new_n533_,
new_n534_, new_n535_, new_n536_, new_n537_, new_n538_, new_n539_,
new_n540_, new_n541_, new_n542_, new_n543_, new_n545_, new_n546_,
new_n547_, new_n548_, new_n549_, new_n550_, new_n551_, new_n552_,
new_n553_, new_n554_, new_n555_, new_n556_, new_n557_, new_n558_,
new_n559_, new_n560_, new_n561_, new_n562_, new_n563_, new_n564_,
new_n565_, new_n566_, new_n567_, new_n568_, new_n569_, new_n570_,
new_n571_, new_n572_, new_n573_, new_n574_, new_n575_, new_n576_,
new_n577_, new_n578_, new_n579_, new_n580_, new_n581_, new_n582_,
new_n583_, new_n584_, new_n585_, new_n586_, new_n587_, new_n588_,
new_n589_, new_n590_, new_n591_, new_n592_, new_n593_, new_n594_,
new_n595_, new_n596_, new_n597_, new_n598_, new_n599_, new_n600_,
new_n601_, new_n602_, new_n603_, new_n604_, new_n605_, new_n606_,
new_n607_, new_n608_, new_n609_, new_n610_, new_n611_, new_n612_,
new_n613_, new_n614_, new_n615_, new_n616_, new_n617_, new_n618_,
new_n619_, new_n620_, new_n621_, new_n622_, new_n623_, new_n624_,
new_n625_, new_n626_, new_n627_, new_n628_, new_n629_, new_n630_,
new_n631_, new_n632_, new_n633_, new_n634_, new_n635_, new_n636_,
new_n637_, new_n638_, new_n639_, new_n640_, new_n641_, new_n642_,
new_n643_, new_n644_, new_n645_, new_n646_, new_n647_, new_n648_,
new_n649_, new_n650_, new_n651_, new_n652_, new_n653_, new_n654_,
new_n655_, new_n656_, new_n657_, new_n658_, new_n659_, new_n660_,
new_n661_, new_n662_, new_n663_, new_n664_, new_n665_, new_n666_,
new_n667_, new_n668_, new_n669_, new_n670_, new_n671_, new_n672_,
new_n673_, new_n674_, new_n675_, new_n676_, new_n677_, new_n678_,
new_n679_, new_n682_, new_n683_, new_n684_, new_n685_, new_n686_,
new_n687_, new_n688_, new_n689_, new_n690_, new_n691_, new_n693_,
new_n694_, new_n695_, new_n696_, new_n697_, new_n698_, new_n699_,
new_n700_, new_n701_, new_n702_, new_n703_, new_n704_, new_n705_,
new_n706_, new_n707_, new_n708_, new_n709_, new_n710_, new_n711_,
new_n712_, new_n713_, new_n714_, new_n715_, new_n717_, new_n718_,
new_n719_, new_n720_, new_n721_, new_n722_, new_n723_, new_n724_,
new_n725_, new_n726_, new_n727_, new_n728_, new_n729_, new_n730_,
new_n731_, new_n732_, new_n734_, new_n735_, new_n736_, new_n737_,
new_n738_, new_n739_, new_n740_, new_n741_, new_n742_, new_n743_,
new_n745_, new_n746_, new_n747_, new_n748_, new_n749_, new_n750_,
new_n751_, new_n752_, new_n753_, new_n754_, new_n755_, new_n756_,
new_n757_, new_n758_, new_n759_, new_n760_, new_n761_, new_n762_,
new_n763_, new_n764_, new_n765_, new_n766_, new_n767_, new_n768_,
new_n769_, new_n770_, new_n771_, new_n772_, new_n773_, new_n774_,
new_n775_, new_n776_, new_n777_, new_n778_, new_n779_, new_n780_,
new_n781_, new_n782_, new_n783_, new_n784_, new_n785_, new_n786_,
new_n787_, new_n788_, new_n789_, new_n790_, new_n791_, new_n792_,
new_n793_, new_n794_, new_n795_, new_n796_, new_n797_, new_n798_,
new_n799_, new_n800_, new_n801_, new_n802_, new_n803_, new_n804_,
new_n805_, new_n806_, new_n807_, new_n808_, new_n809_, new_n810_,
new_n811_, new_n812_, new_n813_, new_n814_, new_n815_, new_n816_,
new_n817_, new_n818_, new_n819_, new_n820_, new_n821_, new_n822_,
new_n823_, new_n824_, new_n825_, new_n826_, new_n827_, new_n830_;
NOT g000(.A(\44 ), .Y(\487 ));
NOT g001(.A(\132 ), .Y(\488 ));
NOT g002(.A(\82 ), .Y(\489 ));
NOT g003(.A(\96 ), .Y(\490 ));
NOT g004(.A(\69 ), .Y(\491 ));
NOT g005(.A(\120 ), .Y(\492 ));
NOT g006(.A(\57 ), .Y(\493 ));
NOT g007(.A(\108 ), .Y(\494 ));
NAND4 g008(.A(\309 ), .B(\305 ), .C(\301 ), .D(\297 ), .Y(\792 ));
NAND3 g009(.A(\237 ), .B(\15 ), .C(\2 ), .Y(\799 ));
AND2 g010(.A(\219 ), .B(\94 ), .Y(\1026 ));
NAND2 g011(.A(\237 ), .B(\7 ), .Y(\1028 ));
NAND3 g012(.A(\237 ), .B(\231 ), .C(\7 ), .Y(\1029 ));
NAND3 g013(.A(\325 ), .B(\237 ), .C(\7 ), .Y(\1269 ));
NAND4 g014(.A(\120 ), .B(\108 ), .C(\69 ), .D(\57 ), .Y(new_n388_));
NAND4 g015(.A(\132 ), .B(\96 ), .C(\82 ), .D(\44 ), .Y(new_n389_));
NOR2 g016(.A(new_n389_), .B(new_n388_), .Y(\1277 ));
NOT g017(.A(\1277 ), .Y(\1448 ));
NAND2 g018(.A(new_n389_), .B(\325 ), .Y(new_n392_));
NAND2 g019(.A(new_n388_), .B(\231 ), .Y(new_n393_));
NAND2 g020(.A(new_n393_), .B(new_n392_), .Y(new_n394_));
NOT g021(.A(new_n394_), .Y(\1726 ));
NAND3 g022(.A(\322 ), .B(\319 ), .C(\113 ), .Y(new_n396_));
NOT g023(.A(\319 ), .Y(new_n397_));
NAND3 g024(.A(\322 ), .B(new_n397_), .C(\125 ), .Y(new_n398_));
NOT g025(.A(\322 ), .Y(new_n399_));
NAND3 g026(.A(new_n399_), .B(new_n397_), .C(\137 ), .Y(new_n400_));
NAND3 g027(.A(new_n399_), .B(\319 ), .C(\101 ), .Y(new_n401_));
AND4 g028(.A(new_n401_), .B(new_n400_), .C(new_n398_), .D(new_n396_), .Y(\1816 ));
NAND3 g029(.A(\322 ), .B(\319 ), .C(\112 ), .Y(new_n403_));
NAND3 g030(.A(\322 ), .B(new_n397_), .C(\124 ), .Y(new_n404_));
NAND3 g031(.A(new_n399_), .B(new_n397_), .C(\136 ), .Y(new_n405_));
NAND3 g032(.A(new_n399_), .B(\319 ), .C(\100 ), .Y(new_n406_));
NAND4 g033(.A(new_n406_), .B(new_n405_), .C(new_n404_), .D(new_n403_), .Y(new_n407_));
NOT g034(.A(new_n407_), .Y(\1817 ));
NAND3 g035(.A(\322 ), .B(\319 ), .C(\114 ), .Y(new_n409_));
NAND3 g036(.A(\322 ), .B(new_n397_), .C(\126 ), .Y(new_n410_));
NAND3 g037(.A(new_n399_), .B(new_n397_), .C(\138 ), .Y(new_n411_));
NAND3 g038(.A(new_n399_), .B(\319 ), .C(\102 ), .Y(new_n412_));
NAND4 g039(.A(new_n412_), .B(new_n411_), .C(new_n410_), .D(new_n409_), .Y(new_n413_));
NOT g040(.A(new_n413_), .Y(\1818 ));
NAND3 g041(.A(\234 ), .B(\227 ), .C(\75 ), .Y(new_n415_));
NOT g042(.A(\227 ), .Y(new_n416_));
NAND3 g043(.A(\234 ), .B(new_n416_), .C(\62 ), .Y(new_n417_));
NOT g044(.A(\234 ), .Y(new_n418_));
NAND3 g045(.A(new_n418_), .B(new_n416_), .C(\88 ), .Y(new_n419_));
NAND3 g046(.A(new_n418_), .B(\227 ), .C(\50 ), .Y(new_n420_));
NAND4 g047(.A(new_n420_), .B(new_n419_), .C(new_n417_), .D(new_n415_), .Y(\2016 ));
NOT g048(.A(\2016 ), .Y(\1819 ));
NAND3 g049(.A(\234 ), .B(\227 ), .C(\76 ), .Y(new_n423_));
NAND3 g050(.A(\234 ), .B(new_n416_), .C(\63 ), .Y(new_n424_));
NAND3 g051(.A(new_n418_), .B(new_n416_), .C(\89 ), .Y(new_n425_));
NAND3 g052(.A(new_n418_), .B(\227 ), .C(\51 ), .Y(new_n426_));
NAND4 g053(.A(new_n426_), .B(new_n425_), .C(new_n424_), .D(new_n423_), .Y(\2014 ));
NOT g054(.A(\2014 ), .Y(\1820 ));
NAND3 g055(.A(\234 ), .B(\227 ), .C(\77 ), .Y(new_n429_));
NAND3 g056(.A(\234 ), .B(new_n416_), .C(\64 ), .Y(new_n430_));
NAND3 g057(.A(new_n418_), .B(new_n416_), .C(\90 ), .Y(new_n431_));
NAND3 g058(.A(new_n418_), .B(\227 ), .C(\52 ), .Y(new_n432_));
NAND4 g059(.A(new_n432_), .B(new_n431_), .C(new_n430_), .D(new_n429_), .Y(\2012 ));
NOT g060(.A(\2012 ), .Y(\1821 ));
NAND3 g061(.A(\234 ), .B(\227 ), .C(\68 ), .Y(new_n435_));
NAND3 g062(.A(\234 ), .B(new_n416_), .C(\56 ), .Y(new_n436_));
NAND3 g063(.A(new_n418_), .B(new_n416_), .C(\81 ), .Y(new_n437_));
NAND3 g064(.A(new_n418_), .B(\227 ), .C(\43 ), .Y(new_n438_));
NAND4 g065(.A(new_n438_), .B(new_n437_), .C(new_n436_), .D(new_n435_), .Y(new_n439_));
NOT g066(.A(new_n439_), .Y(new_n440_));
NAND2 g067(.A(new_n440_), .B(\241 ), .Y(\1969 ));
NAND4 g068(.A(\1726 ), .B(\237 ), .C(\224 ), .D(\36 ), .Y(\1970 ));
NAND2 g069(.A(\3 ), .B(\1 ), .Y(new_n443_));
NAND4 g070(.A(new_n443_), .B(\1726 ), .C(\237 ), .D(\224 ), .Y(\1971 ));
NAND3 g071(.A(\234 ), .B(\227 ), .C(\78 ), .Y(new_n445_));
NAND3 g072(.A(\234 ), .B(new_n416_), .C(\65 ), .Y(new_n446_));
NAND3 g073(.A(new_n418_), .B(new_n416_), .C(\91 ), .Y(new_n447_));
NAND3 g074(.A(new_n418_), .B(\227 ), .C(\53 ), .Y(new_n448_));
NAND4 g075(.A(new_n448_), .B(new_n447_), .C(new_n446_), .D(new_n445_), .Y(\2010 ));
NAND3 g076(.A(\234 ), .B(\227 ), .C(\74 ), .Y(new_n450_));
OR2 g077(.A(new_n418_), .B(\227 ), .Y(new_n451_));
NAND3 g078(.A(new_n418_), .B(new_n416_), .C(\87 ), .Y(new_n452_));
NAND3 g079(.A(new_n418_), .B(\227 ), .C(\49 ), .Y(new_n453_));
NAND4 g080(.A(new_n453_), .B(new_n452_), .C(new_n451_), .D(new_n450_), .Y(\2018 ));
NAND3 g081(.A(\234 ), .B(\227 ), .C(\73 ), .Y(new_n455_));
NAND3 g082(.A(\234 ), .B(new_n416_), .C(\61 ), .Y(new_n456_));
NAND3 g083(.A(new_n418_), .B(new_n416_), .C(\86 ), .Y(new_n457_));
NAND3 g084(.A(new_n418_), .B(\227 ), .C(\48 ), .Y(new_n458_));
NAND4 g085(.A(new_n458_), .B(new_n457_), .C(new_n456_), .D(new_n455_), .Y(\2020 ));
NAND3 g086(.A(\234 ), .B(\227 ), .C(\72 ), .Y(new_n460_));
NAND3 g087(.A(\234 ), .B(new_n416_), .C(\60 ), .Y(new_n461_));
NAND3 g088(.A(new_n418_), .B(new_n416_), .C(\85 ), .Y(new_n462_));
NAND3 g089(.A(new_n418_), .B(\227 ), .C(\47 ), .Y(new_n463_));
NAND4 g090(.A(new_n463_), .B(new_n462_), .C(new_n461_), .D(new_n460_), .Y(\2022 ));
NOT g091(.A(\246 ), .Y(new_n465_));
NAND3 g092(.A(\234 ), .B(\227 ), .C(\79 ), .Y(new_n466_));
NAND3 g093(.A(\234 ), .B(new_n416_), .C(\66 ), .Y(new_n467_));
NAND3 g094(.A(new_n418_), .B(new_n416_), .C(\92 ), .Y(new_n468_));
NAND3 g095(.A(new_n418_), .B(\227 ), .C(\54 ), .Y(new_n469_));
NAND4 g096(.A(new_n469_), .B(new_n468_), .C(new_n467_), .D(new_n466_), .Y(new_n470_));
NAND2 g097(.A(new_n470_), .B(new_n465_), .Y(new_n471_));
NAND2 g098(.A(\2012 ), .B(\246 ), .Y(new_n472_));
NAND2 g099(.A(new_n472_), .B(new_n471_), .Y(\2387 ));
NAND2 g100(.A(\2010 ), .B(new_n465_), .Y(new_n474_));
NAND2 g101(.A(\2014 ), .B(\246 ), .Y(new_n475_));
NAND2 g102(.A(new_n475_), .B(new_n474_), .Y(\2389 ));
NOR2 g103(.A(new_n470_), .B(\230 ), .Y(new_n477_));
OR2 g104(.A(new_n477_), .B(\241 ), .Y(new_n478_));
NAND2 g105(.A(new_n470_), .B(\241 ), .Y(new_n479_));
NAND2 g106(.A(new_n479_), .B(new_n478_), .Y(\2496 ));
NAND2 g107(.A(new_n439_), .B(new_n465_), .Y(new_n481_));
OR2 g108(.A(new_n477_), .B(new_n465_), .Y(new_n482_));
NAND2 g109(.A(new_n482_), .B(new_n481_), .Y(\2643 ));
NAND3 g110(.A(\322 ), .B(\319 ), .C(\111 ), .Y(new_n484_));
NAND3 g111(.A(\322 ), .B(new_n397_), .C(\123 ), .Y(new_n485_));
NAND3 g112(.A(new_n399_), .B(new_n397_), .C(\135 ), .Y(new_n486_));
NAND3 g113(.A(new_n399_), .B(\319 ), .C(\99 ), .Y(new_n487_));
NAND4 g114(.A(new_n487_), .B(new_n486_), .C(new_n485_), .D(new_n484_), .Y(new_n488_));
NAND2 g115(.A(new_n488_), .B(\313 ), .Y(new_n489_));
OR2 g116(.A(new_n488_), .B(\313 ), .Y(new_n490_));
NAND2 g117(.A(\322 ), .B(\319 ), .Y(new_n491_));
OR2 g118(.A(new_n399_), .B(\319 ), .Y(new_n492_));
OR2 g119(.A(\322 ), .B(\319 ), .Y(new_n493_));
OR2 g120(.A(\322 ), .B(new_n397_), .Y(new_n494_));
NAND4 g121(.A(new_n494_), .B(new_n493_), .C(new_n492_), .D(new_n491_), .Y(new_n495_));
OR2 g122(.A(new_n495_), .B(\316 ), .Y(new_n496_));
NAND2 g123(.A(new_n495_), .B(\316 ), .Y(new_n497_));
NAND4 g124(.A(new_n497_), .B(new_n496_), .C(new_n490_), .D(new_n489_), .Y(\2891 ));
XOR2 g125(.A(\349 ), .B(\346 ), .Y(new_n499_));
XNOR2 g126(.A(\259 ), .B(\256 ), .Y(new_n500_));
XOR2 g127(.A(new_n500_), .B(new_n499_), .Y(new_n501_));
XNOR2 g128(.A(\337 ), .B(\334 ), .Y(new_n502_));
XNOR2 g129(.A(\343 ), .B(\340 ), .Y(new_n503_));
XNOR2 g130(.A(\331 ), .B(\328 ), .Y(new_n504_));
NOT g131(.A(new_n504_), .Y(new_n505_));
NAND3 g132(.A(new_n505_), .B(new_n503_), .C(new_n502_), .Y(new_n506_));
NOT g133(.A(new_n503_), .Y(new_n507_));
NAND3 g134(.A(new_n504_), .B(new_n507_), .C(new_n502_), .Y(new_n508_));
NOT g135(.A(new_n502_), .Y(new_n509_));
NAND3 g136(.A(new_n504_), .B(new_n503_), .C(new_n509_), .Y(new_n510_));
NAND3 g137(.A(new_n505_), .B(new_n507_), .C(new_n509_), .Y(new_n511_));
NAND4 g138(.A(new_n511_), .B(new_n510_), .C(new_n508_), .D(new_n506_), .Y(new_n512_));
NAND2 g139(.A(new_n512_), .B(new_n501_), .Y(new_n513_));
OR2 g140(.A(new_n512_), .B(new_n501_), .Y(new_n514_));
NAND3 g141(.A(new_n514_), .B(new_n513_), .C(\14 ), .Y(new_n515_));
NOT g142(.A(new_n515_), .Y(\2925 ));
XNOR2 g143(.A(\316 ), .B(\313 ), .Y(new_n517_));
XNOR2 g144(.A(\301 ), .B(\297 ), .Y(new_n518_));
XNOR2 g145(.A(\309 ), .B(\305 ), .Y(new_n519_));
XNOR2 g146(.A(\355 ), .B(\294 ), .Y(new_n520_));
NOT g147(.A(new_n520_), .Y(new_n521_));
NAND3 g148(.A(new_n521_), .B(new_n519_), .C(new_n518_), .Y(new_n522_));
NOT g149(.A(new_n519_), .Y(new_n523_));
NAND3 g150(.A(new_n520_), .B(new_n523_), .C(new_n518_), .Y(new_n524_));
NOT g151(.A(new_n518_), .Y(new_n525_));
NAND3 g152(.A(new_n520_), .B(new_n519_), .C(new_n525_), .Y(new_n526_));
NAND3 g153(.A(new_n521_), .B(new_n523_), .C(new_n525_), .Y(new_n527_));
NAND4 g154(.A(new_n527_), .B(new_n526_), .C(new_n524_), .D(new_n522_), .Y(new_n528_));
XOR2 g155(.A(new_n528_), .B(new_n517_), .Y(\2970 ));
XOR2 g156(.A(\281 ), .B(\278 ), .Y(new_n530_));
XNOR2 g157(.A(\287 ), .B(\284 ), .Y(new_n531_));
XOR2 g158(.A(new_n531_), .B(new_n530_), .Y(new_n532_));
XNOR2 g159(.A(\269 ), .B(\266 ), .Y(new_n533_));
XNOR2 g160(.A(\275 ), .B(\272 ), .Y(new_n534_));
XNOR2 g161(.A(\352 ), .B(\263 ), .Y(new_n535_));
NOT g162(.A(new_n535_), .Y(new_n536_));
NAND3 g163(.A(new_n536_), .B(new_n534_), .C(new_n533_), .Y(new_n537_));
NOT g164(.A(new_n534_), .Y(new_n538_));
NAND3 g165(.A(new_n535_), .B(new_n538_), .C(new_n533_), .Y(new_n539_));
NOT g166(.A(new_n533_), .Y(new_n540_));
NAND3 g167(.A(new_n535_), .B(new_n534_), .C(new_n540_), .Y(new_n541_));
NAND3 g168(.A(new_n536_), .B(new_n538_), .C(new_n540_), .Y(new_n542_));
NAND4 g169(.A(new_n542_), .B(new_n541_), .C(new_n539_), .D(new_n537_), .Y(new_n543_));
XOR2 g170(.A(new_n543_), .B(new_n532_), .Y(\2971 ));
NOT g171(.A(\27 ), .Y(new_n545_));
OR2 g172(.A(\29 ), .B(new_n545_), .Y(new_n546_));
NAND2 g173(.A(new_n413_), .B(\29 ), .Y(new_n547_));
NAND2 g174(.A(new_n547_), .B(new_n546_), .Y(new_n548_));
OR2 g175(.A(new_n548_), .B(\301 ), .Y(new_n549_));
NOT g176(.A(\34 ), .Y(new_n550_));
OR2 g177(.A(new_n550_), .B(\29 ), .Y(new_n551_));
NAND4 g178(.A(new_n401_), .B(new_n400_), .C(new_n398_), .D(new_n396_), .Y(new_n552_));
NAND2 g179(.A(new_n552_), .B(\29 ), .Y(new_n553_));
NAND2 g180(.A(new_n553_), .B(new_n551_), .Y(new_n554_));
OR2 g181(.A(new_n554_), .B(\305 ), .Y(new_n555_));
NAND2 g182(.A(new_n548_), .B(\301 ), .Y(new_n556_));
NOT g183(.A(\26 ), .Y(new_n557_));
OR2 g184(.A(\29 ), .B(new_n557_), .Y(new_n558_));
NAND3 g185(.A(\322 ), .B(\319 ), .C(\116 ), .Y(new_n559_));
NAND3 g186(.A(\322 ), .B(new_n397_), .C(\128 ), .Y(new_n560_));
NAND3 g187(.A(new_n399_), .B(new_n397_), .C(\140 ), .Y(new_n561_));
NAND3 g188(.A(new_n399_), .B(\319 ), .C(\104 ), .Y(new_n562_));
NAND4 g189(.A(new_n562_), .B(new_n561_), .C(new_n560_), .D(new_n559_), .Y(new_n563_));
NAND2 g190(.A(new_n563_), .B(\29 ), .Y(new_n564_));
NAND2 g191(.A(new_n564_), .B(new_n558_), .Y(new_n565_));
OR2 g192(.A(new_n565_), .B(\294 ), .Y(new_n566_));
NOT g193(.A(\33 ), .Y(new_n567_));
OR2 g194(.A(new_n567_), .B(\29 ), .Y(new_n568_));
NAND3 g195(.A(\322 ), .B(\319 ), .C(\115 ), .Y(new_n569_));
NAND3 g196(.A(\322 ), .B(new_n397_), .C(\127 ), .Y(new_n570_));
NAND3 g197(.A(new_n399_), .B(new_n397_), .C(\139 ), .Y(new_n571_));
NAND3 g198(.A(new_n399_), .B(\319 ), .C(\103 ), .Y(new_n572_));
NAND4 g199(.A(new_n572_), .B(new_n571_), .C(new_n570_), .D(new_n569_), .Y(new_n573_));
NAND2 g200(.A(new_n573_), .B(\29 ), .Y(new_n574_));
NAND2 g201(.A(new_n574_), .B(new_n568_), .Y(new_n575_));
NAND2 g202(.A(new_n575_), .B(\297 ), .Y(new_n576_));
OR2 g203(.A(new_n575_), .B(\297 ), .Y(new_n577_));
NAND2 g204(.A(new_n554_), .B(\305 ), .Y(new_n578_));
NAND4 g205(.A(new_n578_), .B(new_n577_), .C(new_n576_), .D(new_n566_), .Y(new_n579_));
NOT g206(.A(\35 ), .Y(new_n580_));
OR2 g207(.A(new_n580_), .B(\29 ), .Y(new_n581_));
NAND2 g208(.A(new_n407_), .B(\29 ), .Y(new_n582_));
NAND2 g209(.A(new_n582_), .B(new_n581_), .Y(new_n583_));
OR2 g210(.A(new_n583_), .B(\309 ), .Y(new_n584_));
NOT g211(.A(\32 ), .Y(new_n585_));
OR2 g212(.A(new_n585_), .B(\29 ), .Y(new_n586_));
NAND3 g213(.A(\322 ), .B(\319 ), .C(\117 ), .Y(new_n587_));
NAND3 g214(.A(\322 ), .B(new_n397_), .C(\129 ), .Y(new_n588_));
NAND3 g215(.A(new_n399_), .B(new_n397_), .C(\141 ), .Y(new_n589_));
NAND3 g216(.A(new_n399_), .B(\319 ), .C(\105 ), .Y(new_n590_));
NAND4 g217(.A(new_n590_), .B(new_n589_), .C(new_n588_), .D(new_n587_), .Y(new_n591_));
NAND2 g218(.A(new_n591_), .B(\29 ), .Y(new_n592_));
NAND2 g219(.A(new_n592_), .B(new_n586_), .Y(new_n593_));
NAND2 g220(.A(new_n593_), .B(\287 ), .Y(new_n594_));
OR2 g221(.A(new_n593_), .B(\287 ), .Y(new_n595_));
NAND2 g222(.A(new_n565_), .B(\294 ), .Y(new_n596_));
NAND4 g223(.A(new_n596_), .B(new_n595_), .C(new_n594_), .D(new_n584_), .Y(new_n597_));
NOR2 g224(.A(new_n597_), .B(new_n579_), .Y(new_n598_));
NAND4 g225(.A(new_n598_), .B(new_n556_), .C(new_n555_), .D(new_n549_), .Y(new_n599_));
NOT g226(.A(\22 ), .Y(new_n600_));
OR2 g227(.A(new_n600_), .B(\16 ), .Y(new_n601_));
NAND2 g228(.A(\2016 ), .B(\16 ), .Y(new_n602_));
NAND2 g229(.A(new_n602_), .B(new_n601_), .Y(new_n603_));
NAND2 g230(.A(new_n603_), .B(\272 ), .Y(new_n604_));
NAND2 g231(.A(new_n465_), .B(\11 ), .Y(new_n605_));
NAND2 g232(.A(\246 ), .B(\11 ), .Y(new_n606_));
NAND2 g233(.A(new_n606_), .B(new_n605_), .Y(new_n607_));
NOT g234(.A(\28 ), .Y(new_n608_));
OR2 g235(.A(\29 ), .B(new_n608_), .Y(new_n609_));
NAND2 g236(.A(new_n488_), .B(\29 ), .Y(new_n610_));
NAND2 g237(.A(new_n610_), .B(new_n609_), .Y(new_n611_));
NAND3 g238(.A(new_n611_), .B(new_n607_), .C(new_n604_), .Y(new_n612_));
OR2 g239(.A(new_n603_), .B(\272 ), .Y(new_n613_));
NOT g240(.A(\23 ), .Y(new_n614_));
OR2 g241(.A(new_n614_), .B(\16 ), .Y(new_n615_));
NAND2 g242(.A(\2018 ), .B(\16 ), .Y(new_n616_));
NAND2 g243(.A(new_n616_), .B(new_n615_), .Y(new_n617_));
NAND2 g244(.A(new_n617_), .B(\275 ), .Y(new_n618_));
OR2 g245(.A(new_n617_), .B(\275 ), .Y(new_n619_));
NOT g246(.A(\6 ), .Y(new_n620_));
OR2 g247(.A(\16 ), .B(new_n620_), .Y(new_n621_));
NAND2 g248(.A(\2020 ), .B(\16 ), .Y(new_n622_));
NAND2 g249(.A(new_n622_), .B(new_n621_), .Y(new_n623_));
NAND2 g250(.A(new_n623_), .B(\278 ), .Y(new_n624_));
NAND4 g251(.A(new_n624_), .B(new_n619_), .C(new_n618_), .D(new_n613_), .Y(new_n625_));
NOT g252(.A(\24 ), .Y(new_n626_));
OR2 g253(.A(new_n626_), .B(\16 ), .Y(new_n627_));
NAND2 g254(.A(\2022 ), .B(\16 ), .Y(new_n628_));
NAND2 g255(.A(new_n628_), .B(new_n627_), .Y(new_n629_));
OR2 g256(.A(new_n629_), .B(\281 ), .Y(new_n630_));
NOT g257(.A(\19 ), .Y(new_n631_));
OR2 g258(.A(new_n631_), .B(\16 ), .Y(new_n632_));
NAND2 g259(.A(new_n439_), .B(\16 ), .Y(new_n633_));
NAND2 g260(.A(new_n633_), .B(new_n632_), .Y(new_n634_));
NAND2 g261(.A(new_n634_), .B(\256 ), .Y(new_n635_));
OR2 g262(.A(new_n634_), .B(\256 ), .Y(new_n636_));
NOT g263(.A(\4 ), .Y(new_n637_));
OR2 g264(.A(\16 ), .B(new_n637_), .Y(new_n638_));
NAND2 g265(.A(new_n470_), .B(\16 ), .Y(new_n639_));
NAND2 g266(.A(new_n639_), .B(new_n638_), .Y(new_n640_));
NAND2 g267(.A(new_n640_), .B(\259 ), .Y(new_n641_));
NAND4 g268(.A(new_n641_), .B(new_n636_), .C(new_n635_), .D(new_n630_), .Y(new_n642_));
OR2 g269(.A(new_n623_), .B(\278 ), .Y(new_n643_));
NOT g270(.A(\25 ), .Y(new_n644_));
OR2 g271(.A(\29 ), .B(new_n644_), .Y(new_n645_));
NAND3 g272(.A(\322 ), .B(\319 ), .C(\107 ), .Y(new_n646_));
NAND3 g273(.A(\322 ), .B(new_n397_), .C(\119 ), .Y(new_n647_));
NAND3 g274(.A(new_n399_), .B(new_n397_), .C(\131 ), .Y(new_n648_));
NAND3 g275(.A(new_n399_), .B(\319 ), .C(\95 ), .Y(new_n649_));
NAND4 g276(.A(new_n649_), .B(new_n648_), .C(new_n647_), .D(new_n646_), .Y(new_n650_));
NAND2 g277(.A(new_n650_), .B(\29 ), .Y(new_n651_));
NAND2 g278(.A(new_n651_), .B(new_n645_), .Y(new_n652_));
NAND2 g279(.A(new_n652_), .B(\284 ), .Y(new_n653_));
OR2 g280(.A(new_n652_), .B(\284 ), .Y(new_n654_));
NAND2 g281(.A(new_n629_), .B(\281 ), .Y(new_n655_));
NAND4 g282(.A(new_n655_), .B(new_n654_), .C(new_n653_), .D(new_n643_), .Y(new_n656_));
NOT g283(.A(\21 ), .Y(new_n657_));
OR2 g284(.A(new_n657_), .B(\16 ), .Y(new_n658_));
NAND2 g285(.A(\2014 ), .B(\16 ), .Y(new_n659_));
NAND2 g286(.A(new_n659_), .B(new_n658_), .Y(new_n660_));
OR2 g287(.A(new_n660_), .B(\269 ), .Y(new_n661_));
NOT g288(.A(\5 ), .Y(new_n662_));
OR2 g289(.A(\16 ), .B(new_n662_), .Y(new_n663_));
NAND2 g290(.A(\2012 ), .B(\16 ), .Y(new_n664_));
NAND2 g291(.A(new_n664_), .B(new_n663_), .Y(new_n665_));
NAND2 g292(.A(new_n665_), .B(\266 ), .Y(new_n666_));
OR2 g293(.A(new_n665_), .B(\266 ), .Y(new_n667_));
NAND2 g294(.A(new_n583_), .B(\309 ), .Y(new_n668_));
NAND4 g295(.A(new_n668_), .B(new_n667_), .C(new_n666_), .D(new_n661_), .Y(new_n669_));
OR2 g296(.A(new_n640_), .B(\259 ), .Y(new_n670_));
NOT g297(.A(\20 ), .Y(new_n671_));
OR2 g298(.A(new_n671_), .B(\16 ), .Y(new_n672_));
NAND2 g299(.A(\2010 ), .B(\16 ), .Y(new_n673_));
NAND2 g300(.A(new_n673_), .B(new_n672_), .Y(new_n674_));
NAND2 g301(.A(new_n674_), .B(\263 ), .Y(new_n675_));
OR2 g302(.A(new_n674_), .B(\263 ), .Y(new_n676_));
NAND2 g303(.A(new_n660_), .B(\269 ), .Y(new_n677_));
NAND4 g304(.A(new_n677_), .B(new_n676_), .C(new_n675_), .D(new_n670_), .Y(new_n678_));
OR4 g305(.A(new_n678_), .B(new_n669_), .C(new_n656_), .D(new_n642_), .Y(new_n679_));
NOR4 g306(.A(new_n679_), .B(new_n625_), .C(new_n612_), .D(new_n599_), .Y(\3038 ));
NOT g307(.A(\3038 ), .Y(\3079 ));
XNOR2 g308(.A(new_n470_), .B(new_n439_), .Y(new_n682_));
XOR2 g309(.A(new_n682_), .B(new_n477_), .Y(new_n683_));
NAND3 g310(.A(\234 ), .B(\227 ), .C(\80 ), .Y(new_n684_));
NAND3 g311(.A(\234 ), .B(new_n416_), .C(\67 ), .Y(new_n685_));
NAND3 g312(.A(new_n418_), .B(new_n416_), .C(\93 ), .Y(new_n686_));
NAND3 g313(.A(new_n418_), .B(\227 ), .C(\55 ), .Y(new_n687_));
NAND4 g314(.A(new_n687_), .B(new_n686_), .C(new_n685_), .D(new_n684_), .Y(new_n688_));
XOR2 g315(.A(new_n688_), .B(new_n683_), .Y(new_n689_));
OR2 g316(.A(new_n689_), .B(\241 ), .Y(new_n690_));
NAND2 g317(.A(new_n688_), .B(\241 ), .Y(new_n691_));
NAND2 g318(.A(new_n691_), .B(new_n690_), .Y(\3546 ));
NOT g319(.A(\37 ), .Y(new_n693_));
XOR2 g320(.A(new_n407_), .B(new_n552_), .Y(new_n694_));
XNOR2 g321(.A(new_n495_), .B(new_n488_), .Y(new_n695_));
XOR2 g322(.A(new_n695_), .B(new_n694_), .Y(new_n696_));
XNOR2 g323(.A(new_n591_), .B(new_n563_), .Y(new_n697_));
XNOR2 g324(.A(new_n573_), .B(new_n413_), .Y(new_n698_));
NAND3 g325(.A(\322 ), .B(\319 ), .C(\118 ), .Y(new_n699_));
NAND3 g326(.A(\322 ), .B(new_n397_), .C(\130 ), .Y(new_n700_));
NAND3 g327(.A(new_n399_), .B(new_n397_), .C(\142 ), .Y(new_n701_));
NAND3 g328(.A(new_n399_), .B(\319 ), .C(\106 ), .Y(new_n702_));
NAND4 g329(.A(new_n702_), .B(new_n701_), .C(new_n700_), .D(new_n699_), .Y(new_n703_));
XNOR2 g330(.A(new_n703_), .B(new_n650_), .Y(new_n704_));
NOT g331(.A(new_n704_), .Y(new_n705_));
NAND3 g332(.A(new_n705_), .B(new_n698_), .C(new_n697_), .Y(new_n706_));
NOT g333(.A(new_n698_), .Y(new_n707_));
NAND3 g334(.A(new_n704_), .B(new_n707_), .C(new_n697_), .Y(new_n708_));
NOT g335(.A(new_n697_), .Y(new_n709_));
NAND3 g336(.A(new_n704_), .B(new_n698_), .C(new_n709_), .Y(new_n710_));
NAND3 g337(.A(new_n705_), .B(new_n707_), .C(new_n709_), .Y(new_n711_));
NAND4 g338(.A(new_n711_), .B(new_n710_), .C(new_n708_), .D(new_n706_), .Y(new_n712_));
NAND2 g339(.A(new_n712_), .B(new_n696_), .Y(new_n713_));
OR2 g340(.A(new_n712_), .B(new_n696_), .Y(new_n714_));
NAND3 g341(.A(new_n714_), .B(new_n713_), .C(new_n693_), .Y(new_n715_));
NOT g342(.A(new_n715_), .Y(\3671 ));
NAND2 g343(.A(new_n688_), .B(new_n465_), .Y(new_n717_));
XOR2 g344(.A(\2018 ), .B(\2016 ), .Y(new_n718_));
XNOR2 g345(.A(\2022 ), .B(\2020 ), .Y(new_n719_));
XOR2 g346(.A(new_n719_), .B(new_n718_), .Y(new_n720_));
NOT g347(.A(new_n477_), .Y(new_n721_));
XNOR2 g348(.A(new_n688_), .B(new_n439_), .Y(new_n722_));
XNOR2 g349(.A(new_n470_), .B(\2010 ), .Y(new_n723_));
NAND3 g350(.A(new_n723_), .B(new_n722_), .C(new_n721_), .Y(new_n724_));
NOT g351(.A(new_n723_), .Y(new_n725_));
NAND3 g352(.A(new_n725_), .B(new_n722_), .C(new_n477_), .Y(new_n726_));
NOT g353(.A(new_n722_), .Y(new_n727_));
NAND3 g354(.A(new_n723_), .B(new_n727_), .C(new_n477_), .Y(new_n728_));
NAND3 g355(.A(new_n725_), .B(new_n727_), .C(new_n721_), .Y(new_n729_));
NAND4 g356(.A(new_n729_), .B(new_n728_), .C(new_n726_), .D(new_n724_), .Y(new_n730_));
XOR2 g357(.A(new_n730_), .B(new_n720_), .Y(new_n731_));
OR2 g358(.A(new_n731_), .B(new_n465_), .Y(new_n732_));
NAND2 g359(.A(new_n732_), .B(new_n717_), .Y(\3803 ));
XNOR2 g360(.A(\2012 ), .B(\2014 ), .Y(new_n734_));
NAND3 g361(.A(new_n734_), .B(new_n723_), .C(new_n727_), .Y(new_n735_));
NOT g362(.A(new_n734_), .Y(new_n736_));
NAND3 g363(.A(new_n736_), .B(new_n723_), .C(new_n722_), .Y(new_n737_));
NAND3 g364(.A(new_n734_), .B(new_n725_), .C(new_n722_), .Y(new_n738_));
NAND3 g365(.A(new_n736_), .B(new_n725_), .C(new_n727_), .Y(new_n739_));
NAND4 g366(.A(new_n739_), .B(new_n738_), .C(new_n737_), .D(new_n735_), .Y(new_n740_));
NAND2 g367(.A(new_n740_), .B(new_n720_), .Y(new_n741_));
OR2 g368(.A(new_n740_), .B(new_n720_), .Y(new_n742_));
NAND3 g369(.A(new_n742_), .B(new_n741_), .C(new_n693_), .Y(new_n743_));
NOT g370(.A(new_n743_), .Y(\3809 ));
NOT g371(.A(\40 ), .Y(new_n745_));
NOT g372(.A(\262 ), .Y(new_n746_));
NAND2 g373(.A(new_n413_), .B(new_n746_), .Y(new_n747_));
NOR3 g374(.A(new_n747_), .B(new_n552_), .C(new_n745_), .Y(new_n748_));
NOR2 g375(.A(new_n552_), .B(new_n745_), .Y(new_n749_));
NAND2 g376(.A(new_n749_), .B(new_n747_), .Y(new_n750_));
NOR3 g377(.A(new_n750_), .B(new_n748_), .C(\294 ), .Y(new_n751_));
NAND3 g378(.A(new_n749_), .B(new_n747_), .C(new_n563_), .Y(new_n752_));
XOR2 g379(.A(new_n752_), .B(new_n751_), .Y(new_n753_));
NOR3 g380(.A(new_n750_), .B(new_n748_), .C(\287 ), .Y(new_n754_));
NAND3 g381(.A(new_n749_), .B(new_n747_), .C(new_n591_), .Y(new_n755_));
XOR2 g382(.A(new_n755_), .B(new_n754_), .Y(new_n756_));
NOR3 g383(.A(new_n750_), .B(new_n748_), .C(\284 ), .Y(new_n757_));
NAND3 g384(.A(new_n749_), .B(new_n747_), .C(new_n650_), .Y(new_n758_));
NAND4 g385(.A(new_n758_), .B(new_n757_), .C(new_n756_), .D(new_n753_), .Y(new_n759_));
NOR4 g386(.A(new_n750_), .B(new_n748_), .C(\2022 ), .D(\281 ), .Y(new_n760_));
XOR2 g387(.A(new_n758_), .B(new_n757_), .Y(new_n761_));
NAND4 g388(.A(new_n761_), .B(new_n760_), .C(new_n756_), .D(new_n753_), .Y(new_n762_));
NAND2 g389(.A(new_n752_), .B(new_n751_), .Y(new_n763_));
NAND3 g390(.A(new_n755_), .B(new_n754_), .C(new_n753_), .Y(new_n764_));
AND4 g391(.A(new_n764_), .B(new_n763_), .C(new_n762_), .D(new_n759_), .Y(new_n765_));
NAND4 g392(.A(new_n413_), .B(\1816 ), .C(new_n746_), .D(\40 ), .Y(new_n766_));
OR2 g393(.A(new_n766_), .B(\294 ), .Y(new_n767_));
NOT g394(.A(\259 ), .Y(new_n768_));
NAND2 g395(.A(new_n766_), .B(new_n768_), .Y(new_n769_));
NAND2 g396(.A(new_n769_), .B(new_n767_), .Y(new_n770_));
XNOR2 g397(.A(new_n770_), .B(new_n470_), .Y(new_n771_));
OR2 g398(.A(new_n766_), .B(\297 ), .Y(new_n772_));
NOT g399(.A(\263 ), .Y(new_n773_));
NAND2 g400(.A(new_n766_), .B(new_n773_), .Y(new_n774_));
AND2 g401(.A(new_n774_), .B(new_n772_), .Y(new_n775_));
XOR2 g402(.A(new_n775_), .B(\2010 ), .Y(new_n776_));
OR2 g403(.A(new_n766_), .B(\287 ), .Y(new_n777_));
OR2 g404(.A(new_n748_), .B(\256 ), .Y(new_n778_));
NAND2 g405(.A(new_n778_), .B(new_n777_), .Y(new_n779_));
NAND4 g406(.A(new_n779_), .B(new_n776_), .C(new_n771_), .D(new_n440_), .Y(new_n780_));
OR2 g407(.A(new_n775_), .B(\2010 ), .Y(new_n781_));
NOT g408(.A(new_n470_), .Y(new_n782_));
NAND3 g409(.A(new_n776_), .B(new_n770_), .C(new_n782_), .Y(new_n783_));
NAND3 g410(.A(new_n783_), .B(new_n781_), .C(new_n780_), .Y(new_n784_));
NOT g411(.A(\8 ), .Y(new_n785_));
NOR2 g412(.A(new_n766_), .B(\305 ), .Y(new_n786_));
NOR2 g413(.A(new_n748_), .B(\269 ), .Y(new_n787_));
NOR2 g414(.A(new_n787_), .B(new_n786_), .Y(new_n788_));
NOR2 g415(.A(new_n788_), .B(new_n785_), .Y(new_n789_));
NAND2 g416(.A(\2014 ), .B(\8 ), .Y(new_n790_));
XOR2 g417(.A(new_n790_), .B(new_n789_), .Y(new_n791_));
NOR2 g418(.A(new_n766_), .B(\309 ), .Y(new_n792_));
NOR2 g419(.A(new_n748_), .B(\272 ), .Y(new_n793_));
NOR2 g420(.A(new_n793_), .B(new_n792_), .Y(new_n794_));
NOR2 g421(.A(new_n794_), .B(new_n785_), .Y(new_n795_));
NAND2 g422(.A(\2016 ), .B(\8 ), .Y(new_n796_));
XOR2 g423(.A(new_n796_), .B(new_n795_), .Y(new_n797_));
NOR3 g424(.A(new_n748_), .B(\275 ), .C(new_n785_), .Y(new_n798_));
NAND3 g425(.A(new_n766_), .B(\2018 ), .C(\8 ), .Y(new_n799_));
XNOR2 g426(.A(new_n799_), .B(new_n798_), .Y(new_n800_));
NOT g427(.A(\278 ), .Y(new_n801_));
NAND3 g428(.A(new_n766_), .B(new_n801_), .C(\8 ), .Y(new_n802_));
NAND3 g429(.A(new_n766_), .B(\2020 ), .C(\8 ), .Y(new_n803_));
XOR2 g430(.A(new_n803_), .B(new_n802_), .Y(new_n804_));
NOR2 g431(.A(new_n804_), .B(new_n800_), .Y(new_n805_));
NOR2 g432(.A(new_n766_), .B(\301 ), .Y(new_n806_));
NOR2 g433(.A(new_n748_), .B(\266 ), .Y(new_n807_));
NOR2 g434(.A(new_n807_), .B(new_n806_), .Y(new_n808_));
XOR2 g435(.A(new_n808_), .B(\2012 ), .Y(new_n809_));
AND2 g436(.A(new_n809_), .B(new_n805_), .Y(new_n810_));
NAND4 g437(.A(new_n810_), .B(new_n797_), .C(new_n791_), .D(new_n784_), .Y(new_n811_));
NOT g438(.A(new_n804_), .Y(new_n812_));
NOR3 g439(.A(new_n808_), .B(new_n800_), .C(\2012 ), .Y(new_n813_));
NAND4 g440(.A(new_n813_), .B(new_n812_), .C(new_n797_), .D(new_n791_), .Y(new_n814_));
NAND4 g441(.A(new_n805_), .B(new_n797_), .C(new_n790_), .D(new_n789_), .Y(new_n815_));
NAND3 g442(.A(new_n805_), .B(new_n796_), .C(new_n795_), .Y(new_n816_));
NAND4 g443(.A(new_n803_), .B(new_n766_), .C(new_n801_), .D(\8 ), .Y(new_n817_));
NAND3 g444(.A(new_n812_), .B(new_n799_), .C(new_n798_), .Y(new_n818_));
AND3 g445(.A(new_n818_), .B(new_n817_), .C(new_n816_), .Y(new_n819_));
NAND4 g446(.A(new_n819_), .B(new_n815_), .C(new_n814_), .D(new_n811_), .Y(new_n820_));
OR2 g447(.A(new_n820_), .B(new_n765_), .Y(new_n821_));
NAND3 g448(.A(new_n749_), .B(new_n747_), .C(\2022 ), .Y(new_n822_));
OR3 g449(.A(new_n750_), .B(new_n748_), .C(\281 ), .Y(new_n823_));
XNOR2 g450(.A(new_n823_), .B(new_n822_), .Y(new_n824_));
NAND4 g451(.A(new_n824_), .B(new_n761_), .C(new_n756_), .D(new_n753_), .Y(new_n825_));
NAND2 g452(.A(new_n825_), .B(new_n765_), .Y(new_n826_));
NAND2 g453(.A(new_n826_), .B(new_n820_), .Y(new_n827_));
NAND2 g454(.A(new_n827_), .B(new_n821_), .Y(\3851 ));
NOR3 g455(.A(\2971 ), .B(\2970 ), .C(new_n394_), .Y(new_n830_));
NAND4 g456(.A(new_n830_), .B(new_n743_), .C(new_n715_), .D(new_n515_), .Y(\3882 ));
NOT g457(.A(\3882 ), .Y(\3881 ));
assign \3875 = 1'b0;
BUF g458(.A(\219 ), .Y(\398 ));
BUF g459(.A(\219 ), .Y(\400 ));
BUF g460(.A(\219 ), .Y(\401 ));
BUF g461(.A(\253 ), .Y(\419 ));
BUF g462(.A(\253 ), .Y(\420 ));
BUF g463(.A(\290 ), .Y(\456 ));
BUF g464(.A(\290 ), .Y(\457 ));
BUF g465(.A(\290 ), .Y(\458 ));
BUF g466(.A(\219 ), .Y(\805 ));
NAND2 g467(.A(new_n472_), .B(new_n471_), .Y(\2388 ));
NAND2 g468(.A(new_n475_), .B(new_n474_), .Y(\2390 ));
NAND2 g469(.A(new_n482_), .B(new_n481_), .Y(\2644 ));
NAND2 g470(.A(new_n732_), .B(new_n717_), .Y(\3804 ));
endmodule

View File

@ -1,35 +0,0 @@
# generated by verilog2bench.py https://gitea.yuhangq.com/YuhangQ/any2bench
INPUT(NET_1)
INPUT(NET_2)
INPUT(NET_3)
INPUT(NET_4)
INPUT(NET_5)
OUTPUT(NET_12)
OUTPUT(NET_23)
OUTPUT(NET_27)
OUTPUT(NET_28)
OUTPUT(NET_6)
new_n11_ = NOT ( NET_3 )
new_n12_ = NOT ( NET_4 )
NET_12 = AND ( new_n12_, new_n11_, NET_2 )
new_n14_ = NOR ( new_n11_, NET_2 )
new_n15_ = NAND ( new_n14_, new_n12_ )
new_n16_ = NOR ( NET_3, NET_1 )
new_n17_ = NOR ( new_n16_, NET_2 )
new_n18_ = OR ( new_n17_, new_n12_ )
NET_23 = NAND ( new_n18_, new_n15_ )
new_n20_ = NOR ( new_n11_, NET_1 )
new_n21_ = OR ( new_n20_, NET_4 )
new_n22_ = NAND ( new_n21_, NET_2 )
new_n23_ = NOT ( NET_1 )
new_n24_ = NOR ( new_n14_, NET_4 )
new_n25_ = OR ( new_n24_, new_n23_ )
new_n26_ = NAND ( NET_4, NET_3 )
NET_27 = NAND ( new_n26_, new_n25_, new_n22_ )
new_n28_ = NOR ( NET_4, NET_2, NET_1 )
new_n29_ = NOR ( NET_2, new_n23_ )
new_n30_ = NOR ( new_n29_, new_n12_ )
new_n31_ = NOR ( new_n30_, NET_3 )
NET_28 = OR ( new_n31_, new_n28_ )
NET_6 = BUF ( NET_5 )
NET_2313123 = DFF ( NET_5 )

8829
_c6288.txt

File diff suppressed because it is too large Load Diff

BIN
atpg

Binary file not shown.

View File

@ -1,207 +0,0 @@
# c432
INPUT(1)
INPUT(4)
INPUT(8)
INPUT(11)
INPUT(14)
INPUT(17)
INPUT(21)
INPUT(24)
INPUT(27)
INPUT(30)
INPUT(34)
INPUT(37)
INPUT(40)
INPUT(43)
INPUT(47)
INPUT(50)
INPUT(53)
INPUT(56)
INPUT(60)
INPUT(63)
INPUT(66)
INPUT(69)
INPUT(73)
INPUT(76)
INPUT(79)
INPUT(82)
INPUT(86)
INPUT(89)
INPUT(92)
INPUT(95)
INPUT(99)
INPUT(102)
INPUT(105)
INPUT(108)
INPUT(112)
INPUT(115)
OUTPUT(223)
OUTPUT(329)
OUTPUT(370)
OUTPUT(421)
OUTPUT(430)
OUTPUT(431)
OUTPUT(432)
118 = NOT(1)
119 = NOT(4)
122 = NOT(11)
123 = NOT(17)
126 = NOT(24)
127 = NOT(30)
130 = NOT(37)
131 = NOT(43)
134 = NOT(50)
135 = NOT(56)
138 = NOT(63)
139 = NOT(69)
142 = NOT(76)
143 = NOT(82)
146 = NOT(89)
147 = NOT(95)
150 = NOT(102)
151 = NOT(108)
154 = NAND(118, 4)
157 = NOR(8, 119)
158 = NOR(14, 119)
159 = NAND(122, 17)
162 = NAND(126, 30)
165 = NAND(130, 43)
168 = NAND(134, 56)
171 = NAND(138, 69)
174 = NAND(142, 82)
177 = NAND(146, 95)
180 = NAND(150, 108)
183 = NOR(21, 123)
184 = NOR(27, 123)
185 = NOR(34, 127)
186 = NOR(40, 127)
187 = NOR(47, 131)
188 = NOR(53, 131)
189 = NOR(60, 135)
190 = NOR(66, 135)
191 = NOR(73, 139)
192 = NOR(79, 139)
193 = NOR(86, 143)
194 = NOR(92, 143)
195 = NOR(99, 147)
196 = NOR(105, 147)
197 = NOR(112, 151)
198 = NOR(115, 151)
199 = AND(154, 159, 162, 165, 168, 171, 174, 177, 180)
203 = NOT(199)
213 = NOT(199)
223 = NOT(199)
224 = XOR(203, 154)
227 = XOR(203, 159)
230 = XOR(203, 162)
233 = XOR(203, 165)
236 = XOR(203, 168)
239 = XOR(203, 171)
242 = NAND(1, 213)
243 = XOR(203, 174)
246 = NAND(213, 11)
247 = XOR(203, 177)
250 = NAND(213, 24)
251 = XOR(203, 180)
254 = NAND(213, 37)
255 = NAND(213, 50)
256 = NAND(213, 63)
257 = NAND(213, 76)
258 = NAND(213, 89)
259 = NAND(213, 102)
260 = NAND(224, 157)
263 = NAND(224, 158)
264 = NAND(227, 183)
267 = NAND(230, 185)
270 = NAND(233, 187)
273 = NAND(236, 189)
276 = NAND(239, 191)
279 = NAND(243, 193)
282 = NAND(247, 195)
285 = NAND(251, 197)
288 = NAND(227, 184)
289 = NAND(230, 186)
290 = NAND(233, 188)
291 = NAND(236, 190)
292 = NAND(239, 192)
293 = NAND(243, 194)
294 = NAND(247, 196)
295 = NAND(251, 198)
296 = AND(260, 264, 267, 270, 273, 276, 279, 282, 285)
300 = NOT(263)
301 = NOT(288)
302 = NOT(289)
303 = NOT(290)
304 = NOT(291)
305 = NOT(292)
306 = NOT(293)
307 = NOT(294)
308 = NOT(295)
309 = NOT(296)
319 = NOT(296)
329 = NOT(296)
330 = XOR(309, 260)
331 = XOR(309, 264)
332 = XOR(309, 267)
333 = XOR(309, 270)
334 = NAND(8, 319)
335 = XOR(309, 273)
336 = NAND(319, 21)
337 = XOR(309, 276)
338 = NAND(319, 34)
339 = XOR(309, 279)
340 = NAND(319, 47)
341 = XOR(309, 282)
342 = NAND(319, 60)
343 = XOR(309, 285)
344 = NAND(319, 73)
345 = NAND(319, 86)
346 = NAND(319, 99)
347 = NAND(319, 112)
348 = NAND(330, 300)
349 = NAND(331, 301)
350 = NAND(332, 302)
351 = NAND(333, 303)
352 = NAND(335, 304)
353 = NAND(337, 305)
354 = NAND(339, 306)
355 = NAND(341, 307)
356 = NAND(343, 308)
357 = AND(348, 349, 350, 351, 352, 353, 354, 355, 356)
360 = NOT(357)
370 = NOT(357)
371 = NAND(14, 360)
372 = NAND(360, 27)
373 = NAND(360, 40)
374 = NAND(360, 53)
375 = NAND(360, 66)
376 = NAND(360, 79)
377 = NAND(360, 92)
378 = NAND(360, 105)
379 = NAND(360, 115)
380 = NAND(4, 242, 334, 371)
381 = NAND(246, 336, 372, 17)
386 = NAND(250, 338, 373, 30)
393 = NAND(254, 340, 374, 43)
399 = NAND(255, 342, 375, 56)
404 = NAND(256, 344, 376, 69)
407 = NAND(257, 345, 377, 82)
411 = NAND(258, 346, 378, 95)
414 = NAND(259, 347, 379, 108)
415 = NOT(380)
416 = AND(381, 386, 393, 399, 404, 407, 411, 414)
417 = NOT(393)
418 = NOT(404)
419 = NOT(407)
420 = NOT(411)
421 = NOR(415, 416)
422 = NAND(386, 417)
425 = NAND(386, 393, 418, 399)
428 = NAND(399, 393, 419)
429 = NAND(386, 393, 407, 420)
430 = NAND(381, 386, 422, 399)
431 = NAND(381, 386, 425, 428)
432 = NAND(381, 422, 425, 429)

File diff suppressed because it is too large Load Diff

View File

@ -4,72 +4,15 @@
#include <unordered_map>
#include <unordered_set>
#include "assert.h"
void Circuit::init_stems() {
for(auto& gate: gates) {
if(gate->outputs.size() >= 2) {
gate->stem = true;
}
gate->stem = true;
if(gate->stem) {
stems.push_back(gate);
}
}
for(Gate *g : gates) {
if(g->isPI) continue;
std::queue<Gate*> q;
std::unordered_map<Gate*, bool> used;
q.push(g);
while(!q.empty()) {
Gate* now = q.front();
q.pop();
for(Gate* in : now->inputs) {
if(in->stem) {
g->pre_stems.push_back(in);
} else if(!used[in]) {
used[in] = true;
q.push(in);
}
}
}
//printf("pre: %s %d\n", g->name.c_str(), g->pre_stems.size());
}
for(Gate *g : gates) {
if(g->isPO) continue;
std::queue<Gate*> q;
std::unordered_map<Gate*, bool> used;
q.push(g);
while(!q.empty()) {
Gate* now = q.front();
q.pop();
for(Gate* out : now->outputs) {
if(out->stem) {
g->suc_stems.push_back(out);
} else if(!used[out]) {
used[out] = true;
q.push(out);
}
}
}
//printf("pre: %s %d\n", g->name.c_str(), g->pre_stems.size());
}
}
#include "clause.h"
void Circuit::init_topo_index() {
int topo = 1;
std::queue<Gate*> q;
std::unordered_map<Gate*, int> ins;
for(Gate* gate : gates) {
ins[gate] = gate->inputs.size();
}
// 计算正向拓扑序
for(auto in : PIs) {
in->id = topo++;
q.push(in);
@ -77,22 +20,47 @@ void Circuit::init_topo_index() {
while(!q.empty()) {
Gate* g = q.front(); q.pop();
for(Gate* out : g->outputs) {
ins[out]--;
if(ins[out] == 0) {
for(Gate* out : g->fan_outs) {
ins[out]++;
if(ins[out] == out->fan_ins.size()) {
out->id = topo++;
q.push(out);
}
}
}
for(Gate* g : gates) {
id2gate[g->id] = g;
}
// 计算反向拓扑序
topo = 1;
std::unordered_map<Gate*, int> outs;
for(auto out : POs) {
out->rtopo = topo++;
q.push(out);
}
while(!q.empty()) {
Gate* g = q.front(); q.pop();
rtopo_gates.push_back(g);
for(Gate* in : g->fan_ins) {
outs[in]++;
if(outs[in] == in->fan_outs.size()) {
in->rtopo = topo++;
q.push(in);
}
}
}
}
void Circuit::print_gates() {
void Circuit::print_circuit() {
static const char* type2name[9] = {"AND", "NAND", "OR", "NOR", "XOR", "XNOR", "NOT", "BUF", "IN"};
for(Gate* gate : gates) {
printf("Gate: %3s (t:%4s v:%d pi:%d po:%d s:%d p:%d s0:%d s1:%d) Inputs:", gate->name.c_str(), type2name[gate->type], gate->value, gate->isPI, gate->isPO, gate->stem, gate->is_propagated(), gate->sa[0], gate->sa[1]);
for(Gate* in : gate->inputs) {
printf(" %s", in->name.c_str());
printf("Gate: %3s (t:%4s v:%d ss:%d pi:%d po:%d s:%d p:%d s0:%d s1:%d fpl0:%d fpl1:%d) Inputs:", gate->name.c_str(), type2name[gate->type], gate->value, gate->stem_satisfied, gate->pi, gate->po, gate->stem, gate->propagate, gate->fault_detected[0], gate->fault_detected[1], gate->fault_propagate_length[0], gate->fault_propagate_length[1]);
for(Gate* in : gate->fan_ins) {
printf(" %s(%d)", in->name.c_str(), gate->is_detected(in));
}
printf("\n");
}
@ -100,95 +68,72 @@ void Circuit::print_gates() {
bool Circuit::is_valid_circuit() {
ll flip_total_weight = 0;
ll stem_total_weight = 0;
ll stem_total_cost = 0;
ll fault_total_weight = 0;
int flip_total_cnt = 0;
int stem_total_cnt = 0;
int fault_total_cnt = 0;
//printf("flip: %d, stem: %d, fault:%d\n", flip_total_weight, stem_total_weight, fault_total_weight);
ll fault_propagate_score = 0;
for(Gate* g : gates) {
if(flip_need_update[g->id]) {
flip_total_weight += flip_weight[g->id];
flip_total_cnt++;
if(g->propagate != (g->fault_detected[0] || g->fault_detected[1])) {
printf("Gate: %s Error: propagte varible wrong\n", g->name.c_str());
return false;
}
if(g->stem && g->cal_value() != g->value) {
stem_total_weight += stem_weight[g->id];
if(g->stem && (g->recal_value() == g->value) != g->stem_satisfied) {
printf("Gate: %s Error: stem satisfied wrong\n", g->name.c_str());
return false;
}
if(g->stem && g->cal_value() == g->value) {
if(!g->stem && g->recal_value() != g->value) {
printf("Gate: %s Error: value cal wrong\n", g->name.c_str());
return false;
}
int fpl[2];
g->recal_propagate_len(fpl);
if(g->fault_propagate_length[0] != fpl[0] || g->fault_propagate_length[1] != fpl[1]) {
printf("Gate: %s Error: fpl cal wrong\n", g->name.c_str());
return false;
}
bool fd[2];
g->recal_fault(fd);
if(g->fault_detected[0] != fd[0] || g->fault_detected[1] != fd[1]) {
printf("Gate: %s Error: fpl cal wrong\n", g->name.c_str());
return false;
}
if(g->stem && g->recal_value() != g->value) {
stem_total_cost += g->stem_weight;
}
if(g->stem && g->recal_value() == g->value) {
stem_total_cnt++;
}
if(g->sa[0]) {
fault_total_weight += fault_weight[g->id][0];
fault_propagate_score += g->fault_propagate_length[0] * g->fault_weight[0];
fault_propagate_score += g->fault_propagate_length[1] * g->fault_weight[1];
if(g->fault_detected[0]) {
fault_total_weight += g->fault_weight[0];
fault_total_cnt += 1;
}
if(g->sa[1]) {
fault_total_weight += fault_weight[g->id][1];
if(g->fault_detected[1]) {
fault_total_weight += g->fault_weight[1];
fault_total_cnt += 1;
}
// 检查门的赋值情况
if(g->cal_value() != g->value) {
printf("WRONG-ASSGIN: %s \n", g->name.c_str());
return false;
}
// 检查 PO 的传播设定是否正确
if(g->isPO) {
if(g->sa[g->value] != 0 || g->sa[!g->value] == 0 ) {
printf("WRONG-PO: %s \n", g->name.c_str());
}
continue;
}
// 非 PO 情况下检查故障传播是否正确
bool sa0 = false;
bool sa1 = false;
for(Gate* out : g->outputs) {
if(out->cal_value() != out->value) {
assert(out->stem);
continue;
}
g->value = !g->value;
if(out->cal_value() != out->value) {
sa0 |= out->is_propagated() && !g->value;
sa1 |= out->is_propagated() && g->value;
}
g->value = !g->value;
}
if(sa0 != g->sa[0] || sa1 != g->sa[1]) {
printf("WRONG-SA: %s \n", g->name.c_str());
return false;
}
}
if(this->flip_total_weight != flip_total_weight || this->stem_total_weight != stem_total_weight || this->fault_total_weight != fault_total_weight) {
printf("CIRCUIT CHECK FAILED!\n");
printf("[wrong] flip: %d, stem: %d, fault:%d\n", this->flip_total_weight, this->stem_total_weight, this->fault_total_weight);
printf("[right] flip: %d, stem: %d, fault:%d\n", flip_total_weight, stem_total_weight, fault_total_weight);
return false;
}
if(this->flip_total_cnt != flip_total_cnt || this->stem_total_cnt != stem_total_cnt || this->fault_total_cnt != fault_total_cnt) {
printf("CIRCUIT CHECK FAILED!\n");
printf("[wrong] flip_cnt: %d, stem_cnt: %d, fault_cnt:%d\n", this->flip_total_cnt, this->stem_total_cnt, this->fault_total_cnt);
printf("[right] flip_cnt: %d, stem_cnt: %d, fault_cnt:%d\n", flip_total_cnt, stem_total_cnt, fault_total_weight);
return false;
}
assert(this->stem_total_cost == stem_total_cost);
//assert(this->fault_total_weight == fault_total_weight);
assert(this->stem_total_cnt == stem_total_cnt);
assert(this->fault_total_cnt == fault_total_cnt);
assert(this->fault_propagate_score == fault_propagate_score);
return true;
}

125
circuit.h
View File

@ -1,107 +1,118 @@
#pragma once
#include "option.h"
#include <string>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <queue>
using ll = long long;
class Gate {
public:
// 门的原始信息
int id;
int rtopo;
std::string name;
enum Type { AND, NAND, OR, NOR, XOR, XNOR, NOT, BUF, INPUT } type;
int value;
bool sa[2];
bool stem;
bool isPI;
bool isPO;
std::unordered_map<Gate*, std::pair<int, int>> sa_by_out;
bool pi;
bool po;
std::vector<Gate*> fan_outs;
std::vector<Gate*> fan_ins;
std::vector<Gate*> pre_stems;
std::vector<Gate*> suc_stems;
std::vector<Gate*> outputs;
std::vector<Gate*> inputs;
// 记录全局已经发现的错误
bool global_fault_detected[2];
bool is_propagated();
int cal_value();
};
// atpg-ls 附加信息
int CC;
bool stem;
bool propagate;
class Fault {
public:
Gate* gate;
enum Type { SA0, SA1 } type;
Fault(Gate* gate, Type type):gate(gate),type(type) {}
int stem_weight;
bool stem_satisfied;
int fault_weight[2];
bool fault_detected[2];
int fault_propagate_length[2];
// 计算此门的信息
int recal_value();
void recal_fault(bool fd[2]);
void recal_propagate_len(int fpl[2]);
// 门的某个输入产生的错误是否可以通过这个门传播
bool is_detected(Gate* one_of_input);
};
class Circuit {
public:
// 电路的基本信息
std::vector<Gate*> PIs;
std::vector<Gate*> POs;
std::vector<Gate*> gates;
std::vector<Gate*> stems; // PI + stems
std::vector<Gate*> rtopo_gates;
std::vector<Gate*> stems; // PIs and POs are stems by default
std::unordered_map<int, Gate*> id2gate;
std::unordered_map<std::string, Gate*> name2gate;
std::queue<Gate*> tmp;
std::unordered_map<Gate*, bool> tmp_used;
// 读入和输出电路
void parse_from_file(const char *filename);
void print_gates();
void print_circuit();
bool is_valid_circuit();
// 初始化电路统计信息
int MAX_GATE_LEVEL;
void init_topo_index();
void init_stems();
// 电路状态 checker
bool is_valid_circuit();
// local search
bool local_search(std::unordered_set<Fault*> &faults);
bool local_search();
// incremental flip struct
int global_fault_undetected_count;
const double SP = 0.01;
const int FLIP_INC = 1;
const int FLIP_WEIGHT_MAX = 1e9;
int* CC;
ll flip_total_weight;
int flip_total_cnt;
int* flip_weight;
int* flip_need_update;
std::vector<Gate*> flip_update_queue;
// incremental stem struct
const int STEM_INC = 10;
const int STEM_WEIGHT_MAX = 1e9;
ll stem_total_weight;
ll stem_total_cost;
int stem_total_cnt;
int* stem_weight;
int* stem_satisfied;
const int FAULT_INC = 1;
const int FAULT_WEIGHT_MAX = 20;
ll fault_propagate_score;
ll fault_total_weight;
int fault_total_cnt;
int** fault_weight;
int** fault_detected;
void ls_init_circuit();
void ls_init_weight(const std::unordered_set<Fault*> &faults);
void ls_reset_data();
void ls_init_stems();
void ls_init_weight();
void ls_random_circuit();
void ls_statistics();
void ls_update_weight();
void ls_init_data_structs();
void ls_block_recal(Gate* stem);
int ls_pick();
Gate* ls_pick_falsified();
void ls_flip(Gate* stem);
void ls_update(Gate* stem);
ll ls_pick_score(Gate* stem);
void ls_flip_var(int var);
void ls_flip_stem(Gate* stem);
ll ls_score();
ll ls_pick_score(int var);
ll ls_circuit_score();
int flip_cnt = 0;
double flip_time = 0;
int update_cnt = 0;
double update_time = 0;
};

275
clause.cpp Normal file
View File

@ -0,0 +1,275 @@
#include "clause.h"
#include <fstream>
ll Clause::total_cost;
void Clause::update_satisfied_lit_count() {
using namespace ClauseLS;
ll old_lit_count = satisfied_lit_count;
satisfied_lit_count = 0;
for(auto& lit : lits) {
if(lit_value[abs(lit)]) {
satisfied_lit_count += (lit > 0);
} else {
satisfied_lit_count += (lit < 0);
}
}
if(old_lit_count == 0 && satisfied_lit_count > 0) {
falsified_clauses.erase(this);
total_cost -= weight;
satisfied_clauses.insert(this);
}
if(old_lit_count > 0 && satisfied_lit_count == 0) {
satisfied_clauses.erase(this);
total_cost += weight;
falsified_clauses.insert(this);
}
}
namespace ClauseLS {
int num_vars;
int num_clauses;
std::unordered_set<Clause*> satisfied_clauses;
std::unordered_set<Clause*> falsified_clauses;
std::vector<Clause*> clauses;
std::vector<Clause*> *lit_related_clauses;
int *lit_value;
int *CC;
void write_cnf() {
std::ofstream f("test.cnf");
f << "p cnf " << num_vars << " " << num_clauses << std::endl;
for(auto& c : clauses) {
for(auto &lit : c->lits) {
f << lit << " ";
}
f << "0" << std::endl;
}
f.close();
}
void flip(int var) {
lit_value[var] = !lit_value[var];
for(auto& clause : lit_related_clauses[var]) {
clause->update_satisfied_lit_count();
for(auto& lit : clause->lits) {
CC[abs(lit)] = 1;
}
}
CC[var] = 0;
}
void add_to_tmp_clause(int x) {
static std::vector<int> lits;
if(x != 0) {
lits.push_back(x);
} else {
Clause* clause = new Clause();
clause->lits = lits;
clause->satisfied_lit_count = 0;
clauses.push_back(clause);
lits.clear();
}
}
void init_data_structs(Circuit* circuit) {
build_clauses(circuit);
printf("====== Clause Statistics ====== \n");
printf("num_vars:\t%d\n", num_vars);
printf("num_clauses:\t%ld\n", num_clauses);
printf("================================ \n");
lit_related_clauses = new std::vector<Clause*>[num_vars + 1];
lit_value = new int[num_vars + 1];
CC = new int[num_vars + 1];
for(int i=1; i<=num_vars; i++) {
lit_value[i] = 0;
CC[i] = 1;
}
for(auto& clause : clauses) {
clause->weight = 1;
Clause::total_cost += clause->weight;
falsified_clauses.insert(clause);
//printf("fs: %d. ss: %d\n", falsified_clauses.size(), satisfied_clauses.size());
clause->update_satisfied_lit_count();
for(auto& lit : clause->lits) {
lit_related_clauses[abs(lit)].push_back(clause);
}
}
write_cnf();
}
void reset_data_structs() {
for(int i=1; i<=num_vars; i++) {
lit_value[i] = rand() % 2;
CC[i] = 1;
}
}
void build_clauses(Circuit* circuit) {
int extra_variable = circuit->gates.size();
int last_id, last_v;
for(Gate* g : circuit->gates) {
if(g->pi) continue;
switch(g->type) {
case Gate::NOT:
add_to_tmp_clause(-g->id);
add_to_tmp_clause(-(g->fan_ins[0]->id));
add_to_tmp_clause(0);
add_to_tmp_clause(g->id);
add_to_tmp_clause(g->fan_ins[0]->id);
add_to_tmp_clause(0);
break;
case Gate::BUF:
add_to_tmp_clause(-g->id);
add_to_tmp_clause((g->fan_ins[0]->id));
add_to_tmp_clause(0);
add_to_tmp_clause(g->id);
add_to_tmp_clause(-(g->fan_ins[0]->id));
add_to_tmp_clause(0);
break;
case Gate::AND:
for(int i=0; i<g->fan_ins.size(); i++) {
add_to_tmp_clause(-g->id);
add_to_tmp_clause(g->fan_ins[i]->id);
add_to_tmp_clause(0);
}
for(int i=0; i<g->fan_ins.size(); i++) {
add_to_tmp_clause(-g->fan_ins[i]->id);
}
add_to_tmp_clause(g->id);
add_to_tmp_clause(0);
break;
case Gate::NAND:
for(int i=0; i<g->fan_ins.size(); i++) {
add_to_tmp_clause(g->id);
add_to_tmp_clause(g->fan_ins[i]->id);
add_to_tmp_clause(0);
}
for(int i=0; i<g->fan_ins.size(); i++) {
add_to_tmp_clause(-g->fan_ins[i]->id);
}
add_to_tmp_clause(-g->id);
add_to_tmp_clause(0);
break;
case Gate::OR:
for(int i=0; i<g->fan_ins.size(); i++) {
add_to_tmp_clause(g->fan_ins[i]->id);
}
add_to_tmp_clause(-g->id);
add_to_tmp_clause(0);
for(int i=0; i<g->fan_ins.size(); i++) {
add_to_tmp_clause(g->id);
add_to_tmp_clause(-g->fan_ins[i]->id);
add_to_tmp_clause(0);
}
break;
case Gate::NOR:
for(int i=0; i<g->fan_ins.size(); i++) {
add_to_tmp_clause(g->fan_ins[i]->id);
}
add_to_tmp_clause(g->id);
add_to_tmp_clause(0);
for(int i=0; i<g->fan_ins.size(); i++) {
add_to_tmp_clause(-g->id);
add_to_tmp_clause(-g->fan_ins[i]->id);
add_to_tmp_clause(0);
}
break;
case Gate::XOR:
last_v = g->fan_ins[0]->id;
for(int i=1; i<g->fan_ins.size() - 1; i++) {
int new_v = ++extra_variable;
add_to_tmp_clause(-g->fan_ins[i]->id); add_to_tmp_clause(-last_v); add_to_tmp_clause(-new_v);
add_to_tmp_clause(0);
add_to_tmp_clause(-g->fan_ins[i]->id); add_to_tmp_clause(last_v); add_to_tmp_clause(new_v);
add_to_tmp_clause(0);
add_to_tmp_clause(g->fan_ins[i]->id); add_to_tmp_clause(-last_v); add_to_tmp_clause(new_v);
add_to_tmp_clause(0);
add_to_tmp_clause(g->fan_ins[i]->id); add_to_tmp_clause(last_v); add_to_tmp_clause(-new_v);
add_to_tmp_clause(0);
last_v = new_v;
}
last_id = g->fan_ins[g->fan_ins.size() - 1]->id;
add_to_tmp_clause(-g->id); add_to_tmp_clause(-last_v); add_to_tmp_clause(-last_id);
add_to_tmp_clause(0);
add_to_tmp_clause(-g->id); add_to_tmp_clause(last_v); add_to_tmp_clause(last_id);
add_to_tmp_clause(0);
add_to_tmp_clause(g->id); add_to_tmp_clause(-last_v); add_to_tmp_clause(last_id);
add_to_tmp_clause(0);
add_to_tmp_clause(g->id); add_to_tmp_clause(last_v); add_to_tmp_clause(-last_id);
add_to_tmp_clause(0);
break;
case Gate::XNOR:
last_v = g->fan_ins[0]->id;
for(int i=1; i<g->fan_ins.size() - 1; i++) {
int new_v = ++extra_variable;
add_to_tmp_clause(-g->fan_ins[i]->id); add_to_tmp_clause(-last_v); add_to_tmp_clause(-new_v);
add_to_tmp_clause(0);
add_to_tmp_clause(-g->fan_ins[i]->id); add_to_tmp_clause(last_v); add_to_tmp_clause(new_v);
add_to_tmp_clause(0);
add_to_tmp_clause(g->fan_ins[i]->id); add_to_tmp_clause(-last_v); add_to_tmp_clause(new_v);
add_to_tmp_clause(0);
add_to_tmp_clause(g->fan_ins[i]->id); add_to_tmp_clause(last_v); add_to_tmp_clause(-new_v);
add_to_tmp_clause(0);
last_v = new_v;
}
last_id = g->fan_ins[g->fan_ins.size() - 1]->id;
add_to_tmp_clause(g->id); add_to_tmp_clause(-last_v); add_to_tmp_clause(-last_id);
add_to_tmp_clause(0);
add_to_tmp_clause(g->id); add_to_tmp_clause(last_v); add_to_tmp_clause(last_id);
add_to_tmp_clause(0);
add_to_tmp_clause(-g->id); add_to_tmp_clause(-last_v); add_to_tmp_clause(last_id);
add_to_tmp_clause(0);
add_to_tmp_clause(-g->id); add_to_tmp_clause(last_v); add_to_tmp_clause(-last_id);
add_to_tmp_clause(0);
break;
default:
exit(-1);
break;
}
}
num_vars = extra_variable;
num_clauses = clauses.size();
}
}

40
clause.h Normal file
View File

@ -0,0 +1,40 @@
#pragma once
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include "circuit.h"
class Clause {
public:
int satisfied_lit_count;
int weight;
static ll total_cost;
std::vector<int> lits;
void update_satisfied_lit_count();
};
namespace ClauseLS {
extern int num_vars;
extern int num_clauses;
extern std::vector<Clause*> clauses;
extern std::vector<Clause*> *lit_related_clauses;
extern int *lit_value;
extern int *CC;
extern int *score;
extern std::unordered_set<Clause*> satisfied_clauses;
extern std::unordered_set<Clause*> falsified_clauses;
void init_data_structs(Circuit* circuit);
void reset_data_structs();
void add_to_tmp_clause(int x);
void build_clauses(Circuit* circuit);
void write_cnf();
void flip(int var);
}

View File

@ -2,56 +2,94 @@
#include "assert.h"
bool Gate::is_propagated() {
return sa[0] || sa[1];
void Gate::recal_propagate_len(int fpl[2]) {
fpl[0] = fpl[1] = 0;
for(Gate* out : fan_outs) {
if(!out->is_detected(this)) continue;
fpl[!value] = std::max(fpl[!value], out->fault_propagate_length[!out->value] + 1);
}
}
int Gate::cal_value() {
bool Gate::is_detected(Gate* one_of_input) {
one_of_input->value = !one_of_input->value;
bool detect = (recal_value() != value);
one_of_input->value = !one_of_input->value;
return (recal_value() == value) && detect;
}
void Gate::recal_fault(bool fd[2]) {
if(po) {
fd[!value] = true;
fd[value] = false;
return;
}
fd[0] = fd[1] = 0;
for(Gate* out : fan_outs) {
if(!out->propagate) continue;
if(out->recal_value() != out->value) continue;
this->value = !this->value;
bool detect = (out->recal_value() != out->value);
this->value = !this->value;
if(!detect) continue;
fd[0] |= this->value;
fd[1] |= !this->value;
}
return;
}
int Gate::recal_value() {
int res;
switch(type) {
case NOT:
res = !inputs[0]->value;
res = !fan_ins[0]->value;
break;
case BUF:
res = inputs[0]->value;
res = fan_ins[0]->value;
break;
case AND:
res = inputs[0]->value;
for(int i=1; i<inputs.size(); i++) {
res &= inputs[i]->value;
res = fan_ins[0]->value;
for(int i=1; i<fan_ins.size(); i++) {
res &= fan_ins[i]->value;
}
break;
case NAND:
res = inputs[0]->value;
for(int i=1; i<inputs.size(); i++) {
res &= inputs[i]->value;
res = fan_ins[0]->value;
for(int i=1; i<fan_ins.size(); i++) {
res &= fan_ins[i]->value;
}
res = !res;
break;
case OR:
res = inputs[0]->value;
for(int i=1; i<inputs.size(); i++) {
res |= inputs[i]->value;
res = fan_ins[0]->value;
for(int i=1; i<fan_ins.size(); i++) {
res |= fan_ins[i]->value;
}
break;
case NOR:
res = inputs[0]->value;
for(int i=1; i<inputs.size(); i++) {
res |= inputs[i]->value;
res = fan_ins[0]->value;
for(int i=1; i<fan_ins.size(); i++) {
res |= fan_ins[i]->value;
}
res = !res;
break;
case XOR:
res = inputs[0]->value;
for(int i=1; i<inputs.size(); i++) {
res ^= inputs[i]->value;
res = fan_ins[0]->value;
for(int i=1; i<fan_ins.size(); i++) {
res ^= fan_ins[i]->value;
}
break;
case XNOR:
res = inputs[0]->value;
for(int i=1; i<inputs.size(); i++) {
res ^= inputs[i]->value;
res = fan_ins[0]->value;
for(int i=1; i<fan_ins.size(); i++) {
res ^= fan_ins[i]->value;
}
res = !res;
break;

743
ls.cpp
View File

@ -5,476 +5,505 @@
#include <unordered_map>
#include <algorithm>
#include "assert.h"
#include <chrono>
bool Circuit::local_search(std::unordered_set<Fault*> &faults) {
#include "clause.h"
#include "CCAnr/ccanr.h"
//STEM_INC = 0;
bool Circuit::local_search() {
// 初始化并重置所有 ls 数据结构
ls_init_data_structs();
//printf("[start ls]\n");
// 赋值初始权重
ls_init_weight(faults);
ls_reset_data();
// 随机生成初始电路
ls_init_circuit();
printf("local search!\n");
ls_init_stems();
while(true) {
ls_init_weight();
Gate* stem = nullptr;
ll max_score = 0;
CCAnr::module_reset();
ls_random_circuit();
//printf("stem-cnt: %d\n", stem_total_cnt);
for(int i=0; i<MAX_STEPS; i++) {
auto start = std::chrono::system_clock::now();
std::vector<Gate*> stems_random;
std::vector<Gate*> candidates;
//printf("[FLIP] stem: %lld, fault:%lld, stem_cnt: %lld, fault_cnt:%lld, fpl_score: %lld citcuit-score: %lld\n", stem_total_cost, fault_total_weight, stems.size() - stem_total_cnt, fault_total_cnt, fault_propagate_score, ls_circuit_score());
for(int i=0; i<stems.size(); i++) {
if(CC[stems[i]->id]) {
stems_random.push_back(stems[i]);
}
}
for(int i=0; i<stems_random.size(); i++) {
std::swap(stems_random[i], stems_random[rand()%stems_random.size()]);
int id;
double p = 0.8;
// if(rand() % 10000 <= p * 10000) {
// id = CCAnr::module_pick_var();
// } else {
// }
id = ls_pick();
CCAnr::module_flip_var(id);
ls_flip_var(id);
if(stem_total_cnt == stems.size()) {
printf("FIND SOLUTION!\n");
break;
}
const int T = 100;
int t = 0;
//assert(is_valid_circuit());
for(int i=0; i<stems_random.size(); i++) {
Gate* t_stem = stems_random[i];
ll t_score = ls_pick_score(t_stem);
if(t_score > max_score) {
max_score = t_score;
stem = t_stem;
}
if(t_score > 0) t++;
if(i >= T) break;
}
auto end = std::chrono::system_clock::now();
std::chrono::duration<double> elapsed_seconds = end - start;
update_cnt++;
update_time += elapsed_seconds.count();
if(max_score > 0) {
// printf("FLIP: %s (+%lld)\n", stem->name.c_str(), max_score);
// printf("[LS] flip: %lld, stem: %lld, fault:%lld. flip_cnt: %d, stem_cnt: %d, fault_cnt:%d\n", flip_total_weight, stem_total_weight, fault_total_weight, flip_total_cnt, stem_total_cnt, fault_total_cnt);
ls_flip(stem);
CC[stem->id] = 0;
for(Gate* pre : stem->pre_stems) {
CC[pre->id] = 1;
}
for(Gate* suc : stem->suc_stems) {
CC[suc->id] = 1;
}
} else {
ls_update_weight();
while(!flip_update_queue.empty()) {
Gate* g = flip_update_queue.back();
flip_update_queue.pop_back();
if(!flip_need_update[g->id]) continue;
flip_need_update[g->id] = false;
flip_total_weight -= flip_weight[g->id];
flip_total_cnt -= 1;
ls_update(g);
}
if(stem_total_cnt == stems.size() && flip_total_cnt == 0) {
printf("FIND SOLUTION!\n");
printf("[SOL] flip: %lld, stem: %lld, fault:%lld. flip_cnt: %d, stem_cnt: %d, fault_cnt:%d\n", flip_total_weight, stem_total_weight, fault_total_weight, flip_total_cnt, stem_total_cnt, fault_total_cnt);
break;
}
std::vector<Gate*> candidates;
for(Gate *g : stems) {
if(g->isPO) continue;
if(stem_satisfied[g->id]) continue;
candidates.push_back(g);
}
if(candidates.size() == 0) {
candidates.push_back(stems[rand()%stems.size()]);
}
Gate* pick = candidates[rand()%candidates.size()];
ls_flip(pick);
CC[pick->id] = 0;
for(Gate* pre : pick->pre_stems) {
CC[pre->id] = 1;
}
for(Gate* suc : pick->suc_stems) {
CC[suc->id] = 1;
}
printf("[UP] flip: %lld, stem: %lld, fault:%lld. flip_cnt: %lld, stem_cnt: %lld, fault_cnt:%lld\n", flip_total_weight, stem_total_weight, fault_total_weight, flip_total_cnt, stem_total_cnt, fault_total_cnt);
}
//printf("[UP] flip: %lld, stem: %lld, fault:%lld. flip_cnt: %lld, stem_cnt: %lld, fault_cnt:%lld\n", flip_total_weight, stem_total_weight, fault_total_weight, flip_total_cnt, stem_total_cnt, fault_total_cnt);
}
static int original_faults = -1;
if(original_faults == - 1) {
original_faults = faults.size();
}
static int pattern = 0;
std::unordered_set<Fault*> tmp = faults;
for(Fault* f : tmp) {
if(f->gate->sa[f->type]) {
faults.erase(f);
}
}
if(tmp.size() == faults.size()) pattern--;
printf("coverage: %.4f\tpattern: %d\tbefore: %d\tnow: %d\n", (double)(original_faults - faults.size()) / (original_faults), ++pattern, tmp.size(), faults.size());
//if(tmp.size() == faults.size()) return false;
ls_statistics();
return true;
}
void Circuit::ls_statistics() {
static int pattern = 0;
int last_undetect = global_fault_undetected_count;
for(Gate* g : gates) {
if(g->fault_detected[0] && !g->global_fault_detected[0]) {
global_fault_undetected_count--;
g->global_fault_detected[0] = 1;
}
if(g->fault_detected[1] && !g->global_fault_detected[1]) {
global_fault_undetected_count--;
g->global_fault_detected[1] = 1;
}
}
if(global_fault_undetected_count - last_undetect < 0) {
pattern++;
}
printf("coverage: %.2f%% undected_fault: %d delta: %d total-pt:%d\n",
(gates.size() * 2.0 - global_fault_undetected_count) / (gates.size() * 2.0) * 100,
global_fault_undetected_count, global_fault_undetected_count - last_undetect, pattern);
printf("flip-cnt: %d flip-time: %.3fs update-cnt: %d update-time: %.3fs\n", flip_cnt, flip_time, update_cnt, update_time);
printf("time-per-update: %.2fms\n", update_time / update_cnt * 1000);
}
void Circuit::ls_update_weight() {
//STEM_INC += 5;
if(rand() % 10000 <= SP * 10000) {
for(auto& clause : ClauseLS::satisfied_clauses) {
if(clause->weight - CLAUSE_FALSIFIED_INC < 1) continue;
clause->weight -= CLAUSE_FALSIFIED_INC;
}
for(Gate* g : gates) {
if(g->stem && stem_satisfied[g->id] && (stem_weight[g->id] - STEM_INC >= 1)) {
stem_weight[g->id] -= STEM_INC;
for(Gate* suc : g->suc_stems) {
if(stem_weight[suc->id] + STEM_INC <= STEM_WEIGHT_MAX) {
stem_weight[suc->id] += STEM_INC;
if(!stem_satisfied[suc->id]) {
stem_total_weight += STEM_INC;
}
}
}
if(g->fault_detected[0] && g->fault_weight[0] - FAULT_INC >= 1) {
g->fault_weight[0] -= FAULT_INC;
fault_propagate_score -= FAULT_INC * (g->fault_propagate_length[0]);
}
if(g->fault_detected[1] && g->fault_weight[1] - FAULT_INC >= 1) {
g->fault_weight[1] -= FAULT_INC;
fault_propagate_score -= FAULT_INC * (g->fault_propagate_length[1]);
}
}
} else {
for(auto& clause : ClauseLS::falsified_clauses) {
if(clause->weight + CLAUSE_FALSIFIED_INC > CLAUSE_FALSIFIED_MAX) continue;
clause->weight += CLAUSE_FALSIFIED_INC;
clause->total_cost += CLAUSE_FALSIFIED_INC;
}
for(Gate* g : gates) {
if(flip_need_update[g->id] && (flip_weight[g->id] + FLIP_INC < FLIP_WEIGHT_MAX)) {
flip_weight[g->id] += FLIP_INC;
flip_total_weight += FLIP_INC;
if(!g->fault_detected[0] && g->fault_weight[0] > 0 && (g->fault_weight[0] + FAULT_INC < FAULT_WEIGHT_MAX)) {
g->fault_weight[0] += FAULT_INC;
fault_propagate_score += FAULT_INC * (g->fault_propagate_length[0]);
}
if(g->stem && !stem_satisfied[g->id] && (stem_weight[g->id] + STEM_INC < STEM_WEIGHT_MAX)) {
stem_weight[g->id] += STEM_INC;
stem_total_weight += STEM_INC;
for(Gate* suc : g->suc_stems) {
if(stem_weight[suc->id] - STEM_INC > 1) {
stem_weight[suc->id] -= STEM_INC;
if(!stem_satisfied[suc->id]) {
stem_total_weight -= STEM_INC;
}
}
}
}
for(int i=0; i<=1; i++) {
for(Gate* pre : g->suc_stems) {
// int inc = 0.2 * fault_weight[pre->id][i];
// inc = std::max(1, inc);
// if(g->type == Gate::NAND || g->type == Gate::NOR || g->type == Gate::NOT || g->type == Gate::XNOR) {
// if(fault_weight[g->id][!pre->value] + inc <= FAULT_WEIGHT_MAX) {
// fault_weight[g->id][!pre->value] += inc;
// if(g->sa[!pre->value]) fault_total_weight += inc;
// }
// } else {
// if(fault_weight[g->id][pre->value] + inc <= FAULT_WEIGHT_MAX) {
// fault_weight[g->id][pre->value] += inc;
// if(g->sa[pre->value]) fault_total_weight += inc;
// }
// }
// if(fault_weight[suc->id][1] + inc <= FAULT_WEIGHT_MAX) {
// fault_weight[suc->id][1] += inc;
// if(suc->sa[1]) fault_total_weight += inc;
// }
}
}
if(!g->sa[0] && fault_weight[g->id][0] > 0 && (fault_weight[g->id][0] + FAULT_INC < FAULT_WEIGHT_MAX)) {
fault_weight[g->id][0] += FAULT_INC;
}
if(!g->sa[1] && fault_weight[g->id][1] > 0 && (fault_weight[g->id][1] + FAULT_INC < FAULT_WEIGHT_MAX)) {
fault_weight[g->id][1] += FAULT_INC;
if(!g->fault_detected[1] && g->fault_weight[1] > 0 && (g->fault_weight[1] + FAULT_INC < FAULT_WEIGHT_MAX)) {
g->fault_weight[1] += FAULT_INC;
fault_propagate_score += FAULT_INC * (g->fault_propagate_length[1]);
}
}
}
}
int Circuit::ls_pick() {
int var = -1;
ll max_score = 0;
bool cmp(Gate* a, Gate *b) {
return a->id > b->id;
for(int i=0; i<SAMPLING_COUNT; i++) {
int t_var = rand() % ClauseLS::num_vars + 1;
if(!ClauseLS::CC[t_var]) continue;
ll t_score = ls_pick_score(t_var);
if(t_score > max_score) {
max_score = t_score;
var = t_var;
}
}
if(var == -1) {
ls_update_weight();
//printf("[UP] stem: %lld, fault:%lld, stem_cnt: %lld, fault_cnt:%lld, fpl_score: %lld citcuit-score: %lld\n", stem_total_cost, fault_total_weight, stems.size() - stem_total_cnt, fault_total_cnt, fault_propagate_score, ls_circuit_score());
auto it = std::next(ClauseLS::falsified_clauses.begin(), rand() % ClauseLS::falsified_clauses.size());
auto& lits = (*it)->lits;
var = abs(lits[rand()%lits.size()]);
}
int var_score = ls_pick_score(var);
assert(var != -1);;
return var;
}
void Circuit::ls_flip(Gate* stem) {
stem->value = !stem->value;
ls_block_recal(stem);
void Circuit::ls_init_stems() {
stems.clear();
for(Gate* g : gates) {
if(g->pi || g->po) {
g->stem = true;
}
if(!g->global_fault_detected[0] || !g->global_fault_detected[0]) {
g->stem = true;
}
if(g->fan_outs.size() >= 2) {
g->stem = true;
}
if(g->stem) {
stems.push_back(g);
}
}
for(Gate *g : gates) {
if(g->pi) continue;
std::queue<Gate*> q;
std::unordered_map<Gate*, bool> used;
q.push(g);
while(!q.empty()) {
Gate* now = q.front();
q.pop();
for(Gate* in : now->fan_ins) {
if(in->stem) {
g->pre_stems.push_back(in);
} else if(!used[in]) {
used[in] = true;
q.push(in);
}
}
}
}
for(Gate *g : gates) {
if(g->po) continue;
std::queue<Gate*> q;
std::unordered_map<Gate*, bool> used;
q.push(g);
while(!q.empty()) {
Gate* now = q.front();
q.pop();
for(Gate* out : now->fan_outs) {
if(out->stem) {
g->suc_stems.push_back(out);
} else if(!used[out]) {
used[out] = true;
q.push(out);
}
}
}
}
}
void Circuit::ls_update(Gate* stem) {
ls_block_recal(stem);
void Circuit::ls_flip_var(int var) {
ClauseLS::flip(var);
if(id2gate.count(var) && id2gate[var]->stem) {
ls_flip_stem(id2gate[var]);
}
}
ll Circuit::ls_pick_score(Gate* stem) {
ll old_score = ls_score();
ll Circuit::ls_pick_score(int var) {
ls_flip(stem);
ll old_score = ls_circuit_score();
ll new_score = ls_score();
ls_flip_var(var);
ls_flip(stem);
ll new_score = ls_circuit_score();
old_score = std::max(old_score, ls_score());
ls_flip_var(var);
assert(old_score == ls_circuit_score());
return new_score - old_score;
}
ll Circuit::ls_score() {
//ll score = -flip_total_weight -stem_total_weight + fault_total_weight;
ll score = -flip_total_weight -stem_total_weight + fault_total_weight;
ll Circuit::ls_circuit_score() {
ll score = - Clause::total_cost + fault_propagate_score + fault_total_weight;
//ll score = - Clause::total_cost;
return score;
}
void Circuit::ls_init_weight(const std::unordered_set<Fault*> &faults) {
void Circuit::ls_init_weight() {
for(Gate* s : stems) {
stem_weight[s->id] = 1;
stem_total_weight += stem_weight[s->id];
s->stem_weight = 1;
stem_total_cost += s->stem_weight;
}
for(Fault* f : faults) {
fault_weight[f->gate->id][f->type] = 1;
}
for(Gate* s: stems) {
flip_weight[s->id] = 1;
}
}
void Circuit::ls_init_circuit() {
for(Gate* g : gates) {
g->sa[0] = 0;
g->sa[1] = 0;
}
for(Gate* s : stems) {
s->value = rand() % 2;
}
for(int i=stems.size()-1; i>=0; i--) {
ls_update(stems[i]);
}
while(!flip_update_queue.empty()) {
Gate* g = flip_update_queue.back();
flip_update_queue.pop_back();
if(!flip_need_update[g->id]) continue;
flip_need_update[g->id] = false;
flip_total_weight -= flip_weight[g->id];
flip_total_cnt -= 1;
ls_update(g);
g->fault_weight[0] = !g->global_fault_detected[0];
g->fault_weight[1] = !g->global_fault_detected[1];
}
}
void Circuit::ls_init_data_structs() {
const int MAX_LEN = gates.size() + 1;
void Circuit::ls_random_circuit() {
if(flip_weight == nullptr) {
CC = new int[MAX_LEN];
flip_weight = new int[MAX_LEN];
flip_need_update = new int[MAX_LEN];
stem_weight = new int[MAX_LEN];
stem_satisfied = new int[MAX_LEN];
fault_weight = new int*[MAX_LEN];
for(int i=0; i<MAX_LEN; i++) {
fault_weight[i] = new int[2];
// random init clauseLS
for(int i=1; i<=ClauseLS::num_vars; i++) {
int new_v = CCAnr::module_cur_soln()[i];
if(new_v != ClauseLS::lit_value[i]) {
//ls_flip_var(i);
ClauseLS::flip(i);
}
fault_detected = new int*[MAX_LEN];
for(int i=0; i<MAX_LEN; i++) {
fault_detected[i] = new int[2];
}
}
flip_total_weight = 0;
flip_total_cnt = 0;
// init assignment
for(Gate* s : stems) {
s->value = ClauseLS::lit_value[s->id];
}
stem_total_weight = 0;
// recal value by topo
for(Gate *g : gates) {
if(g->stem) {
g->stem_satisfied = (g->recal_value() == g->value);
if(g->stem_satisfied) {
stem_total_cost -= g->stem_weight;
stem_total_cnt++;
}
} else {
g->value = g->recal_value();
}
}
// recal fault by rtopo
for(Gate* g : rtopo_gates) {
g->recal_fault(g->fault_detected);
if(g->fault_detected[0]) {
fault_total_weight += g->fault_weight[0];
fault_total_cnt++;
}
if(g->fault_detected[1]) {
fault_total_weight += g->fault_weight[1];
fault_total_cnt++;
}
g->propagate = (g->fault_detected[0] || g->fault_detected[1]);
g->recal_propagate_len(g->fault_propagate_length);
fault_propagate_score += g->fault_weight[0] * g->fault_propagate_length[0];
fault_propagate_score += g->fault_weight[1] * g->fault_propagate_length[1];
}
assert(is_valid_circuit());
}
void Circuit::ls_reset_data() {
stems.clear();
fault_propagate_score = 0;
stem_total_cost = 0;
stem_total_cnt = 0;
fault_total_weight = 0;
fault_total_cnt = 0;
for(int i=0; i<MAX_LEN; i++) {
CC[i] = 1;
flip_weight[i] = 0;
flip_need_update[i] = 0;
stem_weight[i] = 0;
stem_satisfied[i] = 0;
fault_weight[i][0] = 0;
fault_weight[i][1] = 0;
fault_detected[i][0] = 0;
fault_detected[i][1] = 0;
for(Gate *g : gates) {
g->CC = 1;
g->stem = 0;
g->propagate = 0;
g->stem_weight = 0;
g->stem_satisfied = 0;
g->fault_weight[0] = g->fault_weight[1] = 0;
g->fault_detected[0] = g->fault_detected[1] = 0;
g->fault_propagate_length[0] = 0;
g->fault_propagate_length[1] = 0;
}
}
void Circuit::ls_block_recal(Gate* stem) {
if(flip_need_update[stem->id]) {
flip_need_update[stem->id] = false;
flip_total_weight -= flip_weight[stem->id];
flip_total_cnt -= 1;
void Circuit::ls_flip_stem(Gate* stem) {
stem->value = !stem->value;
// update CC
stem->CC = 0;
for(Gate* pre : stem->pre_stems) {
pre->CC = 1;
}
for(Gate* suc : stem->suc_stems) {
suc->CC = 1;
}
if(stem->cal_value() == stem->value && !stem_satisfied[stem->id]){
stem_satisfied[stem->id] = true;
stem_total_weight -= stem_weight[stem->id];
// update value
bool new_stem_satisfied = (stem->recal_value() == stem->value);
if(new_stem_satisfied && !stem->stem_satisfied){
stem->stem_satisfied = true;
stem_total_cost -= stem->stem_weight;
stem_total_cnt += 1;
}
if(stem->cal_value() != stem->value && stem_satisfied[stem->id]) {
stem_satisfied[stem->id] = false;
stem_total_weight += stem_weight[stem->id];
if(!new_stem_satisfied && stem->stem_satisfied){
stem->stem_satisfied = false;
stem_total_cost += stem->stem_weight;
stem_total_cnt -= 1;
}
//printf("flip: %s\n", stem->name.c_str());
//stem->value = !stem->value;
if(stem->isPO) {
if(stem->sa[!stem->value] == false) {
fault_total_weight += fault_weight[stem->id][!stem->value];
// update po fault
if(stem->po) {
stem->propagate = true;
if(!stem->fault_detected[!stem->value]) {
fault_total_weight += stem->fault_weight[!stem->value];
fault_total_cnt += 1;
stem->sa[!stem->value] = true;
stem->fault_detected[!stem->value] = true;
}
if(stem->sa[stem->value] == true) {
fault_total_weight -= fault_weight[stem->id][stem->value];
if(stem->fault_detected[stem->value]) {
fault_total_weight -= stem->fault_weight[stem->value];
fault_total_cnt -= 1;
stem->sa[stem->value] = false;
stem->fault_detected[stem->value] = false;
}
}
std::queue<Gate*> q;
std::unordered_map<Gate*, int> used;
std::vector<Gate*> suc_stems;
static std::queue<Gate*> q1;
static std::unordered_map<Gate*, int> used1;
static std::queue<Gate*> q2;
static std::unordered_map<Gate*, int> used2;
used1.clear();
used2.clear();
q.push(stem);
q1.push(stem);
while(!q.empty()) {
Gate* g = q.front();
q.pop();
used[g] = false;
for(Gate* out : g->outputs) {
while(!q1.empty()) {
Gate* g = q1.front();
q1.pop();
used1[g] = false;
for(Gate* suc : g->suc_stems) {
if(!used2[suc]) {
used2[suc] = true;
q2.push(suc);
}
}
for(Gate* out : g->fan_outs) {
if(out->stem) {
suc_stems.push_back(out);
Gate* stem = out;
bool new_stem_satisfied = (stem->recal_value() == stem->value);
if(new_stem_satisfied && !stem->stem_satisfied){
stem->stem_satisfied = true;
stem_total_cost -= stem->stem_weight;
stem_total_cnt += 1;
}
if(!new_stem_satisfied && stem->stem_satisfied){
stem->stem_satisfied = false;
stem_total_cost += stem->stem_weight;
stem_total_cnt -= 1;
}
continue;
}
out->value = out->cal_value();
if(!used[out]) {
used[out] = true;
q.push(out);
int new_value = out->recal_value();
if(new_value == out->value) continue;
out->value = new_value;
if(!used1[out]) {
used1[out] = true;
q1.push(out);
}
}
}
assert(q.empty());
used.clear();
q2.push(stem);
used2[stem] = true;
for(Gate* stem : suc_stems) {
q.push(stem);
while(!q2.empty()) {
Gate *g = q2.front();
q2.pop();
if(stem->cal_value() == stem->value && !stem_satisfied[stem->id]){
stem_satisfied[stem->id] = true;
stem_total_weight -= stem_weight[stem->id];
stem_total_cnt += 1;
}
if(stem->cal_value() != stem->value && stem_satisfied[stem->id]) {
stem_satisfied[stem->id] = false;
stem_total_weight += stem_weight[stem->id];
stem_total_cnt -= 1;
}
}
used2[g] = false;
while(!q.empty()) {
Gate *g = q.front();
q.pop();
for(Gate* in : g->fan_ins) {
used[g] = false;
bool update = false;
bool right_value = (g->cal_value() == g->value);
for(Gate* in : g->inputs) {
in->value = !in->value;
bool input_detected = (g->cal_value() != g->value);
in->value = !in->value;
bool sa0 = right_value && input_detected && g->sa[!g->value] && in->value;
bool sa1 = right_value && input_detected && g->sa[!g->value] && !in->value;
bool fd[2];
in->recal_fault(fd);
in->sa_by_out[g] = std::make_pair(sa0, sa1);
bool old_sa[2];
old_sa[0] = in->sa[0];
old_sa[1] = in->sa[1];
in->sa[0] = in->sa[1] = 0;
for(Gate* out : in->outputs) {
auto &p = in->sa_by_out[out];
in->sa[0] |= p.first;
in->sa[1] |= p.second;
}
if(in->stem && !in->isPI && (in->sa[0] != old_sa[0] || in->sa[1] != old_sa[1])) {
for(Gate* pre : in->pre_stems) {
if(flip_need_update[pre->id]) continue;
flip_need_update[pre->id] = true;
flip_update_queue.push_back(pre);
flip_total_weight += flip_weight[pre->id];
flip_total_cnt += 1;
}
}
if(old_sa[0] != in->sa[0]) {
if(in->sa[0]) {
fault_total_weight += fault_weight[in->id][0];
if(fd[0] != in->fault_detected[0]) {
update = true;
if(fd[0]) {
fault_total_weight += in->fault_weight[0];
fault_total_cnt += 1;
} else {
fault_total_weight -= fault_weight[in->id][0];
fault_total_weight -= in->fault_weight[0];
fault_total_cnt -= 1;
}
in->fault_detected[0] = fd[0];
}
if(old_sa[1] != in->sa[1]) {
if(in->sa[1]) {
fault_total_weight += fault_weight[in->id][1];
if(fd[1] != in->fault_detected[1]) {
update = true;
if(fd[1]) {
fault_total_weight += in->fault_weight[1];
fault_total_cnt += 1;
} else {
fault_total_weight -= fault_weight[in->id][1];
fault_total_weight -= in->fault_weight[1];
fault_total_cnt -= 1;
}
in->fault_detected[1] = fd[1];
}
in->propagate = (in->fault_detected[0] || in->fault_detected[1]);
int fpl[2];
in->recal_propagate_len(fpl);
if(fpl[0] != in->fault_propagate_length[0] || fpl[1] != in->fault_propagate_length[1]) {
update = true;
fault_propagate_score += in->fault_weight[0] * (fpl[0] - in->fault_propagate_length[0]);
fault_propagate_score += in->fault_weight[1] * (fpl[1] - in->fault_propagate_length[1]);
in->fault_propagate_length[0] = fpl[0];
in->fault_propagate_length[1] = fpl[1];
}
if(!in->stem && !used[in]) {
used[in] = true;
q.push(in);
if(update && !used2[in]) {
used2[in] = true;
q2.push(in);
}
}
}

View File

@ -3,6 +3,8 @@
#include <assert.h>
#include "circuit.h"
#include "clause.h"
#include "CCAnr/ccanr.h"
int main(int args, char* argv[]) {
@ -17,7 +19,6 @@ int main(int args, char* argv[]) {
printf("parsing file %s ...", argv[1]);
circuit->parse_from_file(argv[1]);
circuit->init_stems();
circuit->init_topo_index();
printf(" Done.\n");
@ -28,25 +29,22 @@ int main(int args, char* argv[]) {
printf("Stem:\t%ld\n", circuit->stems.size());
printf("================================ \n");
std::unordered_set<Fault*> faults;
circuit->global_fault_undetected_count = circuit->gates.size() * 2;
// init faults
for(auto g : circuit->gates) {
faults.insert(new Fault(g, Fault::SA0));
faults.insert(new Fault(g, Fault::SA1));
}
CCAnr::module_init();
// init clause local search
ClauseLS::init_data_structs(circuit);
while(true) {
bool ls = circuit->local_search(faults);
bool ls = circuit->local_search();
bool is_valid = circuit->is_valid_circuit();
printf("checking valid circuit ...");
printf(" result: %d.\n", is_valid);
if(!ls) break;
if(!is_valid) break;
if(faults.size() == 0) break;
if(circuit->global_fault_undetected_count == 0) break;
}
//printf("[final] flip: %d, stem: %d, fault:%d\n", circuit->flip_total_weight, circuit->stem_total_weight, circuit->fault_total_weight);
return 0;
}

105
makefile
View File

@ -1,72 +1,35 @@
#一个实用的makefile能自动编译当前目录下所有.c/.cpp源文件支持二者混合编译
#并且当某个.c/.cpp、.h或依赖的源文件被修改后仅重编涉及到的源文件未涉及的不编译
#详解文档http://blog.csdn.net/huyansoft/article/details/8924624
#author胡彦 2013-5-21
#----------------------------------------------------------
#编译工具用g++以同时支持C和C++程序,以及二者的混合编译
CC=g++
# 定义源文件列表
SOURCES := $(wildcard *.c) $(wildcard *.cpp) $(wildcard CCAnr/*.cpp)
CPPFLAGS=-O3 -std=c++17
#使用$(winldcard *.c)来获取工作目录下的所有.c文件的列表
#sources:=main.cpp command.c
#变量sources得到当前目录下待编译的.c/.cpp文件的列表两次调用winldcard、结果连在一起即可
sources:=$(wildcard *.c) $(wildcard *.cpp)
#变量objects得到待生成的.o文件的列表把sources中每个文件的扩展名换成.o即可。这里两次调用patsubst函数第1次把sources中所有.cpp换成.o第2次把第1次结果里所有.c换成.o
objects:=$(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(sources)))
#变量dependence得到待生成的.d文件的列表把objects中每个扩展名.o换成.d即可。也可写成$(patsubst %.o,%.d,$(objects))
dependence:=$(objects:.o=.d)
#----------------------------------------------------------
#当$(objects)列表里所有文件都生成后,便可调用这里的 $(CC) $^ -o $@ 命令生成最终目标all了
#把all定义成第1个规则使得可以把make all命令简写成make
atpg: $(objects)
$(CC) $(CPPFLAGS) $^ -o $@
# @./$@ #编译后立即执行
#这段使用make的模式规则指示如何由.c文件生成.o即对每个.c文件调用gcc -c XX.c -o XX.o命令生成对应的.o文件
#如果不写这段也可以因为make的隐含规则可以起到同样的效果
%.o: %.c
$(CC) $(CPPFLAGS) -c $< -o $@
#同上,指示如何由.cpp生成.o可省略
%.o: %.cpp
$(CC) $(CPPFLAGS) -c $< -o $@
#----------------------------------------------------------
include $(dependence) #注意该句要放在终极目标all的规则之后否则.d文件里的规则会被误当作终极规则了
#因为这4行命令要多次凋用定义成命令包以简化书写
define gen_dep
set -e; rm -f $@; \
$(CC) -MM $(CPPFLAGS) $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
endef
#指示如何由.c生成其依赖规则文件.d
#这段使用make的模式规则指示对每个.c文件如何生成其依赖规则文件.d调用上面的命令包即可
%.d: %.c
$(gen_dep)
#同上,指示对每个.cpp如何生成其依赖规则文件.d
%.d: %.cpp
$(gen_dep)
#----------------------------------------------------------
#清除所有临时文件(所有.o和.d。之所以把clean定义成伪目标是因为这个目标并不对应实际的文件
.PHONY: clean
clean: #.$$已在每次使用后立即删除。-f参数表示被删文件不存在时不报错
rm -f all $(objects) $(dependence)
echo: #调试时显示一些变量的值
@echo sources=$(sources)
@echo objects=$(objects)
@echo dependence=$(dependence)
@echo CPPFLAGS=$(CPPFLAGS)
#提醒:当混合编译.c/.cpp时为了能够在C++程序里调用C函数必须把每一个要调用的C函数其声明都包括在extern "C"{}块里面这样C++链接时才能成功链接它们。
# 将源文件列表转换为目标文件列表
OBJECTS := $(addprefix build/,$(SOURCES:%=%.o))
# 声明编译器和编译选项
CC := gcc
CXX := g++
CFLAGS := -O0 -g -Wall -Wextra -MMD -MP
CXXFLAGS := -O0 -g -Wall -Wextra -MMD -MP
# 默认目标,编译所有目标文件
atpg: $(OBJECTS)
$(CXX) $(CXXFLAGS) $^ -o $@
# 生成目标文件的规则
build/%.o: % | build
$(CC) $(CFLAGS) -c $< -o $@
build/%.o: %.cpp | build
$(CXX) $(CXXFLAGS) -c $< -o $@
# 包含依赖文件
-include $(OBJECTS:.o=.d)
# 如果需要,则递归创建源文件的目录结构
build:
mkdir -p $(sort $(dir $(OBJECTS)))
# 清除所有目标文件和build目录
clean:
rm -rf build $(OBJECTS)
.PHONY: clean all

15
option.h Normal file
View File

@ -0,0 +1,15 @@
#pragma once
const double SP = 0.0001;
const int MAX_STEPS = 1000000000;
const int SAMPLING_COUNT = 25;
const int STEM_INC = 2;
const int STEM_WEIGHT_MAX = 1e9;
const int FAULT_INC = 1;
const int FAULT_WEIGHT_MAX = 20;
const int CLAUSE_FALSIFIED_INC = 2;
const int CLAUSE_FALSIFIED_MAX = 1e9;

16104
output.txt

File diff suppressed because it is too large Load Diff

View File

@ -46,12 +46,6 @@ void Circuit::parse_from_file(const char *filename) {
std::vector<std::string> tokens;
line2tokens(line, tokens);
// std::cout << line << std::endl;
// std::cout << "tokens: ";
// for(auto &token : tokens) {
// std::cout << "$" << token << "$ ";
// }
// std::cout << std::endl;
// gate
if(tokens.size() >= 6 && tokens[1] == "=" && tokens[3] == "(" && tokens.back() == ")") {
@ -73,10 +67,10 @@ void Circuit::parse_from_file(const char *filename) {
Gate* gate = new Gate();
gate->name = tokens[0];
gate->sa[0] = gate->sa[1] = false;
gate->fault_detected[0] = gate->fault_detected[1] = false;
gate->stem = false;
gate->isPI = false;
gate->isPO = false;
gate->pi = false;
gate->po = false;
for(auto &in : ins) {
@ -87,8 +81,8 @@ void Circuit::parse_from_file(const char *filename) {
auto in_gate = name2gate[in];
gate->inputs.push_back(in_gate);
in_gate->outputs.push_back(gate);
gate->fan_ins.push_back(in_gate);
in_gate->fan_outs.push_back(gate);
}
if(tokens[2] == "AND") { gate->type = Gate::AND; }
@ -113,10 +107,10 @@ void Circuit::parse_from_file(const char *filename) {
Gate* gate = new Gate();
gate->name = tokens[2];
gate->type = Gate::INPUT;
gate->sa[0] = gate->sa[1] = false;
gate->fault_detected[0] = gate->fault_detected[1] = false;
gate->stem = true;
gate->isPI = true;
gate->isPO = false;
gate->pi = true;
gate->po = false;
name2gate.insert(std::make_pair(gate->name, gate));
gates.push_back(gate);
@ -141,7 +135,7 @@ void Circuit::parse_from_file(const char *filename) {
}
Gate* po = name2gate[po_name];
po->isPO = true;
po->po = true;
po->stem = true;
POs.push_back(po);
}

View File

@ -0,0 +1,30 @@
---------------------------------------------------------------------------------------------------------------
| data | fault coverage(ATPG-LS) | time(ATPG-LS) | cube(ATPG-LS) | pattern(ATPG-LS) |
| ----------------------- | ----------------------- | -------------------- | ------------- | ---------------- |
| ./benchmark/c17.bench | 100.000 | 0.035004615783691406 | 5 | 5 |
| ./benchmark/b06.bench | 100.000 | 0.07079482078552246 | 11 | 11 |
| ./benchmark/b01.bench | 100.000 | 0.09065485000610352 | 14 | 14 |
| ./benchmark/b03.bench | 100.000 | 2.3637137413024902 | 14 | 14 |
| ./benchmark/b09.bench | 100.000 | 3.8993797302246094 | 18 | 18 |
| ./benchmark/b10.bench | 100.000 | 6.369290351867676 | 29 | 29 |
| ./benchmark/b08.bench | 100.000 | 7.467808723449707 | 35 | 35 |
| ./benchmark/c880.bench | 100.000 | 50.42959809303284 | 22 | 22 |
| ./benchmark/c499.bench | 100.000 | 65.37915563583374 | 49 | 49 |
| ./benchmark/c1355.bench | 100.000 | 363.1095223426819 | 82 | 82 |
| ./benchmark/b17.bench | ERROR | 2000.0039329528809 | ERROR | ERROR |
| ./benchmark/c7552.bench | 25.531 | 2000.0044975280762 | 1 | 1 |
| ./benchmark/b20.bench | ERROR | 2000.0045347213745 | ERROR | ERROR |
| ./benchmark/b11.bench | 98.951 | 2000.0055797100067 | 47 | 47 |
| ./benchmark/c3540.bench | 93.543 | 2000.006273508072 | 63 | 63 |
| ./benchmark/c1908.bench | 95.893 | 2000.0061783790588 | 39 | 39 |
| ./benchmark/b22.bench | ERROR | 2000.0057337284088 | ERROR | ERROR |
| ./benchmark/c2670.bench | 82.328 | 2000.0055947303772 | 31 | 31 |
| ./benchmark/b21.bench | ERROR | 2000.0054640769958 | ERROR | ERROR |
| ./benchmark/c6288.bench | 92.116 | 2000.0076813697815 | 5 | 5 |
| ./benchmark/c5315.bench | 33.139 | 2000.0081040859222 | 2 | 2 |
| ./benchmark/b04.bench | 99.744 | 2000.0090584754944 | 45 | 45 |
| ./benchmark/b12.bench | 91.771 | 2000.0079457759857 | 81 | 81 |
| ./benchmark/b07.bench | 98.568 | 2000.00936460495 | 29 | 29 |
| ./benchmark/c432.bench | 99.235 | 2000.0103182792664 | 19 | 19 |
| ./benchmark/b13.bench | 98.602 | 2000.009345293045 | 32 | 32 |
---------------------------------------------------------------------------------------------------------------

View File

@ -0,0 +1,30 @@
--------------------------------------------------------------------------------------------------------------
| data | fault coverage(ATPG-LS) | time(ATPG-LS) | cube(ATPG-LS) | pattern(ATPG-LS) |
| ----------------------- | ----------------------- | ------------------- | ------------- | ---------------- |
| ./benchmark/c17.bench | 100.000 | 0.11560654640197754 | 4 | 4 |
| ./benchmark/b06.bench | 100.000 | 0.11869049072265625 | 10 | 10 |
| ./benchmark/b01.bench | 100.000 | 0.3559579849243164 | 13 | 13 |
| ./benchmark/b03.bench | 100.000 | 0.8975160121917725 | 13 | 13 |
| ./benchmark/b09.bench | 100.000 | 6.73541784286499 | 20 | 20 |
| ./benchmark/c880.bench | 100.000 | 13.738963603973389 | 38 | 38 |
| ./benchmark/b10.bench | 100.000 | 13.915901899337769 | 31 | 31 |
| ./benchmark/b08.bench | 100.000 | 44.885215282440186 | 36 | 36 |
| ./benchmark/c499.bench | 100.000 | 72.9014344215393 | 59 | 59 |
| ./benchmark/c1355.bench | 100.000 | 354.89149928092957 | 93 | 93 |
| ./benchmark/c3540.bench | 92.932 | 2000.0045857429504 | 126 | 126 |
| ./benchmark/c1908.bench | 99.452 | 2000.0044167041779 | 85 | 85 |
| ./benchmark/b11.bench | 98.485 | 2000.0039746761322 | 59 | 59 |
| ./benchmark/c6288.bench | 99.653 | 2000.005141735077 | 37 | 37 |
| ./benchmark/c2670.bench | 94.881 | 2000.0041010379791 | 75 | 75 |
| ./benchmark/b21.bench | 45.309 | 2000.031025648117 | 21 | 21 |
| ./benchmark/b13.bench | 98.602 | 2000.030693769455 | 30 | 30 |
| ./benchmark/b22.bench | 30.701 | 2000.1147837638855 | 4 | 4 |
| ./benchmark/b17.bench | ERROR | 2000.1162934303284 | ERROR | ERROR |
| ./benchmark/b20.bench | 48.958 | 2000.1155791282654 | 19 | 19 |
| ./benchmark/c7552.bench | 95.832 | 2000.1170272827148 | 134 | 134 |
| ./benchmark/b12.bench | 94.418 | 2000.1147434711456 | 123 | 123 |
| ./benchmark/c5315.bench | 99.175 | 2000.1144452095032 | 139 | 139 |
| ./benchmark/b04.bench | 99.659 | 2000.1151909828186 | 50 | 50 |
| ./benchmark/b07.bench | 98.687 | 2000.1153008937836 | 34 | 34 |
| ./benchmark/c432.bench | 99.235 | 2000.1161303520203 | 28 | 28 |
--------------------------------------------------------------------------------------------------------------

30
report/atpg-ls.txt Normal file
View File

@ -0,0 +1,30 @@
--------------------------------------------------------------------------------------------------------
| data | fault coverage(ATPG-LS) | time(ATPG-LS) | cube(ATPG-LS) | pattern(ATPG-LS) |
| ----------------------- | ----------------------- | ------------- | ------------- | ---------------- |
| ./benchmark/c6288.bench | 99.653 | -*- | 27 | 27 |
| ./benchmark/c17.bench | 100.000 | -*- | 4 | 4 |
| ./benchmark/b17.bench | ERROR | -*- | ERROR | ERROR |
| ./benchmark/b22.bench | ERROR | -*- | ERROR | ERROR |
| ./benchmark/b13.bench | 95.652 | -*- | 35 | 35 |
| ./benchmark/c880.bench | 100.000 | -*- | 45 | 45 |
| ./benchmark/b07.bench | 90.453 | -*- | 26 | 26 |
| ./benchmark/c432.bench | 99.235 | -*- | 29 | 29 |
| ./benchmark/c5315.bench | ERROR | -*- | ERROR | ERROR |
| ./benchmark/b20.bench | ERROR | -*- | ERROR | ERROR |
| ./benchmark/c1355.bench | 99.744 | -*- | 103 | 103 |
| ./benchmark/b01.bench | 100.000 | -*- | 15 | 15 |
| ./benchmark/b10.bench | 100.000 | -*- | 33 | 33 |
| ./benchmark/b03.bench | 100.000 | -*- | 18 | 18 |
| ./benchmark/b11.bench | 95.688 | -*- | 44 | 44 |
| ./benchmark/b08.bench | 100.000 | -*- | 34 | 34 |
| ./benchmark/c3540.bench | 90.169 | -*- | 96 | 96 |
| ./benchmark/c2670.bench | 82.609 | -*- | 53 | 53 |
| ./benchmark/b09.bench | 100.000 | -*- | 20 | 20 |
| ./benchmark/c7552.bench | 95.133 | -*- | 103 | 103 |
| ./benchmark/b04.bench | 73.424 | -*- | 15 | 15 |
| ./benchmark/b12.bench | ERROR | -*- | ERROR | ERROR |
| ./benchmark/b21.bench | ERROR | -*- | ERROR | ERROR |
| ./benchmark/b06.bench | 100.000 | -*- | 13 | 13 |
| ./benchmark/c499.bench | 100.000 | -*- | 55 | 55 |
| ./benchmark/c1908.bench | 99.179 | -*- | 91 | 91 |
--------------------------------------------------------------------------------------------------------

90
res.txt
View File

@ -1,90 +0,0 @@
parsing file c432.bench...
INPUT(1)
tokens: $INPUT$ $($ $1$ $)$
INPUT(4)
tokens: $INPUT$ $($ $4$ $)$
INPUT(8)
tokens: $INPUT$ $($ $8$ $)$
INPUT(11)
tokens: $INPUT$ $($ $11$ $)$
INPUT(14)
tokens: $INPUT$ $($ $14$ $)$
INPUT(17)
tokens: $INPUT$ $($ $17$ $)$
INPUT(21)
tokens: $INPUT$ $($ $21$ $)$
INPUT(24)
tokens: $INPUT$ $($ $24$ $)$
INPUT(27)
tokens: $INPUT$ $($ $27$ $)$
INPUT(30)
tokens: $INPUT$ $($ $30$ $)$
INPUT(34)
tokens: $INPUT$ $($ $34$ $)$
INPUT(37)
tokens: $INPUT$ $($ $37$ $)$
INPUT(40)
tokens: $INPUT$ $($ $40$ $)$
INPUT(43)
tokens: $INPUT$ $($ $43$ $)$
INPUT(47)
tokens: $INPUT$ $($ $47$ $)$
INPUT(50)
tokens: $INPUT$ $($ $50$ $)$
INPUT(53)
tokens: $INPUT$ $($ $53$ $)$
INPUT(56)
tokens: $INPUT$ $($ $56$ $)$
INPUT(60)
tokens: $INPUT$ $($ $60$ $)$
INPUT(63)
tokens: $INPUT$ $($ $63$ $)$
INPUT(66)
tokens: $INPUT$ $($ $66$ $)$
INPUT(69)
tokens: $INPUT$ $($ $69$ $)$
INPUT(73)
tokens: $INPUT$ $($ $73$ $)$
INPUT(76)
tokens: $INPUT$ $($ $76$ $)$
INPUT(79)
tokens: $INPUT$ $($ $79$ $)$
INPUT(82)
tokens: $INPUT$ $($ $82$ $)$
INPUT(86)
tokens: $INPUT$ $($ $86$ $)$
INPUT(89)
tokens: $INPUT$ $($ $89$ $)$
INPUT(92)
tokens: $INPUT$ $($ $92$ $)$
INPUT(95)
tokens: $INPUT$ $($ $95$ $)$
INPUT(99)
tokens: $INPUT$ $($ $99$ $)$
INPUT(102)
tokens: $INPUT$ $($ $102$ $)$
INPUT(105)
tokens: $INPUT$ $($ $105$ $)$
INPUT(108)
tokens: $INPUT$ $($ $108$ $)$
INPUT(112)
tokens: $INPUT$ $($ $112$ $)$
INPUT(115)
tokens: $INPUT$ $($ $115$ $)$
OUTPUT(223)
tokens: $OUTPUT$ $($ $223$ $)$
OUTPUT(329)
tokens: $OUTPUT$ $($ $329$ $)$
OUTPUT(370)
tokens: $OUTPUT$ $($ $370$ $)$
OUTPUT(421)
tokens: $OUTPUT$ $($ $421$ $)$
OUTPUT(430)
tokens: $OUTPUT$ $($ $430$ $)$
OUTPUT(431)
tokens: $OUTPUT$ $($ $431$ $)$
OUTPUT(432)
tokens: $OUTPUT$ $($ $432$ $)$
118 = NOT(1)
tokens: $118$ $=$ $NOT$ $($ $1$ $)$
Error while reading line: 118 = NOT(1)

232
run_exp.py Normal file
View File

@ -0,0 +1,232 @@
import os
from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED, FIRST_COMPLETED, as_completed
import time
import re
pool = ThreadPoolExecutor(max_workers=96)
TIMEOUT = 2000
work_dir = "."
data_dir = "./benchmark"
data_suffix = ".bench"
res_dir = "exp_result"
class ExitStatus:
normal = 0
timeout = 1
runtime_error = 2
def run_shell_command(command, output_file, timeout):
res = 0
T1 = time.time()
if timeout: res = os.system("timeout %ds stdbuf -oL %s > %s 2>&1 " % ( timeout, command, output_file ))
else: res = os.system("%s > %s 2>&1 " % (command, output_file))
T2 = time.time()
exec_time = T2 - T1
exit_status = ExitStatus.normal
# if(res == 31744):
# exit_status = ExitStatus.timeout
# if(res != 0):
# exit_status = ExitStatus.runtime_error
return (exit_status, exec_time)
class AtalantaSolver:
name = "Atalanta"
def run(filename, output_file, timeout):
return run_shell_command("./Atalanta/atalanta -b 10000 %s" % filename, output_file, timeout)
def analyse(output_file):
content = open(output_file, "r").read()
p1 = re.compile(r'Fault coverage\s*:\s*(\d+\.\d+)\s*%', re.S)
coverage = p1.findall(content)[0]
p2 = re.compile(r'Number of test patterns before compaction\s*:\s*(\d+)', re.S)
cube = p2.findall(content)[0]
p3 = re.compile(r'Number of test patterns after compaction\s*:\s*(\d+)', re.S)
pattern = p3.findall(content)[0]
return (coverage, cube, pattern)
class ATPGLS:
name = "ATPG-LS"
def run(filename, output_file, timeout):
return run_shell_command("./crun %s" % filename, output_file, timeout)
def analyse(output_file):
print("anal:" + output_file)
content = open(output_file, "r").read()
p1 = re.compile(r'coverage\s*:\s*(\d+\.\d+)\s*%', re.S)
if len(p1.findall(content)) == 0:
return("ERROR", "ERROR", "ERROR")
coverage = p1.findall(content)[-1]
p2 = re.compile(r'pattern\s*:\s*(\d+)', re.S)
cube = p2.findall(content)[-1]
p3 = re.compile(r'pattern\s*:\s*(\d+)', re.S)
pattern = p3.findall(content)[-1]
return (coverage, cube, pattern)
class TGPro:
name = "TGPro"
def run(filename, output_file, timeout):
return run_shell_command("./tg-pro/bin/atpgSat %s" % filename, output_file, timeout)
def analyse(output_file):
content = open(output_file, "r").read()
total = re.compile(r'Total: (\d+)', re.S).findall(content)[1]
detectable = re.compile(r'Detectable: (\d+)', re.S).findall(content)[0]
undetectable = re.compile(r'Undetectable: (\d+)', re.S).findall(content)[0]
print(detectable, undetectable, total)
coverage = str((int(undetectable) + int(detectable)) / int(total) * 100) + "%"
cube = "-*-"
pattern = "-*-"
return (coverage, cube, pattern)
class OpenTPG:
name = "OpenTPG"
def run(filename, output_file, timeout):
(path, filename) = os.path.split(filename)
fault_file = os.path.join(res_dir,"%s_%s.txt" % (solver.name, filename))
cube_file = os.path.join(res_dir,"%s_%s.txt" % (solver.name, filename))
return run_shell_command("./OpenTPG/opentpg/opentpg -n %s -f %s -c /dev/null -u %s" \
% (filename, output_file), output_file, timeout)
def analyse(output_file):
content = open(output_file, "r").read()
p1 = re.compile(r'coverage:\s*:\s*(\d+\.\d+)\s*%', re.S)
coverage = p1.findall(content)[-1]
p2 = re.compile(r'pattern:\s*:\s*(\d+)', re.S)
cube = p2.findall(content)[-1]
p3 = re.compile(r'pattern:\s*:\s*(\d+)', re.S)
pattern = p3.findall(content)[-1]
return (coverage, cube, pattern)
class Table:
def __init__(self, header):
self.header = header
self.col_size = len(header)
self.lines = []
def add_line(self, cols):
if len(cols) != self.col_size:
raise Exception("cols number error! need %d but you have %d." % (self.col_size, len(cols)))
for var in cols: var = str(var)
self.lines.append(cols)
def print_table(self):
col_widths = []
for var in self.header:
col_widths.append(len(var))
for i in range(self.col_size):
for j in range(len(self.lines)):
self.lines[j][i] = str(self.lines[j][i])
for i in range(self.col_size):
for line in self.lines:
col_widths[i] = max(col_widths[i], len(line[i]))
table_with = 1
for width in col_widths:
table_with = table_with + width + 3
for i in range(table_with): print("-", end="")
print()
def print_with_filler(str, width, filler):
print(str, end="")
for i in range(len(str), width):
print(filler, end="")
print("| ", end="")
for i in range(self.col_size):
print_with_filler(self.header[i], col_widths[i], " ")
print(" | ", end="")
print()
print("| ", end="")
for i in range(self.col_size):
print_with_filler("", col_widths[i], "-")
print(" | ", end="")
print()
for line in self.lines:
print("| ", end="")
for i in range(self.col_size):
print_with_filler(line[i], col_widths[i], " ")
print(" | ", end="")
print()
for i in range(table_with): print("-", end="")
print()
class Logger:
def __init__(self, filename):
self.f = open(filename, "w")
def log(self, str):
print(str)
self.f.write(str + "\n")
self.f.flush()
table = None
def multiprocess_run_solver(solver, input_file):
(path, filename) = os.path.split(input_file)
out_file = os.path.join(res_dir,"%s_%s.txt" % (solver.name, filename))
(status, time) = solver.run(input_file, out_file, TIMEOUT)
# time = "-*-"
# status = ExitStatus.normal
fault = "-*-"
cube = "-*-"
pattern = "-*-"
if status == ExitStatus.runtime_error:
fault = "Runtime Error"
elif status == ExitStatus.timeout:
fault = "Time Out"
else:
(f, c, p) = solver.analyse(out_file)
fault = f
cube = c
pattern = p
table.add_line([input_file, fault, time, cube, pattern])
return input_file
if __name__ == '__main__':
logger = Logger("check.log")
os.chdir(work_dir)
os.makedirs(res_dir, exist_ok=True)
all_task = []
solver = ATPGLS
table = Table(["data", "fault coverage(%s)" % solver.name, "time(%s)" % solver.name, "cube(%s)" % solver.name, "pattern(%s)" % solver.name ])
for filename in os.listdir(data_dir):
if not filename.endswith(data_suffix): continue
all_task.append(pool.submit(multiprocess_run_solver, solver, os.path.join(data_dir, filename)))
s = 0
for task in as_completed(all_task):
data = task.result()
s = s + 1
logger.log("[{}/{}] 任务 {}".format(s, len(all_task), data))
table.print_table()

10
test.bench Normal file
View File

@ -0,0 +1,10 @@
INPUT(1)
INPUT(2)
INPUT(3)
OUTPUT(5)
4 = XOR(1, 2)
5 = XOR(3, 4)

515
test.cnf Normal file
View File

@ -0,0 +1,515 @@
p cnf 196 514
-37 -1 0
37 1 0
-38 -2 0
38 2 0
-39 -4 0
39 4 0
-40 -6 0
40 6 0
-41 -8 0
41 8 0
-42 -10 0
42 10 0
-43 -12 0
43 12 0
-44 -14 0
44 14 0
-45 -16 0
45 16 0
-46 -18 0
46 18 0
-47 -20 0
47 20 0
-48 -22 0
48 22 0
-49 -24 0
49 24 0
-50 -26 0
50 26 0
-51 -28 0
51 28 0
-52 -30 0
52 30 0
-53 -32 0
53 32 0
-54 -34 0
54 34 0
55 37 0
55 2 0
-37 -2 -55 0
3 38 56 0
-56 -3 0
-56 -38 0
5 38 57 0
-57 -5 0
-57 -38 0
58 39 0
58 6 0
-39 -6 -58 0
61 41 0
61 10 0
-41 -10 -61 0
64 43 0
64 14 0
-43 -14 -64 0
67 45 0
67 18 0
-45 -18 -67 0
70 47 0
70 22 0
-47 -22 -70 0
73 49 0
73 26 0
-49 -26 -73 0
76 51 0
76 30 0
-51 -30 -76 0
79 53 0
79 34 0
-53 -34 -79 0
7 40 59 0
-59 -7 0
-59 -40 0
9 40 60 0
-60 -9 0
-60 -40 0
11 42 62 0
-62 -11 0
-62 -42 0
13 42 63 0
-63 -13 0
-63 -42 0
15 44 65 0
-65 -15 0
-65 -44 0
17 44 66 0
-66 -17 0
-66 -44 0
19 46 68 0
-68 -19 0
-68 -46 0
21 46 69 0
-69 -21 0
-69 -46 0
23 48 71 0
-71 -23 0
-71 -48 0
25 48 72 0
-72 -25 0
-72 -48 0
27 50 74 0
-74 -27 0
-74 -50 0
29 50 75 0
-75 -29 0
-75 -50 0
31 52 77 0
-77 -31 0
-77 -52 0
33 52 78 0
-78 -33 0
-78 -52 0
35 54 80 0
-80 -35 0
-80 -54 0
36 54 81 0
-81 -36 0
-81 -54 0
-82 55 0
-82 58 0
-82 61 0
-82 64 0
-82 67 0
-82 70 0
-82 73 0
-82 76 0
-82 79 0
-55 -58 -61 -64 -67 -70 -73 -76 -79 82 0
-83 -82 0
83 82 0
-84 -82 0
84 82 0
-85 -82 0
85 82 0
-86 -83 -55 0
-86 83 55 0
86 -83 55 0
86 83 -55 0
-87 -83 -58 0
-87 83 58 0
87 -83 58 0
87 83 -58 0
-88 -83 -61 0
-88 83 61 0
88 -83 61 0
88 83 -61 0
-89 -83 -64 0
-89 83 64 0
89 -83 64 0
89 83 -64 0
-90 -83 -67 0
-90 83 67 0
90 -83 67 0
90 83 -67 0
-91 -83 -70 0
-91 83 70 0
91 -83 70 0
91 83 -70 0
95 1 0
95 84 0
-1 -84 -95 0
-92 -83 -73 0
-92 83 73 0
92 -83 73 0
92 83 -73 0
96 84 0
96 4 0
-84 -4 -96 0
-93 -83 -76 0
-93 83 76 0
93 -83 76 0
93 83 -76 0
97 84 0
97 8 0
-84 -8 -97 0
-94 -83 -79 0
-94 83 79 0
94 -83 79 0
94 83 -79 0
98 84 0
98 12 0
-84 -12 -98 0
99 84 0
99 16 0
-84 -16 -99 0
100 84 0
100 20 0
-84 -20 -100 0
101 84 0
101 24 0
-84 -24 -101 0
102 84 0
102 28 0
-84 -28 -102 0
103 84 0
103 32 0
-84 -32 -103 0
104 86 0
104 56 0
-86 -56 -104 0
105 86 0
105 57 0
-86 -57 -105 0
106 87 0
106 59 0
-87 -59 -106 0
108 88 0
108 62 0
-88 -62 -108 0
110 89 0
110 65 0
-89 -65 -110 0
112 90 0
112 68 0
-90 -68 -112 0
114 91 0
114 71 0
-91 -71 -114 0
116 92 0
116 74 0
-92 -74 -116 0
118 93 0
118 77 0
-93 -77 -118 0
120 94 0
120 80 0
-94 -80 -120 0
107 87 0
107 60 0
-87 -60 -107 0
109 88 0
109 63 0
-88 -63 -109 0
111 89 0
111 66 0
-89 -66 -111 0
113 90 0
113 69 0
-90 -69 -113 0
115 91 0
115 72 0
-91 -72 -115 0
117 92 0
117 75 0
-92 -75 -117 0
119 93 0
119 78 0
-93 -78 -119 0
121 94 0
121 81 0
-94 -81 -121 0
-130 104 0
-130 106 0
-130 108 0
-130 110 0
-130 112 0
-130 114 0
-130 116 0
-130 118 0
-130 120 0
-104 -106 -108 -110 -112 -114 -116 -118 -120 130 0
-122 -105 0
122 105 0
-123 -107 0
123 107 0
-124 -109 0
124 109 0
-125 -111 0
125 111 0
-126 -113 0
126 113 0
-127 -115 0
127 115 0
-128 -117 0
128 117 0
-129 -119 0
129 119 0
-131 -121 0
131 121 0
-132 -130 0
132 130 0
-133 -130 0
133 130 0
-134 -130 0
134 130 0
-135 -132 -104 0
-135 132 104 0
135 -132 104 0
135 132 -104 0
-136 -132 -106 0
-136 132 106 0
136 -132 106 0
136 132 -106 0
-137 -132 -108 0
-137 132 108 0
137 -132 108 0
137 132 -108 0
-138 -132 -110 0
-138 132 110 0
138 -132 110 0
138 132 -110 0
144 3 0
144 133 0
-3 -133 -144 0
-139 -132 -112 0
-139 132 112 0
139 -132 112 0
139 132 -112 0
145 133 0
145 7 0
-133 -7 -145 0
-140 -132 -114 0
-140 132 114 0
140 -132 114 0
140 132 -114 0
146 133 0
146 11 0
-133 -11 -146 0
-141 -132 -116 0
-141 132 116 0
141 -132 116 0
141 132 -116 0
147 133 0
147 15 0
-133 -15 -147 0
-142 -132 -118 0
-142 132 118 0
142 -132 118 0
142 132 -118 0
148 133 0
148 19 0
-133 -19 -148 0
-143 -132 -120 0
-143 132 120 0
143 -132 120 0
143 132 -120 0
149 133 0
149 23 0
-133 -23 -149 0
150 133 0
150 27 0
-133 -27 -150 0
151 133 0
151 31 0
-133 -31 -151 0
152 133 0
152 35 0
-133 -35 -152 0
153 135 0
153 122 0
-135 -122 -153 0
154 136 0
154 123 0
-136 -123 -154 0
155 137 0
155 124 0
-137 -124 -155 0
156 138 0
156 125 0
-138 -125 -156 0
157 139 0
157 126 0
-139 -126 -157 0
158 140 0
158 127 0
-140 -127 -158 0
159 141 0
159 128 0
-141 -128 -159 0
160 142 0
160 129 0
-142 -129 -160 0
161 143 0
161 131 0
-143 -131 -161 0
-162 153 0
-162 154 0
-162 155 0
-162 156 0
-162 157 0
-162 158 0
-162 159 0
-162 160 0
-162 161 0
-153 -154 -155 -156 -157 -158 -159 -160 -161 162 0
-163 -162 0
163 162 0
-164 -162 0
164 162 0
165 5 0
165 163 0
-5 -163 -165 0
166 163 0
166 9 0
-163 -9 -166 0
167 163 0
167 13 0
-163 -13 -167 0
168 163 0
168 17 0
-163 -17 -168 0
169 163 0
169 21 0
-163 -21 -169 0
170 163 0
170 25 0
-163 -25 -170 0
171 163 0
171 29 0
-163 -29 -171 0
172 163 0
172 33 0
-163 -33 -172 0
173 163 0
173 36 0
-163 -36 -173 0
174 2 0
174 95 0
174 144 0
174 165 0
-2 -95 -144 -165 -174 0
175 96 0
175 145 0
175 166 0
175 6 0
-96 -145 -166 -6 -175 0
176 97 0
176 146 0
176 167 0
176 10 0
-97 -146 -167 -10 -176 0
177 98 0
177 147 0
177 168 0
177 14 0
-98 -147 -168 -14 -177 0
178 99 0
178 148 0
178 169 0
178 18 0
-99 -148 -169 -18 -178 0
179 100 0
179 149 0
179 170 0
179 22 0
-100 -149 -170 -22 -179 0
180 101 0
180 150 0
180 171 0
180 26 0
-101 -150 -171 -26 -180 0
181 102 0
181 151 0
181 172 0
181 30 0
-102 -151 -172 -30 -181 0
182 103 0
182 152 0
182 173 0
182 34 0
-103 -152 -173 -34 -182 0
-183 -174 0
183 174 0
-188 175 0
-188 176 0
-188 177 0
-188 178 0
-188 179 0
-188 180 0
-188 181 0
-188 182 0
-175 -176 -177 -178 -179 -180 -181 -182 188 0
-184 -177 0
184 177 0
-185 -179 0
185 179 0
-186 -180 0
186 180 0
-187 -181 0
187 181 0
183 188 193 0
-193 -183 0
-193 -188 0
189 176 0
189 184 0
-176 -184 -189 0
190 176 0
190 177 0
190 185 0
190 178 0
-176 -177 -185 -178 -190 0
191 178 0
191 177 0
191 186 0
-178 -177 -186 -191 0
192 176 0
192 177 0
192 180 0
192 187 0
-176 -177 -180 -187 -192 0
194 175 0
194 176 0
194 189 0
194 178 0
-175 -176 -189 -178 -194 0
195 175 0
195 176 0
195 190 0
195 191 0
-175 -176 -190 -191 -195 0
196 175 0
196 189 0
196 190 0
196 192 0
-175 -189 -190 -192 -196 0