Section 1.1 Logic LOGIC

Similar documents
COMP Intro to Logic for Computer Scientists. Lecture 2

Propositional Logic:

Mixed Integer Linear Programming

1. Logic as a subject matter is the study of logics, understood as models of acceptable inference patterns

Propositional Logic. Part I

Propositional Calculus

CSE 20 DISCRETE MATH. Fall

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27

Control Structures. Lecture 4 COP 3014 Fall September 18, 2017

Logic (or Declarative) Programming Foundations: Prolog. Overview [1]

Lecture 5. Logic I. Statement Logic

Mathematical Logic Prof. Arindama Singh Department of Mathematics Indian Institute of Technology, Madras. Lecture - 9 Normal Forms

Program Verification & Testing; Review of Propositional Logic

Discrete structures - CS Fall 2017 Questions for chapter 2.1 and 2.2

CS Bootcamp Boolean Logic Autumn 2015 A B A B T T T T F F F T F F F F T T T T F T F T T F F F

Logical statements and. Lecture 1 ICOM 4075

CS40-S13: Functional Completeness

Homework 1 CS 1050 A Due:

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

G.CO.C.9: Compound Statements

Syntax of Eiffel: a Brief Overview

CSE 20 DISCRETE MATH. Winter

Commands, and Queries, and Features. Syntax of Eiffel: a Brief Overview. Escape Sequences. Naming Conventions

Logical Connectives. All kittens are cute. ; I like pizza. ; The sky is blue. ; Triangles have three sides.

Class 8 - September 13 Indirect Truth Tables for Invalidity and Inconsistency ( 6.5)

Propositional Logic. Andreas Klappenecker

2.2 Set Operations. Introduction DEFINITION 1. EXAMPLE 1 The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5}; that is, EXAMPLE 2

Propositional Logic Formal Syntax and Semantics. Computability and Logic

Definition: A context-free grammar (CFG) is a 4- tuple. variables = nonterminals, terminals, rules = productions,,

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Chapter 9 Deductive Arguments II Truth-Functional Logic. Tutorial: Truth Tables

Conditions, logical expressions, and selection. Introduction to control structures

Warmup Problem. Translate the following sentence from English into Propositional Logic. I want to eat ice cream even though I am on a diet.

An Evolution of Mathematical Tools

Truth Functional Properties on Truth Trees

Defining an Abstract Core Production Rule System

Binary Decision Diagrams

Introduction to Computer Architecture

Foundations of Computation

Fondamenti della Programmazione: Metodi Evoluti. Lezione 5: Invariants and Logic

Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5

CSC 501 Semantics of Programming Languages

Chapter 1.3 Quantifiers, Predicates, and Validity. Reading: 1.3 Next Class: 1.4. Motivation

Summary of Course Coverage

Propositional Calculus. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Propositional Calculus: Boolean Functions and Expressions. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

Implementation of a Sudoku Solver Using Reduction to SAT

Homework 1. Due Date: Wednesday 11/26/07 - at the beginning of the lecture

Math Week in Review #5. A proposition, or statement, is a declarative sentence that can be classified as either true or false, but not both.

Propositional Logic. Application of Propositional logic

Lecture Notes 15 Number systems and logic CSS Data Structures and Object-Oriented Programming Professor Clark F. Olson

1 Introduction to Logic

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

Solutions to In-Class Problems Week 1, Fri

(a) (4 pts) Prove that if a and b are rational, then ab is rational. Since a and b are rational they can be written as the ratio of integers a 1

First-Order Predicate Logic. CSCI 5582, Fall 2007

STUDENT LESSON A14 Boolean Algebra and Loop Boundaries

Operators. Java operators are classified into three categories:

Declarative programming. Logic programming is a declarative style of programming.

Chapter 5 Selection Statements. Mr. Dave Clausen La Cañada High School

Mathematical Logic Part One

Logic and its Applications

Grade 7/8 Math Circles Fall November 6/7/8 Boolean Logic

Chapter 3. Describing Syntax and Semantics

SC/MATH Boolean Formulae. Ref: G. Tourlakis, Mathematical Logic, John Wiley & Sons, York University

Geometry Note-Sheet Overview

LOGIC AND DISCRETE MATHEMATICS

Learning Rules. Learning Rules from Decision Trees

QUIZ: What value is stored in a after this

EECS 183. Week 3 - Diana Gage. www-personal.umich.edu/ ~drgage

Please try all of the TRY THIS problems throughout this document. When done, do the following:

Math 55 - Spring 04 - Lecture notes # 1 - Jan 20 (Tuesday)

Assignment 3: Logical Agents: Solutions

7/25/2016. Example: Addition of Unsigned Bit Patterns. ECE 120: Introduction to Computing. Adding Two Non-Negative Patterns Can Overflow

L05 - Negating Statements

Logic Haskell Exercises

CSL105: Discrete Mathematical Structures. Ragesh Jaiswal, CSE, IIT Delhi

HW1. Due: September 13, 2018

Propositional Calculus. Math Foundations of Computer Science

PRG PROGRAMMING ESSENTIALS. Lecture 2 Program flow, Conditionals, Loops

SMURF Language Reference Manual Serial MUsic Represented as Functions

Foundations of AI. 9. Predicate Logic. Syntax and Semantics, Normal Forms, Herbrand Expansion, Resolution

Test #2 October 8, 2015

Grade 7/8 Math Circles Fall November 6/7/8 Boolean Logic

III SEMESTER B. A. PHILOSOPHY PHL3B04 - SYMBOLIC LOGIC AND INFORMATICS QUESTION BANK FOR INTERNAL ASSESSMENT. Multiple Choice Questions

Back to the knights and knaves island

Control Structures in Java if-else and switch

Midterms Save the Dates!

THEORY OF COMPUTATION

STABILITY AND PARADOX IN ALGORITHMIC LOGIC

Diagonalization. The cardinality of a finite set is easy to grasp: {1,3,4} = 3. But what about infinite sets?

2SAT Andreas Klappenecker

Logical reasoning systems

Introduction to Boolean logic and Logical Gates

Introduction to predicate calculus

Mathematical Logic Part One

BOOLEAN ALGEBRA AND CIRCUITS

NP-Completeness of 3SAT, 1-IN-3SAT and MAX 2SAT

Chapter 16. Logic Programming Languages

Transcription:

Section 1.1 Logic 1.1.1 1.1 LOGIC Mathematics is used to predict empirical reality, and is therefore the foundation of engineering. Logic gives precise meaning to mathematical statements. PROPOSITIONS def: A proposition is a statement that is either true (T) or false (F), but not both. Example 1.1.1: 1 + 1 = 2. (T) 2 + 2 = 5. (F) Example 1.1.2: A fact-based declaration is a proposition, even if no one knows whether it is true. 11213 is prime. 1 is prime. There exists an odd perfect number.

Chapter 1 FOUNDATIONS 1.1.2 Example 1.1.3: Logical analysis of rhetoric begins with the modeling of fact-based natural language declarations by propositions. Portland is the capital of Oregon. Columbia University was founded in 1754 by Romulus and Remus. If 2+2 = 5, then you are the pope. (a conditional fact-based declaration). Example 1.1.4: A statement cannot be true or false unless it is declarative. This excludes commands and questions. Go directly to jail. What time is it? Example 1.1.5: Declarations about semantic tokens of non-constant value are NOT propositions. x + 2 = 5.

Section 1.1 Logic 1.1.3 TRUTH TABLES def: The boolean domain is the set {T, F }. Either of its elements is called a boolean value. An n-tuple (p 1,..., p n ) of boolean values is called a boolean n-tuple. def: An n-operand truth table is a table that assigns a boolean value to the set of all boolean n-tuples. def: A propositional operator is a rule defined by a truth table. def: An operator is monadic if it has only one argument. It is dyadic if it has two arguments. def: The following truth table defines the monadic propositional operator called negation: In other words, the negation of a proposition has the opposite truth value from the proposition itself.

Chapter 1 FOUNDATIONS 1.1.4 Example 1.1.6: The negation operator can be used to model the following constructions: It is not sunny. 2 + 2 5. def: The following truth table defines the dyadic propositional operator called conjunction: Example 1.1.7: by conjunction: The word and is modeled It is sunny and I am going to the beach. Proposition 1.1.1. The total number of propositional operators on n arguments is 2 2n. Proof: The number of boolean n-tuples is 2 n. Thus, the number of rows in a truth table for a propositional operator on n arguments is 2 n. The truth value (in the right hand column) of each boolean n-tuple has two possibilities.

Section 1.1 Logic 1.1.5 Corollary 1.1.2. There are 4 = 2 2 monadic propositional operators. Corollary 1.1.3. There are 16 = 2 22 dyadic propositional operators. Example 1.1.8: There are only four monadic propositional operators: Identity, Negation, Constant-True, and Constant-False. def: The following truth table defines the dyadic propositional operator called disjunction: The disjunction is true if either (or both) of its component clauses is true. Example 1.1.9: Disjunction models or : It is rainy or Sweetums goes to the beach. This sentence is TRUE if Sweetums goes to the beach in the rain. It is false only if Sweetums stays home on a sunny day.

Chapter 1 FOUNDATIONS 1.1.6 def: Exclusive or is true if one and only one of its component clauses is true: Exclusive or is GOOD for modeling binary addition. It is BAD for modeling or in English.

Section 1.1 Logic 1.1.7 CONDITIONAL OPERATOR def: This truth table defines the dyadic operator called the conditional a.k.a implies : In the form p q, the proposition to the left of the conditional operator (in this case, p) is called the antecedent, and the proposition to the right (in this case, q) is called the consequent. The conditional operator is best understood as a CONTRACT. Example 1.1.10: The assertion If the Yankees win the World Series, then they give Lou Gehrig a $1,000 bonus is of the form p q: p: Yankees win World Series q: Yankees give Gehrig a $1,000 bonus. What circumstance would allow Gehrig to win a breach-of-contract suit against the Yankees?

Chapter 1 FOUNDATIONS 1.1.8 Example 1.1.11: Conditional propositions. If 2 + 2 = 4, then Albany is the capital of NY. If 2 + 2 = 4, then Peapack is the capital of NJ. If 2 + 2 = 5, then there is a state with only one neighbor. If 2 + 2 = 5, then you are the pope. disambiguation: Premises and conclusions are parts of logical arguments. We disambiguate them from antecedent and consequent. Hypothesis is already an overloaded term. def: The following truth table defined the dyadic operator called the biconditional: * N.B. Technically, you is a variable.

Section 1.1 Logic 1.1.9 COMPOUND PROPOSITIONAL FORMS def: A propositional variable is a variable such as p, q, r (possibly subscripted, e.g. p j ) over the boolean domain. def: An atomic propositional form is either a boolean constant or a propositional variable. def: A compound propositional form is derived from atomic propositional forms by application of propositional operators. Monadic operators are evaluated first, and otherwise, precedence is indicated by parentheses. disambiguation: A proposition is an instance of a propositional form. Careful terminological distinction is temporary. Example 1.1.12: Some compound propositional forms on two variables: p, p q, p q, p q, p q, p q, (p q) q. Example 1.1.13: If you don t repay the Friendly Loan Company, then you will get a call from the Unfriendly Collection Agency. p q.

Chapter 1 FOUNDATIONS 1.1.10 Any compound propositional form can be evaluated by a truth table Example 1.1.14: (p q) q Example 1.1.15: From Quiz 1 in Fall 1994: Analyze (p (r q)) with a truth table. SOLUTION

Section 1.1 Logic 1.1.11 Example 1.1.16: 1.1 Exer 60: solve a crime. Alice: Carlos did it. Carlos: Diana did it. Diana: Carlos is lying. John: I didn t do it. Oracle: Only one of them is telling the truth. Problem: Who did it? METHOD 1: modified truth table. Find the row in which only one statement is true. METHOD 2: sequential analysis. (1) If Alice is telling the truth, then so is John. Thus, Alice is lying, which implies that Carlos did not do it. (2) Similarly, if Carlos is telling the truth, then so is John. Thus, Carlos is lying, which implies that Diana did not do it. (3) By (2), Diana must be telling the truth. (4) By (3), John is lying. Thus, John did it.