automated reasoning · 2018-12-07 · automated reasoning agostino dovier universita di udine`...

57
AUTOMATED REASONING Agostino Dovier Universit ` a di Udine CLPLAB Udine, December 7, 2018 AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE,DECEMBER 7, 2018 1/22

Upload: others

Post on 29-Jun-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

AUTOMATED REASONING

Agostino Dovier

Universita di UdineCLPLAB

Udine, December 7, 2018

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 1 / 22

Page 2: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

ASP solving (in short)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 2 / 22

Page 3: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

ASP SOLVING IN SHORT

The solving procedure starts from the ground program PThe first solver Smodels was a DPLL-like procedure (with a finalunfounded set check)The breakthrough come with Clasp which is based onconflict-driven clause learningIt starts as in DPLL, then it learns new clauses each time a failureis found

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 3 / 22

Page 4: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

ASP SOLVING IN SHORT

ω1︷ ︸︸ ︷(x1 ∨ x31 ∨ ¬x2)∧

ω2︷ ︸︸ ︷(x1 ∨ ¬x3)∧

ω3︷ ︸︸ ︷(x2 ∨ x3 ∨ x4)∧

ω4︷ ︸︸ ︷(¬x4 ∨ ¬x5)∧

ω5︷ ︸︸ ︷(x21 ∨ ¬x4 ∨ ¬x6)∧

ω6︷ ︸︸ ︷(x5 ∨ x6)

You can learn x31 ∨ x1 ∨ x21. (but also ¬x4 ∨ x21—various strategies are defined)[Marques-Silva, Lynce, and Malik. Handbook of Satisfiability, Chapter 4, 2008]

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 4 / 22

Page 5: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

ASP SOLVING IN SHORT

ω1︷ ︸︸ ︷(x1 ∨ x31 ∨ ¬x2)∧

ω2︷ ︸︸ ︷(x1 ∨ ¬x3)∧

ω3︷ ︸︸ ︷(x2 ∨ x3 ∨ x4)∧

ω4︷ ︸︸ ︷(¬x4 ∨ ¬x5)∧

ω5︷ ︸︸ ︷(x21 ∨ ¬x4 ∨ ¬x6)∧

ω6︷ ︸︸ ︷(x5 ∨ x6)

You can learn x31 ∨ x1 ∨ x21. (but also ¬x4 ∨ x21—various strategies are defined)[Marques-Silva, Lynce, and Malik. Handbook of Satisfiability, Chapter 4, 2008]

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 4 / 22

Page 6: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

ASP SOLVING IN SHORT

The graph is not “written somewhere”; it can be (partially) discovered using the so-calledresolution rule, namely

(α ∨ X) ∧ (β ∨ ¬X) ↔ (α ∨ β)

[Exercise: prove the equivalence!]

In the example:

ω1︷ ︸︸ ︷(x1 ∨ x31 ∨ ¬x2)∧

ω2︷ ︸︸ ︷(x1 ∨ ¬x3)∧

ω3︷ ︸︸ ︷(x2 ∨ x3 ∨ x4)∧

ω4︷ ︸︸ ︷(¬x4 ∨ ¬x5)∧

ω5︷ ︸︸ ︷(x21 ∨ ¬x4 ∨ ¬x6)∧

ω6︷ ︸︸ ︷(x5 ∨ x6)

X6 : ω5 ∧ ω6 ↔ (X21 ∨ ¬X4 ∨ X5)

X5 : (x21 ∨ ¬X4 ∨ X5) ∧ ω4 ↔ (x21 ∨ ¬X4) One could stop here or continue:

X4 : (x21 ∨ ¬X4) ∧ ω3 ↔ (X21 ∨ X2 ∨ X3)

X3 : (X21 ∨ X2 ∨ X3) ∧ ω2 ↔ (X21 ∨ X1 ∨ X2)

X2 : (X21 ∨ X1 ∨ X2) ∧ ω1 ↔ (X21 ∨ X31 ∨ X1)(now we have the decision variable of this level or variables of higher levels: stop)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 5 / 22

Page 7: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

SMODELS: ABSTRACT VIEWUNFOUNDED SET (VAN GELDER ET AL. 1991)

A set of atoms U is an unfounded set for a program P w.r.t. aninterpretation M if for each rule r ∈ P such that head(r) ∈ U it holdsthat

M 6|= Body(r) OR(M |= Body(r) AND) Body+(r) ∩ U 6= ∅

For instance, consider

p :- q, not rq :- p, not s

and suppose M = {p,q}. Then U = {p,q} is an unfounded set.

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 6 / 22

Page 8: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

“ABSTRACT” ASP SOLVING

Let us see an abstract description of the ASP solver proposed byYuliya Lierler (Univ. Nebraska at Omaha)

Guess who is who in the picture . . .AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 7 / 22

Page 9: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

SMODELS: ABSTRACT VIEW

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 8 / 22

Page 10: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

SMODELS: ABSTRACT VIEW

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 9 / 22

Page 11: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

CLASP (AND CUD@ASP)

Initial Propagation

Selection

Violation?Fail NoGoodCheckandPropagateNY

ViolationY N

LEVEL=1FailY

Conflict Analysis

N

Update ;Update A;

Update LEVEL

TOTAL Return AY

N

Update A;Increment LEVEL

LEVEL=1

Input ∅

The key of CLASP efficiency is conflict analysis and nogood learning

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 10 / 22

Page 12: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

Knowledge Representation

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 11 / 22

Page 13: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTION

Chitta Baral and Michael Gelfond. Logic Programming and KnowledgeRepresentation Journal of Logic Programming 19/20, 73–148, 1994. (PDFavailable on-line)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 12 / 22

Page 14: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTION

Chitta Baral and Michael Gelfond. Logic Programming and KnowledgeRepresentation Journal of Logic Programming 19/20, 73–148, 1994. (PDFavailable on-line)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 12 / 22

Page 15: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTION

Chitta Baral and Michael Gelfond. Logic Programming and KnowledgeRepresentation Journal of Logic Programming 19/20, 73–148, 1994. (PDFavailable on-line)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 12 / 22

Page 16: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTION

Chitta Baral and Michael Gelfond. Logic Programming and KnowledgeRepresentation Journal of Logic Programming 19/20, 73–148, 1994. (PDFavailable on-line)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 12 / 22

Page 17: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONTHE SYLLOGISM

Socrate is a manAll men are mortalTherefore Socrate is mortal

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 13 / 22

Page 18: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONTHE SYLLOGISM

Socrate is a manAll men are mortalTherefore Socrate is mortal

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 13 / 22

Page 19: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONTHE SYLLOGISM

Socrate is a manAll men are mortalTherefore Socrate is mortal

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 13 / 22

Page 20: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONTHE SYLLOGISM

Let us model this statement using f.o.l.Socrate is a man

man(socrate) (1)

All men are mortal

∀X (man(X )→ mortal(X )) (2)

Let’s have a look on the direction of the implication. If rex is a dog wehave that mortal(rex) but not that man(rex) One should know thata dog is not a man (or one can inference that using Complete WorldAssumption).Observe that

(1), (2) |= mortal(socrate)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 14 / 22

Page 21: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONTHE SYLLOGISM

Let us model this statement using f.o.l.Socrate is a man

man(socrate) (1)

All men are mortal

∀X (man(X )→ mortal(X )) (2)

Let’s have a look on the direction of the implication. If rex is a dog wehave that mortal(rex) but not that man(rex) One should know thata dog is not a man (or one can inference that using Complete WorldAssumption).Observe that

(1), (2) |= mortal(socrate)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 14 / 22

Page 22: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONTHE SYLLOGISM

Let us model this statement using f.o.l.Socrate is a man

man(socrate) (1)

All men are mortal

∀X (man(X )→ mortal(X )) (2)

Let’s have a look on the direction of the implication. If rex is a dog wehave that mortal(rex) but not that man(rex) One should know thata dog is not a man (or one can inference that using Complete WorldAssumption).Observe that

(1), (2) |= mortal(socrate)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 14 / 22

Page 23: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONTHE SYLLOGISM

Let us model this statement using f.o.l.Socrate is a man

man(socrate) (1)

All men are mortal

∀X (man(X )→ mortal(X )) (2)

Let’s have a look on the direction of the implication. If rex is a dog wehave that mortal(rex) but not that man(rex) One should know thata dog is not a man (or one can inference that using Complete WorldAssumption).Observe that

(1), (2) |= mortal(socrate)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 14 / 22

Page 24: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONTHE SYLLOGISM

Let us model this statement using f.o.l.Socrate is a man

man(socrate) (1)

All men are mortal

∀X (man(X )→ mortal(X )) (2)

Let’s have a look on the direction of the implication. If rex is a dog wehave that mortal(rex) but not that man(rex) One should know thata dog is not a man (or one can inference that using Complete WorldAssumption).Observe that

(1), (2) |= mortal(socrate)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 14 / 22

Page 25: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONTHE SYLLOGISM

Let us model this statement using f.o.l.Socrate is a man

man(socrate) (1)

All men are mortal

∀X (man(X )→ mortal(X )) (2)

Let’s have a look on the direction of the implication. If rex is a dog wehave that mortal(rex) but not that man(rex) One should know thata dog is not a man (or one can inference that using Complete WorldAssumption).Observe that

(1), (2) |= mortal(socrate)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 14 / 22

Page 26: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONTHE SYLLOGISM

Let us model this statement using f.o.l.Socrate is a man

man(socrate) (1)

All men are mortal

∀X (man(X )→ mortal(X )) (2)

Let’s have a look on the direction of the implication. If rex is a dog wehave that mortal(rex) but not that man(rex) One should know thata dog is not a man (or one can inference that using Complete WorldAssumption).Observe that

(1), (2) |= mortal(socrate)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 14 / 22

Page 27: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONTHE SYLLOGISM

Let us model this statement using f.o.l.Socrate is a man

man(socrate) (1)

All men are mortal

∀X (man(X )→ mortal(X )) (2)

Let’s have a look on the direction of the implication. If rex is a dog wehave that mortal(rex) but not that man(rex) One should know thata dog is not a man (or one can inference that using Complete WorldAssumption).Observe that

(1), (2) |= mortal(socrate)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 14 / 22

Page 28: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONTHE SYLLOGISM

If we discovered thatman(agostino) (3)

we have that(1), (2), (3) |= mortal(socrate)

and(1), (2), (3) |= mortal(agostino)

If, augmenting the premises, theorems that were true remains true(and possibly we have new theorems) we are in a monotonic setting.

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 15 / 22

Page 29: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONTHE SYLLOGISM

If we discovered thatman(agostino) (3)

we have that(1), (2), (3) |= mortal(socrate)

and(1), (2), (3) |= mortal(agostino)

If, augmenting the premises, theorems that were true remains true(and possibly we have new theorems) we are in a monotonic setting.

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 15 / 22

Page 30: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONNON MONOTONIC SETTINGS

You want to cross the railway.You can cross safely if the train is not there.If the barriers are horizontal the train is there.The barriers are vertical.You’ll probably crossNew info: If there is a power failure the barriers are always horizontalor always vertical.Would you cross now?New info: There is a power failure.Would you cross now?New info: You hear the train noise.Would you cross now?

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 16 / 22

Page 31: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONNON MONOTONIC SETTINGS

You want to cross the railway.You can cross safely if the train is not there.If the barriers are horizontal the train is there.The barriers are vertical.You’ll probably crossNew info: If there is a power failure the barriers are always horizontalor always vertical.Would you cross now?New info: There is a power failure.Would you cross now?New info: You hear the train noise.Would you cross now?

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 16 / 22

Page 32: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONNON MONOTONIC SETTINGS

You want to cross the railway.You can cross safely if the train is not there.If the barriers are horizontal the train is there.The barriers are vertical.You’ll probably crossNew info: If there is a power failure the barriers are always horizontalor always vertical.Would you cross now?New info: There is a power failure.Would you cross now?New info: You hear the train noise.Would you cross now?

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 16 / 22

Page 33: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONNON MONOTONIC SETTINGS

You want to cross the railway.You can cross safely if the train is not there.If the barriers are horizontal the train is there.The barriers are vertical.You’ll probably crossNew info: If there is a power failure the barriers are always horizontalor always vertical.Would you cross now?New info: There is a power failure.Would you cross now?New info: You hear the train noise.Would you cross now?

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 16 / 22

Page 34: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONNON MONOTONIC SETTINGS

You want to cross the railway.You can cross safely if the train is not there.If the barriers are horizontal the train is there.The barriers are vertical.You’ll probably crossNew info: If there is a power failure the barriers are always horizontalor always vertical.Would you cross now?New info: There is a power failure.Would you cross now?New info: You hear the train noise.Would you cross now?

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 16 / 22

Page 35: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONNON MONOTONIC SETTINGS

You want to cross the railway.You can cross safely if the train is not there.If the barriers are horizontal the train is there.The barriers are vertical.You’ll probably crossNew info: If there is a power failure the barriers are always horizontalor always vertical.Would you cross now?New info: There is a power failure.Would you cross now?New info: You hear the train noise.Would you cross now?

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 16 / 22

Page 36: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONNON MONOTONIC SETTINGS

You want to cross the railway.You can cross safely if the train is not there.If the barriers are horizontal the train is there.The barriers are vertical.You’ll probably crossNew info: If there is a power failure the barriers are always horizontalor always vertical.Would you cross now?New info: There is a power failure.Would you cross now?New info: You hear the train noise.Would you cross now?

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 16 / 22

Page 37: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONNON MONOTONIC SETTINGS

You want to cross the railway.You can cross safely if the train is not there.If the barriers are horizontal the train is there.The barriers are vertical.You’ll probably crossNew info: If there is a power failure the barriers are always horizontalor always vertical.Would you cross now?New info: There is a power failure.Would you cross now?New info: You hear the train noise.Would you cross now?

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 16 / 22

Page 38: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONNON MONOTONIC SETTINGS

You want to cross the railway.You can cross safely if the train is not there.If the barriers are horizontal the train is there.The barriers are vertical.You’ll probably crossNew info: If there is a power failure the barriers are always horizontalor always vertical.Would you cross now?New info: There is a power failure.Would you cross now?New info: You hear the train noise.Would you cross now?

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 16 / 22

Page 39: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONNON MONOTONIC SETTINGS

You want to cross the railway.You can cross safely if the train is not there.If the barriers are horizontal the train is there.The barriers are vertical.You’ll probably crossNew info: If there is a power failure the barriers are always horizontalor always vertical.Would you cross now?New info: There is a power failure.Would you cross now?New info: You hear the train noise.Would you cross now?

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 16 / 22

Page 40: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONNON MONOTONIC SETTINGS

You want to cross the railway.You can cross safely if the train is not there.If the barriers are horizontal the train is there.The barriers are vertical.You’ll probably crossNew info: If there is a power failure the barriers are always horizontalor always vertical.Would you cross now?New info: There is a power failure.Would you cross now?New info: You hear the train noise.Would you cross now?

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 16 / 22

Page 41: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONCOMMONSENSE REASONING

In commonsense reasoning we commonly (sometimes implicitly) usenormative statements of the kind:

A’s are normally B’s

that admit exceptions.

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 17 / 22

Page 42: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONCOMMONSENSE REASONING

Suppose that a reasoning agent has the following knowledgeabout birds: birds typically fly and penguins are non flyingbirds. He also knows that Tweety is a bird. Suppose now thatthe agent is hired to build a cage for Tweety, and he leaves offthe roof on the grounds that he does not whether or nor Tweetycan fly. It would be reasonable for us to view this argument asinvalid and to refuse the agent’s product. This would be notthe case if Tweety could not fly for some reason (unknown tothe agent), and we refused to pay for the bird cage becausehad unnecessarily put a roof on it. [McCarthy, 1959]

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 18 / 22

Page 43: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONCOMMONSENSE REASONING

Any bird flies, unless it is abnormal.Any penguin is a bird.Any songbird is a bird.Any penguin is abnormal.Put the roof for any flying bird.tweety is a bird.Build the cage for tweetytweety is a songbird

(pingu is a penguin)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 19 / 22

Page 44: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONCOMMONSENSE REASONING

Any bird flies, unless it is abnormal.Any penguin is a bird.Any songbird is a bird.Any penguin is abnormal.Put the roof for any flying bird.tweety is a bird.Build the cage for tweetytweety is a songbird

(pingu is a penguin)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 19 / 22

Page 45: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONCOMMONSENSE REASONING

Any bird flies, unless it is abnormal.Any penguin is a bird.Any songbird is a bird.Any penguin is abnormal.Put the roof for any flying bird.tweety is a bird.Build the cage for tweetytweety is a songbird

(pingu is a penguin)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 19 / 22

Page 46: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONCOMMONSENSE REASONING

Any bird flies, unless it is abnormal.Any penguin is a bird.Any songbird is a bird.Any penguin is abnormal.Put the roof for any flying bird.tweety is a bird.Build the cage for tweetytweety is a songbird

(pingu is a penguin)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 19 / 22

Page 47: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONCOMMONSENSE REASONING

Any bird flies, unless it is abnormal.Any penguin is a bird.Any songbird is a bird.Any penguin is abnormal.Put the roof for any flying bird.tweety is a bird.Build the cage for tweetytweety is a songbird

(pingu is a penguin)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 19 / 22

Page 48: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONCOMMONSENSE REASONING

Any bird flies, unless it is abnormal.Any penguin is a bird.Any songbird is a bird.Any penguin is abnormal.Put the roof for any flying bird.tweety is a bird.Build the cage for tweetytweety is a songbird

(pingu is a penguin)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 19 / 22

Page 49: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONCOMMONSENSE REASONING

Any bird flies, unless it is abnormal.Any penguin is a bird.Any songbird is a bird.Any penguin is abnormal.Put the roof for any flying bird.tweety is a bird.Build the cage for tweetytweety is a songbird

(pingu is a penguin)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 19 / 22

Page 50: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONCOMMONSENSE REASONING

Any bird flies, unless it is abnormal.Any penguin is a bird.Any songbird is a bird.Any penguin is abnormal.Put the roof for any flying bird.tweety is a bird.Build the cage for tweetytweety is a songbird

(pingu is a penguin)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 19 / 22

Page 51: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONCOMMONSENSE REASONING

Any bird flies, unless it is abnormal.Any penguin is a bird.Any songbird is a bird.Any penguin is abnormal.Put the roof for any flying bird.tweety is a bird.Build the cage for tweetytweety is a songbird

(pingu is a penguin)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 19 / 22

Page 52: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONCOMMONSENSE REASONING

Any bird that is not abnormal flies (for←, think of mosquitos)

∀X (bird(X ) ∧ ¬ab(X )→ flies(X )) (4)

Any penguin is a bird. Any songbird is a bird.

∀X (penguin(X )→ bird(X )) (5)

∀X (songbird(X )→ bird(X )) (6)

Any penguin is abnormal. Put the roof for any flying bird.

∀X (penguin(X )→ ab(X )) (7)

∀X (bird(X ) ∧ flies(X )→ put roof cage(X )) (8)

tweety is a bird.bird(tweety) (9)

(4), (5), (6), (7), (8),CWA |= put roof cage(tweety)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 20 / 22

Page 53: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONCOMMONSENSE REASONING

Any bird that is not abnormal flies (for←, think of mosquitos)

∀X (bird(X ) ∧ ¬ab(X )→ flies(X )) (4)

Any penguin is a bird. Any songbird is a bird.

∀X (penguin(X )→ bird(X )) (5)

∀X (songbird(X )→ bird(X )) (6)

Any penguin is abnormal. Put the roof for any flying bird.

∀X (penguin(X )→ ab(X )) (7)

∀X (bird(X ) ∧ flies(X )→ put roof cage(X )) (8)

tweety is a bird.bird(tweety) (9)

(4), (5), (6), (7), (8),CWA |= put roof cage(tweety)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 20 / 22

Page 54: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONCOMMONSENSE REASONING

Any bird that is not abnormal flies (for←, think of mosquitos)

∀X (bird(X ) ∧ ¬ab(X )→ flies(X )) (4)

Any penguin is a bird. Any songbird is a bird.

∀X (penguin(X )→ bird(X )) (5)

∀X (songbird(X )→ bird(X )) (6)

Any penguin is abnormal. Put the roof for any flying bird.

∀X (penguin(X )→ ab(X )) (7)

∀X (bird(X ) ∧ flies(X )→ put roof cage(X )) (8)

tweety is a bird.bird(tweety) (9)

(4), (5), (6), (7), (8),CWA |= put roof cage(tweety)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 20 / 22

Page 55: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONCOMMONSENSE REASONING

If we knew thatsongbird(tweety) (10)

it still holds that

(4), (5), (6), (7), (8), (9), (10),CWA |= put roof cage(tweety)

Let us repeat with pingu. We know that is is a bird:

bird(pingu) (11)

Then(4)–(11),CWA |= put roof cage(pingu)

If we now discover that

penguin(pingu) (12)

We’ll have that:

(4)–(11), (12),CWA 6|= put roof cage(pingu)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 21 / 22

Page 56: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONCOMMONSENSE REASONING

If we knew thatsongbird(tweety) (10)

it still holds that

(4), (5), (6), (7), (8), (9), (10),CWA |= put roof cage(tweety)

Let us repeat with pingu. We know that is is a bird:

bird(pingu) (11)

Then(4)–(11),CWA |= put roof cage(pingu)

If we now discover that

penguin(pingu) (12)

We’ll have that:

(4)–(11), (12),CWA 6|= put roof cage(pingu)

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 21 / 22

Page 57: AUTOMATED REASONING · 2018-12-07 · AUTOMATED REASONING Agostino Dovier Universita di Udine` CLPLAB Udine, December 7, ... [Marques-Silva, Lynce, and Malik. Handbook of Satisfiability,

INTRODUCTIONCOMMONSENSE REASONING

Default negation and stable models allow us to deal withcommonsense reasoning!

Encode the previous example in ASP.

AGOSTINO DOVIER (CLPLAB) AUTOMATED REASONING UDINE, DECEMBER 7, 2018 22 / 22