Logic - recap. So far, we have seen that: Logic is a language which can be used to describe:

Similar documents
Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

Rules Build Arguments Rules Building Arguments

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

Packet #1: Logic & Proofs. Applied Discrete Mathematics

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

A. Propositional Logic

Supplementary Logic Notes CSE 321 Winter 2009

Learning Goals of CS245 Logic and Computation

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

Introduction to Sets and Logic (MATH 1190)

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

EECS 1028 M: Discrete Mathematics for Engineers

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

CS 2336 Discrete Mathematics

Propositional Logic Arguments (5A) Young W. Lim 11/8/16

Chapter 4, Logic using Propositional Calculus Handout

CSC Discrete Math I, Spring Propositional Logic

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

A statement is a sentence that is definitely either true or false but not both.

Propositional logic (revision) & semantic entailment. p. 1/34

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Logic and Proof. Aiichiro Nakano

Logic and Proofs. (A brief summary)

CSE 20 DISCRETE MATH. Winter

PROPOSITIONAL CALCULUS

Propositional Logic. Spring Propositional Logic Spring / 32

Mat 243 Exam 1 Review

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

Propositional Logic Not Enough

Announcements. Today s Menu

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

It rains now. (true) The followings are not propositions.

3 The Semantics of the Propositional Calculus

Today. Proof using contrapositive. Compound Propositions. Manipulating Propositions. Tautology

CSE 20 DISCRETE MATH. Fall

MAT 243 Test 1 SOLUTIONS, FORM A

Natural Deduction is a method for deriving the conclusion of valid arguments expressed in the symbolism of propositional logic.

COMP 2600: Formal Methods for Software Engineeing

Symbolic Logic 3. For an inference to be deductively valid it is impossible for the conclusion to be false if the premises are true.

software design & management Gachon University Chulyun Kim

Chapter 1 Elementary Logic

Review. Propositional Logic. Propositions atomic and compound. Operators: negation, and, or, xor, implies, biconditional.

Propositional Logic Arguments (5A) Young W. Lim 10/11/16

1 The Foundation: Logic and Proofs

Logic and Proof. On my first day of school my parents dropped me off at the wrong nursery. There I was...surrounded by trees and bushes!

Propositional Logic. Jason Filippou UMCP. ason Filippou UMCP) Propositional Logic / 38

1.3 Propositional Equivalences

CSE 20: Discrete Mathematics

1.1 Statements and Compound Statements

Logic. Propositional Logic: Syntax

On my first day of school my parents dropped me off at the wrong nursery. There I was...surrounded by trees and bushes! 26-Aug-2011 MA

Section 1.1 Propositions

Logic Overview, I. and T T T T F F F T F F F F

Logic, Sets, and Proofs

1 The Foundation: Logic and Proofs

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

HANDOUT AND SET THEORY. Ariyadi Wijaya

cse 311: foundations of computing Fall 2015 Lecture 6: Predicate Logic, Logical Inference

Propositional Logic: Review

Examples: P: it is not the case that P. P Q: P or Q P Q: P implies Q (if P then Q) Typical formula:

The Logic of Compound Statements cont.

Mathematical Logic Part One

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Propositional and First-Order Logic

Topic 1: Propositional logic

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

Knowledge Representation and Reasoning

2.2: Logical Equivalence: The Laws of Logic

Propositional Logic and Semantics

Propositional Logic Arguments (5A) Young W. Lim 11/29/16

Chapter 1: The Logic of Compound Statements. January 7, 2008

THE LOGIC OF COMPOUND STATEMENTS

Review. Propositions, propositional operators, truth tables. Logical Equivalences. Tautologies & contradictions

Propositional Logic Arguments (5A) Young W. Lim 11/30/16

Section 1.1: Logical Form and Logical Equivalence

AI Principles, Semester 2, Week 2, Lecture 5 Propositional Logic and Predicate Logic

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

What is Logic? Introduction to Logic. Simple Statements. Which one is statement?

1.1 Language and Logic

III. Elementary Logic

Logic and Proofs. (A brief summary)

Proofs. Example of an axiom in this system: Given two distinct points, there is exactly one line that contains them.

Introducing Proof 1. hsn.uk.net. Contents

Chapter 16. Logic Programming. Topics. Logic Programming. Logic Programming Paradigm

Manual of Logical Style (fresh version 2018)

Section 1.2: Propositional Logic

Logic. Logic is a discipline that studies the principles and methods used in correct reasoning. It includes:

CPSC 121: Models of Computation

10/5/2012. Logic? What is logic? Propositional Logic. Propositional Logic (Rosen, Chapter ) Logic is a truth-preserving system of inference

A Little Deductive Logic

CS70 is a course about on Discrete Mathematics for Computer Scientists. The purpose of the course is to teach you about:

Mathematical Logic Part One

CPSC 121: Models of Computation. Module 6: Rewriting predicate logic statements

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

Chapter Summary. Propositional Logic. Predicate Logic. Proofs. The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1.

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 1

Transcription:

Logic - recap So far, we have seen that: Logic is a language which can be used to describe: Statements about the real world The simplest pieces of data in an automatic processing system such as a computer

Logic - recap The key characteristic of a statement, or a piece of data, in logic is its truth value. There are two possible truth values: True False

Logic - recap Simple statements, or simple pieces of data, can be joined together to give more complicated structures using logical connectives. The most important of these are and, or, implies, equivalent to and not, for which we use the symbols,,,, and respectively.

Logic - recap Each of these logical connectives is defined by a truth table. It is often possible to convert an English sentence into a logical formula there are simple techniques for doing this.

Questions: Logic - recap when is this formula true? are these two formulae essentially the same? One useful technique for answering questions about logical formula (such as above) is to draw up a large truth table describing the formula/formulae in question.

What is low-level logic used for? To specify the way in which individual bits of information are processed in order to perform the arithmetic, and all the other forms of symbolic processing, that goes on in the circuits of a computer.

What is high-level logic used for? Used as an unambiguous language, i.e. as a medium for knowledge representation.

What is high-level logic used for? Used as a rigorous form of reasoning. Deductions which follow the rules of logic are guaranteed to be correct. This is not necessarily true of other representation schemes. So logic can act as a "gold standard" against which other forms or representation and reasoning can be assessed.

What is high-level logic used for? Logic is available for establishing whether a complicated argument, e.g. a legal case, makes sense or not.

What is high-level logic used for? Logic is a tool for mathematical research. The mathematician has available a set of propositions which have been established as true - these are referred to as "the axioms". He/she has a proposition, or set of propositions, that he/she wants to prove to be true - referred to as "the theorem". Both sets can be written as statements in logic: the problem is to find a set of sound logical manipulations to convert one into the other.

More on processing logical formulae The build a truth table technique described earlier always works, at least for the simple form of logic we ve been using so far. However, sometimes it isn t necessary. Instead, to solve a problem in logic, we can use: Rules of inference Logical equivalencies

Rules of inference These are well-established ways of proving an argument in logic.

The most useful are: modus ponens: P Q. P. Q. modus tolens: P Q. Q. P. disjunctive syllogism:p Q. P. Q. hypothetical syllogism: P Q. Q R. P R. contraposition: P Q. Q P. In English, the first of these would read If you know that P implies Q, and you know that P is true, then you know that Q is true. These can be used to establish the truth of arguments involving complicated formulae.

Logical equivalences: these are well-established ways of turning a logical statement containing one set of logical connectives into a statement containing a different set.

Logical equivalences Here are some of the more important ones. Idempotency P is logically equivalent to (P P) Double negation P is logically equivalent to P Commutative laws (P Q) is logically equivalent to (Q P) (P Q) is logically equivalent to (Q P)

Logical equivalencies Associative laws (P (Q R) is logically equivalent to ((P Q) R) (P (Q R)) is logically equivalent to ((P Q) R) Distributive laws (P (Q R) is logically equivalent to ((P Q) (P R)) (P (Q R)) is logically equivalent to ((P Q) (P R))

Logical equivalences De Morgan s laws (P Q) is logically equivalent to ( P Q) (P Q) is logically equivalent to ( P Q) Contraposition (P Q) is logically equivalent to ( Q P)

Logical equivalences Redefining material conditional as a disjunction or conjunction (P Q) is logically equivalent to ( P Q) (P Q) is logically equivalent to (P Q) Exportation (P (Q R)) is logically equivalent to ((P Q) R))

Logical equivalencies It's not necessary to remember the elaborate names, or the exact details of these equivalences. It is important to appreciate that, by using one of these equivalences, a logical formula can be turned into a formula which looks quite different, but which actually has exactly the same truth value.

Tautologies and contradictions A logical statement which is always true (no matter what values you give to the parts that make it up) is called a tautology. A statement which is always false is called a contradiction. All other logical statements are known as contingent statements.

Tautologies and contradictions example: Consider the statement ( P ((P Q) Q)). P could be true and Q could be true. P could be false and Q could be false. P could be true and Q could be false. P could be false and Q could be true. In every one of these cases, the whole statement would be true. So the statement is a tautology.

Propositional calculus The simple form of logic which we have been using so far, in which the symbols stand for ideas which can be expressed as whole sentences, is known as Propositional Calculus.

Propositional calculus Propositional calculus is decidable: it's always possible to decide whether an argument in propositional calculus is valid or not. You can either use the logical equivalence rules, and the rules of inference, described above, or you can build a big truth table.

Propositional calculus Propositional calculus: is the simplest form of logic, and also the weakest, in terms of its power to express ideas. Other forms of logic have been invented to express more complex ideas.

Predicate calculus Another form of logic: first order predicate calculus. There are many fairly simple, obvious arguments that propositional calculus cannot handle at all. e.g. All lawyers are scoundrels. Sir James Thames is a lawyer. Therefore Sir James Thames is a scoundrel.

Predicate calculus 1st order predicate calculus has some extra features: the statements joined by the logical connectives can be predicates. e.g. a(b) a(b, c) lawyer(sir_james_thames) owes(jim, Sid, 500pounds) These can convey ideas such as "b is an a", b has the quality a, or "b & c are connected by the property a". A predicate can have any number of places, i.e. items in brackets.

Predicate calculus The items inside the brackets of a predicate can be constants (names of things or relationships) or variables. If they're variables, they don't refer to specific things; specific items can be substituted for them. When this happens, all variables with the same name will refer to the same thing.

Predicate calculus - the universal quantifier 1st order predicate calculus has a symbol called the universal quantifier. x means "for every x".

Predicate calculus - the universal quantifier Thus, if lawyer(x) means "x is a lawyer" and scoundrel(x) means "x is a scoundrel", x ( lawyer(x) scoundrel(x) ) means "for every x, if that x is a lawyer, then that x is a scoundrel". Which is the predicate calculus way of saying "All lawyers are scoundrels."

Predicate calculus - the existential quantifier 1st order predicate calculus has a symbol called the existential quantifier. x means "there is an x such that".

Predicate calculus - the existential quantifier If lawyer(x) means "x is a lawyer" and scoundrel(x) means "x is a scoundrel", x ( lawyer(x) scoundrel(x) ) means "There is an x such that x is a lawyer, and x is a scoundrel". Which means that there is at least one lawyer who is a scoundrel, and is the predicate calculus way of saying "Some lawyers are scoundrels."

Predicate calculus Predicate calculus uses the same logical connectives as propositional calculus.

Logic and ambiguity One of the problems with converting statements in English into statements in some other knowledge representation is that English statements are often ambiguous. e.g. "Someone is mugged in Soho every day." [Could mean: "a particular person goes to Soho every day, and gets mugged"; or "A mugging takes place in Soho every day (not necessarily with the same victim)".]

Logic and ambiguity Statements in predicate calculus aren't ambiguous, so translating English into predicate calculus forces the ambiguity to be ironed out. The previous statement translates into: x( person(x) y( day(y) (mugged_on(x, y) mugged_in(x, Soho)))) or x( day(x) y( person(y) mugged_on(y, x) mugged_in(y, Soho))))

Predicate calculus Establishing whether an argument is valid or not, in First Order Predicate Calculus: this is harder than in propositional calculus. You can't use truth tables.

Predicate calculus There are some rules of inference (i.e. ways of proving an argument) which correspond to those found in propositional calculus; e.g. universal instantiation: x( p(x) c(x) ) p(a). c(a). and the rules already established for propositional calculus apply here too.

Predicate calculus There are techniques for proving an argument in FOPC - sequences of steps which will always show that an argument is true, if it is true. If it isn't true, the sequence of steps is liable to go on for ever, without producing a result. For this reason, FOPC is said to be semidecidable.

Problems and Assignments Read Chapter 2 in the Luger/Stubblefield book. Read chapter 3.3 in the Luger/Stubblefield book. Read chapter 5.4 in the Luger/Stubblefield book. Create a robot planner using predicate calculus, next program it in Prolog.

John Platts Sources