• Keine Ergebnisse gefunden

Proofs for Boolean Logic

N/A
N/A
Protected

Academic year: 2022

Aktie "Proofs for Boolean Logic"

Copied!
24
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Formal Proofs and Booelan Logic

Logik f¨ ur Informatiker Logic for computer scientists

Till Mossakowski

WiSe 2013/14

(2)

Formal Proofs and Booelan Logic

Proofs for Boolean Logic

(3)

Formal Proofs and Booelan Logic

Logical consequence

1 Q is a logical consequence ofP1, . . . ,Pn, if all worlds that

makeP1, . . . ,Pn true also makeQ true.

2 Q is a tautological consequenceofP1, . . . ,Pn, if all valuations of atomic formulas with truth values that make P1, . . . ,Pn

true also make Q true.

3 Q is a TW-logical consequence ofP1, . . . ,Pn, if all worlds from Tarski’s world that makeP1, . . . ,Pn true also makeQ true.

The difference lies in theset of worlds that is considered:

1 all worlds (whatever this exactly means . . . )

(4)

Formal Proofs and Booelan Logic

Proofs

With proofs, we try to show (tauto)logical consequence Truth-table method can lead to very large tables, proofs are often shorter

Proofs are also available for consequence in full first-order logic, not only for tautological consequence

(5)

Formal Proofs and Booelan Logic

Limits of the truth-table method

1 truth-table method leads to exponentially growingtables 20 atomic sentencesmore than 1.000.000 rows

2 truth-table method cannot be extended to first-order logic model checkingcan overcome the first limitation (up to 1.000.000 atomic sentences)

proofscan overcome both limitations

(6)

Formal Proofs and Booelan Logic

Proofs

A proof consists of a sequence ofproof steps Each proof step is known to be valid and should

be significant but easily understood, ininformalproofs, follow someproof rule, in formalproofs.

Some valid patterns of inference that generally go unmentioned in informal (but not in formal) proofs:

FromPQ, inferP.

FromPandQ, inferPQ.

FromP, inferPQ.

(7)

Formal Proofs and Booelan Logic

Proof by cases (disjunction elimination)

To proveS fromP1∨. . .∨Pn, proveS from each of P1, . . . ,Pn. Claim: there are irrational numbers b andc such thatbc is rational.

Proof: √ 2

2

is either rational or irrational.

Case 1: If √ 2

2 is rational: takeb=c =√ 2.

Case 2: If √ 2

2 is irrational: takeb =√ 2

2 andc =√ 2.

Then bc= (√ 2

2

)

2=√

2(

2) =√

22 = 2.

(8)

Formal Proofs and Booelan Logic

Proof by contradiction

To prove¬S, assume S and prove a contradiction ⊥. (⊥may be infered from P and¬P.)

AssumeCube(c)∨Dodec(c) andTet(b).

Claim: ¬(b=c).

Proof: Let us assumeb =c.

Case 1: If Cube(c), then by b=c, also Cube(b), which contradictsTet(b).

Case 2: Dodec(c) similarly contradictsTet(b).

In both case, we arrive at a contradiction. Hence, our assumption b=c cannot be true, thus¬(b=c).

(9)

Formal Proofs and Booelan Logic

Arguments with inconsistent premises

A proof of a contradiction⊥from premisesP1, . . . ,Pn (without additional assumptions) shows that the premises areinconsistent.

An argument with inconsistent premises is alwaysvalid, but more importantly, alwaysunsound.

Home(max)∨Home(claire)

¬Home(max)

¬Home(claire)

Home(max)∧Happy(carl)

(10)

Formal Proofs and Booelan Logic

Arguments without premises

A proof without any premises shows that its conclusion is alogical truth.

Example: ¬(P ∧ ¬P).

(11)

Formal Proofs and Booelan Logic

Formal Proofs and

Boolean Logic

(12)

Formal Proofs and Booelan Logic

Formal proofs in Fitch

Well-defined set offormal proof rules

Formal proofs in Fitch can be mechanically checked For each connective, there is

anintroduction rule, e.g. “fromP, inferPQ”.

anelimination rule, e.g. “fromPQ, inferP”.

(13)

Proofs for Boolean Logic Formal Proofs and Booelan Logic

Summary of Rules

Propositional rules ( F

T

)

Conjunction Introduction ( Intro)

P1

Pn

...

. P1. . .Pn

Conjunction Elimination ( Elim)

P1. . . Pi. . .Pn ...

. Pi

Disjunction Introduction ( Intro)

Pi ...

. P1. . .Pi. . .Pn

Disjunction Elimination ( Elim)

P1. . . Pn ...

P1

... S

Pn

... S ...

. S

Till Mossakowski Logic 13/ 24

(14)

Proofs for Boolean Logic Formal Proofs and Booelan Logic

Summary of Rules

Propositional rules ( F

T

)

Conjunction Introduction ( Intro)

P1

Pn

...

. P1. . .Pn

Conjunction Elimination ( Elim)

P1. . . Pi. . .Pn ...

. Pi

Disjunction Introduction ( Intro)

Pi ...

. P1. . .Pi. . .Pn

Disjunction Elimination ( Elim)

P1. . . Pn ...

P1 ... S

Pn

... S ...

. S

Till Mossakowski Logic 14/ 24

(15)

Proofs for Boolean Logic Formal Proofs and Booelan Logic

Summary of Rules

Propositional rules ( F

T

)

Conjunction Introduction (Intro)

P1

Pn

...

. P1. . .Pn

Conjunction Elimination ( Elim)

P1. . . Pi. . .Pn ...

. Pi

Disjunction Introduction (Intro)

Pi ...

. P1. . .Pi. . .Pn

Disjunction Elimination ( Elim)

P1. . . Pn ...

P1 ... S

Pn

... S ...

. S

Till Mossakowski Logic 15/ 24

(16)

Proofs for Boolean Logic Formal Proofs and Booelan Logic

Summary of Rules

Propositional rules ( F

T

)

Conjunction Introduction ( Intro)

P1

Pn

...

. P1. . .Pn

Conjunction Elimination ( Elim)

P1. . . Pi. . .Pn ...

. Pi

Disjunction Introduction ( Intro)

Pi ...

. P1. . .Pi. . .Pn

Disjunction Elimination ( Elim)

P1. . . Pn ...

P1 ... S

Pn

... S ...

. S

Till Mossakowski Logic 16/ 24

(17)

Proofs for Boolean Logic Formal Proofs and Booelan Logic

The proper use of subproofs

In the following two exercises, determine whether the sentences are consistent. If they are, use Tarski’s World to build a world where the sentences are both true. If they are inconsistent, use Fitch to give a proof that they are inconsistent (that is, derivefrom them). You may useAna Con in your proof, but only applied to literals (that is, atomic sentences or negations of atomic sentences).

6.15

¬(Larger(a,b)Larger(b,a))

¬SameSize(a,b)

6.16

Smaller(a,b)Smaller(b,a) SameSize(a,b)

Section 6.4

The proper use of subproofs

Subproofs are the characteristic feature of Fitch-style deductive systems. It is important that you understand how to use them properly, since if you are not careful, you may “prove” things that don’t follow from your premises. For example, the following formal proof looks like it is constructed according to our rules, but it purports to prove thatABfollows from (BA)(AC), which is clearly not right.

1. (BA)(AC) 2.BA

3.B Elim: 2

4.A Elim: 2

5.AC

6.A Elim: 5

7.A Elim: 1, 2–4, 5–6

8.AB Intro: 7, 3

The problem with this proof is step 8. In this step we have used step 3, a step that occurs within an earlier subproof. But it turns out that this sort of justification—one that reaches back inside a subproof that has already ended—is not legitimate. To understand why it’s not legitimate, we need to think about what function subproofs play in a piece of reasoning.

A subproof typically looks something like this:Till Mossakowski Logic 17/ 24

(18)

Formal Proofs and Booelan Logic

The proper use of subproofs (cont’d)

In justifying a step of a subproof, you may cite any earlier step contained in the main proof, or in any subproof whose

assumption is still in force. You may never cite individual steps inside a subproof that has already ended.

Fitch enforces this automatically by not permitting the citation of individual steps inside subproofs that have ended.

(19)

Proofs for Boolean Logic Formal Proofs and Booelan Logic

Negation Introduction (¬ Intro)

P ...

. ¬P

Negation Elimination (¬ Elim)

¬¬P ...

. P

Introduction ( Intro)

P...

¬P ...

.

Elimination (Elim)

...

. P

Conditional Introduction ( Intro)

P ... Q

. PQ

Conditional Elimination (Elim)

PQ ... P...

. Q

Till Mossakowski Logic 19/ 24

(20)

Formal Proofs and Booelan Logic

558 /Summary of Rules

Negation Introduction (¬Intro)

P ...

. ¬P

Negation Elimination (¬ Elim)

¬¬P ...

. P

Introduction (Intro)

P...

¬P ...

.

Elimination ( Elim)

...

. P

Conditional Introduction ( Intro)

P ... Q

. PQ

Conditional Elimination ( Elim)

PQ ... P...

. Q

Till Mossakowski Logic 20/ 24

(21)

Formal Proofs and Booelan Logic

558 /Summary of Rules

Negation Introduction (¬Intro)

P ...

. ¬P

Negation Elimination (¬ Elim)

¬¬P ...

. P

Introduction (Intro)

P...

¬P ...

.

Elimination ( Elim)

...

. P

Conditional Introduction ( Intro)

P ... Q

. PQ

Conditional Elimination ( Elim)

PQ ... P...

. Q

Till Mossakowski Logic 21/ 24

(22)

Proofs for Boolean Logic Formal Proofs and Booelan Logic

Negation Introduction (¬Intro)

P ...

. ¬P

Negation Elimination (¬ Elim)

¬¬P ...

. P

Introduction (Intro)

P...

¬P ...

.

Elimination ( Elim)

...

. P

Conditional Introduction (Intro)

P ... Q

. PQ

Conditional Elimination ( Elim)

PQ ... P...

. Q

Till Mossakowski Logic 22/ 24

(23)

Formal Proofs and Booelan Logic

Strategies and tactics in Fitch

1 Understandwhat the sentences are saying.

2 Decidewhether you think the conclusion follows from the premises.

3 If you think it does not follow, or are not sure, try to find a counterexample.

4 If you think it does follow, try to give aninformal proof.

5 If aformal proofis called for, use theinformal proof to guideyou in finding one.

6 In giving consequence proofs, both formal and informal, don’t forget the tactic ofworking backwards.

In working backwards, though, always check that yourintermediate

(24)

Formal Proofs and Booelan Logic

Strategies in Fitch, cont’d

Always try to matchthe situation in your proof with the rules in the book (see book appendix for a complete list)

Look at the main connectivein a premise, apply the corresponding elimination rule (forwards)

Or: look at themain connective in the conclusion, apply the corresponding introduction rule(backwards)

Referenzen

ÄHNLICHE DOKUMENTE

TW-necessary, if it is true in all worlds of Tarski’s world, a tautology, if it is true in all valuations of the atomic sentences with { TRUE , FALSE }.. Till Mossakowski Logic

A logical connective is truth-functional, if the truth value of a complex sentence built up using these connectives depends on nothing more than the truth values of the

2 truth-table method cannot be extended to first-order logic model checking can overcome the first limitation (up to 1.000.000 atomic sentences).. proofs can overcome

In the presence of equality, we can show the undecidability of satisfiability of GFU (and hence of TGF ) by a reduction from the tiling problem for an infinite grid [7]..

We first point out that if g has no pair of exchangeable literals, then FOL(∃, ∧, ¬ a )-E NTAILMENT has the same complexity as in the positive fragment (indeed it can be computed by

Semantics for Logic Programs via Circumscription and Projection Based on the representation of a logic program as a clausal first-order sentence with raw rule clauses, three

Rule ( L is also responsible for some non- deterministic choices about the splitting of state into multiple substates. Clauses are applicable to the atomic context Λ whenever

We consider a Lotka-Volterra tritrophic food chain composed of a resource, its consumer, and a predator species, each characterized by a single adaptive phenotypic trait, and we