1 A Paper Presentation on “ DETERMINING NEED FOR CNF TO DNF CONVERSION BY IMPLEMENING POLYNOMIAL...

Post on 12-Jan-2016

222 views 3 download

Tags:

Transcript of 1 A Paper Presentation on “ DETERMINING NEED FOR CNF TO DNF CONVERSION BY IMPLEMENING POLYNOMIAL...

1

APaper Presentation

on

“DETERMINING NEED FOR CNF TO DNF CONVERSION BY IMPLEMENING

POLYNOMIAL ALGORITHMS USING GRID COMPUTING IN PARALLEL”

Presented By: Mayuresh S. Pardeshi

M. Tech

Department of Computer Science and Engineering. Walchand College of Engineering, Sangli.

2

I. Problem statement

II. Objectives

III. Schedule

IV. Literature survey

V. Methodology

VI. Results

Contents

Problem Statement

Recently, high dimension optimal conjunctive normal form to optimal(prime implicants) disjunctive normal form conversion is considered to be as an NP hard problem. So we will be converting it to an NP complete.

3

Objectives:

1. Conversion of NP hard problem to NP complete.

2. Achieve maximum simplification of boolean functions.

3. Operations on high dimension data as much as possible.

4. Improve performance by utilizing grid resources in parallel.

4

Schedule:

5

Literature Survey: On Converting CNF to DNF

CNF with m clauses with k literals converted to DNF with K m .

dnfsize(f) and cnfsize(f) are fundamental complexity measures.

f : {0,1}n -> {0,1}

No. of prime clauses of f is equal to cnfsize(f) and prime implicants of f is equal to dnfsize(f).

Blow-up when going from CNF to DNF is large

Monotone case:

2. Functions with large blow-up

Functions with small cnfsize but large dnfsize.

Functions with conjunction of small parity and majority functions.

Lemma to estimate cnfsize and dnfsize of such functions.

Corollary 1 Let 2n≤m≤2n-1. There is a function f with cnfsize(f) ≤ m and

dnfsize(f)≥2[n-2n/log(m/n) ]

Let 4n ≤ m ≤ (n / [n/2]). Then, there is a monotone function h with cnfsize(h) ≤ m and dnfsize(h) ≥ 2[n-nloglog(m/n) ]/log(m/n) – log(m/n) .

3. Upper Bounds on the Blow-up

Lemma-2: For all S c V and all boolean functions f with variable V, dnfsize(f) ≤ ΣpєRS ^V dnfsize(fp)

Upper and Lower Bounds on the Number of Disjunctive Forms:

• Upper and lower bounds on the number of disjunctive (normal) forms of an n-variable Boolean function.

• We use a one-to-one correspondence between the disjunctive forms and the antichains in the ternary n-cube which is isomorphic to the partially ordered set formed by all terms of the given function.

• For the lower bounds, we evaluate the number of anticains in the cube by analyzing the dependency among the three consecutive layers instead of two.

9

• Logic function is usually represented by a disjunctive form.

• Counting disjunctive forms is equivalent to counting the elements of a distributive lattice.

• Number of elements of a finite distributive lattice is equal to the number of antichains in the partial ordered set formed from its irreducible elements.

• An n-variable logic (or Boolean) function is a map f : Bn → B

• Let Pn2

denote set of all n-variable logic functions.

• A term is a product of literals where each index i appears at most once, i.e., no literals x i and ~x i appears in it simultaneously.

10

Methodology:

11

Algorithms

12

Algorithm for Multi-Line Boole

Example:

We save the first step and define f B∈ 4 by Q4 , the set of implicants of length 4.

Q4: Q4,4 = ø , Q4,3 = {a b c d ; a b c d }, Q4,2 = {a b c d ; a b c d ; a b c d },

Q4,1 = {a b c d ; a b c d ; a b c d}, Q4,0 = {a b c d} .

Q3: Q3,3 = ø , Q3,2 = {a b c ; a b c ; b c d }

Q3,1 = {a b d ; a c d ; a b c ; a c d ; b c d }, Q3,0 = {a b c ; a c d ; b c d },

P4 = ø.

Q2: Q2,2 = ø , Q2;1 = {b c} , Q2;0 = {c d ; a c}

P3 = {a b c; a b d} .

Q1 = ø .

P2 = Q2 .

 PI(f) = { a b ; ac ; a d }:

14

Results for Multi-Line boole’s algorithm:

Result of CNF conversion:

Problem statement taken is:

∀x [ y Animal(y) Loves(x, y)] [ y Loves(y, x)]∀ ⇒ ⇒ ∃

Solution achieved using coding:

1. Eliminate implications: x [¬ y ¬Animal(y) Loves(x, y)] [ y Loves(y, x)]∀ ∀ ∨ ∨ ∃2. Move ¬ inwards

• ∀x [ y ¬(¬Animal(y) Loves(x, y))] [ y Loves(y, x)]∃ ∨ ∨ ∃• ∀x [ y ¬¬Animal(y) ¬Loves(x, y)] [ y Loves(y, x)] (De Morgan)∃ ∧ ∨ ∃• ∀x [ y Animal(y) ¬Loves(x, y)] [ y Loves(y, x)] (double negation)∃ ∧ ∨ ∃3. Standardize variables: x [ y Animal(y) ¬Loves(x, y)] [ z Loves(z, x)]∀ ∃ ∧ ∨ ∃4. Skolemization: x [Animal(F(x)) ¬Loves(x, F(x))] [Loves(G(x), x)]∀ ∧ ∨5. Drop universal quantifiers: [Animal(F(x)) ¬Loves(x, F(x))] [Loves(G(x), ∧ ∨

x)]

6. Distribute over : [Animal(F(x)) Loves(G(x), x)] [¬Loves(x, F(x)) ∨ ∧ ∨ ∧ ∨Loves(G(x), x)]

15

IRIS CNF dataset (DIMACS format)

p cnf 100 160

16 30 95 0

-16 30 95 0

-30 35 78 0

-30 -78 85 0

-78 -85 95 0

8 55 100 0

8 55 -95 0

9 52 100 0

9 73 -100 0

-8 -9 52 0

38 66 83 0

-38 83 87 0

-52 83 -87 0

66 74 -83 0

-52 -66 89 0

-52 73 -89 0

-52 73 -74 0

-8 -73 -95 0

16

Conversion tree and exponential blow-up

17

Final result using MS Compute Cluster

18

Result of 5 clause conversion:

19

Consensus tree Resolution tree

20

Graph analysis of results

21

1 2 3 4 5 6 7 8 90

2000

4000

6000

8000

10000

12000

14000

16000

18000

20000

Clauses

Consensus

Resolution

Output

Clause Consensus Resolution Output

1 1 1 3

2 2 3 9

3 7 9 27

4 20 27 81

5 60 81 243

6 180 243 723

7 540 723 2187

8 1800 2187 6561

9 5750 6561 19683

Remaining work

1. Implementation of algorithm using MPICH-G2, a globus tool for inherent parallelism in grid computing.

2. Improvement in terms of reduction in complexity.

22

23

REFERENCES:

[1] Wegener, I. , The Complexity of Boolean Functions , John Wiley & Sons Ltd, and B. G. Teubner, Stuttgart.

[2] Peter Bro Miltersen, Jaikumar Radhakrishnan and Ingo Wegener On Converting CNF To DNF Electronic Colloquium on Computational Complexity, Report No. 17 (2003)

[3] Hisayuki TATSUMI , Masahiro MIYAKAWA Masao MUKAIDONO , Upper and Lower Bounds on the Number of Disjunctive Forms , Proceedings of the 36th International Symposium on Multiple-Valued Logic (ISMVL’06), IEEE computer society.

[4] Paul Beame, A Switching Lemma Primer, University of Toronto.

[5] Rajat Auora and Michael S. Hsiao, CNF Formula Simplication Using Implication Reasoning" 0-7803-8714-7104 2004 IEEE Transactions.

[6] Kenneth H. Rosen, Discrete Mathematics and It's Applications , 6 th Edition, CRC Press.

[7] Wahid Chrabakh , Rich Wolski , GrADSAT: A Parallel SAT Solver for the Grid, UCSB Computer Science Technical Report Number 2003-05, Department of Computer Science, University of California Santa Barbara

[8] R. Zuim, J.T. de Sousa and C.N. Coelho, Decision heuristic for Davis Putnam, Loveland and Logemann algorithm satisability solving based on cube subtraction, IET Comput. Digit. Tech., 2008, 2, (1), pp. 3039

[9] Manoj K. Raut and Arindama Singh, Prime Implicates of First Order Formulas IITM, International Journal of Computer Science & Applications.

[10] Gi-Joon Nam, Fadi Aloul, A Comparative Study of Two Boolean Formulations of FPGA Detailed Routing Constraints, IEEE TRANSACTIONS ON COMPUTERS, VOL. 53, NO. 6, JUNE 2004.

[11] Marcus Fontoura, Suhas Sadanandan, Jayavel Shanmugasundaram Sergei Vassilvitski, Erik Vee, Srihari Venkatesan, Jason Zien, Eciently Evaluating Complex Boolean Expressions, SIGMOD10, June 611, 2010, Indianapolis, Indiana, USA.

[12] Dragos Sbirlea, Quine McKluskey Algorithm,

http://www.codeproject.com/Articles/15756/Quine-McKluskey- Algorithm

[13] Prof. Michael B. Feldman, BINARY TREES, The George Washington University http://www.seas.gwu.edu/~csci133/fall05

[14] Douglas Gregor and Benjamin Martin, MPI.NET Tutorial in C#, Indiana University.

24

Thank You

25