Symmetry Detection in Boolean Functions - PowerPoint PPT Presentation

1 / 38
About This Presentation
Title:

Symmetry Detection in Boolean Functions

Description:

Let us define the operator as Exclusive-OR, which means P Q is true if and only ... Computer-Aided Design, vol. 10, No. 4, Apr. 1991. ... – PowerPoint PPT presentation

Number of Views:165
Avg rating:5.0/5.0
Slides: 39
Provided by: staceyba
Category:

less

Transcript and Presenter's Notes

Title: Symmetry Detection in Boolean Functions


1
Symmetry Detection in Boolean Functions
  • Stacey Balamucki
  • Dan Steffy
  • Advisor Dr. Debnath

2
Outline
  • Problem Description
  • Applications
  • Background
  • Method
  • Implementation
  • Results
  • Conclusions

3
Project Objective
  • Our goal was to develop a system to detect
    symmetry between variables in Boolean functions

4
Applications
  • More efficient algorithms for circuit design
  • Applications in Boolean matching
  • Building BDDs (Binary Decision Diagrams)
  • Digital Circuit Testing
  • Circuit Verification

5
What is Symmetry?
  • A Boolean function is said to be totally
    symmetric if it remains invariant under any
    permutation of its variables
  • A Boolean function is said to be partially
    symmetric around some subset of its variables if
    it is invariant with respect to any permutation
    of those variables

6
Checking for Symmetry
  • Let f be a Boolean function with inputs x and y
  • To check for symmetry between x and y in f,
    create a new function g which is identical to f
    except that x and y are switched
  • If we find that f g then we may conclude that f
    is symmetric with respect to x and y

7
Equality of Boolean Functions
  • Given two n-variable Boolean functions f and g,
    it is not easy to check if f g
  • There are 2n different inputs, so checking each
    one is impossible for large values of n
  • This is where we can turn to Boolean
    Satisfiabilty for help

8
Exclusive-OR
  • Let us define the operator ? as Exclusive-OR,
    which means P ? Q is true if and only if P or Q
    is true, but P and Q are not both true

9
Using XOR (cont.)
  • If f g, then f ? g will always be false since
    (true ? true) (false ? false) false
  • If f ? g then there must exist some input X such
    that f (X) ? g (X), in which case f (X) ? g (X)
    would be true
  • Therefore f ? g will always be false if and only
    if f g

10
Fixing Variable Assignments
  • For some variables x,y, let f10(X) represent
    f(X) with x,y fixed as 1,0
  • For x,y, let f01(X) represent f(X) with x,y
    fixed as 0,1
  • For example
  • f01(X) f ( ,0,1,)
  • f10(X) f ( ,1,0,)

x y
11
Looking for Symmetry
  • Checking to see if f10(X) f01(X) is sufficient
    to detect symmetry
  • In order to use this method we must be able to
    check equality of Boolean functions efficiently

12
SAT Solver and Exclusive-OR
  • We may now use the Exclusive-OR function with a
    SAT solver to find symmetry
  • Send f10? f01 to the SAT solver
  • The function f10? f01 is unsatisfiable if and
    only if f10(X) f01(X)
  • This is true if and only if f is symmetric with
    respect to x,y

13
SAT Solver Specifications
  • We use zChaff, currently one of the best SAT
    solver according to the SAT 2003 Competition
  • zChaff requires that input is in a special form
    known as CNF form (conjunctive normal form)

14
File Formats
  • Benchmarking samples and the problems that we
    tested were not in CNF form
  • We developed a method to convert general Boolean
    functions in blif format into CNF form
  • We have implemented our method in C

15
Blif to CNF
  • Converting the blif file to CNF is a somewhat
    difficult task
  • Our program successfully converts a blif file
    into CNF format

16
Blif Format
  • This is an example of a blif file
  • .model ABC
  • .inputs a b c
  • .outputs d e
  • .names a b d
  • 10 1
  • - 1 1
  • .names b c e
  • 11 1
  • 0 - 1
  • .end
  • Each line that starts with .names starts another
    logic block

a
b
d
a/a
b
17
CNF Format
  • CNF format consists of several literals ORed
    together inside clauses that are ANDed together
  • f (a,b,c,d) (a d)(c d)(a b c)

clause
literal
18
Reading Blif File
  • The program uses two buffers (Word, Buffer) to
    grab one line at a time in the file
  • We do some comparisons with the first word of the
    line to see what kind of line it is (e.g. input,
    output, names)
  • When we find a match we send it to the
    corresponding IF statement

19
Compare Word Buffer
20
Storing Variables
  • We store all the variables in a list and organize
    it between input, output, and temp variables.

A (INPUT)
B(OUTPUT)
C (TEMP)
Variable is inserted into the array as either an
input, output or temp variable
21
Converting to CNF
  • The logic blocks within the BLIF file represent
    logical relationships between the variables
  • These logical relationships such as equality,
    AND, and OR can be converted into CNF form
  • Each block is looked at one by one and converted
    into CNF representation

22
CNF Formulas for Simple Gates
23
Example Blif to CNF
  • Each logic block of the BLIF file represents a
    disjunction of conjunctions
  • y (ab b)
  • First we assign a temporary variable for each
    conjunction
  • y x1 x2
  • Where
  • x1 ab
  • x2 b
  • Then convert each simple statement into CNF form

24
Example (cont.)
  • Next we use the conversion formulas on the
    previous table and make clauses
  • y x1 x2
  • (x1 x2 y)(x1 y)(x2 y)
  • x1 ab
  • (a b x1)(a x1)(b x1)
  • x2 b
  • (b x2)(b x2)

25
Exclusive-OR
  • Once our function is in CNF form we must generate
    another CNF function to represent f10? f01 for
    each pair of variables that need to be checked
  • Once in this format, f10? f01 can be sent to
    zChaff to test if it is satisfiable

26
Generating f10? f01
  • Method for generating f10? f01
  • Create CNF formula to represent f10 and f01 by
    making two copies of f and fixing x, y in each of
    them as 1,0 and 0,1
  • Use an Exclusive-OR gate on the outputs of each
    of these functions
  • Convert the Exclusive-OR gate into CNF form
  • p ? q ( p q ) ( p q )
  • Combine everything into one CNF function

27
Generating f10? f01
28
Calling zChaff
  • Once we have generated f10? f01 we can send it to
    zChaff to check for Satisfiabilty
  • zChaff requires CNF format
  • The standard format used to represent CNF
    functions is called DIMACS format

29
Transitivity of Symmetry
  • Symmetry of variables in Boolean functions is
    transitive
  • This means that if a function f is symmetric with
    respect to variables x,y, and it is also
    symmetric with respect to variables y,z then we
    can conclude it is also symmetric with respect to
    x,z

30
Use of Transitivity
  • We may use the property of transitivity to our
    advantage when checking pairs of variables
  • For example, if we have already determined that f
    is symmetric with respect to x,y and y,z then
    we need do not check x,z for symmetry

31
Advantage of Using Transitivity
  • Suppose the function f has n variables and is
    totally symmetric
  • If we take advantage of transitivity we only need
    to check n-1 pairs of variables for symmetry to
    find out if the function is totally symmetric
  • Checking all possibilities would take
    n(n-1)/2 tries which could be much larger than n-1

32
Experimental Results
For more than one output we took the sizes of
the first output
33
Comparison to GRM Results
34
Conclusions
  • Use of Exclusive-OR and Satisfiabilty is a
    promising method for detecting symmetry
  • Initial results are comparable on many instances
    with leading methods
  • Further refinement of this method and combination
    with other methods could solve previously
    unsolvable instances

35
Future Work
  • Optimization of code and integration with other
    SAT solvers
  • Use of search reduction techniques to reduce the
    number of variables checked for symmetry
  • Improved methods of converting blif to CNF form
    that will generate less clauses and temporary
    variables
  • Improved methods of generating f10? f01 using
    less clauses and variables

36
Acknowledgements
  • National Science Foundation (NSF)
  • REU Program
  • Dr. D. Debnath
  • Dr. I. K. Sethi, Dr. F. Mili, Dr. J. Li
  • Mr. B. Clark
  • Dr. L. Zhang

37
References
  • T.H. Cormen, C. E. Leiseron, and R. L. Rivest,
    Introduction to Algorithms. The MIT Press, 1998.
  • S. R. Das, and C. L. Sheng, On Detecting Total
    or Partial Symmetry of Switching Functions,
    IEEE Transactions on Computers, pp.352-355, March
    1971.
  • B.- G. Kim and D.L. Dietmeyer, Multilevel Logic
    Synthesis of Symmetric Switching Functions, IEEE
    Trans. Computer-Aided Design, vol. 10, No. 4,
    Apr. 1991.
  • T. Larrabee, Test Pattern Generation using
    Boolean Satisfiabilty, IEEE Trans.
    Computer-Aided Design, vol. 11, no. 1, Jan. 1992.
  • J. P. Marques-Silva, and K. A. Sakallah, Boolean
    Satisfiabilty in Electronic Design Automation,
    ACM/IEEE Proc. Design Automation Conference, pp.
    675-680, 2000.

38
References (cont.)
  • M.W. Moskewicz, C.F. Madigan, Y. Zhao, L. Zhang,
    and S. Malik, Chaff Engineering an Efficient
    SAT Solver, 39th Design Automation Conference,
    Las Vegas, June 2001.
  • C.- C. Tsai, and M. Marek-Sadowska, Generalized
    Reed-Muller Forms as a Tool to Detect Symmetry,
    IEEE Trans. Computers, vol. 45, no. 1, Jan. 1996.
  • T. Sasao, Switching Theory for Logic Synthesis.
    Kluwer Academic Publishers, 1999.
Write a Comment
User Comments (0)
About PowerShow.com