Propositional Logic Exercises€¦ · Propositional Logic Exercises Mario Alviano University of...

Preview:

Citation preview

Propositional LogicExercises

Mario Alviano

University of Calabria, Italy

A.Y. 2017/2018

1 / 23

Outline

1 Understanding

2 Tautologies, contradictions, satisfiability, etc.

3 Normal Forms

4 Modelling

5 Reduction to Satisfiability

2 / 23

Outline

1 Understanding

2 Tautologies, contradictions, satisfiability, etc.

3 Normal Forms

4 Modelling

5 Reduction to Satisfiability

3 / 23

Understanding: Mode of reasoning (1)

Deduction, induction, or abduction?

1 You are walking on the bridge at Unical for the first time,South to North direction

You see a cube with a sign 0The next one has a sign 1, and then one with sign 2You conclude that cubes are associated to increasingnatural numbers, where 0 is associated to the south-mostcube

2 You are still walking on the bridge

You note that after cube 25 comes cube 27You conclude that there is no cube 26Perhaps, it may be an exception! (I really don’t know)

3 Reached cube 31, someone asks you where is cube 42?

You have never seen cube 42Still you can provide an answerCube 42 is north of here (or there is no cube 42!)

4 / 23

Understanding: Mode of reasoning (1)

Deduction, induction, or abduction?

1 You are walking on the bridge at Unical for the first time,South to North direction

You see a cube with a sign 0

The next one has a sign 1, and then one with sign 2You conclude that cubes are associated to increasingnatural numbers, where 0 is associated to the south-mostcube

2 You are still walking on the bridge

You note that after cube 25 comes cube 27You conclude that there is no cube 26Perhaps, it may be an exception! (I really don’t know)

3 Reached cube 31, someone asks you where is cube 42?

You have never seen cube 42Still you can provide an answerCube 42 is north of here (or there is no cube 42!)

4 / 23

Understanding: Mode of reasoning (1)

Deduction, induction, or abduction?

1 You are walking on the bridge at Unical for the first time,South to North direction

You see a cube with a sign 0The next one has a sign 1, and then one with sign 2

You conclude that cubes are associated to increasingnatural numbers, where 0 is associated to the south-mostcube

2 You are still walking on the bridge

You note that after cube 25 comes cube 27You conclude that there is no cube 26Perhaps, it may be an exception! (I really don’t know)

3 Reached cube 31, someone asks you where is cube 42?

You have never seen cube 42Still you can provide an answerCube 42 is north of here (or there is no cube 42!)

4 / 23

Understanding: Mode of reasoning (1)

Deduction, induction, or abduction?

1 You are walking on the bridge at Unical for the first time,South to North direction

You see a cube with a sign 0The next one has a sign 1, and then one with sign 2You conclude that cubes are associated to increasingnatural numbers, where 0 is associated to the south-mostcube

2 You are still walking on the bridge

You note that after cube 25 comes cube 27You conclude that there is no cube 26Perhaps, it may be an exception! (I really don’t know)

3 Reached cube 31, someone asks you where is cube 42?

You have never seen cube 42Still you can provide an answerCube 42 is north of here (or there is no cube 42!)

4 / 23

Understanding: Mode of reasoning (1)

Deduction, induction, or abduction?

1 You are walking on the bridge at Unical for the first time,South to North direction

You see a cube with a sign 0The next one has a sign 1, and then one with sign 2You conclude that cubes are associated to increasingnatural numbers, where 0 is associated to the south-mostcube

2 You are still walking on the bridge

You note that after cube 25 comes cube 27You conclude that there is no cube 26Perhaps, it may be an exception! (I really don’t know)

3 Reached cube 31, someone asks you where is cube 42?

You have never seen cube 42Still you can provide an answerCube 42 is north of here (or there is no cube 42!)

4 / 23

Understanding: Mode of reasoning (1)

Deduction, induction, or abduction?

1 You are walking on the bridge at Unical for the first time,South to North direction

You see a cube with a sign 0The next one has a sign 1, and then one with sign 2You conclude that cubes are associated to increasingnatural numbers, where 0 is associated to the south-mostcube

2 You are still walking on the bridgeYou note that after cube 25 comes cube 27

You conclude that there is no cube 26Perhaps, it may be an exception! (I really don’t know)

3 Reached cube 31, someone asks you where is cube 42?

You have never seen cube 42Still you can provide an answerCube 42 is north of here (or there is no cube 42!)

4 / 23

Understanding: Mode of reasoning (1)

Deduction, induction, or abduction?

1 You are walking on the bridge at Unical for the first time,South to North direction

You see a cube with a sign 0The next one has a sign 1, and then one with sign 2You conclude that cubes are associated to increasingnatural numbers, where 0 is associated to the south-mostcube

2 You are still walking on the bridgeYou note that after cube 25 comes cube 27You conclude that there is no cube 26

Perhaps, it may be an exception! (I really don’t know)3 Reached cube 31, someone asks you where is cube 42?

You have never seen cube 42Still you can provide an answerCube 42 is north of here (or there is no cube 42!)

4 / 23

Understanding: Mode of reasoning (1)

Deduction, induction, or abduction?

1 You are walking on the bridge at Unical for the first time,South to North direction

You see a cube with a sign 0The next one has a sign 1, and then one with sign 2You conclude that cubes are associated to increasingnatural numbers, where 0 is associated to the south-mostcube

2 You are still walking on the bridgeYou note that after cube 25 comes cube 27You conclude that there is no cube 26Perhaps, it may be an exception! (I really don’t know)

3 Reached cube 31, someone asks you where is cube 42?

You have never seen cube 42Still you can provide an answerCube 42 is north of here (or there is no cube 42!)

4 / 23

Understanding: Mode of reasoning (1)

Deduction, induction, or abduction?

1 You are walking on the bridge at Unical for the first time,South to North direction

You see a cube with a sign 0The next one has a sign 1, and then one with sign 2You conclude that cubes are associated to increasingnatural numbers, where 0 is associated to the south-mostcube

2 You are still walking on the bridgeYou note that after cube 25 comes cube 27You conclude that there is no cube 26Perhaps, it may be an exception! (I really don’t know)

3 Reached cube 31, someone asks you where is cube 42?

You have never seen cube 42Still you can provide an answerCube 42 is north of here (or there is no cube 42!)

4 / 23

Understanding: Mode of reasoning (1)

Deduction, induction, or abduction?

1 You are walking on the bridge at Unical for the first time,South to North direction

You see a cube with a sign 0The next one has a sign 1, and then one with sign 2You conclude that cubes are associated to increasingnatural numbers, where 0 is associated to the south-mostcube

2 You are still walking on the bridgeYou note that after cube 25 comes cube 27You conclude that there is no cube 26Perhaps, it may be an exception! (I really don’t know)

3 Reached cube 31, someone asks you where is cube 42?You have never seen cube 42

Still you can provide an answerCube 42 is north of here (or there is no cube 42!)

4 / 23

Understanding: Mode of reasoning (1)

Deduction, induction, or abduction?

1 You are walking on the bridge at Unical for the first time,South to North direction

You see a cube with a sign 0The next one has a sign 1, and then one with sign 2You conclude that cubes are associated to increasingnatural numbers, where 0 is associated to the south-mostcube

2 You are still walking on the bridgeYou note that after cube 25 comes cube 27You conclude that there is no cube 26Perhaps, it may be an exception! (I really don’t know)

3 Reached cube 31, someone asks you where is cube 42?You have never seen cube 42Still you can provide an answer

Cube 42 is north of here (or there is no cube 42!)

4 / 23

Understanding: Mode of reasoning (1)

Deduction, induction, or abduction?

1 You are walking on the bridge at Unical for the first time,South to North direction

You see a cube with a sign 0The next one has a sign 1, and then one with sign 2You conclude that cubes are associated to increasingnatural numbers, where 0 is associated to the south-mostcube

2 You are still walking on the bridgeYou note that after cube 25 comes cube 27You conclude that there is no cube 26Perhaps, it may be an exception! (I really don’t know)

3 Reached cube 31, someone asks you where is cube 42?You have never seen cube 42Still you can provide an answerCube 42 is north of here (or there is no cube 42!)

4 / 23

Understanding: Mode of reasoning (2)

You push the on/offbutton, but no lightturns on

You buy a package ofBeloCafe and obtainbad coffeeThen, you buy apackage of Guglielmoand obtain good coffee

5 / 23

Understanding: Mode of reasoning (2)

You push the on/offbutton, but no lightturns on

You buy a package ofBeloCafe and obtainbad coffeeThen, you buy apackage of Guglielmoand obtain good coffee

5 / 23

Understanding: Mode of reasoning (2)

You push the on/offbutton, but no lightturns on

You buy a package ofBeloCafe and obtainbad coffeeThen, you buy apackage of Guglielmoand obtain good coffee

5 / 23

Understanding: Implication (1)

L→ S

Sentences associated to propositions

L has librettoS is student

If one has a libretto then they1 is a student

L S L→ Sdoesn’t have libretto is no student

OK!

has libretto is no student

NO!

doesn’t have libretto is student

OK!

has libretto is student

OK!

1

Amazing British English stuff: Singular they!

6 / 23

Understanding: Implication (1)

L→ S

Sentences associated to propositions

L has librettoS is student

If one has a libretto then they1 is a student

L S L→ Sdoesn’t have libretto is no student

OK!

has libretto is no student

NO!

doesn’t have libretto is student

OK!

has libretto is student

OK!

1

Amazing British English stuff: Singular they!

6 / 23

Understanding: Implication (1)

L→ S

Sentences associated to propositions

L has librettoS is student

If one has a libretto then they1 is a student

L S L→ Sdoesn’t have libretto is no student

OK!

has libretto is no student

NO!

doesn’t have libretto is student

OK!

has libretto is student

OK!

1Amazing British English stuff: Singular they!6 / 23

Understanding: Implication (1)

L→ S

Sentences associated to propositions

L has librettoS is student

If one has a libretto then they1 is a student

L S L→ Sdoesn’t have libretto is no student

OK!

has libretto is no student

NO!

doesn’t have libretto is student

OK!

has libretto is student

OK!

1Amazing British English stuff: Singular they!6 / 23

Understanding: Implication (1)

L→ S

Sentences associated to propositions

L has librettoS is student

If one has a libretto then they1 is a student

L S L→ Sdoesn’t have libretto is no student OK!

has libretto is no student

NO!

doesn’t have libretto is student

OK!

has libretto is student

OK!

1Amazing British English stuff: Singular they!6 / 23

Understanding: Implication (1)

L→ S

Sentences associated to propositions

L has librettoS is student

If one has a libretto then they1 is a student

L S L→ Sdoesn’t have libretto is no student OK!

has libretto is no student NO!doesn’t have libretto is student

OK!

has libretto is student

OK!

1Amazing British English stuff: Singular they!6 / 23

Understanding: Implication (1)

L→ S

Sentences associated to propositions

L has librettoS is student

If one has a libretto then they1 is a student

L S L→ Sdoesn’t have libretto is no student OK!

has libretto is no student NO!doesn’t have libretto is student OK!

has libretto is student

OK!

1Amazing British English stuff: Singular they!6 / 23

Understanding: Implication (1)

L→ S

Sentences associated to propositions

L has librettoS is student

If one has a libretto then they1 is a student

L S L→ Sdoesn’t have libretto is no student OK!

has libretto is no student NO!doesn’t have libretto is student OK!

has libretto is student OK!1Amazing British English stuff: Singular they!

6 / 23

Understanding: Implication (2)

Exercise

Which formula represents the following proposition?

Students are exactly those who have a libretto

L S

L↔ S

doesn’t have libretto is no student

OK!

has libretto is no student

NO!

doesn’t have libretto is student

NO!

has libretto is student

OK!

7 / 23

Understanding: Implication (2)

Exercise

Which formula represents the following proposition?

Students are exactly those who have a libretto

L S

L↔ S

doesn’t have libretto is no student OK!has libretto is no student

NO!

doesn’t have libretto is student

NO!

has libretto is student

OK!

7 / 23

Understanding: Implication (2)

Exercise

Which formula represents the following proposition?

Students are exactly those who have a libretto

L S

L↔ S

doesn’t have libretto is no student OK!has libretto is no student NO!

doesn’t have libretto is student

NO!

has libretto is student

OK!

7 / 23

Understanding: Implication (2)

Exercise

Which formula represents the following proposition?

Students are exactly those who have a libretto

L S

L↔ S

doesn’t have libretto is no student OK!has libretto is no student NO!

doesn’t have libretto is student NO!has libretto is student

OK!

7 / 23

Understanding: Implication (2)

Exercise

Which formula represents the following proposition?

Students are exactly those who have a libretto

L S

L↔ S

doesn’t have libretto is no student OK!has libretto is no student NO!

doesn’t have libretto is student NO!has libretto is student OK!

7 / 23

Understanding: Implication (2)

Exercise

Which formula represents the following proposition?

Students are exactly those who have a libretto

L S L↔ Sdoesn’t have libretto is no student OK!

has libretto is no student NO!doesn’t have libretto is student NO!

has libretto is student OK!

7 / 23

Understanding: Eliminate parentheses

Exercise 1.1 from Logica a Informatica

1 ((A ∧ B)→ (¬C))

2 (A→ (B → (¬C)))

3 ((A ∧ B) ∨ (C → C))

4 (¬(A ∨ ((¬B)→ C)))

5 (A→ (B ∨ (C → D)))

6 (¬((¬(¬(¬A))) ∧ ⊥))7 (A→ (B ∧ ((¬C) ∨ D)))

Where to place parentheses in the following one?

A→ B → C

8 / 23

Understanding: Eliminate parentheses

Exercise 1.1 from Logica a Informatica

1 ((A ∧ B)→ (¬C))

2 (A→ (B → (¬C)))

3 ((A ∧ B) ∨ (C → C))

4 (¬(A ∨ ((¬B)→ C)))

5 (A→ (B ∨ (C → D)))

6 (¬((¬(¬(¬A))) ∧ ⊥))7 (A→ (B ∧ ((¬C) ∨ D)))

Where to place parentheses in the following one?

A→ B → C

8 / 23

Understanding: Eliminate parentheses

Exercise 1.1 from Logica a Informatica

1 ((A ∧ B)→ (¬C))

2 (A→ (B → (¬C)))

3 ((A ∧ B) ∨ (C → C))

4 (¬(A ∨ ((¬B)→ C)))

5 (A→ (B ∨ (C → D)))

6 (¬((¬(¬(¬A))) ∧ ⊥))7 (A→ (B ∧ ((¬C) ∨ D)))

Where to place parentheses in the following one?

A→ B → C

8 / 23

Understanding: Eliminate parentheses

Exercise 1.1 from Logica a Informatica

1 ((A ∧ B)→ (¬C))

2 (A→ (B → (¬C)))

3 ((A ∧ B) ∨ (C → C))

4 (¬(A ∨ ((¬B)→ C)))

5 (A→ (B ∨ (C → D)))

6 (¬((¬(¬(¬A))) ∧ ⊥))7 (A→ (B ∧ ((¬C) ∨ D)))

Where to place parentheses in the following one?

A→ B → C

8 / 23

Understanding: Eliminate parentheses

Exercise 1.1 from Logica a Informatica

1 ((A ∧ B)→ (¬C))

2 (A→ (B → (¬C)))

3 ((A ∧ B) ∨ (C → C))

4 (¬(A ∨ ((¬B)→ C)))

5 (A→ (B ∨ (C → D)))

6 (¬((¬(¬(¬A))) ∧ ⊥))7 (A→ (B ∧ ((¬C) ∨ D)))

Where to place parentheses in the following one?

A→ B → C

8 / 23

Understanding: Eliminate parentheses

Exercise 1.1 from Logica a Informatica

1 ((A ∧ B)→ (¬C))

2 (A→ (B → (¬C)))

3 ((A ∧ B) ∨ (C → C))

4 (¬(A ∨ ((¬B)→ C)))

5 (A→ (B ∨ (C → D)))

6 (¬((¬(¬(¬A))) ∧ ⊥))

7 (A→ (B ∧ ((¬C) ∨ D)))

Where to place parentheses in the following one?

A→ B → C

8 / 23

Understanding: Eliminate parentheses

Exercise 1.1 from Logica a Informatica

1 ((A ∧ B)→ (¬C))

2 (A→ (B → (¬C)))

3 ((A ∧ B) ∨ (C → C))

4 (¬(A ∨ ((¬B)→ C)))

5 (A→ (B ∨ (C → D)))

6 (¬((¬(¬(¬A))) ∧ ⊥))7 (A→ (B ∧ ((¬C) ∨ D)))

Where to place parentheses in the following one?

A→ B → C

8 / 23

Understanding: Eliminate parentheses

Exercise 1.1 from Logica a Informatica

1 ((A ∧ B)→ (¬C))

2 (A→ (B → (¬C)))

3 ((A ∧ B) ∨ (C → C))

4 (¬(A ∨ ((¬B)→ C)))

5 (A→ (B ∨ (C → D)))

6 (¬((¬(¬(¬A))) ∧ ⊥))7 (A→ (B ∧ ((¬C) ∨ D)))

Where to place parentheses in the following one?

A→ B → C

8 / 23

Outline

1 Understanding

2 Tautologies, contradictions, satisfiability, etc.

3 Normal Forms

4 Modelling

5 Reduction to Satisfiability

9 / 23

Tautologies and contradictions

Exercise 1.3 from Logica a Informatica

Decide whether the following formulas are tautologies orcontradictions:

1 (A→ (B → C))→ ((A→ B)→ (A→ C))

2 ¬(A→ ¬A)3 A ∨ ¬A4 ⊥ → A5 ¬A→ (A→ B)

6 (A ∧ B) ∧ (¬B ∨ C)

7 A ∨ B → A ∧ B8 (A→ C)→ ((B → C)→ (A ∨ B → C))

9 (A→ B)→ ((B → ¬C)→ ¬A)

Which of these formulas are satisfiable?

10 / 23

Tautologies and contradictions

Exercise 1.3 from Logica a Informatica

Decide whether the following formulas are tautologies orcontradictions:

1 (A→ (B → C))→ ((A→ B)→ (A→ C))

2 ¬(A→ ¬A)

3 A ∨ ¬A4 ⊥ → A5 ¬A→ (A→ B)

6 (A ∧ B) ∧ (¬B ∨ C)

7 A ∨ B → A ∧ B8 (A→ C)→ ((B → C)→ (A ∨ B → C))

9 (A→ B)→ ((B → ¬C)→ ¬A)

Which of these formulas are satisfiable?

10 / 23

Tautologies and contradictions

Exercise 1.3 from Logica a Informatica

Decide whether the following formulas are tautologies orcontradictions:

1 (A→ (B → C))→ ((A→ B)→ (A→ C))

2 ¬(A→ ¬A)3 A ∨ ¬A

4 ⊥ → A5 ¬A→ (A→ B)

6 (A ∧ B) ∧ (¬B ∨ C)

7 A ∨ B → A ∧ B8 (A→ C)→ ((B → C)→ (A ∨ B → C))

9 (A→ B)→ ((B → ¬C)→ ¬A)

Which of these formulas are satisfiable?

10 / 23

Tautologies and contradictions

Exercise 1.3 from Logica a Informatica

Decide whether the following formulas are tautologies orcontradictions:

1 (A→ (B → C))→ ((A→ B)→ (A→ C))

2 ¬(A→ ¬A)3 A ∨ ¬A4 ⊥ → A

5 ¬A→ (A→ B)

6 (A ∧ B) ∧ (¬B ∨ C)

7 A ∨ B → A ∧ B8 (A→ C)→ ((B → C)→ (A ∨ B → C))

9 (A→ B)→ ((B → ¬C)→ ¬A)

Which of these formulas are satisfiable?

10 / 23

Tautologies and contradictions

Exercise 1.3 from Logica a Informatica

Decide whether the following formulas are tautologies orcontradictions:

1 (A→ (B → C))→ ((A→ B)→ (A→ C))

2 ¬(A→ ¬A)3 A ∨ ¬A4 ⊥ → A5 ¬A→ (A→ B)

6 (A ∧ B) ∧ (¬B ∨ C)

7 A ∨ B → A ∧ B8 (A→ C)→ ((B → C)→ (A ∨ B → C))

9 (A→ B)→ ((B → ¬C)→ ¬A)

Which of these formulas are satisfiable?

10 / 23

Tautologies and contradictions

Exercise 1.3 from Logica a Informatica

Decide whether the following formulas are tautologies orcontradictions:

1 (A→ (B → C))→ ((A→ B)→ (A→ C))

2 ¬(A→ ¬A)3 A ∨ ¬A4 ⊥ → A5 ¬A→ (A→ B)

6 (A ∧ B) ∧ (¬B ∨ C)

7 A ∨ B → A ∧ B8 (A→ C)→ ((B → C)→ (A ∨ B → C))

9 (A→ B)→ ((B → ¬C)→ ¬A)

Which of these formulas are satisfiable?

10 / 23

Tautologies and contradictions

Exercise 1.3 from Logica a Informatica

Decide whether the following formulas are tautologies orcontradictions:

1 (A→ (B → C))→ ((A→ B)→ (A→ C))

2 ¬(A→ ¬A)3 A ∨ ¬A4 ⊥ → A5 ¬A→ (A→ B)

6 (A ∧ B) ∧ (¬B ∨ C)

7 A ∨ B → A ∧ B

8 (A→ C)→ ((B → C)→ (A ∨ B → C))

9 (A→ B)→ ((B → ¬C)→ ¬A)

Which of these formulas are satisfiable?

10 / 23

Tautologies and contradictions

Exercise 1.3 from Logica a Informatica

Decide whether the following formulas are tautologies orcontradictions:

1 (A→ (B → C))→ ((A→ B)→ (A→ C))

2 ¬(A→ ¬A)3 A ∨ ¬A4 ⊥ → A5 ¬A→ (A→ B)

6 (A ∧ B) ∧ (¬B ∨ C)

7 A ∨ B → A ∧ B8 (A→ C)→ ((B → C)→ (A ∨ B → C))

9 (A→ B)→ ((B → ¬C)→ ¬A)

Which of these formulas are satisfiable?

10 / 23

Tautologies and contradictions

Exercise 1.3 from Logica a Informatica

Decide whether the following formulas are tautologies orcontradictions:

1 (A→ (B → C))→ ((A→ B)→ (A→ C))

2 ¬(A→ ¬A)3 A ∨ ¬A4 ⊥ → A5 ¬A→ (A→ B)

6 (A ∧ B) ∧ (¬B ∨ C)

7 A ∨ B → A ∧ B8 (A→ C)→ ((B → C)→ (A ∨ B → C))

9 (A→ B)→ ((B → ¬C)→ ¬A)

Which of these formulas are satisfiable?

10 / 23

Tautologies and contradictions

Exercise 1.3 from Logica a Informatica

Decide whether the following formulas are tautologies orcontradictions:

1 (A→ (B → C))→ ((A→ B)→ (A→ C))

2 ¬(A→ ¬A)3 A ∨ ¬A4 ⊥ → A5 ¬A→ (A→ B)

6 (A ∧ B) ∧ (¬B ∨ C)

7 A ∨ B → A ∧ B8 (A→ C)→ ((B → C)→ (A ∨ B → C))

9 (A→ B)→ ((B → ¬C)→ ¬A)

Which of these formulas are satisfiable?10 / 23

Satisfiability

Similar to Exercise 1.4 from Logica a Informatica

Decide whether the following formula is satisfiable:

(A1 ∨ A2) ∧ (¬A2 ∨ ¬A3) ∧ (A3 ∨ A4) ∧ (¬A4 ∨ A5)

2-CNFs formulas, also known as Krom formulas,can be solved in linear time!

11 / 23

Satisfiability

Similar to Exercise 1.4 from Logica a Informatica

Decide whether the following formula is satisfiable:

(A1 ∨ A2) ∧ (¬A2 ∨ ¬A3) ∧ (A3 ∨ A4) ∧ (¬A4 ∨ A5)

2-CNFs formulas, also known as Krom formulas,can be solved in linear time!

11 / 23

Equivalences and consequences (1)

Exercise 1.8 from Logica a Informatica

Prove the following claims:1 ⊥ ∨ B ≡ B

2 ¬⊥ ∧ B ≡ B3 A |= A4 A |= B and B |= C implies A |= C5 |= A→ B implies A ∧ B ≡ A and A ∨ B ≡ B6 |= A implies A ∧ B ≡ B7 |= A implies ¬A ∨ B ≡ B8 If A |= B and A |= ¬B then |= ¬A9 If A |= C and B |= C then A ∨ B |= C

What are A, B and C?

12 / 23

Equivalences and consequences (1)

Exercise 1.8 from Logica a Informatica

Prove the following claims:1 ⊥ ∨ B ≡ B2 ¬⊥ ∧ B ≡ B

3 A |= A4 A |= B and B |= C implies A |= C5 |= A→ B implies A ∧ B ≡ A and A ∨ B ≡ B6 |= A implies A ∧ B ≡ B7 |= A implies ¬A ∨ B ≡ B8 If A |= B and A |= ¬B then |= ¬A9 If A |= C and B |= C then A ∨ B |= C

What are A, B and C?

12 / 23

Equivalences and consequences (1)

Exercise 1.8 from Logica a Informatica

Prove the following claims:1 ⊥ ∨ B ≡ B2 ¬⊥ ∧ B ≡ B3 A |= A

4 A |= B and B |= C implies A |= C5 |= A→ B implies A ∧ B ≡ A and A ∨ B ≡ B6 |= A implies A ∧ B ≡ B7 |= A implies ¬A ∨ B ≡ B8 If A |= B and A |= ¬B then |= ¬A9 If A |= C and B |= C then A ∨ B |= C

What are A, B and C?

12 / 23

Equivalences and consequences (1)

Exercise 1.8 from Logica a Informatica

Prove the following claims:1 ⊥ ∨ B ≡ B2 ¬⊥ ∧ B ≡ B3 A |= A4 A |= B and B |= C implies A |= C

5 |= A→ B implies A ∧ B ≡ A and A ∨ B ≡ B6 |= A implies A ∧ B ≡ B7 |= A implies ¬A ∨ B ≡ B8 If A |= B and A |= ¬B then |= ¬A9 If A |= C and B |= C then A ∨ B |= C

What are A, B and C?

12 / 23

Equivalences and consequences (1)

Exercise 1.8 from Logica a Informatica

Prove the following claims:1 ⊥ ∨ B ≡ B2 ¬⊥ ∧ B ≡ B3 A |= A4 A |= B and B |= C implies A |= C5 |= A→ B implies A ∧ B ≡ A and A ∨ B ≡ B

6 |= A implies A ∧ B ≡ B7 |= A implies ¬A ∨ B ≡ B8 If A |= B and A |= ¬B then |= ¬A9 If A |= C and B |= C then A ∨ B |= C

What are A, B and C?

12 / 23

Equivalences and consequences (1)

Exercise 1.8 from Logica a Informatica

Prove the following claims:1 ⊥ ∨ B ≡ B2 ¬⊥ ∧ B ≡ B3 A |= A4 A |= B and B |= C implies A |= C5 |= A→ B implies A ∧ B ≡ A and A ∨ B ≡ B6 |= A implies A ∧ B ≡ B

7 |= A implies ¬A ∨ B ≡ B8 If A |= B and A |= ¬B then |= ¬A9 If A |= C and B |= C then A ∨ B |= C

What are A, B and C?

12 / 23

Equivalences and consequences (1)

Exercise 1.8 from Logica a Informatica

Prove the following claims:1 ⊥ ∨ B ≡ B2 ¬⊥ ∧ B ≡ B3 A |= A4 A |= B and B |= C implies A |= C5 |= A→ B implies A ∧ B ≡ A and A ∨ B ≡ B6 |= A implies A ∧ B ≡ B7 |= A implies ¬A ∨ B ≡ B

8 If A |= B and A |= ¬B then |= ¬A9 If A |= C and B |= C then A ∨ B |= C

What are A, B and C?

12 / 23

Equivalences and consequences (1)

Exercise 1.8 from Logica a Informatica

Prove the following claims:1 ⊥ ∨ B ≡ B2 ¬⊥ ∧ B ≡ B3 A |= A4 A |= B and B |= C implies A |= C5 |= A→ B implies A ∧ B ≡ A and A ∨ B ≡ B6 |= A implies A ∧ B ≡ B7 |= A implies ¬A ∨ B ≡ B8 If A |= B and A |= ¬B then |= ¬A

9 If A |= C and B |= C then A ∨ B |= C

What are A, B and C?

12 / 23

Equivalences and consequences (1)

Exercise 1.8 from Logica a Informatica

Prove the following claims:1 ⊥ ∨ B ≡ B2 ¬⊥ ∧ B ≡ B3 A |= A4 A |= B and B |= C implies A |= C5 |= A→ B implies A ∧ B ≡ A and A ∨ B ≡ B6 |= A implies A ∧ B ≡ B7 |= A implies ¬A ∨ B ≡ B8 If A |= B and A |= ¬B then |= ¬A9 If A |= C and B |= C then A ∨ B |= C

What are A, B and C?

12 / 23

Equivalences and consequences (1)

Exercise 1.8 from Logica a Informatica

Prove the following claims:1 ⊥ ∨ B ≡ B2 ¬⊥ ∧ B ≡ B3 A |= A4 A |= B and B |= C implies A |= C5 |= A→ B implies A ∧ B ≡ A and A ∨ B ≡ B6 |= A implies A ∧ B ≡ B7 |= A implies ¬A ∨ B ≡ B8 If A |= B and A |= ¬B then |= ¬A9 If A |= C and B |= C then A ∨ B |= C

What are A, B and C?

12 / 23

Equivalences and consequences (2)

Exercise 1.9 from Logica a Informatica

Check whether the following claims hold or not:1 If A |= B then ¬A |= ¬B

2 If A |= B and A ∧ B |= C then A |= C3 If A ∨ B |= A ∧ B then A ≡ B

13 / 23

Equivalences and consequences (2)

Exercise 1.9 from Logica a Informatica

Check whether the following claims hold or not:1 If A |= B then ¬A |= ¬B2 If A |= B and A ∧ B |= C then A |= C

3 If A ∨ B |= A ∧ B then A ≡ B

13 / 23

Equivalences and consequences (2)

Exercise 1.9 from Logica a Informatica

Check whether the following claims hold or not:1 If A |= B then ¬A |= ¬B2 If A |= B and A ∧ B |= C then A |= C3 If A ∨ B |= A ∧ B then A ≡ B

13 / 23

Outline

1 Understanding

2 Tautologies, contradictions, satisfiability, etc.

3 Normal Forms

4 Modelling

5 Reduction to Satisfiability

14 / 23

Normal Forms

Exercise 1.13 from Logica a Informatica

Find equivalent formulas in CNF for1 (A→ B)→ (B → ¬C)

2 ¬(A→ (B → ¬C)) ∧ D3 ¬(A ∧ B ∧ (C → D))

4 ¬(A↔ B)

Now find equivalent formulas in DNF!

15 / 23

Normal Forms

Exercise 1.13 from Logica a Informatica

Find equivalent formulas in CNF for1 (A→ B)→ (B → ¬C)

2 ¬(A→ (B → ¬C)) ∧ D

3 ¬(A ∧ B ∧ (C → D))

4 ¬(A↔ B)

Now find equivalent formulas in DNF!

15 / 23

Normal Forms

Exercise 1.13 from Logica a Informatica

Find equivalent formulas in CNF for1 (A→ B)→ (B → ¬C)

2 ¬(A→ (B → ¬C)) ∧ D3 ¬(A ∧ B ∧ (C → D))

4 ¬(A↔ B)

Now find equivalent formulas in DNF!

15 / 23

Normal Forms

Exercise 1.13 from Logica a Informatica

Find equivalent formulas in CNF for1 (A→ B)→ (B → ¬C)

2 ¬(A→ (B → ¬C)) ∧ D3 ¬(A ∧ B ∧ (C → D))

4 ¬(A↔ B)

Now find equivalent formulas in DNF!

15 / 23

Normal Forms

Exercise 1.13 from Logica a Informatica

Find equivalent formulas in CNF for1 (A→ B)→ (B → ¬C)

2 ¬(A→ (B → ¬C)) ∧ D3 ¬(A ∧ B ∧ (C → D))

4 ¬(A↔ B)

Now find equivalent formulas in DNF!

15 / 23

Outline

1 Understanding

2 Tautologies, contradictions, satisfiability, etc.

3 Normal Forms

4 Modelling

5 Reduction to Satisfiability

16 / 23

Find the formula! (1)

Similar to Exercise 1.10 from Logica a Informatica

Find φ such that

A B φ

0 0 10 1 11 0 01 1 0

Using only→ and ⊥?

17 / 23

Find the formula! (1)

Similar to Exercise 1.10 from Logica a Informatica

Find φ such that

A B φ

0 0 10 1 11 0 01 1 0

Using only→ and ⊥?

17 / 23

Find the formula! (2)

Similar to Exercise 1.13 from Logica a Informatica

Find φ such that

A B φ

0 0 10 1 01 0 01 1 0

Using only ∨ and ¬?

18 / 23

Find the formula! (2)

Similar to Exercise 1.13 from Logica a Informatica

Find φ such that

A B φ

0 0 10 1 01 0 01 1 0

Using only ∨ and ¬?

18 / 23

Find the formula in CNF and DNF!

Similar to Exercise 1.17 from Logica a Informatica

Find φs (one in CNF and one in DNF) such that

A B C φ

0 0 0 10 0 1 00 1 0 10 1 1 01 0 0 01 0 1 11 1 0 11 1 1 0

19 / 23

Modelling dinner

Dinner constraints

Available dishes:1 Farfalle al salmone2 Risotto agli asparagi3 Tagliatelle ai funghi4 Filetto di manzo5 Spigola grigliata6 Trancia di pesce spada

We can choose 7 white or 8 red wineWe must choose exactly one primo, one secondo and onedrinkDo not eat fish after mushroomsChoose white wine if fish is involved

Goal: Write a set of wffs the models of which correspond toadmissible dinner choices

20 / 23

Outline

1 Understanding

2 Tautologies, contradictions, satisfiability, etc.

3 Normal Forms

4 Modelling

5 Reduction to Satisfiability

21 / 23

Reduction to SAT

Reformulate the following questions such that they can bedecided using a SAT algorithm:

1 Is (P ∨ (¬P → Q))↔ (P ∨Q) valid?

2 Does P → Q follow from ¬Q → ¬P?3 Is P ↔ Q ∧ P a contradiction?4 Is P ↔ P ∨ ⊥ a tautology?

22 / 23

Reduction to SAT

Reformulate the following questions such that they can bedecided using a SAT algorithm:

1 Is (P ∨ (¬P → Q))↔ (P ∨Q) valid?2 Does P → Q follow from ¬Q → ¬P?

3 Is P ↔ Q ∧ P a contradiction?4 Is P ↔ P ∨ ⊥ a tautology?

22 / 23

Reduction to SAT

Reformulate the following questions such that they can bedecided using a SAT algorithm:

1 Is (P ∨ (¬P → Q))↔ (P ∨Q) valid?2 Does P → Q follow from ¬Q → ¬P?3 Is P ↔ Q ∧ P a contradiction?

4 Is P ↔ P ∨ ⊥ a tautology?

22 / 23

Reduction to SAT

Reformulate the following questions such that they can bedecided using a SAT algorithm:

1 Is (P ∨ (¬P → Q))↔ (P ∨Q) valid?2 Does P → Q follow from ¬Q → ¬P?3 Is P ↔ Q ∧ P a contradiction?4 Is P ↔ P ∨ ⊥ a tautology?

22 / 23

END OF THELECTURE

23 / 23

Recommended