0% found this document useful (0 votes)
112 views

Intro

This document outlines an introduction to formal logic, including motivations from law, mathematics, and computer science. It provides sample problems in propositional logic, predicate logic, number theory, and set theory. It also discusses automated reasoning and the importance of proving algorithm correctness through formal proofs. The key topics covered are the definition of a valid argument, logical inference, and analyzing algorithms' resource usage.

Uploaded by

kay
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
112 views

Intro

This document outlines an introduction to formal logic, including motivations from law, mathematics, and computer science. It provides sample problems in propositional logic, predicate logic, number theory, and set theory. It also discusses automated reasoning and the importance of proving algorithm correctness through formal proofs. The key topics covered are the definition of a valid argument, logical inference, and analyzing algorithms' resource usage.

Uploaded by

kay
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Outline

Formal Logic - Introduction


K. Subramani1
1 Lane Department of Computer Science and Electrical Engineering
West Virginia University

17 August, 2015

Subramani

CS 220 - Discrete Mathematics

Outline

Outline

Motivation for Formal Logic

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Motivation

Why Logic?

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Motivation

Why Logic?
(i) The Law!

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Motivation

Why Logic?
(i) The Law!
(ii) Mathematics.

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Motivation

Why Logic?
(i) The Law!
(ii) Mathematics.
(iii) Computer Science

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Motivation

Why Logic?
(i) The Law!
(ii) Mathematics.
(iii) Computer Science (Automated Reasoning).

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Propositional Logic)

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Propositional Logic)

Argument

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Propositional Logic)

Argument
If a Democrat is elected, then taxes will go up.

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Propositional Logic)

Argument
If a Democrat is elected, then taxes will go up.
Either a Democrat will be elected or the bill will pass.

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Propositional Logic)

Argument
If a Democrat is elected, then taxes will go up.
Either a Democrat will be elected or the bill will pass.
Therefore, if the taxes do not go up, then the bill will pass.

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Propositional Logic)

Argument
If a Democrat is elected, then taxes will go up.
Either a Democrat will be elected or the bill will pass.
Therefore, if the taxes do not go up, then the bill will pass.
Questions of Interest

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Propositional Logic)

Argument
If a Democrat is elected, then taxes will go up.
Either a Democrat will be elected or the bill will pass.
Therefore, if the taxes do not go up, then the bill will pass.
Questions of Interest

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Propositional Logic)

Argument
If a Democrat is elected, then taxes will go up.
Either a Democrat will be elected or the bill will pass.
Therefore, if the taxes do not go up, then the bill will pass.
Questions of Interest
1

Is the above argument valid?

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Propositional Logic)

Argument
If a Democrat is elected, then taxes will go up.
Either a Democrat will be elected or the bill will pass.
Therefore, if the taxes do not go up, then the bill will pass.
Questions of Interest
1

Is the above argument valid?

What is a valid argument?

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Propositional Logic)

Argument
If a Democrat is elected, then taxes will go up.
Either a Democrat will be elected or the bill will pass.
Therefore, if the taxes do not go up, then the bill will pass.
Questions of Interest
1

Is the above argument valid?

What is a valid argument?

What is an argument?

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Propositional Logic)

Argument
If a Democrat is elected, then taxes will go up.
Either a Democrat will be elected or the bill will pass.
Therefore, if the taxes do not go up, then the bill will pass.
Questions of Interest
1

Is the above argument valid?

What is a valid argument?

What is an argument?

How do I prove the validity of an argument?

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Predicate Logic)

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Predicate Logic)

Argument

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Predicate Logic)

Argument
Every farmer owns a cow.

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Predicate Logic)

Argument
Every farmer owns a cow. No dentist owns a cow.

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Predicate Logic)

Argument
Every farmer owns a cow. No dentist owns a cow. Therefore, no dentist is a farmer.

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Predicate Logic)

Argument
Every farmer owns a cow. No dentist owns a cow. Therefore, no dentist is a farmer.
Questions of Interest

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Predicate Logic)

Argument
Every farmer owns a cow. No dentist owns a cow. Therefore, no dentist is a farmer.
Questions of Interest

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Predicate Logic)

Argument
Every farmer owns a cow. No dentist owns a cow. Therefore, no dentist is a farmer.
Questions of Interest
1

Is the above argument valid?

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Predicate Logic)

Argument
Every farmer owns a cow. No dentist owns a cow. Therefore, no dentist is a farmer.
Questions of Interest
1

Is the above argument valid?

What is a valid argument?

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Predicate Logic)

Argument
Every farmer owns a cow. No dentist owns a cow. Therefore, no dentist is a farmer.
Questions of Interest
1

Is the above argument valid?

What is a valid argument?

What are our tools of inference?

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Predicate Logic)

Argument
Every farmer owns a cow. No dentist owns a cow. Therefore, no dentist is a farmer.
Questions of Interest
1

Is the above argument valid?

What is a valid argument?

What are our tools of inference?

Note

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Predicate Logic)

Argument
Every farmer owns a cow. No dentist owns a cow. Therefore, no dentist is a farmer.
Questions of Interest
1

Is the above argument valid?

What is a valid argument?

What are our tools of inference?

Note
More generally, we are interested in deducing new facts, given a set of facts and
inferences.

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Number theory)

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Number theory)

Problem

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Number theory)

Problem
Prove that the sum of the first n positive integers is

Subramani

n(n+1)
.
2

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Set Theory)

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Set Theory)

Problem

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Set Theory)

Problem
Let A and B denote two sets.

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Sample Problem (Set Theory)

Problem
Let A and B denote two sets. Argue that (A B) A.

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Automated Reasoning

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Automated Reasoning

An algorithm

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Automated Reasoning

An algorithm
Consider the following algorithm:

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Automated Reasoning

An algorithm
Consider the following algorithm:
Function M AX -F IND(A, n)
1: if (n == 1) then
2:
return(A[1]).
3: else
4:
return(max(A[n], M AX -F IND(A, n 1))).
5: end if

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Questions

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Questions

Questions of Interest

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Questions

Questions of Interest

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Questions

Questions of Interest
1

Is the above algorithm correct?

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Questions

Questions of Interest
1

Is the above algorithm correct?

What is the definition of correctness?

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Questions

Questions of Interest
1

Is the above algorithm correct?

What is the definition of correctness?

Can you provide a proof of correctness?

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Questions

Questions of Interest
1

Is the above algorithm correct?

What is the definition of correctness?

Can you provide a proof of correctness?

What is a proof?

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Questions

Questions of Interest
1

Is the above algorithm correct?

What is the definition of correctness?

Can you provide a proof of correctness?

What is a proof?

Can you analyze the resources taken by the algorithm?

Subramani

CS 220 - Discrete Mathematics

Motivation for Formal Logic

Subramani

CS 220 - Discrete Mathematics

You might also like