A Computational Understanding of Classical (Co)Recursion

Total Page:16

File Type:pdf, Size:1020Kb

A Computational Understanding of Classical (Co)Recursion A Computational Understanding of Classical (Co)Recursion Paul Downen Zena M. Ariola University of Oregon University of Oregon Eugene, Oregon Eugene, Oregon [email protected] [email protected] Abstract The goal of this paper is to introduce the basic principles Recursion and induction are mature, well-understood top- of coinductive and inductive structures from a computational ics in programming. Yet their duals, corecursion and co- point of view, by presenting a language that captures known induction, are still exotic and underdeveloped programming intuitions about them. For example, Harper [23] explains that features. We aim to put them on equal footing by giving a an element in a infinite stream of natural numbers can only foundation for corecursion based on computation, analogous be generated after computing all the proceeding elements. to the original computational foundation of recursion. At the Moreover, the introduction of stream objects is sometimes lower level, we show how the connection between the two described as the “dual” to the elimination of natural numbers _ can be strengthened through their implementation details [35, 37], but how is this so? Especially since, in the -calculus, in an abstract machine. At the higher level, we develop a stream objects are introduced with an internal “seed” used syntactic equational theory for inductive and coinductive to generate the elements in order, whereas the elimination reasoning based on control flow. We also observe the impact of natural numbers has no such internal state. of evaluation strategy: call-by-name has efficient recursion To make these intuitions precise, we express the (co)- and strong coinductive reasoning, but call-by-value has effi- inductive principles with symmetric forms of recursion and cient corecursion and strong inductive reasoning. corecursion in a programming language. This symmetry is en- capsulated by the duality [9, 22] between data types—defined CCS Concepts: • Theory of computation ! Program by the structure of objects—and codata types—defined by the schemes. behavior of objects. We aim to demystify coinductive codata Keywords: Corecursion, Coinduction, Control, Duality types, and to make them more suitable for widespread use in programming environments [15, 21]. ACM Reference Format: Our contributions (•) and observations (–) are: Paul Downen and Zena M. Ariola. 2020. A Computational Under- standing of Classical (Co)Recursion. In 22nd International Sympo- – (Section2) We point out the impact of evaluation strat- sium on Principles and Practice of Declarative Programming (PPDP ’20), egy on recursion combinators for inductive types: September 8–10, 2020, Bologna, Italy. ACM, New York, NY, USA, * In call-by-value, recursion is eager, and is just as 14 pages. https://doi.org/10.1145/3414080.3414086 inefficient as its encoding in terms of the iterator. * In call-by-name, recursion may end early; an asymp- 1 Introduction totic complexity improvement. Induction is a familiar and commonplace notion with many – (Section3) In an abstract machine, the recursor for firm foundations: logical, algebraic, and computational. Co- inductive types like numbers accumulates a continu- induction—the dual to induction—instead looks unfamiliar, ation during evaluation, maintaining the progress of and is usually relegated to coalgebras [36], since traditionally recursion that is implicit in the _-calculus. only the categorical setting speaks clearly about this duality. • (Section4) Applying duality in an abstract machine based on the sequent calculus [4, 11], we derive the Permission to make digital or hard copies of all or part of this work for corresponding corecursors for infinite streams with a personal or classroom use is granted without fee provided that copies value accumulator dual to the recursor’s continuation. are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights – (Section 4.2) Like recursion, corecursion can be more for components of this work owned by others than the author(s) must efficient than coiteration by letting corecursive pro- be honored. Abstracting with credit is permitted. To copy otherwise, or cesses stop early. Dual to recursion, this improvement republish, to post on servers or to redistribute to lists, requires prior specific in algorithmic complexity is only seen in call-by-value. permission and/or a fee. Request permissions from [email protected]. • (Section5) We translate the fully-general corecursor PPDP ’20, September 8–10, 2020, Bologna, Italy from the abstract machine back into direct style in © 2020 Copyright held by the owner/author(s). Publication rights licensed _` to ACM. terms of a -calculus using first-class control effects. ACM ISBN 978-1-4503-8821-4/20/09...$15.00 • (Section 5.1) (Co)recursive introduction rules require https://doi.org/10.1145/3414080.3414086 an internal state to express non-trivial computations. PPDP ’20, September 8–10, 2020, Bologna, Italy P. Downen and Z.M. Ariola Var 퐴, 퐵 ::= 퐴 ! 퐵 j nat Γ,G : 퐴 ` G : 퐴 ", # G j _G." j "# j j " j " ::= zero succ rec as ralt Γ,G : 퐴 ` " : 퐵 Γ ` " : 퐴 ! 퐵 Γ ` # : 퐴 # G ~." !퐼 !퐸 ralt ::= fzero ! j succ ! g Γ ` _G." : 퐴 ! 퐵 Γ ` "# : 퐵 ` " : nat Figure 1. System T: _-calculus with numbers and recursion. nat퐼 Γ nat퐼 Γ ` zero : nat zero Γ ` succ " : nat succ Γ ` " : nat Γ ` # : 퐴 Γ,G : nat,~ : 퐴 ` # 0 : 퐴 nat퐸 Γ ` rec " as fzero ! # j succ G ! ~.# 0g : 퐴 In contrast, recursive elimination rules (as in System T) do not. We define the corresponding stateless corecursor Figure 2. Type system of System T. as coelimination. Call-by-name values (+ ) and evaluation contexts (퐸): • (Section6) We present a direct-style equational the- +,, " 퐸 퐸 # 퐸 ory of natural numbers and streams, corresponding ::= ::= □ j j rec as ralt to weak induction and coinduction, based on control Call-by-value values (+ ) and evaluation contexts (퐸): flow. The theory does not resort to bisimulation [18]; +,, ::= G j _G." j zero j succ+ it uses syntactic, locally criteria for valid applications 퐸 ::= □ j 퐸 # j + 퐸 j succ 퐸 j rec 퐸 as ralt of the coinductive hypothesis. 0 • (Section 6.3) We identify the impact of evaluation strat- Operational rules, where ralt = fzero !# j succ G!~.# g: egy on equational reasoning in order to generalize the ¹V!º ¹_G."º + 7! " »+ /G¼ weak (co)inductive principles to strong (co)induction: ¹Vzeroº rec zero as ralt 7! # * In call-by-value, strong induction is sound. 0 ¹Vsuccº rec succ+ as ralt 7! ¹_~.# »+ /G¼º ¹rec+ as raltº * In call-by-name, strong coinduction is sound, which subsumes the traditional notion of bisimulation. Figure 3. Operational semantics of System T. 2 Recursion in the Lambda Calculus These macro-expansions are analogous to the common syn- tactic sugar of let-bindings in terms of functions: The prototypical example of computational recursion is Gödel’s System T [20], whose syntax is given in fig.1. System T ex- let G = " in # := ¹_G.# º " tends the simply-typed _-calculus, whose focus is on func- tions of type 퐴 ! 퐵, with ways to construct and use natural The type system of System T is given in fig.2. The Var, !퐼 numbers of type nat. Values of nat are built with the famil- and !퐸 typing rules are from the simply typed _-calculus. iar constructors zero (denoting the number 0) and succ " The two nat퐼 introduction rules give the types of the con- (denoting the successor of the number represented by "). structors of nat, and the nat퐸 elimination rule types the nat This way, the number = can be written as succ= zero. To use recursor. If rec is seen instead as a primitive function, rather these numbers, System T includes a recursor of the form than a syntactic construct, it would have the type rec " as fzero ! # j succ G ! ~.# 0g. This recursor is rec퐴 : nat ! 퐴 ! ¹nat ! 퐴 ! 퐴º ! 퐴 similar to pattern-matching in functional programming: the nat term " is analyzed to determine if it has the shape zero or whereas the primitive functions corresponding to case and succ G, and the matching branch is returned. But in addition iter on nat would have the type to binding the predecessor of " to G in the succ G branch, this 퐴 퐴 퐴 퐴 recursor also binds ~ to the recursive result that is returned casenat : nat ! ! ¹nat ! º ! " 퐴 퐴 퐴 퐴 퐴 if is replaced with its predecessor. iternat : nat ! ! ¹ ! º ! Notice how the recursor performs two jobs at the same time: finding the predecessor of a natural numbers as well System T’s call-by-name and -value operational seman- as calculating the recursive result given for the predeces- tics are given in fig.3. Both of these evaluation strategies V sor. These two functionalities are captured separately by a share operational rules of the same form, with ! being V _ V V conventional case-expression and the iterator, respectively. the well-known rule of the -calculus and zero and succ Both can be expressed in terms of macro-expansions into defining recursion on the two nat constructors. The only the recursor by ignoring the unneeded parameter: difference between call-by-value and -name evaluation lies in their notion of values + (i.e., those terms which can be substituted for variables) and evaluation contexts (i.e., the case " of f zero ! # rec " as f zero ! # 0 := 0 location of the next reduction step to perform). Note that we j succ G ! # g j succ G ! .# g take this notion seriously, and never substitute a non-value " # " # iter of f zero ! rec as f zero ! for a variable. As such, the Vsucc rule does not substitute the 0 := 0 j succ ! ~. # g j succ ! ~. # g recursive computation rec+ as ralt for ~, since it might not A Computational Understanding of Classical (Co)Recursion PPDP ’20, September 8–10, 2020, Bologna, Italy be a value (in call-by-value).
Recommended publications
  • 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]
  • 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]
  • NICOLAS WU Department of Computer Science, University of Bristol (E-Mail: [email protected], [email protected])
    Hinze, R., & Wu, N. (2016). Unifying Structured Recursion Schemes. Journal of Functional Programming, 26, [e1]. https://doi.org/10.1017/S0956796815000258 Peer reviewed version Link to published version (if available): 10.1017/S0956796815000258 Link to publication record in Explore Bristol Research PDF-document University of Bristol - Explore Bristol Research General rights This document is made available in accordance with publisher policies. Please cite only the published version using the reference above. Full terms of use are available: http://www.bristol.ac.uk/red/research-policy/pure/user-guides/ebr-terms/ ZU064-05-FPR URS 15 September 2015 9:20 Under consideration for publication in J. Functional Programming 1 Unifying Structured Recursion Schemes An Extended Study RALF HINZE Department of Computer Science, University of Oxford NICOLAS WU Department of Computer Science, University of Bristol (e-mail: [email protected], [email protected]) Abstract Folds and unfolds have been understood as fundamental building blocks for total programming, and have been extended to form an entire zoo of specialised structured recursion schemes. A great number of these schemes were unified by the introduction of adjoint folds, but more exotic beasts such as recursion schemes from comonads proved to be elusive. In this paper, we show how the two canonical derivations of adjunctions from (co)monads yield recursion schemes of significant computational importance: monadic catamorphisms come from the Kleisli construction, and more astonishingly, the elusive recursion schemes from comonads come from the Eilenberg-Moore construction. Thus we demonstrate that adjoint folds are more unifying than previously believed. 1 Introduction Functional programmers have long realised that the full expressive power of recursion is untamable, and so intensive research has been carried out into the identification of an entire zoo of structured recursion schemes that are well-behaved and more amenable to program comprehension and analysis (Meijer et al., 1991).
    [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]
  • 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]
  • A Quasi-Classical Logic for Classical Mathematics
    Theses Honors College 11-2014 A Quasi-Classical Logic for Classical Mathematics Henry Nikogosyan University of Nevada, Las Vegas Follow this and additional works at: https://digitalscholarship.unlv.edu/honors_theses Part of the Logic and Foundations Commons Repository Citation Nikogosyan, Henry, "A Quasi-Classical Logic for Classical Mathematics" (2014). Theses. 21. https://digitalscholarship.unlv.edu/honors_theses/21 This Honors Thesis is protected by copyright and/or related rights. It has been brought to you by Digital Scholarship@UNLV with permission from the rights-holder(s). You are free to use this Honors Thesis in any way that is permitted by the copyright and related rights legislation that applies to your use. For other uses you need to obtain permission from the rights-holder(s) directly, unless additional rights are indicated by a Creative Commons license in the record and/or on the work itself. This Honors Thesis has been accepted for inclusion in Theses by an authorized administrator of Digital Scholarship@UNLV. For more information, please contact [email protected]. A QUASI-CLASSICAL LOGIC FOR CLASSICAL MATHEMATICS By Henry Nikogosyan Honors Thesis submitted in partial fulfillment for the designation of Departmental Honors Department of Philosophy Ian Dove James Woodbridge Marta Meana College of Liberal Arts University of Nevada, Las Vegas November, 2014 ABSTRACT Classical mathematics is a form of mathematics that has a large range of application; however, its application has boundaries. In this paper, I show that Sperber and Wilson’s concept of relevance can demarcate classical mathematics’ range of applicability by demarcating classical logic’s range of applicability.
    [Show full text]
  • Practical Coinduction
    Math. Struct. in Comp. Science: page 1 of 21. c Cambridge University Press 2016 doi:10.1017/S0960129515000493 Practical coinduction DEXTER KOZEN† and ALEXANDRA SILVA‡ †Computer Science, Cornell University, Ithaca, New York 14853-7501, U.S.A. Email: [email protected] ‡Intelligent Systems, Radboud University Nijmegen, Postbus 9010, 6500 GL Nijmegen, the Netherlands Email: [email protected] Received 6 March 2013; revised 17 October 2014 Induction is a well-established proof principle that is taught in most undergraduate programs in mathematics and computer science. In computer science, it is used primarily to reason about inductively defined datatypes such as finite lists, finite trees and the natural numbers. Coinduction is the dual principle that can be used to reason about coinductive datatypes such as infinite streams or trees, but it is not as widespread or as well understood. In this paper, we illustrate through several examples the use of coinduction in informal mathematical arguments. Our aim is to promote the principle as a useful tool for the working mathematician and to bring it to a level of familiarity on par with induction. We show that coinduction is not only about bisimilarity and equality of behaviors, but also applicable to a variety of functions and relations defined on coinductive datatypes. 1. Introduction Perhaps the single most important general proof principle in computer science, and argu- ably in all of mathematics, is induction. There is a valid induction principle corresponding to any well-founded relation, but in computer science, it is most often seen in the form known as structural induction, in which the domain of discourse is an inductively-defined datatype such as finite lists, finite trees, or the natural numbers.
    [Show full text]
  • The Development of Mathematical Logic from Russell to Tarski: 1900–1935
    The Development of Mathematical Logic from Russell to Tarski: 1900–1935 Paolo Mancosu Richard Zach Calixto Badesa The Development of Mathematical Logic from Russell to Tarski: 1900–1935 Paolo Mancosu (University of California, Berkeley) Richard Zach (University of Calgary) Calixto Badesa (Universitat de Barcelona) Final Draft—May 2004 To appear in: Leila Haaparanta, ed., The Development of Modern Logic. New York and Oxford: Oxford University Press, 2004 Contents Contents i Introduction 1 1 Itinerary I: Metatheoretical Properties of Axiomatic Systems 3 1.1 Introduction . 3 1.2 Peano’s school on the logical structure of theories . 4 1.3 Hilbert on axiomatization . 8 1.4 Completeness and categoricity in the work of Veblen and Huntington . 10 1.5 Truth in a structure . 12 2 Itinerary II: Bertrand Russell’s Mathematical Logic 15 2.1 From the Paris congress to the Principles of Mathematics 1900–1903 . 15 2.2 Russell and Poincar´e on predicativity . 19 2.3 On Denoting . 21 2.4 Russell’s ramified type theory . 22 2.5 The logic of Principia ......................... 25 2.6 Further developments . 26 3 Itinerary III: Zermelo’s Axiomatization of Set Theory and Re- lated Foundational Issues 29 3.1 The debate on the axiom of choice . 29 3.2 Zermelo’s axiomatization of set theory . 32 3.3 The discussion on the notion of “definit” . 35 3.4 Metatheoretical studies of Zermelo’s axiomatization . 38 4 Itinerary IV: The Theory of Relatives and Lowenheim’s¨ Theorem 41 4.1 Theory of relatives and model theory . 41 4.2 The logic of relatives .
    [Show full text]
  • Introduction to Formal Logic II (3 Credit
    PHILOSOPHY 115 INTRODUCTION TO FORMAL LOGIC II BULLETIN INFORMATION PHIL 115 – Introduction to Formal Logic II (3 credit hrs) Course Description: Intermediate topics in predicate logic, including second-order predicate logic; meta-theory, including soundness and completeness; introduction to non-classical logic. SAMPLE COURSE OVERVIEW Building on the material from PHIL 114, this course introduces new topics in logic and applies them to both propositional and first-order predicate logic. These topics include argument by induction, duality, compactness, and others. We will carefully prove important meta-logical results, including soundness and completeness for both propositional logic and first-order predicate logic. We will also learn a new system of proof, the Gentzen-calculus, and explore first-order predicate logic with functions and identity. Finally, we will discuss potential motivations for alternatives to classical logic, and examine how those motivations lead to the development of intuitionistic logic, including a formal system for intuitionistic logic, comparing the features of that formal system to those of classical first-order predicate logic. ITEMIZED LEARNING OUTCOMES Upon successful completion of PHIL 115, students will be able to: 1. Apply, as appropriate, principles of analytical reasoning, using as a foundation the knowledge of mathematical, logical, and algorithmic principles 2. Recognize and use connections among mathematical, logical, and algorithmic methods across disciplines 3. Identify and describe problems using formal symbolic methods and assess the appropriateness of these methods for the available data 4. Effectively communicate the results of such analytical reasoning and problem solving 5. Explain and apply important concepts from first-order logic, including duality, compactness, soundness, and completeness 6.
    [Show full text]
  • The Method of Coalgebra: Exercises in Coinduction
    The Method of Coalgebra: exercises in coinduction Jan Rutten CWI & RU [email protected] Draft d.d. 8 July 2018 (comments are welcome) 2 Draft d.d. 8 July 2018 Contents 1 Introduction 7 1.1 The method of coalgebra . .7 1.2 History, roughly and briefly . .7 1.3 Exercises in coinduction . .8 1.4 Enhanced coinduction: algebra and coalgebra combined . .8 1.5 Universal coalgebra . .8 1.6 How to read this book . .8 1.7 Acknowledgements . .9 2 Categories { where coalgebra comes from 11 2.1 The basic definitions . 11 2.2 Category theory in slogans . 12 2.3 Discussion . 16 3 Algebras and coalgebras 19 3.1 Algebras . 19 3.2 Coalgebras . 21 3.3 Discussion . 23 4 Induction and coinduction 25 4.1 Inductive and coinductive definitions . 25 4.2 Proofs by induction and coinduction . 28 4.3 Discussion . 32 5 The method of coalgebra 33 5.1 Basic types of coalgebras . 34 5.2 Coalgebras, systems, automata ::: ....................... 34 6 Dynamical systems 37 6.1 Homomorphisms of dynamical systems . 38 6.2 On the behaviour of dynamical systems . 41 6.3 Discussion . 44 3 4 Draft d.d. 8 July 2018 7 Stream systems 45 7.1 Homomorphisms and bisimulations of stream systems . 46 7.2 The final system of streams . 52 7.3 Defining streams by coinduction . 54 7.4 Coinduction: the bisimulation proof method . 59 7.5 Moessner's Theorem . 66 7.6 The heart of the matter: circularity . 72 7.7 Discussion . 76 8 Deterministic automata 77 8.1 Basic definitions . 78 8.2 Homomorphisms and bisimulations of automata .
    [Show full text]
  • Common Sense for Concurrency and Strong Paraconsistency Using Unstratified Inference and Reflection
    Published in ArXiv http://arxiv.org/abs/0812.4852 http://commonsense.carlhewitt.info Common sense for concurrency and strong paraconsistency using unstratified inference and reflection Carl Hewitt http://carlhewitt.info This paper is dedicated to John McCarthy. Abstract Unstratified Reflection is the Norm....................................... 11 Abstraction and Reification .............................................. 11 This paper develops a strongly paraconsistent formalism (called Direct Logic™) that incorporates the mathematics of Diagonal Argument .......................................................... 12 Computer Science and allows unstratified inference and Logical Fixed Point Theorem ........................................... 12 reflection using mathematical induction for almost all of Disadvantages of stratified metatheories ........................... 12 classical logic to be used. Direct Logic allows mutual Reification Reflection ....................................................... 13 reflection among the mutually chock full of inconsistencies Incompleteness Theorem for Theories of Direct Logic ..... 14 code, documentation, and use cases of large software systems Inconsistency Theorem for Theories of Direct Logic ........ 15 thereby overcoming the limitations of the traditional Tarskian Consequences of Logically Necessary Inconsistency ........ 16 framework of stratified metatheories. Concurrency is the Norm ...................................................... 16 Gödel first formalized and proved that it is not possible
    [Show full text]
  • Friends with Benefits: Implementing Corecursion in Foundational
    Friends with Benefits Implementing Corecursion in Foundational Proof Assistants Jasmin Christian Blanchette1;2, Aymeric Bouzy3, Andreas Lochbihler4, Andrei Popescu5;6, and Dmitriy Traytel4 1 Vrije Universiteit Amsterdam, the Netherlands 2 Inria Nancy – Grand Est, Nancy, France 3 Laboratoire d’informatique, École polytechnique, Palaiseau, France 4 Institute of Information Security, Department of Computer Science, ETH Zürich, Switzerland 5 Department of Computer Science, Middlesex University London, UK 6 Institute of Mathematics Simion Stoilow of the Romanian Academy, Bucharest, Romania Abstract. We introduce AmiCo, a tool that extends a proof assistant, Isabelle/ HOL, with flexible function definitions well beyond primitive corecursion. All definitions are certified by the assistant’s inference kernel to guard against in- consistencies. A central notion is that of friends: functions that preserve the pro- ductivity of their arguments and that are allowed in corecursive call contexts. As new friends are registered, corecursion benefits by becoming more expressive. We describe this process and its implementation, from the user’s specification to the synthesis of a higher-order definition to the registration of a friend. We show some substantial case studies where our approach makes a difference. 1 Introduction Codatatypes and corecursion are emerging as a major methodology for programming with infinite objects. Unlike in traditional lazy functional programming, codatatypes support total (co)programming [1, 8, 30, 68], where the defined functions have a simple set-theoretic semantics and productivity is guaranteed. The proof assistants Agda [19], Coq [12], and Matita [7] have been supporting this methodology for years. By contrast, proof assistants based on higher-order logic (HOL), such as HOL4 [64], HOL Light [32], and Isabelle/HOL [56], have traditionally provided only datatypes.
    [Show full text]