LEXSAT
find the minimum satisfying assignment:
- Initialize an all-zero array A
- 遍历 MSB->LSB
Algorithm 1 [2]
Algorithm 2(Knuth)
可视作一个LEX优化问题:
m i n : l e x min: lex min:lex
s . t . s.t. s.t. All satisfying assignment for the given CNF
find the maximum satisfying assignment:
- Initialize an all-one array A
- 遍历 MSB->LSB
Moreover, find the closet larger or smaller assignment of the present asignment
Fomulation:
m
i
n
:
∣
a
s
s
′
−
a
s
s
∣
min: |ass'-ass|
min:∣ass′−ass∣
s
.
t
.
s.t.
s.t.
∣
a
s
s
′
−
a
s
s
≠
0
∣
|ass'-ass\neq 0|
∣ass′−ass=0∣
Heuristic NPN Classification
Main idea:
Given a Boolean function
f
f
f, find its corresponding NPN class representative
r
(
f
)
r(f)
r(f)
<=> find the smallest lex function in its NPN class
[
f
]
[f]
[f]
=relax=> 在遍历的NPN等价的functions中找出LEX minimum Boolean functions (找到局部最优解 )。
Encoding as a lex optimization problem
- encode the truth table as lex, such as:
- Example
OR gate f ( X ) = x 1 ∨ x 2 f(X)=x_1 \lor x_2 f(X)=x1∨x2, its corresponding lex is 0111 0111 0111 ( 0 0 0 corresponds to the function value with the assignment 00 00 00). Its NPN class representative r ( f ) = x ˉ 1 ∨ x ˉ 2 ‾ r(f)=\overline{ \bar{x}_{1} \vee \bar{x}_{2}} r(f)=xˉ1∨xˉ2 has a lex 0001 0001 0001 smaller than 0111 0111 0111.
- Given two NPN equal Boolean functions
g
g
g and
h
h
h, then
g
<
h
g < h
g<h if and only if:
g ≠ h g\neq h g=h and g ( m i n ( g ⊕ h ) ) = 0 g(min(g\oplus h))=0 g(min(g⊕h))=0
- Example
g = x 1 ∨ x 2 g=x_1 \lor x_2 g=x1∨x2 , h = x ˉ 1 ∨ x ˉ 2 ‾ h=\overline{ \bar{x}_{1} \vee \bar{x}_{2}} h=xˉ1∨xˉ2. m i n ( g ⊕ h ) = 01 min(g\oplus h)=01 min(g⊕h)=01 and g ( 01 ) = 0 g(01)=0 g(01)=0. Thus g < h g<h g<h.
- NPN(Input negation&Variable Permuation&Output negation) Class
布尔函数 f ( x ) f(x) f(x),它的NPN class定义为 [ f ] [f] [f],另外一个布尔函数 g ( x ) g(x) g(x), f f f和 g g g是NPN等价,当且仅当 [ f ] = [ g ] [f]=[g] [f]=[g]。 [ f ] [f] [f]的 NPN class representative定义为 r ( f ) r(f) r(f)( r ( f ) ≤ l e x g r(f)\le_{lex} g r(f)≤lexg for ∀ g ∈ [ f ] \forall g \in[f] ∀g∈[f])。
- Example
f ( X ) = x 1 ∨ x 2 f(X)=x_1 \lor x_2 f(X)=x1∨x2 => r ( f ) = x ˉ 1 ∨ x ˉ 2 ‾ r(f)=\overline{ \bar{x}_{1} \vee \bar{x}_{2}} r(f)=xˉ1∨xˉ2
- As NPN equal can be easily achieved in AIG, the NPN classification is implemented through AIG. The algorithm consists of three steps [1]:
[1] Soeken M , Mishchenko A , Petkovska A , et al. Heuristic NPN Classification for Large Functions Using AIGs and LEXSAT[C]// International Conference on Theory and Applications of Satisfiability Testing. Springer International Publishing, 2016.
[2] Mishchenko A , Brayton R , Petkovska A , et al. Canonical computation without canonical representation[C]// the 55th Annual Design Automation Conference. 2018.