Chapter 2 Logic 2.1

Total Page:16

File Type:pdf, Size:1020Kb

Chapter 2 Logic 2.1 Chapter 2 Logic 2.1 Proposition and logical operations Logic Main goal: use logic to analyze arguments (claims) to see if they are valid or invalid. This is useful for math theory, but also in the real world any time someone is trying to convince you of something. To analyze an argument, we break it down into smaller pieces: statements, logical connectives and quantifiers. Statements • A statement is a declarative sentence that is either true or false (but not both at the same time) • A compound statement consists of simple statements combined using logical connectives like and, or, not, if…then. • The negation of a statement must have the opposite truth value to the original statement Connectives and Symbols Type of Connective Symbol Statement and Ù conjunction or Ú disjunction not ~ negation Quantifiers • Universal quantifier: all, every, each. Statement is true if the claim is true for every object it is referring to. • Existential quantifier: some, there exists, for at least one. Statement is true if the claim is true for al least one object it is referring to. Negations of Quantified Statements Statement Negation Some do not All do Not all do None do Some do All do not Truth Tables • Shows truth value of a compound statement for all possible truth values of the component statements • If there are n component statements, then the truth table has 2n rows Conjunction p q p Ù q T T T T F F F T F F F F Disjunction p q p Ú q T T T T F T F T T F F F Negation p ~p T F F T Logical connectives • Connectives are used to create a compound proposition from two or more propositions – Negation (denote ¬ or !) $\neg$ – And or logical conjunction (denoted Ù) $\wedge$ – Or or logical disjunction (denoted Ú) $\vee$ – XOR or exclusive or (denoted Å) $\xor$ – Implication (denoted Þ or ®) $\Rightarrow$, $\rightarrow$ – Biconditional (denoted Û or «) $\LeftRightarrow$, $\leftrightarrow$ • We define the meaning (semantics) of the logical connectives using truth tables Precedence of Logical Operators • As in arithmetic, an ordering is imposed on the use of logical operators in compound propositions • However, it is preferable to use parentheses to disambiguate operators and facilitate readability ¬ p Ú q Ù ¬ r º (¬p) Ú (q Ù (¬r)) • To avoid unnecessary parenthesis, the following precedences hold: 1. Negation (¬) 2. Conjunction (Ù) 3. Disjunction (Ú) 4. Implication (®) 5. Biconditional («) Terminology: Tautology, Contradictions, Contingencies • Definitions – A compound proposition that is always true, no matter what the truth values of the propositions that occur in it is called a tautology – A compound proposition that is always false is called a contradiction – A proposition that is neither a tautology nor a contradiction is a contingency • Examples – A simple tautology is p Ú ¬p – A simple contradiction is p Ù ¬p Equivalent Statements • Two statements are equivalent if they have the same truth value for every possible situation, and we write p ≡ q • De Morgan’s Laws: ~(p Ù q) ≡ ~p Ú ~q ~(p Ú q) ≡ ~p Ù ~q Logical Equivalences: Definition • Definition: Propositions p and q are logically equivalent if p « q is a tautology. • Informally, p and q are equivalent if whenever p is true, q is true, and vice versa • Notation: p º q (p is equivalent to q), p « q, and p Û q • Alert: º is not a logical connective $\equiv$ Logical Equivalences: Example 1 • Are the propositions (p ® q) and (¬p Ú q) logically equivalent? • To find out, we construct the truth tables for each: p q p®q ¬p ¬pÚq 0 0 0 1 1 0 1 1 The two columns in the truth table are identical, thus we conclude that (p ® q) º (¬p Ú q) Example: Constructing a Truth Table Construct the truth table for: p ˄ (~ p ˅ ~ q) A logical statement having n component statements will have 2n rows in its truth table. 22 = 4 rows p q ~ p ~ q ~ p ˅ ~ q p ˄ (~ p ˅ ~ q) T T F T F F F T T F F T Example: Constructing a Truth Table Construct the truth table for: p ˄ (~ p ˅ ~ q) A logical statement having n component statements will have 2n rows in its truth table. 22 = 4 rows p q ~ p ~ q ~ p ˅ ~ q p ˄ (~ p ˅ ~ q) T T F F T F F T F T T F F F T T Example: Constructing a Truth Table Construct the truth table for: p ˄ (~ p ˅ ~ q) A logical statement having n component statements will have 2n rows in its truth table. 22 = 4 rows p q ~ p ~ q ~ p ˅ ~ q p ˄ (~ p ˅ ~ q) T T F F F T F F T T F T T F T F F T T T Example: Constructing a Truth Table Construct the truth table for: p ˄ (~ p ˅ ~ q) A logical statement having n component statements will have 2n rows in its truth table. 22 = 4 rows p q ~ p ~ q ~ p ˅ ~ q p ˄ (~ p ˅ ~ q) T T F F F F T F F T T T F T T F T F F F T T T F Examples .
Recommended publications
  • UNIT-I Mathematical Logic Statements and Notations
    UNIT-I Mathematical Logic Statements and notations: A proposition or statement is a declarative sentence that is either true or false (but not both). For instance, the following are propositions: “Paris is in France” (true), “London is in Denmark” (false), “2 < 4” (true), “4 = 7 (false)”. However the following are not propositions: “what is your name?” (this is a question), “do your homework” (this is a command), “this sentence is false” (neither true nor false), “x is an even number” (it depends on what x represents), “Socrates” (it is not even a sentence). The truth or falsehood of a proposition is called its truth value. Connectives: Connectives are used for making compound propositions. The main ones are the following (p and q represent given propositions): Name Represented Meaning Negation ¬p “not p” Conjunction p q “p and q” Disjunction p q “p or q (or both)” Exclusive Or p q “either p or q, but not both” Implication p ⊕ q “if p then q” Biconditional p q “p if and only if q” Truth Tables: Logical identity Logical identity is an operation on one logical value, typically the value of a proposition that produces a value of true if its operand is true and a value of false if its operand is false. The truth table for the logical identity operator is as follows: Logical Identity p p T T F F Logical negation Logical negation is an operation on one logical value, typically the value of a proposition that produces a value of true if its operand is false and a value of false if its operand is true.
    [Show full text]
  • Introduction to Logic
    IntroductionI Introduction to Logic Propositional calculus (or logic) is the study of the logical Christopher M. Bourke relationship between objects called propositions and forms the basis of all mathematical reasoning. Definition A proposition is a statement that is either true or false, but not both (we usually denote a proposition by letters; p, q, r, s, . .). Computer Science & Engineering 235 Introduction to Discrete Mathematics [email protected] IntroductionII ExamplesI Example (Propositions) Definition I 2 + 2 = 4 I The derivative of sin x is cos x. The value of a proposition is called its truth value; denoted by T or I 6 has 2 factors 1 if it is true and F or 0 if it is false. Opinions, interrogative and imperative sentences are not Example (Not Propositions) propositions. I C++ is the best language. I When is the pretest? I Do your homework. ExamplesII Logical Connectives Connectives are used to create a compound proposition from two Example (Propositions?) or more other propositions. I Negation (denoted or !) ¬ I 2 + 2 = 5 I And (denoted ) or Logical Conjunction ∧ I Every integer is divisible by 12. I Or (denoted ) or Logical Disjunction ∨ I Microsoft is an excellent company. I Exclusive Or (XOR, denoted ) ⊕ I Implication (denoted ) → I Biconditional; “if and only if” (denoted ) ↔ Negation Logical And A proposition can be negated. This is also a proposition. We usually denote the negation of a proposition p by p. ¬ The logical connective And is true only if both of the propositions are true. It is also referred to as a conjunction. Example (Negated Propositions) Example (Logical Connective: And) I Today is not Monday.
    [Show full text]
  • Chapter 1 Logic and Set Theory
    Chapter 1 Logic and Set Theory To criticize mathematics for its abstraction is to miss the point entirely. Abstraction is what makes mathematics work. If you concentrate too closely on too limited an application of a mathematical idea, you rob the mathematician of his most important tools: analogy, generality, and simplicity. – Ian Stewart Does God play dice? The mathematics of chaos In mathematics, a proof is a demonstration that, assuming certain axioms, some statement is necessarily true. That is, a proof is a logical argument, not an empir- ical one. One must demonstrate that a proposition is true in all cases before it is considered a theorem of mathematics. An unproven proposition for which there is some sort of empirical evidence is known as a conjecture. Mathematical logic is the framework upon which rigorous proofs are built. It is the study of the principles and criteria of valid inference and demonstrations. Logicians have analyzed set theory in great details, formulating a collection of axioms that affords a broad enough and strong enough foundation to mathematical reasoning. The standard form of axiomatic set theory is denoted ZFC and it consists of the Zermelo-Fraenkel (ZF) axioms combined with the axiom of choice (C). Each of the axioms included in this theory expresses a property of sets that is widely accepted by mathematicians. It is unfortunately true that careless use of set theory can lead to contradictions. Avoiding such contradictions was one of the original motivations for the axiomatization of set theory. 1 2 CHAPTER 1. LOGIC AND SET THEORY A rigorous analysis of set theory belongs to the foundations of mathematics and mathematical logic.
    [Show full text]
  • Folktale Documentation Release 1.0
    Folktale Documentation Release 1.0 Quildreen Motta Nov 05, 2017 Contents 1 Guides 3 2 Indices and tables 5 3 Other resources 7 3.1 Getting started..............................................7 3.2 Folktale by Example........................................... 10 3.3 API Reference.............................................. 12 3.4 How do I................................................... 63 3.5 Glossary................................................. 63 Python Module Index 65 i ii Folktale Documentation, Release 1.0 Folktale is a suite of libraries for generic functional programming in JavaScript that allows you to write elegant modular applications with fewer bugs, and more reuse. Contents 1 Folktale Documentation, Release 1.0 2 Contents CHAPTER 1 Guides • Getting Started A series of quick tutorials to get you up and running quickly with the Folktale libraries. • API reference A quick reference of Folktale’s libraries, including usage examples and cross-references. 3 Folktale Documentation, Release 1.0 4 Chapter 1. Guides CHAPTER 2 Indices and tables • Global Module Index Quick access to all modules. • General Index All functions, classes, terms, sections. • Search page Search this documentation. 5 Folktale Documentation, Release 1.0 6 Chapter 2. Indices and tables CHAPTER 3 Other resources • Licence information 3.1 Getting started This guide will cover everything you need to start using the Folktale project right away, from giving you a brief overview of the project, to installing it, to creating a simple example. Once you get the hang of things, the Folktale By Example guide should help you understanding the concepts behind the library, and mapping them to real use cases. 3.1.1 So, what’s Folktale anyways? Folktale is a suite of libraries for allowing a particular style of functional programming in JavaScript.
    [Show full text]
  • Theorem Proving in Classical Logic
    MEng Individual Project Imperial College London Department of Computing Theorem Proving in Classical Logic Supervisor: Dr. Steffen van Bakel Author: David Davies Second Marker: Dr. Nicolas Wu June 16, 2021 Abstract It is well known that functional programming and logic are deeply intertwined. This has led to many systems capable of expressing both propositional and first order logic, that also operate as well-typed programs. What currently ties popular theorem provers together is their basis in intuitionistic logic, where one cannot prove the law of the excluded middle, ‘A A’ – that any proposition is either true or false. In classical logic this notion is provable, and the_: corresponding programs turn out to be those with control operators. In this report, we explore and expand upon the research about calculi that correspond with classical logic; and the problems that occur for those relating to first order logic. To see how these calculi behave in practice, we develop and implement functional languages for propositional and first order logic, expressing classical calculi in the setting of a theorem prover, much like Agda and Coq. In the first order language, users are able to define inductive data and record types; importantly, they are able to write computable programs that have a correspondence with classical propositions. Acknowledgements I would like to thank Steffen van Bakel, my supervisor, for his support throughout this project and helping find a topic of study based on my interests, for which I am incredibly grateful. His insight and advice have been invaluable. I would also like to thank my second marker, Nicolas Wu, for introducing me to the world of dependent types, and suggesting useful resources that have aided me greatly during this report.
    [Show full text]
  • Learning Dependency-Based Compositional Semantics
    Learning Dependency-Based Compositional Semantics Percy Liang∗ University of California, Berkeley Michael I. Jordan∗∗ University of California, Berkeley Dan Klein† University of California, Berkeley Suppose we want to build a system that answers a natural language question by representing its semantics as a logical form and computing the answer given a structured database of facts. The core part of such a system is the semantic parser that maps questions to logical forms. Semantic parsers are typically trained from examples of questions annotated with their target logical forms, but this type of annotation is expensive. Our goal is to instead learn a semantic parser from question–answer pairs, where the logical form is modeled as a latent variable. We develop a new semantic formalism, dependency-based compositional semantics (DCS) and define a log-linear distribution over DCS logical forms. The model parameters are estimated using a simple procedure that alternates between beam search and numerical optimization. On two standard semantic parsing benchmarks, we show that our system obtains comparable accuracies to even state-of-the-art systems that do require annotated logical forms. 1. Introduction One of the major challenges in natural language processing (NLP) is building systems that both handle complex linguistic phenomena and require minimal human effort. The difficulty of achieving both criteria is particularly evident in training semantic parsers, where annotating linguistic expressions with their associated logical forms is expensive but until recently, seemingly unavoidable. Advances in learning latent-variable models, however, have made it possible to progressively reduce the amount of supervision ∗ Computer Science Division, University of California, Berkeley, CA 94720, USA.
    [Show full text]
  • Logical Vs. Natural Language Conjunctions in Czech: a Comparative Study
    ITAT 2016 Proceedings, CEUR Workshop Proceedings Vol. 1649, pp. 68–73 http://ceur-ws.org/Vol-1649, Series ISSN 1613-0073, c 2016 K. Prikrylová,ˇ V. Kubon,ˇ K. Veselovská Logical vs. Natural Language Conjunctions in Czech: A Comparative Study Katrin Prikrylová,ˇ Vladislav Kubon,ˇ and Katerinaˇ Veselovská Charles University in Prague, Faculty of Mathematics and Physics Czech Republic {prikrylova,vk,veselovska}@ufal.mff.cuni.cz Abstract: This paper studies the relationship between con- ceptions and irregularities which do not abide the rules as junctions in a natural language (Czech) and their logical strictly as it is the case in logic. counterparts. It shows that the process of transformation Primarily due to this difference, the transformation of of a natural language expression into its logical representa- natural language sentences into their logical representation tion is not straightforward. The paper concentrates on the constitutes a complex issue. As we are going to show in most frequently used logical conjunctions, and , and it the subsequent sections, there are no simple rules which analyzes the natural language phenomena which∧ influence∨ would allow automation of the process – the majority of their transformation into logical conjunction and disjunc- problematic cases requires an individual approach. tion. The phenomena discussed in the paper are temporal In the following text we are going to restrict our ob- sequence, expressions describing mutual relationship and servations to the two most frequently used conjunctions, the consequences of using plural. namely a (and) and nebo (or). 1 Introduction and motivation 2 Sentences containing the conjunction a (and) The endeavor to express natural language sentences in the form of logical expressions is probably as old as logic it- The initial assumption about complex sentences contain- self.
    [Show full text]
  • Presupposition Projection and Entailment Relations
    Presupposition Projection and Entailment Relations Amaia Garcia Odon i Acknowledgements I would like to thank the members of my thesis committee, Prof. Dr. Rob van der Sandt, Dr. Henk Zeevat, Dr. Isidora Stojanovic, Dr. Cornelia Ebert and Dr. Enric Vallduví for having accepted to be on my thesis committee. I am extremely grateful to my adviser, Louise McNally, and to Rob van der Sandt. Without their invaluable help, I would not have written this dissertation. Louise has been a wonderful adviser, who has always provided me with excellent guid- ance and continuous encouragement. Rob has been a mentor who has generously spent much time with me, teaching me Logic, discussing my work, and helping me clear up my thoughts. Very special thanks to Henk Zeevat for having shared his insights with me and for having convinced me that it was possible to finish on time. Thanks to Bart Geurts, Noor van Leusen, Sammie Tarenskeen, Bob van Tiel, Natalia Zevakhina and Corien Bary in Nijmegen; to Paul Dekker, Jeroen Groe- nendijk, Frank Veltman, Floris Roelofsen, Morgan Mameni, Raquel Fernández and Margot Colinet in Amsterdam; to Fernando García Murga, Agustín Vicente, Myriam Uribe-Etxebarria, Javier Ormazabal, Vidal Valmala, Gorka Elordieta, Urtzi Etxeberria and Javi Fernández in Vitoria-Gasteiz, to David Beaver and Mari- bel Romero. Also thanks to the people I met at the ESSLLIs of Bordeaux, Copen- hagen and Ljubljana, especially to Nick Asher, Craige Roberts, Judith Tonhauser, Fenghui Zhang, Mingya Liu, Alexandra Spalek, Cornelia Ebert and Elena Pa- ducheva. I gratefully acknowledge the financial help provided by the Basque Government – Departamento de Educación, Universidades e Investigación (BFI07.96) and Fun- dación ICREA (via an ICREA Academia award to Louise McNally).
    [Show full text]
  • Introduction to Deductive Logic
    Introduction to Deductive Logic Part I: Logic & Language There is no royal road to logic, and really valuable ideas can only be had at the price of close attention. Charles Saunders Peirce INTRODUCTION TO DEDUCTIVE LOGIC PART I: LOGIC AND LANGUAGE I. INTRODUCTION What is Logic? . 4 What is an argument? . 5 Three Criteria for Evaluating Arguments . 6 II. ARGUMENT ANALYSIS – PART 1 Preliminary Issues . 9 Statements and Truth Value Premises and Conclusions . 9 Statements vs Sentences 10 Simple vs Compound Statements 12 Recognizing premises and conclusions . 13 Indicator Language. 15 TWO TYPES OF ARGUMENTS Inductive Reasoning/Argument . 18 Deductive Reasoning/Argument . 19 III. ANALYSIS – PART II FORMALIZING ARGUMENT Preliminary Issue: Formal vs. Informal Argument . 24 Simple and Compound Statements . 25 Types of Compound Statements . 26 Formation Rules for Sentential . 26 DEFINING LOGICAL OPERATORS . 29 Negation . 29 Conjunction . 30 Disjunction . 31 Conditional/ Material Implication . 32 Bi-conditional . 33 APPLICATION: TRANSLATING USING LOGICAL OPERATORS . 35 TRUTH TABLE RULES/SUMMARY OF LOGICAL OPERATORS . 38 TRUTH TABLE APPLICATIONS . 39 Application I: Substitute and Calculate Method . 39 Application II: Calculating with Unknown Values . 41 Application III: Full Truth Table Method . 42 A Short Cut Technique for statements. 44 Truth Table Test for Logical Equivalence . 45 Application IV: Using Truth Tables to Facilitate Reasoning . 47 THE NEED FOR PREDICATE . 50 Using Predicate to Represent Categorical Statements . 52 Preliminary Issues– Grammar . 53 Formation Rules for Predicate . 55 Expressing Quantity . 56 APPLICATION: Symbolizing Categorical Statements using Predicate . 56 Negating Standard Form Categorical Statements. 57 Summary Chart for Standard Form Categorical Statements . 59 Extending Predicate . 61 A Universe of Discourse .
    [Show full text]
  • Hardware Abstract the Logic Gates References Results Transistors Through the Years Acknowledgements
    The Practical Applications of Logic Gates in Computer Science Courses Presenters: Arash Mahmoudian, Ashley Moser Sponsored by Prof. Heda Samimi ABSTRACT THE LOGIC GATES Logic gates are binary operators used to simulate electronic gates for design of circuits virtually before building them with-real components. These gates are used as an instrumental foundation for digital computers; They help the user control a computer or similar device by controlling the decision making for the hardware. A gate takes in OR GATE AND GATE NOT GATE an input, then it produces an algorithm as to how The OR gate is a logic gate with at least two An AND gate is a consists of at least two A NOT gate, also known as an inverter, has to handle the output. This process prevents the inputs and only one output that performs what inputs and one output that performs what is just a single input with rather simple behavior. user from having to include a microprocessor for is known as logical disjunction, meaning that known as logical conjunction, meaning that A NOT gate performs what is known as logical negation, which means that if its input is true, decision this making. Six of the logic gates used the output of this gate is true when any of its the output of this gate is false if one or more of inputs are true. If all the inputs are false, the an AND gate's inputs are false. Otherwise, if then the output will be false. Likewise, are: the OR gate, AND gate, NOT gate, XOR gate, output of the gate will also be false.
    [Show full text]
  • Introduction to Logic 1
    Introduction to logic 1. Logic and Artificial Intelligence: some historical remarks One of the aims of AI is to reproduce human features by means of a computer system. One of these features is reasoning. Reasoning can be viewed as the process of having a knowledge base (KB) and manipulating it to create new knowledge. Reasoning can be seen as comprised of 3 processes: 1. Perceiving stimuli from the environment; 2. Translating the stimuli in components of the KB; 3. Working on the KB to increase it. We are going to deal with how to represent information in the KB and how to reason about it. We use logic as a device to pursue this aim. These notes are an introduction to modern logic, whose origin can be found in George Boole’s and Gottlob Frege’s works in the XIX century. However, logic in general traces back to ancient Greek philosophers that studied under which conditions an argument is valid. An argument is any set of statements – explicit or implicit – one of which is the conclusion (the statement being defended) and the others are the premises (the statements providing the defense). The relationship between the conclusion and the premises is such that the conclusion follows from the premises (Lepore 2003). Modern logic is a powerful tool to represent and reason on knowledge and AI has traditionally adopted it as working tool. Within logic, one research tradition that strongly influenced AI is that started by the German philosopher and mathematician Gottfried Leibniz. His aim was to formulate a Lingua Rationalis to create a universal language based only on rationality, which could solve all the controversies between different parties.
    [Show full text]
  • The Composition of Logical Constants
    the morphosemantic makeup of exclusive-disjunctive markers ∗ Moreno Mitrovi´c university of cyprus & bled institute . abstract. The spirit of this paper is strongly decompositional and its aim to meditate on the idea that natural language conjunction and disjunction markers do not necessarily (directly) incarnate Boo- lean terms like ‘0’ and ‘1’,respectively. Drawing from a rich collec- tion of (mostly dead) languages (Ancient Anatolian, Homeric Greek, Tocharian, Old Church Slavonic, and North-East Caucasian), I will examine the morphosemantics of ‘XOR’ (‘exclusive or’) markers, i.e. exclusive (or strong/enriched) disjunction markers of the “ei- Do not cite without consultation. ⭒ ther ...or ...”-type, and demonstrate that the morphology of the XOR marker does not only contain the true (generalised) disjunc- tion marker (I dub it κ), as one would expect on the null (Boolean hy- pothesis), but that the XOR-marker also contains the (generalised) conjunction marker (I dub it μ). After making the case for a fine- April 15, 2017 structure of the Junction Phrase (JP), a common structural denom- ⭒ inator for con- and dis-junction, the paper proposes a new syntax for XOR constructions involving five functional heads (two pairs of κ ver. 6 and μ markers, forming the XOR-word and combining with the respective coordinand, and a J-head pairing up the coordinands). draft I then move on to compose the semantics of the syntactically de- ⭒ composed structure by providing a compositional account obtain- ing the exclusive component, qua the semantic/pragmatic signa- ture of these markers. To do so, I rely on an exhaustification-based system of ‘grammaticised implicatures’ (Chierchia, 2013b) in as- manuscript suming silent exhaustification operators in the narrow syntax, which (in concert with the presence of alternative-triggering κ- and μ-ope- rators) trigger local exclusive (scalar) implicature (SI) computation.
    [Show full text]