On Minimal Corrections in ASP s Janota 1 Joao Marques-Silva 2 Mikol - - PowerPoint PPT Presentation

on minimal corrections in asp
SMART_READER_LITE
LIVE PREVIEW

On Minimal Corrections in ASP s Janota 1 Joao Marques-Silva 2 Mikol - - PowerPoint PPT Presentation

On Minimal Corrections in ASP s Janota 1 Joao Marques-Silva 2 Mikol a RCRA 2017, Bari 1 INESC-ID/IST, University of Lisbon, Portugal 2 LaSIGE, Faculty of Science, University of Lisbon, Portugal Janota and Silva On Minimal Corrections in ASP


slide-1
SLIDE 1

On Minimal Corrections in ASP

Mikol´ aˇ s Janota1 Joao Marques-Silva2 RCRA 2017, Bari

1 INESC-ID/IST, University of Lisbon, Portugal 2 LaSIGE, Faculty of Science, University of Lisbon, Portugal Janota and Silva On Minimal Corrections in ASP 1 / 15

slide-2
SLIDE 2

Context and History

  • Number of interesting problems about propositional formulae:

Janota and Silva On Minimal Corrections in ASP 2 / 15

slide-3
SLIDE 3

Context and History

  • Number of interesting problems about propositional formulae:
  • Minimally Unsatisfiable Set (MUS), diagnostics, debugging,

SMT

Janota and Silva On Minimal Corrections in ASP 2 / 15

slide-4
SLIDE 4

Context and History

  • Number of interesting problems about propositional formulae:
  • Minimally Unsatisfiable Set (MUS), diagnostics, debugging,

SMT

  • Minimal Correction Set (MCS), diagnostics, debugging

Janota and Silva On Minimal Corrections in ASP 2 / 15

slide-5
SLIDE 5

Context and History

  • Number of interesting problems about propositional formulae:
  • Minimally Unsatisfiable Set (MUS), diagnostics, debugging,

SMT

  • Minimal Correction Set (MCS), diagnostics, debugging
  • Prime Implicant/Implicate, model checking

Janota and Silva On Minimal Corrections in ASP 2 / 15

slide-6
SLIDE 6

Context and History

  • Number of interesting problems about propositional formulae:
  • Minimally Unsatisfiable Set (MUS), diagnostics, debugging,

SMT

  • Minimal Correction Set (MCS), diagnostics, debugging
  • Prime Implicant/Implicate, model checking
  • Minimal model, circumscription

Janota and Silva On Minimal Corrections in ASP 2 / 15

slide-7
SLIDE 7

Context and History

  • Number of interesting problems about propositional formulae:
  • Minimally Unsatisfiable Set (MUS), diagnostics, debugging,

SMT

  • Minimal Correction Set (MCS), diagnostics, debugging
  • Prime Implicant/Implicate, model checking
  • Minimal model, circumscription
  • Backbone, fault-localization

Janota and Silva On Minimal Corrections in ASP 2 / 15

slide-8
SLIDE 8

Monotone Predicates

  • These problems are instances of monotone predicates.

[Marques-Silva et al., 2013]

Janota and Silva On Minimal Corrections in ASP 3 / 15

slide-9
SLIDE 9

Monotone Predicates

  • These problems are instances of monotone predicates.

[Marques-Silva et al., 2013]

  • Example for sets of clauses φ, ψ

Janota and Silva On Minimal Corrections in ASP 3 / 15

slide-10
SLIDE 10

Monotone Predicates

  • These problems are instances of monotone predicates.

[Marques-Silva et al., 2013]

  • Example for sets of clauses φ, ψ
  • φ ⊆ ψ ⇒
  • SAT(ψ) ⇒ SAT(φ)
  • Janota and Silva

On Minimal Corrections in ASP 3 / 15

slide-11
SLIDE 11

Monotone Predicates

  • These problems are instances of monotone predicates.

[Marques-Silva et al., 2013]

  • Example for sets of clauses φ, ψ
  • φ ⊆ ψ ⇒
  • SAT(ψ) ⇒ SAT(φ)
  • φ ⊆ ψ ⇒
  • UNSAT(φ) ⇒ UNSAT(ψ)
  • Janota and Silva

On Minimal Corrections in ASP 3 / 15

slide-12
SLIDE 12

Monotone Predicates

  • These problems are instances of monotone predicates.

[Marques-Silva et al., 2013]

  • Example for sets of clauses φ, ψ
  • φ ⊆ ψ ⇒
  • SAT(ψ) ⇒ SAT(φ)
  • φ ⊆ ψ ⇒
  • UNSAT(φ) ⇒ UNSAT(ψ)
  • MUS — subset minimum for the UNSAT predicate.

Janota and Silva On Minimal Corrections in ASP 3 / 15

slide-13
SLIDE 13

Monotone Predicates

  • These problems are instances of monotone predicates.

[Marques-Silva et al., 2013]

  • Example for sets of clauses φ, ψ
  • φ ⊆ ψ ⇒
  • SAT(ψ) ⇒ SAT(φ)
  • φ ⊆ ψ ⇒
  • UNSAT(φ) ⇒ UNSAT(ψ)
  • MUS — subset minimum for the UNSAT predicate.
  • MSS — subset maximum for the SAT predicate.

Janota and Silva On Minimal Corrections in ASP 3 / 15

slide-14
SLIDE 14

Monotone Predicates

  • These problems are instances of monotone predicates.

[Marques-Silva et al., 2013]

  • Example for sets of clauses φ, ψ
  • φ ⊆ ψ ⇒
  • SAT(ψ) ⇒ SAT(φ)
  • φ ⊆ ψ ⇒
  • UNSAT(φ) ⇒ UNSAT(ψ)
  • MUS — subset minimum for the UNSAT predicate.
  • MSS — subset maximum for the SAT predicate.
  • L1, L2 sets of literals:

Janota and Silva On Minimal Corrections in ASP 3 / 15

slide-15
SLIDE 15

Monotone Predicates

  • These problems are instances of monotone predicates.

[Marques-Silva et al., 2013]

  • Example for sets of clauses φ, ψ
  • φ ⊆ ψ ⇒
  • SAT(ψ) ⇒ SAT(φ)
  • φ ⊆ ψ ⇒
  • UNSAT(φ) ⇒ UNSAT(ψ)
  • MUS — subset minimum for the UNSAT predicate.
  • MSS — subset maximum for the SAT predicate.
  • L1, L2 sets of literals:
  • L1 ⊆ L2 ⇒
  • L1 |

= ϕ ⇒ L2 | = ϕ

  • Janota and Silva

On Minimal Corrections in ASP 3 / 15

slide-16
SLIDE 16

Monotone Predicates

  • These problems are instances of monotone predicates.

[Marques-Silva et al., 2013]

  • Example for sets of clauses φ, ψ
  • φ ⊆ ψ ⇒
  • SAT(ψ) ⇒ SAT(φ)
  • φ ⊆ ψ ⇒
  • UNSAT(φ) ⇒ UNSAT(ψ)
  • MUS — subset minimum for the UNSAT predicate.
  • MSS — subset maximum for the SAT predicate.
  • L1, L2 sets of literals:
  • L1 ⊆ L2 ⇒
  • L1 |

= ϕ ⇒ L2 | = ϕ

  • prime implicant — subset minimum for the · |

= ϕ predicate.

Janota and Silva On Minimal Corrections in ASP 3 / 15

slide-17
SLIDE 17

Monotone Predicates

  • These problems are instances of monotone predicates.

[Marques-Silva et al., 2013]

  • Example for sets of clauses φ, ψ
  • φ ⊆ ψ ⇒
  • SAT(ψ) ⇒ SAT(φ)
  • φ ⊆ ψ ⇒
  • UNSAT(φ) ⇒ UNSAT(ψ)
  • MUS — subset minimum for the UNSAT predicate.
  • MSS — subset maximum for the SAT predicate.
  • L1, L2 sets of literals:
  • L1 ⊆ L2 ⇒
  • L1 |

= ϕ ⇒ L2 | = ϕ

  • prime implicant — subset minimum for the · |

= ϕ predicate.

  • Literal a backbone if φ |

= l L1 ⊆ L2 ⇒

l∈L2 φ |

= l ⇒

l∈L1 φ |

= l

  • Janota and Silva

On Minimal Corrections in ASP 3 / 15

slide-18
SLIDE 18

What about ASP?

  • Unlike propositional logic, ASP is not monotone.

Janota and Silva On Minimal Corrections in ASP 4 / 15

slide-19
SLIDE 19

What about ASP?

  • Unlike propositional logic, ASP is not monotone.
  • How to define minimality?

Janota and Silva On Minimal Corrections in ASP 4 / 15

slide-20
SLIDE 20

What about ASP?

  • Unlike propositional logic, ASP is not monotone.
  • How to define minimality?
  • Can the algorithms from propositional logic be adapted?

(or at least some)

Janota and Silva On Minimal Corrections in ASP 4 / 15

slide-21
SLIDE 21

What about ASP?

  • Unlike propositional logic, ASP is not monotone.
  • How to define minimality?
  • Can the algorithms from propositional logic be adapted?

(or at least some) Example ← not move(a). % program move(a) ← stone(b), not stone(c). % program stone(c) ← . % fact (input)

Janota and Silva On Minimal Corrections in ASP 4 / 15

slide-22
SLIDE 22

What about ASP?

  • Unlike propositional logic, ASP is not monotone.
  • How to define minimality?
  • Can the algorithms from propositional logic be adapted?

(or at least some) Example ← not move(a). % program move(a) ← stone(b), not stone(c). % program stone(c) ← . % fact (input) Possible fix: add stone(b), remove stone(c)

Janota and Silva On Minimal Corrections in ASP 4 / 15

slide-23
SLIDE 23

Maximal Consistent Set in ASP

Definition

Janota and Silva On Minimal Corrections in ASP 5 / 15

slide-24
SLIDE 24

Maximal Consistent Set in ASP

Definition

  • Let P be a consistent ASP program and S be a set of atoms.

Janota and Silva On Minimal Corrections in ASP 5 / 15

slide-25
SLIDE 25

Maximal Consistent Set in ASP

Definition

  • Let P be a consistent ASP program and S be a set of atoms.
  • A set L ⊆ S is a maximal consistent subset of S w.r.t. P

Janota and Silva On Minimal Corrections in ASP 5 / 15

slide-26
SLIDE 26

Maximal Consistent Set in ASP

Definition

  • Let P be a consistent ASP program and S be a set of atoms.
  • A set L ⊆ S is a maximal consistent subset of S w.r.t. P
  • if the program P ∪ {s. | s ∈ L} is consistent

Janota and Silva On Minimal Corrections in ASP 5 / 15

slide-27
SLIDE 27

Maximal Consistent Set in ASP

Definition

  • Let P be a consistent ASP program and S be a set of atoms.
  • A set L ⊆ S is a maximal consistent subset of S w.r.t. P
  • if the program P ∪ {s. | s ∈ L} is consistent
  • and for any L′, such that L L′ ⊆ S, the program

P ∪

  • s. | s ∈ L′

is inconsistent.

Observe: In monotone case L is maximally consistent iff L ∪{s} is inconsistent for any s ∈ S \ L. Does not hold in non-monotone.

Janota and Silva On Minimal Corrections in ASP 5 / 15

slide-28
SLIDE 28

Choice Rules

Notation

  • Consider set of atoms: S = {s1, . . . , sk}.

Janota and Silva On Minimal Corrections in ASP 6 / 15

slide-29
SLIDE 29

Choice Rules

Notation

  • Consider set of atoms: S = {s1, . . . , sk}.
  • Let choice(S) denote the choice rule 0 ≤ {s1, . . . , sk}

Janota and Silva On Minimal Corrections in ASP 6 / 15

slide-30
SLIDE 30

Choice Rules

Notation

  • Consider set of atoms: S = {s1, . . . , sk}.
  • Let choice(S) denote the choice rule 0 ≤ {s1, . . . , sk}
  • Let atleast1({s1, . . . , sk}) denote the choice rule

1 ≤ {s1, . . . , sk}.

Janota and Silva On Minimal Corrections in ASP 6 / 15

slide-31
SLIDE 31

Choice Rules

Notation

  • Consider set of atoms: S = {s1, . . . , sk}.
  • Let choice(S) denote the choice rule 0 ≤ {s1, . . . , sk}
  • Let atleast1({s1, . . . , sk}) denote the choice rule

1 ≤ {s1, . . . , sk}. Idea

Janota and Silva On Minimal Corrections in ASP 6 / 15

slide-32
SLIDE 32

Choice Rules

Notation

  • Consider set of atoms: S = {s1, . . . , sk}.
  • Let choice(S) denote the choice rule 0 ≤ {s1, . . . , sk}
  • Let atleast1({s1, . . . , sk}) denote the choice rule

1 ≤ {s1, . . . , sk}. Idea

  • Define P′ = P ∪ {s. | s ∈ L} ∪{choice(S \ L).}.

Janota and Silva On Minimal Corrections in ASP 6 / 15

slide-33
SLIDE 33

Choice Rules

Notation

  • Consider set of atoms: S = {s1, . . . , sk}.
  • Let choice(S) denote the choice rule 0 ≤ {s1, . . . , sk}
  • Let atleast1({s1, . . . , sk}) denote the choice rule

1 ≤ {s1, . . . , sk}. Idea

  • Define P′ = P ∪ {s. | s ∈ L} ∪{choice(S \ L).}.
  • There exists a consistent set L′ s.t. L ⊆ L′ ⊆ S iff P′ has an

answer set µ such that L′ = S ∩µ.

Janota and Silva On Minimal Corrections in ASP 6 / 15

slide-34
SLIDE 34

Algorithm: At-least-1

1 L ← ∅

// consistency lower bound

2 while true do 3

P′ ← P ∪ {s. | s ∈ L}

4

P′ ← P′ ∪ {atleast1(S L).}

5

(res, µ) ← solve(P′)

6

if ¬res then return L

7

L ← L ∪(µ ∩ S)

Janota and Silva On Minimal Corrections in ASP 7 / 15

slide-35
SLIDE 35

Algorithm: Unit addition

1 L ← ∅

// consistency lower bound

2 while S = ∅ do 3

sf ← pick an arbitrary element from S

4

S ← S {sf }

5

L ← L ∪{sf }

6

P′ ← P′ ∪ {s. | s ∈ L}

7

P′ ← P ∪{choice(S).}

8

(res, µ) ← solve(P′)

9

if ¬res then L ← L {sf }

10

else L ← L ∪(µ ∩ S)

11 return L

Janota and Silva On Minimal Corrections in ASP 8 / 15

slide-36
SLIDE 36

Algorithm: Progression

1 L ← ∅

// consistency lower bound

2 K ← 1

// chunk size

3 while S = ∅ do 4

C ← pick min(| S |, K) arbitrary elements from S

5

S ← S C

6

L ← L ∪ C

7

P′ ← P′ ∪ {s. | s ∈ L}

8

P′ ← P ∪{choice(S).}

9

(res, µ) ← solve(P′)

10

if ¬res then // re-analyze chunk more finely

11

L ← L C

12

if K > 1 then S ← S ∪ C

13

K = 1 // reset chunk size

14

else

15

K ← 2K // double chunk size

16

L ← L ∪(µ ∩ S)

17 return L Janota and Silva On Minimal Corrections in ASP 9 / 15

slide-37
SLIDE 37

Minimal Correction Sets in ASP

Definition

Janota and Silva On Minimal Corrections in ASP 10 / 15

slide-38
SLIDE 38

Minimal Correction Sets in ASP

Definition

  • P be an inconsistent logic program

Janota and Silva On Minimal Corrections in ASP 10 / 15

slide-39
SLIDE 39

Minimal Correction Sets in ASP

Definition

  • P be an inconsistent logic program
  • A and R be sets of rules

Janota and Silva On Minimal Corrections in ASP 10 / 15

slide-40
SLIDE 40

Minimal Correction Sets in ASP

Definition

  • P be an inconsistent logic program
  • A and R be sets of rules
  • An (A, R)-correction of P is a pair (Mr, Ma) s.t.

Janota and Silva On Minimal Corrections in ASP 10 / 15

slide-41
SLIDE 41

Minimal Correction Sets in ASP

Definition

  • P be an inconsistent logic program
  • A and R be sets of rules
  • An (A, R)-correction of P is a pair (Mr, Ma) s.t.
  • Mr ⊆ R and Ma ⊆ A and the program

Janota and Silva On Minimal Corrections in ASP 10 / 15

slide-42
SLIDE 42

Minimal Correction Sets in ASP

Definition

  • P be an inconsistent logic program
  • A and R be sets of rules
  • An (A, R)-correction of P is a pair (Mr, Ma) s.t.
  • Mr ⊆ R and Ma ⊆ A and the program
  • (P \ Mr) ∪ Ma is consistent.

Janota and Silva On Minimal Corrections in ASP 10 / 15

slide-43
SLIDE 43

Minimal Correction Sets in ASP

Definition

  • P be an inconsistent logic program
  • A and R be sets of rules
  • An (A, R)-correction of P is a pair (Mr, Ma) s.t.
  • Mr ⊆ R and Ma ⊆ A and the program
  • (P \ Mr) ∪ Ma is consistent.
  • An (A, R)-correction (Mr, Ma) is minimal if

for any (A, R)-correction (M′

r, M′ a) such that M′ r ⊆ Mr and

M′

a ⊆ Ma, it holds that Ma = M′ a and Mr = M′ r.

Janota and Silva On Minimal Corrections in ASP 10 / 15

slide-44
SLIDE 44

Minimal Correction Sets and Maximal Consistency

To calculate (A, R)-correction via Maximal Consistency:

  • Introduce fresh atoms sr

r for each r ∈ R.

Janota and Silva On Minimal Corrections in ASP 11 / 15

slide-45
SLIDE 45

Minimal Correction Sets and Maximal Consistency

To calculate (A, R)-correction via Maximal Consistency:

  • Introduce fresh atoms sr

r for each r ∈ R.

  • Introduce fresh atoms sa

r for each r ∈ A.

Janota and Silva On Minimal Corrections in ASP 11 / 15

slide-46
SLIDE 46

Minimal Correction Sets and Maximal Consistency

To calculate (A, R)-correction via Maximal Consistency:

  • Introduce fresh atoms sr

r for each r ∈ R.

  • Introduce fresh atoms sa

r for each r ∈ A.

  • Replace each rule r ∈ R with head(r) ← sr

r , body(r)

Janota and Silva On Minimal Corrections in ASP 11 / 15

slide-47
SLIDE 47

Minimal Correction Sets and Maximal Consistency

To calculate (A, R)-correction via Maximal Consistency:

  • Introduce fresh atoms sr

r for each r ∈ R.

  • Introduce fresh atoms sa

r for each r ∈ A.

  • Replace each rule r ∈ R with head(r) ← sr

r , body(r)

  • Replace each rule r ∈ A with head(r) ← not sa

r , body(r).

Janota and Silva On Minimal Corrections in ASP 11 / 15

slide-48
SLIDE 48

Minimal Correction Sets and Maximal Consistency

To calculate (A, R)-correction via Maximal Consistency:

  • Introduce fresh atoms sr

r for each r ∈ R.

  • Introduce fresh atoms sa

r for each r ∈ A.

  • Replace each rule r ∈ R with head(r) ← sr

r , body(r)

  • Replace each rule r ∈ A with head(r) ← not sa

r , body(r).

  • Maximal consistent subset of the fresh atoms gives a minimal

correction.

Janota and Silva On Minimal Corrections in ASP 11 / 15

slide-49
SLIDE 49

Experimental Results

Family a p u x VBS knight [8,10] (95) 74 75 78 60 80 knight [8,4] (51) 7 13 13 7 14 patterns [16,10] (100) 100 100 100 100 100 patterns [20,15] (100) 100 100 100 100 100 solitaire [12] (18) 18 18 18 17 18 solitaire [14] (16) 12 9 11 4 13 graceful graphs [10,50] (100) 57 75 63 62 83 graceful graphs [30,20] (57) 56 57 57 55 57 total (537) 424 447 440 405 465

Janota and Silva On Minimal Corrections in ASP 12 / 15

slide-50
SLIDE 50

Experimental Results (Cont.)

300 350 400 450 500 instances 200 400 600 800 1000 CPU time (s)

VBS p u a x

Janota and Silva On Minimal Corrections in ASP 13 / 15

slide-51
SLIDE 51

Summary

  • Many recent results on algorithms for propositional logic

involving monotone predicates.

Janota and Silva On Minimal Corrections in ASP 14 / 15

slide-52
SLIDE 52

Summary

  • Many recent results on algorithms for propositional logic

involving monotone predicates.

  • What about ASP, which is not monotone?

Janota and Silva On Minimal Corrections in ASP 14 / 15

slide-53
SLIDE 53

Summary

  • Many recent results on algorithms for propositional logic

involving monotone predicates.

  • What about ASP, which is not monotone?
  • Idea: Using a choice rule let the solver choose one of the

supersets.

Janota and Silva On Minimal Corrections in ASP 14 / 15

slide-54
SLIDE 54

Summary

  • Many recent results on algorithms for propositional logic

involving monotone predicates.

  • What about ASP, which is not monotone?
  • Idea: Using a choice rule let the solver choose one of the

supersets.

  • 3 different algorithms developed.

Janota and Silva On Minimal Corrections in ASP 14 / 15

slide-55
SLIDE 55

Summary

  • Many recent results on algorithms for propositional logic

involving monotone predicates.

  • What about ASP, which is not monotone?
  • Idea: Using a choice rule let the solver choose one of the

supersets.

  • 3 different algorithms developed.
  • Link between maximal consistency and corrections.

Janota and Silva On Minimal Corrections in ASP 14 / 15

slide-56
SLIDE 56

Summary

  • Many recent results on algorithms for propositional logic

involving monotone predicates.

  • What about ASP, which is not monotone?
  • Idea: Using a choice rule let the solver choose one of the

supersets.

  • 3 different algorithms developed.
  • Link between maximal consistency and corrections.
  • More experiments.

Janota and Silva On Minimal Corrections in ASP 14 / 15

slide-57
SLIDE 57

Summary

  • Many recent results on algorithms for propositional logic

involving monotone predicates.

  • What about ASP, which is not monotone?
  • Idea: Using a choice rule let the solver choose one of the

supersets.

  • 3 different algorithms developed.
  • Link between maximal consistency and corrections.
  • More experiments.
  • More algorithms?

Janota and Silva On Minimal Corrections in ASP 14 / 15

slide-58
SLIDE 58

Summary

  • Many recent results on algorithms for propositional logic

involving monotone predicates.

  • What about ASP, which is not monotone?
  • Idea: Using a choice rule let the solver choose one of the

supersets.

  • 3 different algorithms developed.
  • Link between maximal consistency and corrections.
  • More experiments.
  • More algorithms?
  • How to obtain the “addition set”?

Janota and Silva On Minimal Corrections in ASP 14 / 15

slide-59
SLIDE 59

Summary

  • Many recent results on algorithms for propositional logic

involving monotone predicates.

  • What about ASP, which is not monotone?
  • Idea: Using a choice rule let the solver choose one of the

supersets.

  • 3 different algorithms developed.
  • Link between maximal consistency and corrections.
  • More experiments.
  • More algorithms?
  • How to obtain the “addition set”?
  • What are the good means for users to specify the addition

and removal sets?

Janota and Silva On Minimal Corrections in ASP 14 / 15

slide-60
SLIDE 60

Thank You for Your Attention! Questions?

Janota and Silva On Minimal Corrections in ASP 15 / 15

slide-61
SLIDE 61

Marques-Silva, J., Janota, M., and Belov, A. (2013). Minimal sets over monotone predicates in boolean formulae. In Computer Aided Verification - International Conference (CAV), pages 592–607.

Janota and Silva On Minimal Corrections in ASP 15 / 15