The Haskell Road to Logic, Maths and Programming
Book information
Description
The purpose of this book is to teach logic and mathematical reasoning in practice, and to connect logical reasoning with computer programming in Haskell. Haskell emerged in the last decade as a standard for lazy functional programming, a programming style where arguments are evaluated only when the value is actually needed. Haskell is a marvellous demonstration tool for logic and maths because its functional character allows implementations to remain very close to the concepts that get implemented, while the laziness permits smooth handling of infinite data structures. This book does not assume the reader to have previous experience with either programming or construction of formal proofs, but acquaintance with mathematical notation, at the level of secondary school mathematics is presumed. Everything one needs to know about mathematical reasoning or programming is explained as we go along. After proper digestion of the material in this book the reader will be able to write interesting programs, reason about their correctness, and document them in a clear fashion. The reader will also have learned how to set up mathematical proofs in a structured way, and how to read and digest mathematical proofs written by others. Contents Preface Purpose Logic in Practice How to Use the Book Exercises Book Website and Contact Acknowledgments GettingStarted Preview 1.1 Starting up the Haskell Interpreter 1.2 Implementing a Prime NumberTest 1.3 Haskell Type Declarations 1.4 Identifiers in Haskell 1.5 Playing the Haskell Game 1.6 Haskell Types 1.7 The Prime Factorization Algorithm 1.8 The map and filter Functions 1.9 Haskell Equations and Equational Reasoning 1.10 FurtherReading Talking about Mathematical Objects Preview 2.1 Logical Connectives and their Meanings 2.2 Logical Validity and Related Notions 2.3 Making Symbolic Form Explicit 2.4 Lambda Abstraction 2.5 Definitions and Implementations 2.6 Abstract Formulas and Concrete Structures 2.7 Logical Handling of the Quantifiers 2.8 Quantifiers as Procedures 2.9 Further Reading The Use of Logic: Proof Preview 3.1 Proof Style 3.2 Proof Recipes 3.3 Rules for the Connectives 3.4 Rules for the Quantifiers 3.5 Summary of the Proof Recipes 3.6 Some Strategic Guidelines 3.7 Reasoning and Computation with Primes 3.8 Further Reading Sets,Types and Lists Preview 4.1 Let’s Talk About Sets 4.2 Paradoxes,Types and Type Classes 4.3 SpecialSets 4.4 Algebra of Sets 4.5 Ordered Pairs and Products 4.6 Lists and List Operations 4.7 List Comprehension and Database Query 4.8 Using Lists to Represent Sets 4.9A Data Type for Sets 4.10 Further Reading Relations Preview 5.1 The Notion of a Relation 5.2 Properties of Relations 5.3 Implementing Relations as Sets of Pairs 5.4 Implementing Relations as Characteristic Functions 5.5 Equivalence Relations 5.6 Equivalence Classes and Partitions 5.7 Integer Partitions 5.8 Further Reading Functions Preview 6.1 Basic Notions 6.2 Surjections,Injections,Bijections 6.3 Function Composition 6.4 Inverse Function 6.5 Partial Functions 6.6 Functions as Partitions 6.7 Products 6.8 Congruences 6.9 FurtherReading InductionandRecursion Preview 7.1 Mathematical Induction 7.2 Recursion over the Natural Numbers 7.3 The Nature of Recursive Definitions 7.4 Induction and Recursion over Trees 7.5 Induction and Recursion over Lists 7.6 Some Variations on the Tower of Hanoi 7.7 Induction and Recursion over Other Data Structures 7.8 Further Reading Working with Numbers Preview 8.1 A Module for Natural Numbers 8.2 GCD and the Fundamental Theorem of Arithmetic 8.3 Integers 8.4 Implementing Integer Arithmetic 8.5 Rational Numbers 8.6 Implementing Rational Arithmetic 8.7 Irrational Numbers 8.8 The Mechanic’s Rule 8.9 Reasoning about Reals 8.10 ComplexNumbers 8.11 Further Reading Polynomials Preview 9.1Difference Analysis of Polynomial Sequences 9.2 Gaussian Elimination 9.3 Polynomials and the Binomial Theorem 9.4 Polynomials for Combinatorial Reasoning 9.5 Further Reading Corecursion Preview 10.1 Corecursive Definitions 10.2 Processesand Labeled Transition Systems 10.3 Proof by Approximation 10.4 Proof by Coinduction 10.5 Power Series and Generating Functions 10.6 Exponential Generating Functions 10.7 Further Reading FiniteandInfiniteSets Preview 11.1MoreonMathematicalInduction 11.2 Equipollence 11.3 Infinite Sets 11.4 Cantor’s World Implemented 11.5 *Cardinal Numbers *Further Exercises The Greek Alphabet Bibliography Index
Similar books
MySQL® Notes for Professionals book
2018 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
MrExcel 2022: Boosting Excel
2022 · PDF
Session C11: Ancient Cultural Landscapes in South Europe – their Ecological Setting and Evolution, Session C22: Gardeners from South America, Session S04: Agro-Pastoralism and Early Metallurgy Sessions, Session WS29: The Idea of Enclosure in Recent Iberian Prehistory, Session C88: Rhytmes et causalites des dynamiques de l'anthropisation en Europe entre 6500 ET 500 BC: Hypotheses socio-culturelles et/ou climatiques: Proceedings of the XV UISPP World Congress (Lisbon 4-9 September 2006) / Actes du XV Congrès Mondial (Lisbonne 4-9 Septembre 2006) Vol.36
2010 · PDF
THE BRITISH ARMY IN INDIA: ITS PRESERVATION BY AN APPROPRIATE CLOTHING, HOUSING, LOCATING, RECREATIVE EMPLOYMENT, AND HOPEFUL ENCOURAGEMENT OF THE TROOPS. with AN APPENDIX ON INDIA : THE CLIMATE OP ITS HILLS ; THE DEVELOPMENT OF ITS RESODRCBS, INDUSTRY, AND ARTS ; THE ADMINISTRATION OF JUSTICE ; THE BLACK ACT ; THE PROGRESS OF CHRISTIANITY ; THE TRAFFIC IN OPIUM ; THE VALUE OF INDIA ; PERMANENT CAUSES OF DISAFFECTION, AND OF THE RECENT REBELLION ; THE TRADITIONARY POLICY; MISGOVERNMENT BY NATIVE RULERS ; ANNEXATIONS OF THEIR TERRITORY, ETC.
1858 · PDF
Idries Shah 27 Books Collection : A Perfumed Scorpion, A Veiled Gazelle, Caravan of Dreams, Darkest England, Destination Mecca, Evenings with Idries Shah, Knowing How to Know, Learning How to Learn, Letters and Lectures of Idries Shah, Neglected aspects of Sufi study, Observations, Oriental Magic, Reflections, Seeker after Truth, Special Illumination, Special Problems in the study of Sufi ideas, Sufi thought and action, Tales of the Dervishes, The Dermis Probe, The Elephant in the Dark, The Englishman Handbook, Idries Shah Antology, The Magic Monastery, The natives are restless, wisdom of the Idiots PDF.
2022 · PDF
The travels of Capts. Lewis and Clarke from St. Louis, by way of the Missouri and Columbia rivers, to the Pacific ocean; performed in the years 1804, 1805 & 1806, by order of the government of the United States. Containing delineations of the manners, customs, religion, &c. of the Indians, comp. from various authentic sources, and original documents, and a summary of the Statistical view of the Indian nations, from the official communication of Meriwether Lewis. Illustrated with a map of the country, inhabited by the western tribes of Indians
1809 · PDF
Professional Linux kernel architecture ''Wrox programmer to programmer''--Cover. - ''What you are reading right now is the result of an evolution over more than seven years: After two years of writing, the first edition was published in German by Carl Hanser Verlag in 2003. It then described kernel 2.6.0. The test was used as a basis for the low-level design documentation for the EAL4+ security evaluation of Red Hat Enterprise Linux 5, requiring to update it to kernel 2.6.18 (if the EAL acronym does not mean anything to you, then Wikipedia is once more your friend). Hewlett-Packard sponsored the translation into English and has, thankfully, granted the rights to publish the result. Updates to kernel 2.6.24 were then performed specifically for this book''--P. ix
2008 · PDF