On Definability for Model Counting Jean-Marie Lagniez 1 , Emmanuel - - PowerPoint PPT Presentation

on definability for model counting
SMART_READER_LITE
LIVE PREVIEW

On Definability for Model Counting Jean-Marie Lagniez 1 , Emmanuel - - PowerPoint PPT Presentation

On Definability for Model Counting Jean-Marie Lagniez 1 , Emmanuel Lonca 1 and Pierre Marquis 1 , 2 1 CRIL, U. Artois & CNRS 2 Institut Universitaire de France Meeting GT ALGA, GdR IM, Lille, October 15 th , 2018 Meeting GT ALGA, GdR IM, Lille,


slide-1
SLIDE 1

On Definability for Model Counting

Jean-Marie Lagniez1, Emmanuel Lonca1 and Pierre Marquis1,2

1CRIL, U. Artois & CNRS 2 Institut Universitaire de France Meeting GT ALGA, GdR IM, Lille, October 15th, 2018 1/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-2
SLIDE 2

The Beyond NP Era ash 2

◮ Key idea: Leveraging the power of modern sat solvers to tackle other intractable problems ◮ Objective: Enlarging the sets of instances which can be solved in practice using ”reasonable” resources

◮ Knowledge compilers ◮ MUS/MCS enumerators ◮ QBF solvers ◮ Model counters ◮ ...

◮ beyondnp.org

2/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-3
SLIDE 3

Model Counting ash 3

◮ Σ → Σ = ?

3/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-4
SLIDE 4

Model Counting ash 3

◮ Σ → Σ = ? ◮ Σ = (x ∨ y) ∧ (¬y ∨ z)

3/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-5
SLIDE 5

Model Counting ash 3

◮ Σ → Σ = ? ◮ Σ = (x ∨ y) ∧ (¬y ∨ z) ◮ The models of Σ over {x, y, z} are : 011 100 101 111

3/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-6
SLIDE 6

Model Counting ash 3

◮ Σ → Σ = ? ◮ Σ = (x ∨ y) ∧ (¬y ∨ z) ◮ The models of Σ over {x, y, z} are : 011 100 101 111 ◮ Σ = 4

3/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-7
SLIDE 7

Model Counting ash 4

◮ Counting the models of a propositional formula is a key task for a number of problems (especially in AI):

◮ probabilistic inference ◮ stochastic planning ◮ ...

4/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-8
SLIDE 8

Model Counting ash 4

◮ Counting the models of a propositional formula is a key task for a number of problems (especially in AI):

◮ probabilistic inference ◮ stochastic planning ◮ ...

◮ However #sat is a computationally hard task: #P-complete

4/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-9
SLIDE 9

Model Counting ash 4

◮ Counting the models of a propositional formula is a key task for a number of problems (especially in AI):

◮ probabilistic inference ◮ stochastic planning ◮ ...

◮ However #sat is a computationally hard task: #P-complete ◮ Even for subsets of formulae for which sat is easy (e.g., monotone Krom formulae)!

4/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-10
SLIDE 10

Model Counting ash 4

◮ Counting the models of a propositional formula is a key task for a number of problems (especially in AI):

◮ probabilistic inference ◮ stochastic planning ◮ ...

◮ However #sat is a computationally hard task: #P-complete ◮ Even for subsets of formulae for which sat is easy (e.g., monotone Krom formulae)! ◮ The ”power” of counting and its complexity are reflected by Toda’s theorem: Seinosuke Toda (G¨

  • del Prize 1998):

PH ⊆ P#P

4/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-11
SLIDE 11

Model Counting ash 5

◮ Many model counters have been developed:

◮ Exact model counters:

◮ search-based: Cachet, SharpSAT, DMC, etc., ◮ compilation-based: C2D, Dsharp, D4, etc. ◮ ...

◮ Approximate model counters (SampleCount, etc.) ◮ ...

5/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-12
SLIDE 12

Model Counting ash 5

◮ Many model counters have been developed:

◮ Exact model counters:

◮ search-based: Cachet, SharpSAT, DMC, etc., ◮ compilation-based: C2D, Dsharp, D4, etc. ◮ ...

◮ Approximate model counters (SampleCount, etc.) ◮ ...

◮ In this talk: improving exact model counters by preprocessing the input CNF → CNF

5/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-13
SLIDE 13

Preprocessings ash 6

◮ Objective: simplifying the input so that the task at hand can be achieved more efficiently from the input once preprocessed ◮ Simplifying = ”reducing something” ◮ Trade-off preprocessing cost / rest of the computation to be looked for ◮ Using aggressive, computationally demanding preprocessing techniques can make sense when dealing with highly complex problems (like #sat) ◮ P-preprocessing vs. NP-preprocessing

6/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-14
SLIDE 14

Knowledge Compilation vs. Preprocessing for #sat ash 7

◮ Similarities: two off-line approaches for improving the model counting task

7/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-15
SLIDE 15

Knowledge Compilation vs. Preprocessing for #sat ash 7

◮ Similarities: two off-line approaches for improving the model counting task ◮ Differences:

◮ computing a new representation in the same vs. a distinct language ◮ ”hard part” vs. ”easy part”

7/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-16
SLIDE 16

Knowledge Compilation vs. Preprocessing for #sat ash 7

◮ Similarities: two off-line approaches for improving the model counting task ◮ Differences:

◮ computing a new representation in the same vs. a distinct language ◮ ”hard part” vs. ”easy part”

◮ knowledge compilation CNF Σ compilation d-DNNF Ψ model counting Σ

7/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-17
SLIDE 17

Knowledge Compilation vs. Preprocessing for #sat ash 7

◮ Similarities: two off-line approaches for improving the model counting task ◮ Differences:

◮ computing a new representation in the same vs. a distinct language ◮ ”hard part” vs. ”easy part”

◮ knowledge compilation CNF Σ compilation d-DNNF Ψ model counting Σ ◮ preprocessing CNF Σ preprocessing CNF Φ model counting Σ

7/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-18
SLIDE 18

Knowledge Compilation vs. Preprocessing for #sat ash 7

◮ Similarities: two off-line approaches for improving the model counting task ◮ Differences:

◮ computing a new representation in the same vs. a distinct language ◮ ”hard part” vs. ”easy part”

◮ knowledge compilation CNF Σ compilation d-DNNF Ψ model counting Σ ◮ preprocessing CNF Σ preprocessing CNF Φ model counting Σ ◮ The two approaches can be combined

7/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-19
SLIDE 19

Dozens of P-Preprocessings ash 8

◮ Vivification (VI) and a light form of it, called Occurrence Elimination (OE), ◮ Gate Detection and Replacement (GDR) ◮ Pure Literal Elimination (PLE) ◮ Variable Elimination (VE) ◮ Blocked Clause Elimination (BCE) ◮ Covered Clause Elimination (CCE) ◮ Failed Literal Elimination (FLE) ◮ Self-Subsuming Resolution (SSR) ◮ Hidden Literal Elimination (HLE) ◮ Subsumption Elimination (SE) ◮ Hidden Subsumption Elimination (HSE) ◮ Asymmetric Subsumption Elimination (ASE) ◮ Tautology Elimination (TE) ◮ Hidden Tautology Elimination (HTE) ◮ Asymmetric Tautology Elimination (ATE) ◮ ... 8/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-20
SLIDE 20

Use in State-of-the-Art sat Solvers ash 9

◮ Glucose (exploits the SatELite preprocessor) ◮ Lingeling (has an internal preprocessor) ◮ Riss (use of the Coprocessor preprocessor) ◮ ...

9/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-21
SLIDE 21

Reducing What? ash 10

CNF Σ → CNF p(Σ) ◮ What are the connections between Σ and p(Σ)? ◮ Removing clauses from Σ ◮ Removing literals in the clauses of Σ ◮ ...

10/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-22
SLIDE 22

Looking for IES or Minimal CNF is often too Expensive ash 11

◮ A clause δ of a CNF Σ is redundant if and only if Σ \ {δ} | = δ ◮ A CNF Σ is irredundant if and only if it does not contain any redundant clause ◮ A subset Σ′ of a CNF Σ is an irredundant equivalent subset (IES) of Σ if and only if Σ′ is irredundant and Σ′ ≡ Σ ◮ Deciding whether a CNF Σ is irredundant is NP-complete ◮ Deciding whether a CNF Σ′ is an irredundant equivalent subset (IES) of a CNF Σ is Dp-complete ◮ Given an integer k, deciding whether a CNF Σ has an IES of size at most k is Σp

2-complete

◮ Given an integer k, deciding whether there exists a CNF formula Σ′ with at most k literals (or with at most k clauses) equivalent to a given CNF Σ is Σp

2-complete

11/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-23
SLIDE 23

Preserving What? ash 12

◮ Logical equivalence ◮ Queries over the input alphabet ◮ Number of models ◮ Satisfiability ◮ ...

12/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-24
SLIDE 24

Measuring the Impact of a Preprocessing ash 13

Several measures for the reduction achieved can be considered: ◮ The number of variables in the input CNF Σ ◮ The size of Σ (the number of literals or the number of clauses in it) ◮ The value of some structural parameters for Σ ◮ ...

13/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-25
SLIDE 25

Example: Subsumption Elimination ash 14

A clause δ1 subsumes a clause δ2 if every literal of δ1 is a literal of δ2 SE : (x1 ∨ x2) ∧ (x1 ∨ x2 ∨ ¯ x3) → x1 ∨ x2 ◮ P-preprocessing ◮ Preserves logical equivalence ◮ Hence preserves the number of models of the input (over the

  • riginal alphabet), its queries and its satisfiability

◮ #var(Σ) ≥ #var(SE(Σ)) ◮ #lit(Σ) ≥ #lit(SE(Σ))

14/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-26
SLIDE 26

The Gate Detection and Replacement Family ash 15

A gate of Σ is a circuit ℓ ⇔ β such that Σ | = ℓ ⇔ β Σ and Σ[ℓ ← β] have the same number of models (but are not logically equivalent in general) Σ = x ∨ u ∨ v x ∨ y ∨ u x ∨ z ∨ u x ∨ u y ∨ z ∨ u

15/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-27
SLIDE 27

The Gate Detection and Replacement Family ash 15

A gate of Σ is a circuit ℓ ⇔ β such that Σ | = ℓ ⇔ β Σ and Σ[ℓ ← β] have the same number of models (but are not logically equivalent in general) Σ = x ∨ u ∨ v x ∨ y ∨ u x ∨ z ∨ u x ∨ u y ∨ z ∨ u u ↔ (x ∧ (y ∨ z))

15/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-28
SLIDE 28

The Gate Detection and Replacement Family ash 15

A gate of Σ is a circuit ℓ ⇔ β such that Σ | = ℓ ⇔ β Σ and Σ[ℓ ← β] have the same number of models (but are not logically equivalent in general) Σ = x ∨ u ∨ v x ∨ y ∨ u x ∨ z ∨ u x ∨ u y ∨ z ∨ u u ↔ (x ∧ (y ∨ z)) Σ ≡ (x ∨ u ∨ v) ∧ (u ↔ (x ∧ (y ∨ z))) detection

15/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-29
SLIDE 29

The Gate Detection and Replacement Family ash 15

A gate of Σ is a circuit ℓ ⇔ β such that Σ | = ℓ ⇔ β Σ and Σ[ℓ ← β] have the same number of models (but are not logically equivalent in general) Σ = x ∨ u ∨ v x ∨ y ∨ u x ∨ z ∨ u x ∨ u y ∨ z ∨ u u ↔ (x ∧ (y ∨ z)) Σ ≡ (x ∨ u ∨ v) ∧ (u ↔ (x ∧ (y ∨ z))) detection (x ∨ (x ∧ (y ∨ z)) ∨ v) ∧ (u ↔ (x ∧ (y ∨ z))) replacement

15/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-30
SLIDE 30

The Gate Detection and Replacement Family ash 15

A gate of Σ is a circuit ℓ ⇔ β such that Σ | = ℓ ⇔ β Σ and Σ[ℓ ← β] have the same number of models (but are not logically equivalent in general) Σ = x ∨ u ∨ v x ∨ y ∨ u x ∨ z ∨ u x ∨ u y ∨ z ∨ u u ↔ (x ∧ (y ∨ z)) Σ ≡ (x ∨ u ∨ v) ∧ (u ↔ (x ∧ (y ∨ z))) detection (x ∨ (x ∧ (y ∨ z)) ∨ v) ∧ (u ↔ (x ∧ (y ∨ z))) replacement (x ∨ y ∨ z ∨ v) ∧ (u ↔ (x ∧ (y ∨ z))) normalization

15/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-31
SLIDE 31

The Gate Detection and Replacement Family ash 15

A gate of Σ is a circuit ℓ ⇔ β such that Σ | = ℓ ⇔ β Σ and Σ[ℓ ← β] have the same number of models (but are not logically equivalent in general) Σ = x ∨ u ∨ v x ∨ y ∨ u x ∨ z ∨ u x ∨ u y ∨ z ∨ u u ↔ (x ∧ (y ∨ z)) Σ ≡ (x ∨ u ∨ v) ∧ (u ↔ (x ∧ (y ∨ z))) detection (x ∨ (x ∧ (y ∨ z)) ∨ v) ∧ (u ↔ (x ∧ (y ∨ z))) replacement (x ∨ y ∨ z ∨ v) ∧ (u ↔ (x ∧ (y ∨ z))) normalization Σ = Σ[u ← (x ∧ (y ∨ z))] = x ∨ y ∨ z ∨ v = 15

15/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-32
SLIDE 32

The Gate Detection and Replacement Family ash 16

◮ Gate detection and replacement proves to be a valuable preprocessing ◮ Specific gates are typically sought for (literal equivalence, AND/OR gates, XOR gates) for complexity reasons ◮ The replacement Σ[ℓ ← β] requires to turn the resulting formula into CNF ◮ It is implemented only if it it does not lead to increase the size of the input (a ”small” increase can also be accepted) ◮ BCP (instead of a ”full” sat solver) is often used for efficiency reasons (P-preprocessing)

16/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-33
SLIDE 33

Literal Equivalence (LE) ash 17

◮ Literal equivalence aims to detect equivalences between literals using BCP ◮ P-preprocessing ◮ For each literal ℓ, all the literals ℓ′ which can be found equivalent to ℓ using BCP are replaced by ℓ in Σ ◮ Taking advantage of BCP makes it more efficient than a ”syntactic detection” (if two binary clauses stating an equivalence between two literals ℓ and ℓ′ occur in Σ, then those literals are found equivalent using BCP, but the converse does not hold)

17/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-34
SLIDE 34

Literal Equivalence (LE) ash 18

Algorithm 1: LE input : a CNF formula Σ

  • utput: a CNF formula Φ such that Φ = Σ

Φ←Σ; Unmark all variables of Φ;

1

while ∃ℓ ∈ Lit(Φ) s.t. var(ℓ) is not marked do

2

// detection mark var(ℓ);

3

Pℓ←BCP(Φ ∪ {ℓ});

4

Nℓ←BCP(Φ ∪ {∼ℓ});

5

Γ←{ℓ ↔ ℓ′|ℓ′ = ℓ and ℓ′ ∈ Pℓ and ∼ℓ′ ∈ Nℓ};

6

// replacement foreach ℓ ↔ ℓ′ ∈ Γ do

7

replace ℓ by ℓ′ in Φ;

8

return Φ

9

18/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-35
SLIDE 35

Literal Equivalence (LE): Example ash 19

Σ = a ∨ b ∨ c ∨ ¬d ¬a ∨ ¬b ∨ ¬c ∨ d a ∨ b ∨ ¬c ¬a ∨ ¬b ∨ c ¬a ∨ b a ∨ ¬b ¬e ∨ ¬f ∨ h e ∨ f ∨ g e ∨ ¬g ¬e ∨ ¬h Assume that the variables of Σ are considered in the following

  • rdering: a < b < c < d < e < f < g < h

The equivalences (a ⇔ b) ∧ (b ⇔ c) ∧(c ⇔ d) ∧ (e ⇔ ¬f ) are detected LE(Σ) = ¬f ∨ ¬g f ∨ ¬h

19/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-36
SLIDE 36

Properties of LE ash 20

◮ Preserves the number of models (but not logical equivalence) ◮ #var(Σ) ≥ #var(LE(Σ)) ◮ #lit(Σ) ≥ #lit(LE(Σ))

20/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-37
SLIDE 37

LE: Reduction of the Number of Variables ash 21

1 10 100 1000 10000 100000 100 1000 10000 100000 Σ Bayesian Networks Handmade Planning Circuit Configuration BMC Random Qif Scheduling

equivSimpl(Σ) Figure – Comparing #var(Σ) with #var(LE(Σ)).

21/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-38
SLIDE 38

LE: Reduction of the Size ash 22

1 10 100 1000 10000 100000 1e+06 100 1000 10000 100000 1e+06 Σ Bayesian Networks Handmade Planning Circuit Configuration BMC Random Qif Scheduling

equivSimpl(Σ) Figure – Comparing #lit(Σ) with #lit(LE(Σ)).

22/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-39
SLIDE 39

Backbone Identification (BI) ash 23

◮ The backbone of a CNF formula Σ is the set of all literals which are implied by Σ when Σ is satisfiable, and is the empty set otherwise ◮ The purpose of the BI preprocessing is to make the backbone B of the input CNF formula Σ explicit, to conjoin it to Σ, and to use BCP (Boolean Constraint Propagation) on the resulting set of clauses ◮ NP-preprocessing

23/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-40
SLIDE 40

Backbone Identification (BI) ash 24

Algorithm 2: BI Backbone Identification input : a CNF formula Σ

  • utput: the CNF BCP(Σ ∪ B), where B is the backbone of Σ

B←∅;

1

I←solve(Σ);

2

while ∃ℓ ∈ I s.t. ℓ / ∈ B do

3

I′←solve(Σ ∪ {∼ℓ});

4

if I′ = ∅ then B←B ∪ {ℓ}else I←I ∩ I′;

5

return BCP(Σ ∪ B)

6

24/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-41
SLIDE 41

Backbone Identification (BI): Example ash 25

Σ = a ∨ b ¬a ∨ b ¬b ∨ c c ∨ d ¬c ∨ e ∨ f f ∨ ¬g The backbone of Σ is equal to B = {b, c} BI(Σ) = b c e ∨ f f ∨ ¬g

25/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-42
SLIDE 42

Properties of BI ash 26

◮ Preserves logical equivalence ◮ #var(Σ) ≥ #var(BI(Σ)) ◮ #lit(Σ) ≥ #lit(BI(Σ))

26/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-43
SLIDE 43

BI: Reduction of the Number of Variables ash 27

1 10 100 1000 10000 100000 100 1000 10000 100000 backboneSimpl(Σ) Σ Bayesian Networks Handmade Planning Circuit Configuration BMC Random Qif Scheduling

Figure – Comparing #var(Σ) with #var(BI(Σ)).

27/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-44
SLIDE 44

BI: Reduction of the Size ash 28

1 10 100 1000 10000 100000 1e+06 100 1000 10000 100000 1e+06 backboneSimpl(Σ) Σ Bayesian Networks Handmade Planning Circuit Configuration BMC Random Qif Scheduling

Figure – Comparing #lit(Σ) with #lit(BI(Σ)).

28/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-45
SLIDE 45

Limitations of the Basic Gate Detection and Replacement Preprocessings ash 29

◮ The replacement phase requires gates to be detected

◮ The search space for gates is huge ◮ The size of a gate can be huge as well

29/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-46
SLIDE 46

Limitations of the Basic Gate Detection and Replacement Preprocessings ash 29

◮ The replacement phase requires gates to be detected

◮ The search space for gates is huge ◮ The size of a gate can be huge as well

◮ Identifying ”complex gates” is incompatible with the efficiency expected for a preprocessing:

  • nly ”simple” gates are targeted

literal equivalences y ↔ x1 AND/OR gates y ↔ (x1 ∧ x2 ∧ x3) XOR gates y ↔ (x1 ⊕ x2)

29/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-47
SLIDE 47

Overcoming the Limitations (1) ash 30

◮ The (explicit) identification phase can be replaced by an implicit identification phase ◮ Stated otherwise, there is no need to identify f to determine that a gate of the form y ↔ f (x1, . . . , xn) exists in Σ

30/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-48
SLIDE 48

Overcoming the Limitations (1) ash 30

◮ The (explicit) identification phase can be replaced by an implicit identification phase ◮ Stated otherwise, there is no need to identify f to determine that a gate of the form y ↔ f (x1, . . . , xn) exists in Σ ◮ Let us ask Evert and Alessandro for some help ...

30/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-49
SLIDE 49

Evert Willem Beth (1908-1964) ash 31

31/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-50
SLIDE 50

Evert Willem Beth (1908-1964) ash 31

◮ Σ explicitly defines y in terms of X = {x1, . . . , xn} iff there exists a formula f (x1, . . . , xn) over X such that Σ | = y ↔ f (x1, . . . , xn)

31/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-51
SLIDE 51

Evert Willem Beth (1908-1964) ash 31

◮ Σ explicitly defines y in terms of X = {x1, . . . , xn} iff there exists a formula f (x1, . . . , xn) over X such that Σ | = y ↔ f (x1, . . . , xn) ◮ Σ implicitly defines y in terms of X = {x1, . . . , xn} iff for every canonical term γX over X, we have Σ ∧ γX | = y or Σ ∧ γX | = y

31/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-52
SLIDE 52

Evert Willem Beth (1908-1964) ash 31

◮ Σ explicitly defines y in terms of X = {x1, . . . , xn} iff there exists a formula f (x1, . . . , xn) over X such that Σ | = y ↔ f (x1, . . . , xn) ◮ Σ implicitly defines y in terms of X = {x1, . . . , xn} iff for every canonical term γX over X, we have Σ ∧ γX | = y or Σ ∧ γX | = y ◮ Beth’s theorem: Σ explicitly defines y in terms of X iff Σ implicitly defines y in terms of X

31/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-53
SLIDE 53

Alessandro Padoa (1868-1937) ash 32

Padoa’s theorem: Let Σ′

X be equal to Σ where each variable

but those of X have been renamed in a uniform way If y ∈ X, then Σ (implicitly) defines y in terms of X iff Σ ∧ Σ′

X ∧ y ∧ y′ is

inconsistent

32/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-54
SLIDE 54

Alessandro Padoa (1868-1937) ash 32

Padoa’s theorem: Let Σ′

X be equal to Σ where each variable

but those of X have been renamed in a uniform way If y ∈ X, then Σ (implicitly) defines y in terms of X iff Σ ∧ Σ′

X ∧ y ∧ y′ is

inconsistent Deciding whether Σ (implicitly) defines y in terms of X is ”only” coNP-complete

32/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-55
SLIDE 55

Overcoming the Limitations (2) ash 33

◮ There is no need to identify f to determine that a gate of the form y ↔ f (x1, . . . , xn) exists in Σ

33/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-56
SLIDE 56

Overcoming the Limitations (2) ash 33

◮ There is no need to identify f to determine that a gate of the form y ↔ f (x1, . . . , xn) exists in Σ

◮ Gate identification = Explicit definability

33/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-57
SLIDE 57

Overcoming the Limitations (2) ash 33

◮ There is no need to identify f to determine that a gate of the form y ↔ f (x1, . . . , xn) exists in Σ

◮ Gate identification = Explicit definability ◮ Explicit definability = Implicit definability (Beth’s theorem)

33/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-58
SLIDE 58

Overcoming the Limitations (2) ash 33

◮ There is no need to identify f to determine that a gate of the form y ↔ f (x1, . . . , xn) exists in Σ

◮ Gate identification = Explicit definability ◮ Explicit definability = Implicit definability (Beth’s theorem) ◮ One call to a SAT solver is enough to decide whether Σ defines y in terms of {x1, . . . , xn} (thanks to Padoa’s theorem)

33/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-59
SLIDE 59

Overcoming the Limitations (2) ash 33

◮ There is no need to identify f to determine that a gate of the form y ↔ f (x1, . . . , xn) exists in Σ

◮ Gate identification = Explicit definability ◮ Explicit definability = Implicit definability (Beth’s theorem) ◮ One call to a SAT solver is enough to decide whether Σ defines y in terms of {x1, . . . , xn} (thanks to Padoa’s theorem)

◮ There is no need to identify f to compute Σ[y ← f (x1, . . . , xn)]

33/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-60
SLIDE 60

Overcoming the Limitations (2) ash 33

◮ There is no need to identify f to determine that a gate of the form y ↔ f (x1, . . . , xn) exists in Σ

◮ Gate identification = Explicit definability ◮ Explicit definability = Implicit definability (Beth’s theorem) ◮ One call to a SAT solver is enough to decide whether Σ defines y in terms of {x1, . . . , xn} (thanks to Padoa’s theorem)

◮ There is no need to identify f to compute Σ[y ← f (x1, . . . , xn)]

◮ The replacement phase can be replaced by an output variable elimination phase: if y ↔ f (x1, . . . , xn) is a gate of Σ, then Σ[y ← f (x1, . . . , xn)] ≡ ∃y.Σ

33/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-61
SLIDE 61

The B + E Preprocessing ash 34

A two-step preprocessing ◮ ”Identification = Bipartition”: compute a definability bipartition I, O of Σ such that I ∪ O = Var(Σ), I ∩ O = ∅, and Σ defines every variable

  • ∈ O in terms of I

34/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-62
SLIDE 62

The B + E Preprocessing ash 34

A two-step preprocessing ◮ ”Identification = Bipartition”: compute a definability bipartition I, O of Σ such that I ∪ O = Var(Σ), I ∩ O = ∅, and Σ defines every variable

  • ∈ O in terms of I

◮ ”Replacement = Elimination”: compute ∃E.Σ for E ⊆ O

34/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-63
SLIDE 63

The B + E Preprocessing ash 34

A two-step preprocessing ◮ ”Identification = Bipartition”: compute a definability bipartition I, O of Σ such that I ∪ O = Var(Σ), I ∩ O = ∅, and Σ defines every variable

  • ∈ O in terms of I

◮ ”Replacement = Elimination”: compute ∃E.Σ for E ⊆ O ◮ Steps B and E of B + E can be tuned in order to keep the preprocessing phase light from a computational standpoint (NP-preprocessing)

34/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-64
SLIDE 64

Identifying u as an Output Variable and Eliminating it ash 35

Identification: Σ ∧ Σ′

{x,y,z} ∧ u ∧ u′ is inconsistent

x ∨ u ∨ v x ∨ y ∨ u x ∨ z ∨ u x ∨ u y ∨ z ∨ u x ∨ u′ ∨ v ′ x ∨ y ∨ u′ x ∨ z ∨ u′ x ∨ u′ y ∨ z ∨ u′ u u′

35/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-65
SLIDE 65

Identifying u as an Output Variable and Eliminating it ash 35

Identification: Σ ∧ Σ′

{x,y,z} ∧ u ∧ u′ is inconsistent

x ∨ u ∨ v x ∨ y ∨ u x ∨ z ∨ u x ∨ u y ∨ z ∨ u x ∨ u′ ∨ v ′ x ∨ y ∨ u′ x ∨ z ∨ u′ x ∨ u′ y ∨ z ∨ u′ u u′

Elimination: computing resolvents over u x ∨ v ∨ x valid x ∨ v ∨ y ∨ z x ∨ y ∨ x valid x ∨ y ∨ y ∨ z valid x ∨ z ∨ x valid x ∨ z ∨ y ∨ z valid

35/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-66
SLIDE 66

Identifying u as an Output Variable and Eliminating it ash 35

Identification: Σ ∧ Σ′

{x,y,z} ∧ u ∧ u′ is inconsistent

x ∨ u ∨ v x ∨ y ∨ u x ∨ z ∨ u x ∨ u y ∨ z ∨ u x ∨ u′ ∨ v ′ x ∨ y ∨ u′ x ∨ z ∨ u′ x ∨ u′ y ∨ z ∨ u′ u u′

Elimination: computing resolvents over u x ∨ v ∨ x valid x ∨ v ∨ y ∨ z x ∨ y ∨ x valid x ∨ y ∨ y ∨ z valid x ∨ z ∨ x valid x ∨ z ∨ y ∨ z valid Σ = x ∨ v ∨ y ∨ z = 15

35/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-67
SLIDE 67

Tuning the Computational Effort ash 36

Both steps B and E of B + E can be tuned in order to keep the preprocessing phase light from a computational standpoint

◮ It is not necessary to determine a definability bipartition I, O with |I| minimal ⇒ B is a greedy algorithm (one definability test per variable) ⇒ Only the minimality of I for ⊆ is guaranteed

36/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-68
SLIDE 68

Tuning the Computational Effort ash 36

Both steps B and E of B + E can be tuned in order to keep the preprocessing phase light from a computational standpoint

◮ It is not necessary to determine a definability bipartition I, O with |I| minimal ⇒ B is a greedy algorithm (one definability test per variable) ⇒ Only the minimality of I for ⊆ is guaranteed ◮ It is not necessary to eliminate in Σ every variable of O but focusing on a subset E ⊆ O is enough ⇒ Eliminating every output variable could lead to an exponential blow up ⇒ The elimination of y ∈ O is committed only if |Σ| after the elimination step and some additional preprocessing techniques (occurrence simplification and vivification) remains small enough

36/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-69
SLIDE 69

Experiments ash 37

Objectives: ◮ Evaluating the computational benefits offered by B + E when used upstream to state-of-the-art model counters:

◮ the search-based model counter Cachet ◮ the search-based model counter SharpSAT ◮ the compilation-based model counter C2D (used with -count -in memory -smooth all) ◮ the compilation-based model counter D4

37/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-70
SLIDE 70

Experiments ash 37

Objectives: ◮ Evaluating the computational benefits offered by B + E when used upstream to state-of-the-art model counters:

◮ the search-based model counter Cachet ◮ the search-based model counter SharpSAT ◮ the compilation-based model counter C2D (used with -count -in memory -smooth all) ◮ the compilation-based model counter D4

◮ Comparing the benefits offered by B + E with those offered by

  • ur previous preprocessor pmc (based on gate identification

and replacement) or with no preprocessing

37/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-71
SLIDE 71

Empirical Setting ash 38

◮ 703 CNF instances from the SAT LIBrary ◮ 8 data sets: BN (Bayesian networks) (192), BMC (Bounded Model Checking) (18), Circuit (41), Configuration (35), Handmade (58), Planning (248), Random (104), Qif (7) (Quantitative Information Flow analysis - security) ◮ Cluster of Intel Xeon E5-2643 (3.30 GHz) processors with 32 GiB RAM on Linux CentOS ◮ Time-out =1h ◮ Memory-out = 7.6 GiB

38/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-72
SLIDE 72

Empirical Results: Reduction Achieved ash 39

101 102 103 104 105 101 102 103 104 105 B + E(Σ, ∞) Σ Qif Handmade Planning Circuit Configuration Random BMC BN

(a) #var reduction

100 101 102 103 104 105 106 100 101 102 103 104 105 106 B + E(Σ, ∞) Σ Qif Handmade Planning Circuit Configuration Random BMC BN

(b) #lit reduction

Figure – Reduction achieved by B + E

39/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-73
SLIDE 73

Empirical Results: Time Saving ash 40

10−1 100 101 102 103 10−1 100 101 102 103 Cachet(B + E(Σ, ∞)) Cachet(Σ) Qif Handmade Planning Circuit Configuration Random BMC BN

(a) Cachet vs. B + E+Cachet

10−1 100 101 102 103 10−1 100 101 102 103 SharpSAT(B + E(Σ, ∞)) SharpSAT(Σ) Qif Handmade Planning Circuit Configuration Random BMC BN

(b) SharpSAT vs. B + E+SharpSAT

Figure – Time saved by using B + E upstream

40/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-74
SLIDE 74

Empirical Results: Time Saving ash 41

10−1 100 101 102 103 10−1 100 101 102 103 C2D(B + E(Σ, ∞)) C2D(Σ) Qif Handmade Planning Circuit Configuration Random BMC BN

(a) C2D vs. B + E+C2D

10−1 100 101 102 103 10−1 100 101 102 103 D4(B + E(Σ, ∞)) D4(Σ) Qif Handmade Planning Circuit Configuration Random BMC BN

(b) D4 vs. B + E+D4

Figure – Time saved by using B + E upstream

41/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-75
SLIDE 75

Empirical Results ash 42

10 100 1000 300 350 400 450 500 550 600 time (in seconds) number of instances solved Σ pmc(Σ) b + e(Σ)

Figure – Cachet depending on the preprocessing used

42/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-76
SLIDE 76

Empirical Results ash 43

10 100 1000 300 350 400 450 500 550 600 time (in seconds) number of instances solved Σ pmc(Σ) b + e(Σ)

Figure – SharpSAT depending on the preprocessing used

43/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-77
SLIDE 77

Empirical Results ash 44

10 100 1000 300 350 400 450 500 550 600 time (in seconds) number of instances solved Σ pmc(Σ) b + e(Σ)

Figure – C2D depending on the preprocessing used

44/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-78
SLIDE 78

Empirical Results ash 45

10 100 1000 300 350 400 450 500 550 600 time (in seconds) number of instances solved Σ pmc(Σ) b + e(Σ)

Figure – D4 depending on the preprocessing used

45/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-79
SLIDE 79

Conclusion and Perspectives ash 46

Conclusion ◮ Design and implementation of the B + E preprocessor ◮ Empirical evaluation of B + E: for several model counters mc, mc(B + E(.)) proves computationally more efficient than mc(.) ◮ ”Real” instances are structured ones

46/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018

slide-80
SLIDE 80

Conclusion and Perspectives ash 46

Conclusion ◮ Design and implementation of the B + E preprocessor ◮ Empirical evaluation of B + E: for several model counters mc, mc(B + E(.)) proves computationally more efficient than mc(.) ◮ ”Real” instances are structured ones Perspectives ◮ Developing other ordering heuristics for B ◮ Investigating the connections to projected model counting: computing ∃E.Σ given a set E of variables and a formula Σ

46/46 On Definability for Model Counting Meeting GT ALGA, GdR IM, Lille, October 15th, 2018