Mathematical Logic

Total Page:16

File Type:pdf, Size:1020Kb

Mathematical Logic Mathematical Logic Helmut Schwichtenberg Mathematisches Institut der Universit¨at M¨unchen Wintersemester 2003/2004 Contents Chapter 1. Logic 1 1. Formal Languages 2 2. Natural Deduction 4 3. Normalization 11 4. Normalization including Permutative Conversions 20 5. Notes 31 Chapter 2. Models 33 1. Structures for Classical Logic 33 2. Beth-Structures for Minimal Logic 35 3. Completeness of Minimal and Intuitionistic Logic 39 4. Completeness of Classical Logic 42 5. Uncountable Languages 44 6. Basics of Model Theory 48 7. Notes 54 Chapter 3. Computability 55 1. Register Machines 55 2. Elementary Functions 58 3. The Normal Form Theorem 64 4. Recursive Definitions 69 Chapter 4. G¨odel’s Theorems 73 1. G¨odel Numbers 73 2. Undefinability of the Notion of Truth 77 3. The Notion of Truth in Formal Theories 79 4. Undecidability and Incompleteness 81 5. Representability 83 6. Unprovability of Consistency 87 7. Notes 90 Chapter 5. Set Theory 91 1. Cumulative Type Structures 91 2. Axiomatic Set Theory 92 3. Recursion, Induction, Ordinals 96 4. Cardinals 116 5. The Axiom of Choice 120 6. Ordinal Arithmetic 126 7. Normal Functions 133 8. Notes 138 Chapter 6. Proof Theory 139 i ii CONTENTS 1. Ordinals Below ε0 139 2. Provability of Initial Cases of TI 141 3. Normalization with the Omega Rule 145 4. Unprovable Initial Cases of Transfinite Induction 149 Bibliography 157 Index 159 CHAPTER 1 Logic The main subject of Mathematical Logic is mathematical proof. In this introductory chapter we deal with the basics of formalizing such proofs. The system we pick for the representation of proofs is Gentzen’s natural deduc- tion, from [8]. Our reasons for this choice are twofold. First, as the name says this is a natural notion of formal proof, which means that the way proofs are represented corresponds very much to the way a careful mathematician writing out all details of an argument would go anyway. Second, formal proofs in natural deduction are closely related (via the so-called Curry- Howard correspondence) to terms in typed lambda calculus. This provides us not only with a compact notation for logical derivations (which other- wise tend to become somewhat unmanagable tree-like structures), but also opens up a route to applying the computational techniques which underpin lambda calculus. Apart from classical logic we will also deal with more constructive logics: minimal and intuitionistic logic. This will reveal some interesting aspects of proofs, e.g. that it is possible und useful to distinguish beween existential proofs that actually construct witnessing objects, and others that don’t. As an example, consider the following proposition. There are irrational numbers a, b such that ab is rational. This can be proved as follows, by cases. √2 Case √2 is rational. Choose a = √2 and b = √2. Then a, b are irrational and by assumption ab is rational. √2 √2 Case √2 is irrational. Choose a = √2 and b = √2. Then by assumption a, b are irrational and √2 √2 2 ab = √2 = √2 = 2 ³ ´ ³ ´ is rational. ¤ √2 As long as we have not decided whether √2 is rational, we do not know which numbers a, b we must take. Hence we have an example of an existence proof which does not provide an instance. An essential point for Mathematical Logic is to fix a formal language to be used. We take implication and the universal quantifier as basic. Then the logic rules correspond to lambda→ calculus. The additional∀ connectives , , and are defined via axiom schemes. These axiom schemes will later⊥ be∃ ∨ seen as∧ special cases of introduction and elimination rules for inductive definitions. 1 2 1. LOGIC 1. Formal Languages 1.1. Terms and Formulas. Let a countable infinite set vi i N of variables be given; they will be denoted by x,y,z. A first order{ language| ∈ } then is determined by its signature, which is to mean the following. L For every natural number n 0 a (possible empty) set of n-ary rela- • tion symbols (also called predicate≥ symbols). 0-ary relation symbols are called propositional symbols. (read “falsum”) is required as a fixed propositional symbol. The⊥ language will not, unless stated otherwise, contain = as a primitive. For every natural number n 0 a (possible empty) set of n-ary • function symbols. 0-ary function≥ symbols are called constants. We assume that all these sets of variables, relation and function symbols are disjoint. For instance the language G of group theory is determined by the sig- nature consisting of the followingL relation and function symbols: the group operation (a binary function symbol), the unit e (a constant), the inverse ◦ 1 operation − (a unary function symbol) and finally equality = (a binary relation symbol). -terms are inductively defined as follows. L Every variable is an -term. • Every constant of Lis an -term. • L L If t ,...,tn are -terms and f is an n-ary function symbol of • 1 L L with n 1, then f(t ,...,tn) is an -term. ≥ 1 L From -terms one constructs -prime formulas, also called atomic for- L L mulas of : If t ,...,tn are terms and R is an n-ary relation symbol of , L 1 L then R(t1,...,tn) is an -prime formula. -formulas are inductivelyL defined from -prime formulas by L L Every -prime formula is an -formula. • If A andL B are -formulas, thenL so are (A B) (“if A, then B”), • (A B) (“A andL B”) and (A B) (“A or B→”). If A∧ is an -formula and x is∨ a variable, then xA (“for all x, A • holds”) andL xA (“there is an x such that A”) are∀ -formulas. ∃ L Negation, classical disjunction, and the classical existential quantifier are defined by A := A , ¬ →⊥ A cl B := A B , ∨ ¬ → ¬ →⊥ clxA := x A. ∃ ¬∀ ¬ Usually we fix a language , and speak of terms and formulas instead of -terms and -formulas. WeL use L L r, s, t for terms, x,y,z for variables, c for constants, P, Q, R for relation symbols, f,g,h for function symbols, A,B,C,D for formulas. 1. FORMAL LANGUAGES 3 Definition. The depth dp(A) of a formula A is the maximum length of a branch in its construction tree. In other words, we define recursively dp(P ) = 0 for atomic P , dp(A B) = max(dp(A), dp(B)) + 1 for binary operators , dp( A) = dp(A) + 1◦ for unary operators . The size◦ or ◦length A of a formula A is the number◦ of occurrences of logical symbols and atomic| | formulas (parentheses not counted) in A: P = 1 for P atomic, A B = A + B + 1 for binary operators , A =| A| + 1 for unary operators| ◦ | . | | | | ◦ | ◦ | | | ◦ One can show easily that A + 1 2dp(A)+1. | | ≤ Notation (Saving on parentheses). In writing formulas we save on parentheses by assuming that , , bind more strongly than , , and that in turn , bind more strongly∀ ∃ ¬ than , (where A B abbreviates∧ ∨ (A B) (∧B∨ A)). Outermost parentheses→ ↔ are also usually↔ dropped. Thus→A ∧B →C is read as ((A ( B)) C). In the case of iterated implications∧ ¬ we→ sometimes use the short∧ ¬ notation→ A1 A2 ...An 1 An for A1 (A2 ... (An 1 An) ... ). → → − → → → − → To save parentheses in quantified formulas, we use a mild form of the dot notation: a dot immediately after x or x makes the scope of that quantifier as large as possible, given the parentheses∀ ∃ around. So x.A B means x(A B), not ( xA) B. ∀ → ∀ → ∀ → We also save on parentheses by writing e.g. Rxyz, Rt0t1t2 instead of R(x,y,z), R(t0,t1,t2), where R is some predicate symbol. Similarly for a unary function symbol with a (typographically) simple argument, so fx for f(x), etc. In this case no confusion will arise. But readability requires that we write in full R(fx,gy,hz), instead of Rfxgyhz. Binary function and relation symbols are usually written in infix nota- tion, e.g. x + y instead of +(x, y), and x < y instead of <(x, y). We write t = s for (t = s) and t < s for (t < s). 6 ¬ 6 ¬ 1.2. Substitution, Free and Bound Variables. Expressions , 0 which differ only in the names of bound variables will be regarded as iden-E E tical. This is sometimes expressed by saying that and 0 are α-equivalent. In other words, we are only interested in expressionsE “modulE o renaming of bound variables”. There are methods of finding unique representatives for such expressions, for example the namefree terms of de Bruijn [7]. For the human reader such representations are less convenient, so we shall stick to the use of bound variables. In the definition of “substitution of expression for variable x in ex- E0 pression ”, either one requires that no variable free in 0 becomes bound by a variable-bindingE operator in , when the free occurrencesE of x are re- placed by (also expressed by sayingE that there must be no “clashes of E0 variables”), “ 0 is free for x in ”, or the substitution operation is taken to involve a systematicE renamingE operation for the bound variables, avoiding clashes. Having stated that we are only interested in expressions modulo renaming bound variables, we can without loss of generality assume that substitution is always possible. 4 1. LOGIC Also, it is never a real restriction to assume that distinct quantifier occurrences are followed by distinct variables, and that the sets of bound and free variables of a formula are disjoint. Notation. “FV” is used for the (set of) free variables of an expression; so FV(t) is the set of variables free in the term t, FV(A) the set of variables free in formula A etc.
Recommended publications
  • Reasoning About Equations Using Equality
    Mathematics Instructional Plan – Grade 4 Reasoning About Equations Using Equality Strand: Patterns, Functions, Algebra Topic: Using reasoning to assess the equality in closed and open arithmetic equations Primary SOL: 4.16 The student will recognize and demonstrate the meaning of equality in an equation. Related SOL: 4.4a Materials: Partners Explore Equality and Equations activity sheet (attached) Vocabulary equal symbol (=), equality, equation, expression, not equal symbol (≠), number sentence, open number sentence, reasoning Student/Teacher Actions: What should students be doing? What should teachers be doing? 1. Activate students’ prior knowledge about the equal sign. Formally assess what students already know and what misconceptions they have. Ask students to open their notebooks to a clean sheet of paper and draw lines to divide the sheet into thirds as shown below. Create a poster of the same graphic organizer for the room. This activity should take no more than 10 minutes; it is not a teaching opportunity but simply a data- collection activity. Equality and the Equal Sign (=) I know that- I wonder if- I learned that- 1 1 1 a. Let students know they will be creating a graphic organizer about equality and the equal sign; that is, what it means and how it is used. The organizer is to help them keep track of what they know, what they wonder, and what they learn. The “I know that” column is where they can write things they are pretty sure are correct. The “I wonder if” column is where they can write things they have questions about and also where they can put things they think may be true but they are not sure.
    [Show full text]
  • A Proof of Cantor's Theorem
    Cantor’s Theorem Joe Roussos 1 Preliminary ideas Two sets have the same number of elements (are equinumerous, or have the same cardinality) iff there is a bijection between the two sets. Mappings: A mapping, or function, is a rule that associates elements of one set with elements of another set. We write this f : X ! Y , f is called the function/mapping, the set X is called the domain, and Y is called the codomain. We specify what the rule is by writing f(x) = y or f : x 7! y. e.g. X = f1; 2; 3g;Y = f2; 4; 6g, the map f(x) = 2x associates each element x 2 X with the element in Y that is double it. A bijection is a mapping that is injective and surjective.1 • Injective (one-to-one): A function is injective if it takes each element of the do- main onto at most one element of the codomain. It never maps more than one element in the domain onto the same element in the codomain. Formally, if f is a function between set X and set Y , then f is injective iff 8a; b 2 X; f(a) = f(b) ! a = b • Surjective (onto): A function is surjective if it maps something onto every element of the codomain. It can map more than one thing onto the same element in the codomain, but it needs to hit everything in the codomain. Formally, if f is a function between set X and set Y , then f is surjective iff 8y 2 Y; 9x 2 X; f(x) = y Figure 1: Injective map.
    [Show full text]
  • Chapter 2 Introduction to Classical Propositional
    CHAPTER 2 INTRODUCTION TO CLASSICAL PROPOSITIONAL LOGIC 1 Motivation and History The origins of the classical propositional logic, classical propositional calculus, as it was, and still often is called, go back to antiquity and are due to Stoic school of philosophy (3rd century B.C.), whose most eminent representative was Chryssipus. But the real development of this calculus began only in the mid-19th century and was initiated by the research done by the English math- ematician G. Boole, who is sometimes regarded as the founder of mathematical logic. The classical propositional calculus was ¯rst formulated as a formal ax- iomatic system by the eminent German logician G. Frege in 1879. The assumption underlying the formalization of classical propositional calculus are the following. Logical sentences We deal only with sentences that can always be evaluated as true or false. Such sentences are called logical sentences or proposi- tions. Hence the name propositional logic. A statement: 2 + 2 = 4 is a proposition as we assume that it is a well known and agreed upon truth. A statement: 2 + 2 = 5 is also a proposition (false. A statement:] I am pretty is modeled, if needed as a logical sentence (proposi- tion). We assume that it is false, or true. A statement: 2 + n = 5 is not a proposition; it might be true for some n, for example n=3, false for other n, for example n= 2, and moreover, we don't know what n is. Sentences of this kind are called propositional functions. We model propositional functions within propositional logic by treating propositional functions as propositions.
    [Show full text]
  • COMPSCI 501: Formal Language Theory Insights on Computability Turing Machines Are a Model of Computation Two (No Longer) Surpris
    Insights on Computability Turing machines are a model of computation COMPSCI 501: Formal Language Theory Lecture 11: Turing Machines Two (no longer) surprising facts: Marius Minea Although simple, can describe everything [email protected] a (real) computer can do. University of Massachusetts Amherst Although computers are powerful, not everything is computable! Plus: “play” / program with Turing machines! 13 February 2019 Why should we formally define computation? Must indeed an algorithm exist? Back to 1900: David Hilbert’s 23 open problems Increasingly a realization that sometimes this may not be the case. Tenth problem: “Occasionally it happens that we seek the solution under insufficient Given a Diophantine equation with any number of un- hypotheses or in an incorrect sense, and for this reason do not succeed. known quantities and with rational integral numerical The problem then arises: to show the impossibility of the solution under coefficients: To devise a process according to which the given hypotheses or in the sense contemplated.” it can be determined in a finite number of operations Hilbert, 1900 whether the equation is solvable in rational integers. This asks, in effect, for an algorithm. Hilbert’s Entscheidungsproblem (1928): Is there an algorithm that And “to devise” suggests there should be one. decides whether a statement in first-order logic is valid? Church and Turing A Turing machine, informally Church and Turing both showed in 1936 that a solution to the Entscheidungsproblem is impossible for the theory of arithmetic. control To make and prove such a statement, one needs to define computability. In a recent paper Alonzo Church has introduced an idea of “effective calculability”, read/write head which is equivalent to my “computability”, but is very differently defined.
    [Show full text]
  • Aristotle's Assertoric Syllogistic and Modern Relevance Logic*
    Aristotle’s assertoric syllogistic and modern relevance logic* Abstract: This paper sets out to evaluate the claim that Aristotle’s Assertoric Syllogistic is a relevance logic or shows significant similarities with it. I prepare the grounds for a meaningful comparison by extracting the notion of relevance employed in the most influential work on modern relevance logic, Anderson and Belnap’s Entailment. This notion is characterized by two conditions imposed on the concept of validity: first, that some meaning content is shared between the premises and the conclusion, and second, that the premises of a proof are actually used to derive the conclusion. Turning to Aristotle’s Prior Analytics, I argue that there is evidence that Aristotle’s Assertoric Syllogistic satisfies both conditions. Moreover, Aristotle at one point explicitly addresses the potential harmfulness of syllogisms with unused premises. Here, I argue that Aristotle’s analysis allows for a rejection of such syllogisms on formal grounds established in the foregoing parts of the Prior Analytics. In a final section I consider the view that Aristotle distinguished between validity on the one hand and syllogistic validity on the other. Following this line of reasoning, Aristotle’s logic might not be a relevance logic, since relevance is part of syllogistic validity and not, as modern relevance logic demands, of general validity. I argue that the reasons to reject this view are more compelling than the reasons to accept it and that we can, cautiously, uphold the result that Aristotle’s logic is a relevance logic. Keywords: Aristotle, Syllogism, Relevance Logic, History of Logic, Logic, Relevance 1.
    [Show full text]
  • An Update on the Four-Color Theorem Robin Thomas
    thomas.qxp 6/11/98 4:10 PM Page 848 An Update on the Four-Color Theorem Robin Thomas very planar map of connected countries the five-color theorem (Theorem 2 below) and can be colored using four colors in such discovered what became known as Kempe chains, a way that countries with a common and Tait found an equivalent formulation of the boundary segment (not just a point) re- Four-Color Theorem in terms of edge 3-coloring, ceive different colors. It is amazing that stated here as Theorem 3. Esuch a simply stated result resisted proof for one The next major contribution came in 1913 from and a quarter centuries, and even today it is not G. D. Birkhoff, whose work allowed Franklin to yet fully understood. In this article I concentrate prove in 1922 that the four-color conjecture is on recent developments: equivalent formulations, true for maps with at most twenty-five regions. The a new proof, and progress on some generalizations. same method was used by other mathematicians to make progress on the four-color problem. Im- Brief History portant here is the work by Heesch, who developed The Four-Color Problem dates back to 1852 when the two main ingredients needed for the ultimate Francis Guthrie, while trying to color the map of proof—“reducibility” and “discharging”. While the the counties of England, noticed that four colors concept of reducibility was studied by other re- sufficed. He asked his brother Frederick if it was searchers as well, the idea of discharging, crucial true that any map can be colored using four col- for the unavoidability part of the proof, is due to ors in such a way that adjacent regions (i.e., those Heesch, and he also conjectured that a suitable de- sharing a common boundary segment, not just a velopment of this method would solve the Four- point) receive different colors.
    [Show full text]
  • Use Formal and Informal Language in Persuasive Text
    Author’S Craft Use Formal and Informal Language in Persuasive Text 1. Focus Objectives Explain Using Formal and Informal Language In this mini-lesson, students will: Say: When I write a persuasive letter, I want people to see things my way. I use • Learn to use both formal and different kinds of language to gain support. To connect with my readers, I use informal language in persuasive informal language. Informal language is conversational; it sounds a lot like the text. way we speak to one another. Then, to make sure that people believe me, I also use formal language. When I use formal language, I don’t use slang words, and • Practice using formal and informal I am more objective—I focus on facts over opinions. Today I’m going to show language in persuasive text. you ways to use both types of language in persuasive letters. • Discuss how they can apply this strategy to their independent writing. Model How Writers Use Formal and Informal Language Preparation Display the modeling text on chart paper or using the interactive whiteboard resources. Materials Needed • Chart paper and markers 1. As the parent of a seventh grader, let me assure you this town needs a new • Interactive whiteboard resources middle school more than it needs Old Oak. If selling the land gets us a new school, I’m all for it. Advanced Preparation 2. Last month, my daughter opened her locker and found a mouse. She was traumatized by this experience. She has not used her locker since. If you will not be using the interactive whiteboard resources, copy the Modeling Text modeling text and practice text onto chart paper prior to the mini-lesson.
    [Show full text]
  • Number Theory
    “mcs-ftl” — 2010/9/8 — 0:40 — page 81 — #87 4 Number Theory Number theory is the study of the integers. Why anyone would want to study the integers is not immediately obvious. First of all, what’s to know? There’s 0, there’s 1, 2, 3, and so on, and, oh yeah, -1, -2, . Which one don’t you understand? Sec- ond, what practical value is there in it? The mathematician G. H. Hardy expressed pleasure in its impracticality when he wrote: [Number theorists] may be justified in rejoicing that there is one sci- ence, at any rate, and that their own, whose very remoteness from or- dinary human activities should keep it gentle and clean. Hardy was specially concerned that number theory not be used in warfare; he was a pacifist. You may applaud his sentiments, but he got it wrong: Number Theory underlies modern cryptography, which is what makes secure online communication possible. Secure communication is of course crucial in war—which may leave poor Hardy spinning in his grave. It’s also central to online commerce. Every time you buy a book from Amazon, check your grades on WebSIS, or use a PayPal account, you are relying on number theoretic algorithms. Number theory also provides an excellent environment for us to practice and apply the proof techniques that we developed in Chapters 2 and 3. Since we’ll be focusing on properties of the integers, we’ll adopt the default convention in this chapter that variables range over the set of integers, Z. 4.1 Divisibility The nature of number theory emerges as soon as we consider the divides relation a divides b iff ak b for some k: D The notation, a b, is an abbreviation for “a divides b.” If a b, then we also j j say that b is a multiple of a.
    [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]
  • Video Lessons for Illustrative Mathematics: Grades 6-8 and Algebra I
    Video Lessons for Illustrative Mathematics: Grades 6-8 and Algebra I The Department, in partnership with Louisiana Public Broadcasting (LPB), Illustrative Math (IM), and SchoolKit selected 20 of the critical lessons in each grade level to broadcast on LPB in July of 2020. These lessons along with a few others are still available on demand on the SchoolKit website. To ensure accessibility for students with disabilities, all recorded on-demand videos are available with closed captioning and audio description. Updated on August 6, 2020 Video Lessons for Illustrative Math Grades 6-8 and Algebra I Background Information: Lessons were identified using the following criteria: 1. the most critical content of the grade level 2. content that many students missed due to school closures in the 2019-20 school year These lessons constitute only a portion of the critical lessons in each grade level. These lessons are available at the links below: • Grade 6: http://schoolkitgroup.com/video-grade-6/ • Grade 7: http://schoolkitgroup.com/video-grade-7/ • Grade 8: http://schoolkitgroup.com/video-grade-8/ • Algebra I: http://schoolkitgroup.com/video-algebra/ The tables below contain information on each of the lessons available for on-demand viewing with links to individual lessons embedded for each grade level. • Grade 6 Video Lesson List • Grade 7 Video Lesson List • Grade 8 Video Lesson List • Algebra I Video Lesson List Video Lessons for Illustrative Math Grades 6-8 and Algebra I Grade 6 Video Lesson List 6th Grade Illustrative Mathematics Units 2, 3,
    [Show full text]
  • John P. Burgess Department of Philosophy Princeton University Princeton, NJ 08544-1006, USA [email protected]
    John P. Burgess Department of Philosophy Princeton University Princeton, NJ 08544-1006, USA [email protected] LOGIC & PHILOSOPHICAL METHODOLOGY Introduction For present purposes “logic” will be understood to mean the subject whose development is described in Kneale & Kneale [1961] and of which a concise history is given in Scholz [1961]. As the terminological discussion at the beginning of the latter reference makes clear, this subject has at different times been known by different names, “analytics” and “organon” and “dialectic”, while inversely the name “logic” has at different times been applied much more broadly and loosely than it will be here. At certain times and in certain places — perhaps especially in Germany from the days of Kant through the days of Hegel — the label has come to be used so very broadly and loosely as to threaten to take in nearly the whole of metaphysics and epistemology. Logic in our sense has often been distinguished from “logic” in other, sometimes unmanageably broad and loose, senses by adding the adjectives “formal” or “deductive”. The scope of the art and science of logic, once one gets beyond elementary logic of the kind covered in introductory textbooks, is indicated by two other standard references, the Handbooks of mathematical and philosophical logic, Barwise [1977] and Gabbay & Guenthner [1983-89], though the latter includes also parts that are identified as applications of logic rather than logic proper. The term “philosophical logic” as currently used, for instance, in the Journal of Philosophical Logic, is a near-synonym for “nonclassical logic”. There is an older use of the term as a near-synonym for “philosophy of language”.
    [Show full text]
  • Data Types & Arithmetic Expressions
    Data Types & Arithmetic Expressions 1. Objective .............................................................. 2 2. Data Types ........................................................... 2 3. Integers ................................................................ 3 4. Real numbers ....................................................... 3 5. Characters and strings .......................................... 5 6. Basic Data Types Sizes: In Class ......................... 7 7. Constant Variables ............................................... 9 8. Questions/Practice ............................................. 11 9. Input Statement .................................................. 12 10. Arithmetic Expressions .................................... 16 11. Questions/Practice ........................................... 21 12. Shorthand operators ......................................... 22 13. Questions/Practice ........................................... 26 14. Type conversions ............................................. 28 Abdelghani Bellaachia, CSCI 1121 Page: 1 1. Objective To be able to list, describe, and use the C basic data types. To be able to create and use variables and constants. To be able to use simple input and output statements. Learn about type conversion. 2. Data Types A type defines by the following: o A set of values o A set of operations C offers three basic data types: o Integers defined with the keyword int o Characters defined with the keyword char o Real or floating point numbers defined with the keywords
    [Show full text]