B+E and d4 Emmanuel Lonca CRIL, Universit dArtois and CNRS KOCOON - - PowerPoint PPT Presentation

b e and d4
SMART_READER_LITE
LIVE PREVIEW

B+E and d4 Emmanuel Lonca CRIL, Universit dArtois and CNRS KOCOON - - PowerPoint PPT Presentation

B+E and d4 Emmanuel Lonca CRIL, Universit dArtois and CNRS KOCOON workshop, 18 dec 2019 1/15 Outline One talk, two tools ! B+E : a preprocessor d4 : a compiler 2/15 Outline One talk, many tools ! B+E : a preprocessor d4


slide-1
SLIDE 1

B+E and d4

Emmanuel Lonca

CRIL, Université d’Artois and CNRS

KOCOON workshop, 18 dec 2019

1/15

slide-2
SLIDE 2

Outline

One talk, two tools !

◮ B+E : a preprocessor ◮ d4 : a compiler

2/15

slide-3
SLIDE 3

Outline

One talk, many tools !

◮ B+E : a preprocessor ◮ d4 : a compiler and a reasoner ◮ pddl2cnf, cnf2eadt, ...

2/15

slide-4
SLIDE 4

B+E

◮ B+E : preprocessor initialy designed for model counting ◮ based on variable definability (gates) detection

3/15

slide-5
SLIDE 5

Definability

Exploiting definability for model counting, the old (pmc) way :

◮ replacing a variable by its definition ◮ gate replacement exploits explicit definitions

4/15

slide-6
SLIDE 6

Definability

Exploiting definability for model counting, the old (pmc) way :

◮ replacing a variable by its definition ◮ gate replacement exploits explicit definitions

◮ for k variables, 22k possible gates 4/15

slide-7
SLIDE 7

Definability

Exploiting definability for model counting, the old (pmc) way :

◮ replacing a variable by its definition ◮ gate replacement exploits explicit definitions

◮ for k variables, 22k possible gates ◮ restricted to some gates (AND, XOR, ...) 4/15

slide-8
SLIDE 8

Implicit vs. explicit definability

One does not need to identify the gates themselves but it can be enough to determine that such gates exist ! Let Σ ∈ L, X ⊆ P and y ∈ P :

◮ explicit definability : ∃Φ ∈ PROPX s.t. Σ |

= ΦX ↔ y

◮ implicit definability : ∀γX over X, γX ∧ Σ |

= y or γX ∧ Σ | = ¬y

5/15

slide-9
SLIDE 9

Implicit vs. explicit definability

One does not need to identify the gates themselves but it can be enough to determine that such gates exist ! Let Σ ∈ L, X ⊆ P and y ∈ P :

◮ explicit definability : ∃Φ ∈ PROPX s.t. Σ |

= ΦX ↔ y

◮ implicit definability : ∀γX over X, γX ∧ Σ |

= y or γX ∧ Σ | = ¬y Beth, 1953 : implicit and explicit definability coincide

5/15

slide-10
SLIDE 10

Implicit vs. explicit definability

One does not need to identify the gates themselves but it can be enough to determine that such gates exist ! Let Σ ∈ L, X ⊆ P and y ∈ P :

◮ explicit definability : ∃Φ ∈ PROPX s.t. Σ |

= ΦX ↔ y

◮ implicit definability : ∀γX over X, γX ∧ Σ |

= y or γX ∧ Σ | = ¬y Padoa, 1903 : Σ defines y in terms of X iff Σ ∧ Σ′

X ∧ y ∧ ¬y′ |

= ⊥

5/15

slide-11
SLIDE 11

B+E

B+E = Bipartition + Eliminate

Algorithm 1: B input : a CNF formula Σ

  • utput: a set O of output variables, i.e., variables defined in Σ in

terms of I = Var(Σ) \ O

1 Σ, O← backbone(Σ); 2 V ← sort(Var(Σ)); 3 I←∅; 4 foreach x ∈ V do 5

if defined?(x, Σ, I ∪ succ(x, V ), max#C) then

6

O←O ∪ {x};

7

else

8

I←I ∪ {x};

9 return O 6/15

slide-12
SLIDE 12

B+E

B+E = Bipartition + Eliminate

Algorithm 2: E input : a CNF formula Σ and a set of output variables O ⊆ Var(Σ)

  • utput: a CNF formula Φ such that Φ ≡ ∃E.Σ for some E ⊆ O

1 Φ←Σ ; iterate←true ; P←O; 2 while iterate do 3

E←P ; P←∅ ; iterate←false;

4

while E = ∅ do

5

x←select(E, Φ) ; E←E \ {x};

6

if #(Φx) × #(Φ¬x) > max#Res then

7

P←P ∪ {x}

8

else

9

R←removeSub(Res(x, Φ), Φ);

10

if #((Φ \ Φx,¬x) ∪ R) ≤ #(Φ) then

11

Φ←(Φ \ Φx,¬x) ∪ R;

12

iterate←true;

13

else P←P ∪ {x};

14 return Φ 6/15

slide-13
SLIDE 13

Variable reduction

7/15

slide-14
SLIDE 14

Literal reduction

8/15

slide-15
SLIDE 15

Solved (d4)

9/15

slide-16
SLIDE 16

B+E and compilation

◮ KOCOON → MC KC ◮ B+E(Σ) ≡ Σ

10/15

slide-17
SLIDE 17

B+E and compilation

◮ KOCOON → MC KC ◮ B+E(Σ) ≡ Σ but B+E(Σ) can be queried if only variables of I

are involved

10/15

slide-18
SLIDE 18

B+E and compilation

◮ KOCOON → MC KC ◮ B+E(Σ) ≡ Σ but B+E(Σ) can be queried if only variables of I

are involved

◮ some positive results for planning

◮ PDDL → CNF ◮ B+E with I containing all action, initial state and goal variables 10/15

slide-19
SLIDE 19

B+E and compilation

11/15

slide-20
SLIDE 20

B+E and compilation

◮ B+E very efficient for MC, and may help for KC (planning) ◮ https ://www.cril.univ-artois.fr/KC/bpe2.html

12/15

slide-21
SLIDE 21

B+E and compilation

◮ B+E very efficient for MC, and may help for KC (planning) ◮ https ://www.cril.univ-artois.fr/KC/bpe2.html ◮ send your benchmarks to compile@cril.fr

12/15

slide-22
SLIDE 22

Compile ! project

The purpose of the Compile ! project is to make available on the Web some ressources, especially pieces of software developed at CRIL, which are somehow relevant to knowledge compilation purposes.

◮ translators : bn2cnf, cn2cnf, pddl2cnf, whatever2cnf, tt2bm ◮ preprocessors : pmc, B+E ◮ counters and compilers : several tools including dmc and d4

See the Compile ! project homepage

13/15

slide-23
SLIDE 23

d4

◮ d4 can now execute queries on d-DNNF (interactive shell)

◮ conditioning ◮ consistency check (under assumptions) ◮ model counting (under assumptions) ◮ linear optimization (query + transform)

◮ and load/save them

14/15

slide-24
SLIDE 24

B+E and d4

Emmanuel Lonca

CRIL, Université d’Artois and CNRS

KOCOON workshop, 18 dec 2019

15/15