B+E and d4 Emmanuel Lonca CRIL, Université d’Artois 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 : a compiler and a reasoner ◮ pddl2cnf, cnf2eadt, ... 2/15
B+E ◮ B+E : preprocessor initialy designed for model counting ◮ based on variable definability (gates) detection 3/15
Definability Exploiting definability for model counting, the old (pmc) way : ◮ replacing a variable by its definition ◮ gate replacement exploits explicit definitions 4/15
Definability Exploiting definability for model counting, the old (pmc) way : ◮ replacing a variable by its definition ◮ gate replacement exploits explicit definitions ◮ for k variables, 2 2 k possible gates 4/15
Definability Exploiting definability for model counting, the old (pmc) way : ◮ replacing a variable by its definition ◮ gate replacement exploits explicit definitions ◮ for k variables, 2 2 k possible gates ◮ restricted to some gates (AND, XOR, ...) 4/15
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 : ∃ Φ ∈ PROP X s.t. Σ | = Φ X ↔ y ◮ implicit definability : ∀ γ X over X , γ X ∧ Σ | = y or γ X ∧ Σ | = ¬ y 5/15
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 : ∃ Φ ∈ PROP X s.t. Σ | = Φ X ↔ y ◮ implicit definability : ∀ γ X over X , γ X ∧ Σ | = y or γ X ∧ Σ | = ¬ y Beth, 1953 : implicit and explicit definability coincide 5/15
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 : ∃ Φ ∈ PROP X s.t. Σ | = Φ X ↔ y ◮ implicit definability : ∀ γ X over X , γ X ∧ Σ | = y or γ X ∧ Σ | = ¬ y Padoa, 1903 : X ∧ y ∧ ¬ y ′ | Σ defines y in terms of X iff Σ ∧ Σ ′ = ⊥ 5/15
B+E B+E = Bipartition + Eliminate Algorithm 1: B input : a CNF formula Σ output : 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 if defined ?( x , Σ , I ∪ succ ( x , V ) , max # C ) then 5 O ← O ∪ { x } ; 6 else 7 I ← I ∪ { x } ; 8 9 return O 6/15
B+E B+E = Bipartition + Eliminate Algorithm 2: E input : a CNF formula Σ and a set of output variables O ⊆ Var (Σ) output : a CNF formula Φ such that Φ ≡ ∃ E . Σ for some E ⊆ O 1 Φ ← Σ ; iterate ← true ; P ← O ; 2 while iterate do E ← P ; P ←∅ ; iterate ← false ; 3 while E � = ∅ do 4 x ← select ( E , Φ) ; E ← E \ { x } ; 5 if #(Φ x ) × #(Φ ¬ x ) > max # Res then 6 P ← P ∪ { x } 7 else 8 R ← removeSub ( Res ( x , Φ) , Φ) ; 9 if #((Φ \ Φ x , ¬ x ) ∪ R ) ≤ #(Φ) then 10 Φ ← (Φ \ Φ x , ¬ x ) ∪ R ; 11 iterate ← true ; 12 else P ← P ∪ { x } ; 13 14 return Φ 6/15
Variable reduction 7/15
Literal reduction 8/15
Solved (d4) 9/15
B+E and compilation ◮ KOCOON → MC KC ◮ B+E (Σ) �≡ Σ 10/15
B+E and compilation ◮ KOCOON → MC KC ◮ B+E (Σ) �≡ Σ but B+E( Σ ) can be queried if only variables of I are involved 10/15
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
B+E and compilation 11/15
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
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
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
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
B+E and d4 Emmanuel Lonca CRIL, Université d’Artois and CNRS KOCOON workshop, 18 dec 2019 15/15
Recommend
More recommend