AI aspects in reasoning, languages, and computation 9783030414245, 9783030414252

410 108 1MB

English Pages 113 Year 2020

Report DMCA / Copyright

DOWNLOAD FILE

Polecaj historie

AI aspects in reasoning, languages, and computation
 9783030414245, 9783030414252

Table of contents :
Preface......Page 6
Goal and Intended Readers of this Collection of Works......Page 7
Contents......Page 8
1.1 Background on Type-Theory of Acyclic Recursion......Page 10
1.2 Introduction to the Type Theory of Acyclic Recursion......Page 12
1.2.2 Syntax of TTAR......Page 13
1.2.3 Some Notations and Abbreviations......Page 17
1.2.4 Denotational Semantics of TTAR......Page 19
1.2.5 Canonical Forms......Page 26
1.2.6 Standard Reduction Calculi of TTAR......Page 28
1.2.7 Some Key Features of the Reduction Calculus of TTAR......Page 30
1.3 Algorithmic Semantics of TTAR......Page 31
1.3.1 Recursors and Algorithms: Referential Intensions......Page 32
1.3.2 Natural Isomorphism and Algorithmic Equivalence......Page 34
1.3.3 Underspecified Algorithms......Page 37
1.4 Extended Gamma-Star Reduction Calculi of TTAR......Page 39
1.5 Sequential Binders......Page 42
1.6 Algorithmic Computations with Restrictions......Page 51
1.7.1 Procedural and Declerative Neural Networks......Page 53
1.7.2 Algorithmic Binding of Functional Neuro-Receptors......Page 54
1.8 Conclusion and Future Work......Page 55
References......Page 56
2.1 Introduction......Page 58
2.2 Building Hierarchy of Algebraic Structures......Page 59
2.3 Implementation of Adjectives and Registrations......Page 61
2.3.2 Clustering Adjectives with Nouns......Page 62
2.3.3 Existential Registration......Page 63
2.3.5 Functorial Registration......Page 64
2.3.6 Synonyms and Antonyms......Page 65
2.4 Enriching Structures with Attributes......Page 66
2.5 Ring Homomorphisms......Page 71
2.6 Extending the Hierarchy......Page 73
2.6.1 Polynomial Rings......Page 74
2.6.2 Ordered Fields......Page 77
2.7 Conclusion and Future Work......Page 81
References......Page 82
3.1 Introduction......Page 85
3.2 The Mizar System......Page 86
3.3 Topological Preliminaries......Page 88
3.4.1 Structural Versus Structure-Free Approach......Page 89
3.4.2 Selectors and Aggregates......Page 92
3.5.1 Basic Notions......Page 95
3.5.2 The Closure Operator......Page 97
3.5.4 Axiomatization of Uniform Spaces......Page 98
3.6.1 Finite Formal Topological Spaces......Page 101
3.6.2 Relational Operators......Page 103
3.7 Attribute Splitting......Page 104
3.8 Merging Topologies and Rough Sets......Page 106
3.9 Conclusion and Future Work......Page 110
References......Page 111

Citation preview

Studies in Computational Intelligence 889

Adam Grabowski Roussanka Loukanova Christoph Schwarzweller Editors

AI Aspects in Reasoning, Languages, and Computation

Studies in Computational Intelligence Volume 889 Series Editor Janusz Kacprzyk, Polish Academy of Sciences, Warsaw, Poland

The series “Studies in Computational Intelligence” (SCI) publishes new developments and advances in the various areas of computational intelligence—quickly and with a high quality. The intent is to cover the theory, applications, and design methods of computational intelligence, as embedded in the fields of engineering, computer science, physics and life sciences, as well as the methodologies behind them. The series contains monographs, lecture notes and edited volumes in computational intelligence spanning the areas of neural networks, connectionist systems, genetic algorithms, evolutionary computation, artificial intelligence, cellular automata, self-organizing systems, soft computing, fuzzy systems, and hybrid intelligent systems. Of particular value to both the contributors and the readership are the short publication timeframe and the world-wide distribution, which enable both wide and rapid dissemination of research output. The books of this series are submitted to indexing to Web of Science, EI-Compendex, DBLP, SCOPUS, Google Scholar and Springerlink.

More information about this series at http://www.springer.com/series/7092

Adam Grabowski Roussanka Loukanova Christoph Schwarzweller •



Editors

AI Aspects in Reasoning, Languages, and Computation

123

Editors Adam Grabowski Institute of Informatics University of Bialystok Bialystok, Poland Christoph Schwarzweller Institute of Informatics University of Gdansk Gdańsk, Poland

Roussanka Loukanova Department of Mathematics Stockholm University Stockholm, Sweden

Institute of Mathematics and Informatics Bulgarian Academy of Sciences Sofia, Bulgaria

ISSN 1860-949X ISSN 1860-9503 (electronic) Studies in Computational Intelligence ISBN 978-3-030-41424-5 ISBN 978-3-030-41425-2 (eBook) https://doi.org/10.1007/978-3-030-41425-2 © Springer Nature Switzerland AG 2020 This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. This Springer imprint is published by the registered company Springer Nature Switzerland AG The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland

Preface

The chapters in this book emerged from the 14th International Symposium Advances in Artificial Intelligence and Applications (AAIA’19) and the 4th International Workshop on AI aspects in Reasoning, Languages, and Computation (AIRLangComp’19) at AAIA’19 and their previous editions: https://www.fedcsis.org/2019/airlangcomp. The Federated Conference of Computer Science and Information Systems (FedCSIS) is a yearly conference that has been held since 2006. From the beginning of FedCSIS, Artificial Intelligence (AI) was one of its major topics. Not only that the International Symposium on Advances in Artificial Intelligence and Application (AAIA) saw its 14th edition in 2019, but in addition, a number of satellite events emerged. In 2016, the first International Workshop on AI Aspects of Reasoning, Information, and Memory (AIRIM) was organized. The target was to bring together researchers, who use and/or develop AI techniques, in research areas that had not been represented sufficiently well by other tracks of FedCSIS. The organizers of AIRIM decided to focus on research areas connected with logic oriented approachs, including mathematical foundations of AI, such as reasoning, logic, and theory of computation, with special attention to new approaches and development. Based on the topics of papers submitted to the previous editions of AAIA including AIRIM, as well as in order to emphasize the strong tie of AI with research areas that use logic-oriented methods, the workshop AIRIM was renamed into AI aspects in Reasoning, Languages, and Computation (AIRLangComp), in its 2018 edition. The title of this book reflects on AIRLangComp, as more relevant for the topics of its chapters. Due to the character of the workshop AIRIM, the topics covered by this volume are diverse, while tightly related, in particular, by computational concepts of reasoning, computation, language, syntax, semantics, memory, and context information. The strong relation between the chapters of this book is that they use and develop logically oriented methods and techniques to AI. Some of the work is directly in areas of logic that contribute to both theory and applications of AI.

v

vi

Preface

Chapter 1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding of Functional Neuro-Receptors by Roussanka Loukanova provides a technical introduction to the new Type Theory of Acyclic Recursion (TTAR). TTAR has major computational utilities for potential theoretical and practical applications. The contribution of the chapter is the introduction of operators for binding argument slots, by combinations of recursion and abstraction, at the object level of TTAR. Among the major applications of TTAR are computational semantics of formal, programming, and natural languages. The chapter has in its focus applications of TTAR to computational models of natural neural memory and functionality. Chapter 2 Refining Algebraic Hierarchy in Mathematical Repository of Mizar by Adam Grabowski, Artur Korniłowicz, and Christoph Schwarzweller discusses some problems with the design and the implementation of a hierarchy of algebraic structures. As a tool of this development the authors use Mizar, one of the leading computerized proof-assistants together with its Mizar Mathematical Library, the formal repository of nearly 1400 texts from mathematics and computer science checked for their logical correctness. Chapter 3 Extending Formal Topology in Mizar by Uniform Spaces by Adam Grabowski and Roland Coghetto presents a view for topology formalized in the Mizar language. This chapter develops a third and final (after the lattice theory and the theory of general binary relations) link (via mechanisms of theory merging) with the theory of rough sets proposed by Pawlak in the early 70s of the twentieth century. The authors describe the revision of the existing topological apparatus offered by Mizar, and give the outline of the formalization of uniform spaces.

Goal and Intended Readers of this Collection of Works In recent times, we witness the positive impact of interdisciplinary theoretical research, across areas of mathematics and computer science, on other disciplines in natural sciences, as well as in humanities and social sciences. Computational models of human reasoning can be improved by integration of heterogeneous resources of information and AI techniques, e.g., multidimensional diagrams, images, language, syntax, semantics, and memory. The result is challenging. The goal of this collection of works is to promote intelligent approaches to logical foundations of AI, for covering more relevant development and new methods. The intended readers of the book are researchers in theory and applications of Artificial Intelligence (AI), especially in proof and reasoning systems, Natural Language Processing (NLP), and related subjects. Poland Sweden and Bulgaria Poland December 2019

Adam Grabowski Roussanka Loukanova Christoph Schwarzweller

Contents

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding of Functional Neuro-Receptors . . . . . . . . . . . . . . . . . . . . . . Roussanka Loukanova 1.1 Background on Type-Theory of Acyclic Recursion . . . . . . . . . . . . 1.2 Introduction to the Type Theory of Acyclic Recursion . . . . . . . . . 1.2.1 Types of TTAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2.2 Syntax of TTAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2.3 Some Notations and Abbreviations . . . . . . . . . . . . . . . . . . 1.2.4 Denotational Semantics of TTAR . . . . . . . . . . . . . . . . . . . 1.2.5 Canonical Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2.6 Standard Reduction Calculi of TTAR . . . . . . . . . . . . . . . . 1.2.7 Some Key Features of the Reduction Calculus of TTAR . . . 1.3 Algorithmic Semantics of TTAR . . . . . . . . . . . . . . . . . . . . . . . . . 1.3.1 Recursors and Algorithms: Referential Intensions . . . . . . . 1.3.2 Natural Isomorphism and Algorithmic Equivalence . . . . . . 1.3.3 Underspecified Algorithms . . . . . . . . . . . . . . . . . . . . . . . . 1.4 Extended Gamma-Star Reduction Calculi of TTAR . . . . . . . . . . . 1.5 Sequential Binders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.6 Algorithmic Computations with Restrictions . . . . . . . . . . . . . . . . . 1.7 Modelling Algorithmic Neural Networks . . . . . . . . . . . . . . . . . . . 1.7.1 Procedural and Declerative Neural Networks . . . . . . . . . . . 1.7.2 Algorithmic Binding of Functional Neuro-Receptors . . . . . 1.8 Conclusion and Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Refining Algebraic Hierarchy in Mathematical Repository of Mizar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adam Grabowski, Artur Korniłowicz and Christoph Schwarzweller 2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2 Building Hierarchy of Algebraic Structures . . . . . . . . . . . . . . . . .

1 1 3 4 4 8 10 17 19 21 22 23 25 28 30 33 42 44 44 45 46 47 49 49 50

vii

viii

Contents

2.3 Implementation of Adjectives and Registrations 2.3.1 Defining Attributes . . . . . . . . . . . . . . . 2.3.2 Clustering Adjectives with Nouns . . . . . 2.3.3 Existential Registration . . . . . . . . . . . . . 2.3.4 Conditional Registration . . . . . . . . . . . . 2.3.5 Functorial Registration . . . . . . . . . . . . . 2.3.6 Synonyms and Antonyms . . . . . . . . . . . 2.4 Enriching Structures with Attributes . . . . . . . . . 2.5 Ring Homomorphisms . . . . . . . . . . . . . . . . . . 2.6 Extending the Hierarchy . . . . . . . . . . . . . . . . . 2.6.1 Polynomial Rings . . . . . . . . . . . . . . . . 2.6.2 Ordered Fields . . . . . . . . . . . . . . . . . . . 2.7 Conclusion and Future Work . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

3 Extending Formal Topology in Mizar by Uniform Spaces Adam Grabowski and Roland Coghetto 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 The Mizar System . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3 Topological Preliminaries . . . . . . . . . . . . . . . . . . . . . . 3.4 Refining the Hierarchy of Structures . . . . . . . . . . . . . . 3.4.1 Structural Versus Structure-Free Approach . . . . 3.4.2 Selectors and Aggregates . . . . . . . . . . . . . . . . . 3.5 Topology Formalized . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.1 Basic Notions . . . . . . . . . . . . . . . . . . . . . . . . . 3.5.2 The Closure Operator . . . . . . . . . . . . . . . . . . . . 3.5.3 Introducing Uniformity . . . . . . . . . . . . . . . . . . 3.5.4 Axiomatization of Uniform Spaces . . . . . . . . . . 3.6 The Issue of Equivalent Characterizations . . . . . . . . . . 3.6.1 Finite Formal Topological Spaces . . . . . . . . . . . 3.6.2 Relational Operators . . . . . . . . . . . . . . . . . . . . . 3.7 Attribute Splitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.8 Merging Topologies and Rough Sets . . . . . . . . . . . . . . 3.9 Conclusion and Future Work . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . .

52 53 53 54 55 55 56 57 62 64 65 68 72 73

........

77

. . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . .

. 77 . 78 . 80 . 81 . 81 . 84 . 87 . 87 . 89 . 90 . 90 . 93 . 93 . 95 . 96 . 98 . 102 . 103

Chapter 1

Type-Theory of Acyclic Algorithms for Models of Consecutive Binding of Functional Neuro-Receptors Roussanka Loukanova

Abstract In this chapter, we provide a technical introduction to the new TypeTheory of Acyclic Recursion (TTAR). The formal language and theory of TTAR is a specialised part of a new approach to theory of algorithms. We introduce the formal syntax of TTAR, its reduction calculi, and two kinds of semantics: denotational and algorithmic. The algorithmic computations formalized by TTAR employ specialised operators that are the major computational utilities for potential theoretical and practical applications of TTAR. We present functional binding of arguments slots, by combinations of recursion and abstraction operators, at the object level of TTAR. We consider that such interconnections are models of basic, natural facilities of neural memory and functionality.

1.1 Background on Type-Theory of Acyclic Recursion Work on mathematics of a new approach to the notion of algorithm was originally initiated by Moschovakis [18–20, 22]. The Type-Theory of Acyclic Recursion (TTAR), λ , was introduced by Moschovakis [21] via examples for application to computaLar tional semantics of human language, which is traditionally called Natural Language λ is a strict extension of Gallin TY2 , see Gallin [1], and, (NL). The formal theory Lar therefore, of Montague Intensional Logic (IL), see Montague [24], since TY2 strictly extends IL. λ provide essential, novel computational apparatus The type-theoretic system of Lar for theoretical and practical applications. Applications of Moschovakis theories of algorithms have demonstrated their utilisation. Hurkens et al. [2] uses the untyped, functional language of recursion, introduced by Moschovakis [18, 20], for reasoning about semantic identities. R. Loukanova (B) Department of Mathematics, Stockholm University, Stockholm, Sweden e-mail: [email protected] Institute of Mathematics and Informatics, Bulgarian Academy of Sciences, Acad. G. Bonchev Str., Block 8, 1113 Sofia, Bulgaria © Springer Nature Switzerland AG 2020 A. Grabowski et al. (eds.), AI Aspects in Reasoning, Languages, and Computation, Studies in Computational Intelligence 889, https://doi.org/10.1007/978-3-030-41425-2_1

1

2

R. Loukanova

van Lambalgen and Hamm [4] use Moschovakis recursion for application to logic programming in linguistics and cognitive science, for representing temporal inforλ for representation of fundamental mation in discourse. Loukanova [6, 9–13] uses Lar λ semantic notions in human language. In particular, Loukanova [7, 8] introduces Lar to computational syntax-semantics interface in Constraint-Based Lexicalized Grammar λ , e.g., by γ -reduction, (CBLG) of human language. Extended reduction calculi of Lar ∗ or alternatively γ -reduction, introduced by Loukanova [16, 17], provide more efficient algorithmic computations. Such simplified computations are important for practical applications, e.g., to computational semantics of programs and human language. For instance, γ -reduction, supports clearer representations of semantic ambiguities and underspecification in NL expressions with multiple quantifier scopes, see λ extended with γ ∗ -reduction, which can Loukanova [15]. In this chapter, we use Lar be more flexible than γ -reduction. Loukanova [16, 17] presents technical details for working with these alternative reduction calculi. The extended γ and γ ∗ calculi λ , for provide more simple canonical forms than the original reduction calculus of Lar more efficient. The canonical forms represent algorithms with fine-granularity of λ formalizes acyclic the computational steps. Intuitively, the type-theoretic system Lar algorithms, which terminate after a finite number of computations that can be by λ is a restricted subsystem of the type-system Lrλ mutual, acyclic recursion. TTAR Lar of algorithms that can involve full recursion, without the acyclicity restriction. λ have two kinds of variables: The languages of Lrλ and Lar (1) pure variables, which correspond to the traditional variables for λ-abstraction and quantification (2) new kind of variables, recursion variables, which we also call memory locations, since their algorithmic role is to provide intermediate computational patterns and save the computation values for reuse. Along with the traditional terms of functional application and λ-abstraction, the languages of Lrλ have a new kind of terms, called recursion terms. The recursion terms designate algorithmic computations by steps of mutual recursion, and by that λ recursion terms they contribute a new algorithmic layer of the semantics of Lrλ . In Lar are restricted by acyclicity. In the first part of the chapter, we introduce the major theoretical concepts of the λ , see Moschovakis [21], and key theoretical results, which are essential for original Lar the subject of the work presented in this chapter. The rules of the reduction calculus λ λ are central to the notions of algorithmic computations of Lar and of the type theory Lar the notions of algorithmic meaning. The chapter introduces the reduction calculus λ with its rules and some key theoretical results. The notions are explained by of Lar using examples from English language. λ operators that support the natural The second part of this chapter is devoted to Lar phenomena of algorithmic patterns and binding across sequences of mutual recursion. For clarity of the exposition, we use notations, some of which are given in Sect. 1.2.3.

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

3

1.2 Introduction to the Type Theory of Acyclic Recursion λ Similarly to traditional λ-calculi, the type theory Lrλ , including its sub-theory Lar , employ function application and λ-abstraction for construction of complex terms that denote composite functions with components that can involve other functions. E.g., if f is a constant denoting a one-argument function, then λ(x) f (x 3 ) is a term denoting λ extend traditional λ-calculi, another one-argument function. The theories Lrλ and Lar by adding a specialised recursion operator designated by the constant where. E.g., the formal terms (1.1b) and (1.1c) are constructed by using the constant where. The Lrλ terms (1.1a)–(1.1c) denote the same function. The term (1.1c) represent the algorithm for computing the denotation of these terms stepwise. At first, the function that is the denotation of the term λ(x)(x 3 ) is computed, e.g., as a table of argument values and corresponding function values, and saved in the memory location p. After that, the denotation of λ(x)[ f ( p(x))] is computed by using the data saved in the memory location p.

λ(x) f (x 3 )

(1.1a)

λ(x)[ f (q) where { q := x }] 3

(1.1b)

λ(x)[ f (q1 (x))] where { q1 := λ(x)(x ) } 3

(1.1c)

λ of Lrλ models acyclic algorithms, i.e., computations that always The sub-theory Lar end after a finite number of steps as in (1.1a)–(1.1c). The term in (1.1b) represents computation of the value of (1.1a) in iterative details. At first, the value x 3 is computed and saved in the memory location p, then the value f ( p) is computed by using the value in p. This algorithmic pattern is a function that depends on the pure variable x, which is expressed by the λ abstraction over x. The term (1.1c), while different from both (1.1a) and (1.1b), denotes the same function, and also expresses the same algorithm for computing the same function, in more detailed steps. λ extend the expressive power of λ-calculus. Actually, Lrλ In this way, Lrλ and Lar is a mathematical theory of the notion of algorithm, which, ultimately, is equivalent to any other of the familiar formalisation of the notion of algorithm, e.g., by Turing machines. However, the choice of a theory is determined by its potential applications. λ is for expressing computational structure in semantics, by Our interest in Lrλ and Lar also saving the intermediate outputs in memory locations for subsequent usage. This is achieved by the recursion operator where, at the object level of Lrλ for modelling algorithmic computations. λ have reduction calculi. In the following sections, The formal theories Lrλ and Lar λ . we introduce the technical concepts of Lrλ and Lar

4

R. Loukanova

1.2.1 Types of TTAR λ λ Definition 1.1 (Types of Lar ) The set Types of Lar is the smallest set defined recursively as follows:

1. e, t, s ∈ Types 2. If τ1 , τ2 ∈ Types, then (τ1 → τ2 ) ∈ Types. λ The recursive definition of the set of the types of Lar can be expressed in the style of Backus–Naur Form (BNF), by Definition 1.2. Note that (1.2) is a notational variant of BNF used in computer science, which is not a proper BNF with non-terminal symbols for syntactic categories. λ : in a BNF Notational Style) The set Terms(K ) of Definition 1.2 (Types of Lar λ Lar (K ) is the smallest set defined recursively as

τ :≡ e | t | s | (τ1 → τ2 )

(1.2)

The type e is associated with objects, i.e., entities, called individuals, of potential λ -terms denoting individuals. The type s is semantic domains, as well as with the Lar for states consisting of various context information such as a possible world (or a situation), a time moment, a space location, and a speaker; t is the type of the truth values.

1.2.2 Syntax of TTAR λ The vocabulary of Lar consists of pairwise disjoint sets:  (V1) Constants: K = τ ∈Types K τ , where the set of the constants K τ of type τ is a denumerable set, for each τ ∈ Types  (V2) Pure variables: PureV = τ ∈Types PureVτ , τ ∈ Types where PureVτ = ∅ is a denumerable set, for each  (V3) Recursion variables (memory locations): RecV = τ ∈Types RecVτ , where RecVτ = ∅ is a denumerable set, for each τ ∈ Types (V4) Variables:  Varsτ = RecVτ ∪ PureVτ , Vars = τ ∈Types Varsτ . λ λ The set of the Lar -terms, denoted by Terms(Lar (K )), is defined1 recursively by Definition 1.3, along with, for each term, its (unique) type assignment, the free and bound occurrences of variables in it, and its sets of free and bound variables. The set λ (K )) depends on the selection of the setK of constants. of the terms Terms(Lar

1 Because

Definition 1.3 is long, we shall mark its end with the symbol ♦.

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

5

λ λ When the set K is fixed and understood, we usually write Lar instead of Lar (K ), λ and Termsτ instead of Termsτ (Lar (K )), including in Definition 1.3 to make it more readable, i.e., λ λ Definition 1.3 (Terms of Lar (K )) For every τ ∈ Types, the set Termsτ (Lar (K )) of the terms of type τ , is the smallest set defined by the following recursive rules, (T1)–(T5).

(T1) Constants as terms: If c ∈ K τ , then c ∈ Termsτ (i.e., every constant of type τ is also a term of type τ ) with the type assignment denoted by c : τ , or cτ There are no free and no bound occurrences of variables in the term c, and: FreeV(c) = ∅

and

BoundV(c) = ∅

(1.3)

(T2) Variables as terms: If x ∈ PureVτ ∪ RecVτ , then, x ∈ Termsτ (i.e., every variable of type τ is also a term of type τ ), with the type assignment denoted by x : τ or x τ The only occurrence of the variable x in the term x is free; there are no bound occurrences of variables in x, and: FreeV(x) = {x}

and

BoundV(x) = ∅

(1.4)

(T3) Application terms: If A ∈ Terms(σ →τ ) , i.e., A : (σ → τ ), and B ∈ Termsσ , i.e., B : σ , then A(B) ∈ Termsτ , with the type assignment denoted by A(B) : τ or [A(B)]τ All free occurrences of variables in A and B are also free in A(B); all bound occurrences of variables in A and B are also bound in A(B), and: FreeV(A(B)) = FreeV(A) ∪ FreeV(B) BoundV(A(B)) = BoundV(A) ∪ BoundV(B)

(1.5a) (1.5b)

(T4) λ-abstraction terms: If x ∈ PureVσ , i.e., x : σ , and A ∈ Termsτ , i.e., A : τ , then λ(x)(A) ∈ Terms(σ →τ ) , with the type assignment denoted by λ(x)(A) : (σ → τ ) or [λ(x)(A)](σ →τ ) All occurrences of x in λ(x)(A) are bound; all bound occurrences of variables in A are also bound in λ(x)(A); all other free occurrences of variables in A, except the occurrences of x, are also free in λ(x)(A), and: FreeV(λ(x)(A)) = FreeV(A) − {x}

(1.6a)

BoundV(λ(x)(A)) = BoundV(A) ∪ {x}

(1.6b)

(T5) Recursion terms: For any n ≥ 0, if Ai ∈ Termsσi (i.e., Ai : σi ), for i = 0, . . . , n, and pi ∈ RecVσi for i = 1, . . . , n (such that, for all i, j = 1, . . . , n, if i = j then pi = p j ), and the sequence { p1 := A1 , . . . , pn := An } satisfies the Acyclicity Constraint (AC), i.e., it is acyclic, then:

6

R. Loukanova

A0 where { p1 := A1 , . . . , pn := An } ∈ Termsσ0

(1.7)

The type assignment of the recursion terms (1.7) is denoted by: A0 where { p1 := A1 , . . . , pn := An } : σ0 [A0 where { p1 := A1 , . . . , pn := An }]σ0

(1.8a) (1.8b)

All free occurrences of p1 , . . . , pn in each of the terms A0 , …, An are bound in the recursion term in (1.7). All other free (bound) occurrences of variables in A0 , . . . , An are free (bound) in (1.7), and:   FreeV A0 where { p1 := A1 , . . . , pn := An } =

n  i=0



BoundV A0 where { p1 := A1 , . . . , pn := An } =

n 

(1.9a)

(FreeV(Ai )) − { p1 , . . . , pn }

(BoundV(Ai ))



{ p1 , . . . , pn }

 (1.9b)

i=0

The set of the terms depends on the set of the constants K , which is expressed in (1.10a) and suppressed in (1.10b): λ (K )) = Terms(Lar



λ Termsτ (Lar (K ))

(1.10a)

Termsτ

(1.10b)

τ ∈Types

Terms =



τ ∈Types

♦ For sake of space, sometimes we may write PV(A) and BV(A), instead of PureV(A) and BoundV(A), respectively, by taking PV(A) = PureV(A) and BV(A) = BoundV(A). λ λ The sets Termsτ (Lar (K )) of Lar (K )-terms, for all τ ∈ Types, are defined by recursion on the structure of the terms, which can be expressed by Definition 1.4, by using an extended, typed variant of the BNF style notation, i.e., Typed Backus–Naur Form (TBNF) style. In Definition 1.4: (1) (2) (3) (4) (5)

the letters A, B, C, A0 , …, An are meta-variables for terms the assumed types are presented as superscripts of the given terms the types of the constructed terms are given with colon cτ is a meta-variable for constants, i.e., cτ ∈ K τ  x τ is a meta-variable for pure or recursion variables, i.e., x τ ∈ PureVτ RecVτ .

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

7

λ Definition 1.4 (Terms in TBNF Style)Terms Lar (K ) is the set of expressions defined by the following recursive rules:

A :≡ cτ : τ | x τ : τ | B (σ →τ ) (C σ ) : τ | λ(vσ )(B τ ) : (σ → τ ) | Aσ0 where { p1σ1 := Aσ11 , . . . , pnσn := Aσnn } : σ

(1.11a) (1.11b)

given that cτ ∈ K τ is a (meta-variable for a) constant of type τ ; x τ ∈ Varsτ is a pure or recursion variable; in (1.11b), A1 : σ1 , …, An : σn ∈ Terms, and p1 : σ1 , …, pn : σn ∈ RecV are recursion variables (n ≥ 0), such that: (R1) for all i, j, if i = j and 1 ≤ i, j ≤ n, then pi = p j (i.e., pairwise different) (R2) and the sequence of assignments { p1 := A1 , . . . , pn := An } satisfies the Acyclicity Constraint (AC). Acyclicity Constraint (AC): For pi , Ai : σi , i = 1, . . . , n, a sequence of assignments (1.12) { p1 := A1 , . . . , pn := An }

(1.12)

is acyclic2 if and only if there is a ranking function, rank : { p1 , . . . , pn } → N, such that, for all pi , p j ∈ { p1 , . . . , pn }: p j ∈ FreeV Ai

=⇒

rank( p j ) < rank( pi )

(1.13)

Sometimes we enclose the recursion terms in extra brackets to separate them from their surrounding expressions, e.g., [A0 where { p1 := A1 , . . . , pn := An } : σ0 ]. Extra brackets around complex terms A can be useful when adding the type assignment to the terms, e.g., by [A] : σ and [A]σ . Note 1.1 Alternative variants of Definition 1.3, and, respectively, of Definition 1.4, without the restriction (R2), i.e., without Acyclicity Constraint (AC), define an extended language Lrλ (K ) = Lrλ , which admits full, i.e., cyclic recursion. While the theory Lrλ is not in the subject of the work in this chapter, the corresponding reduction calculus introduced here can be incorporated in the type theory Lrλ of full recursion, which is a topic of future work. (1) Any sequence of assignments { p1 := A1 , . . . , pn := An } is also called a system of assignments, because the order of the assignments is denotationally and algorithmically irrelevant (by Sects. 1.2.4 and 1.3), which is reflected by the congruence relation between terms defined later by Definition 1.16 (2) We call the terms of the form [A0 where { p1 := A1 , . . . , pn := An }] recursion terms, or alternatively where-terms

λ -terms, belonging to acyclicity constraint is a proper part of the recursive definition of the Lar the inductive assumptions in (T5) and (R2), respectively.

2 The

8

R. Loukanova

(3) A term A is called explicit iff the constant where does not occur in it (4) A term A is called a λ-calculus term iff no recursion (memory) variable occurs in it. Intuitively, an acyclic system { p1 := A1 , . . . , pn := An } defines recursive computations, so that the denotational values den(A1 ), …, den(An ) are assigned to, i.e., saved in, the memory locations p1 , . . . , pn . The computations close-off, i.e., terminate, after a finite number of algorithmic steps determined by the rank( pi ), for i ∈ {1, . . . , n}. The rank order rank( p j ) < rank( pi ) implies that the value Ai , which is saved in pi , may depend on the values of p j , in the free occurrences of the memory locations p j in Ai , and of all other free occurrences of locations with lower rank than p j . Definition 1.5 (Fresh Variable) For a given term A, we say that a variable x of either kind, i.e., x ∈ PureV ∪ RecV, is fresh for A in case x has no occurrences in A.

1.2.3 Some Notations and Abbreviations Throughout the chapter, we use the following notations. λ • The symbol “=” is an identity predicate constant from the vocabulary of Lar . It is also overloaded as the identity relation between objects from the semantic domains λ structures, i.e., as denotational identity. in the frame T of Lar • The symbol “≡” is a meta-symbol (i.e., it is not in the vocabulary of the language λ ), which we use to specify orthographical identity between expressions and Lar λ . E.g., we use it to introduce abbreviations and aliases. types of Lar • The symbol “:≡” is a meta-symbol that we use in definitions, e.g., of types and terms, and for the replacement operation, see (1.10). • Typically, we skip some “understood” parentheses, use different shapes and sizes of parentheses, and some extra parentheses for clarity. • The type σ of a variable or a term A may be depicted either as a superscript, Aσ , or by a colon, A : σ , depending on clarity and convenience. • We use the sans serif font for specific instances of constants, variables of the λ . For generic instances of variables, terms, and vocabulary, and for operators of Lar elements of semantic domains, we use math italic. We assume that the discourse makes clear the notations. E.g., typically, we use p, q, and r , with and without indexes, for recursion variables, and capitals A, B, and C with and without indexes, for terms.

Given the basic types, e (for entities), t (for truth values), s (for states), the following are some abbreviations for types, which we use often.  e ≡ (s → e) (for individual concepts) (1.14a)  t ≡ (s → t) (for state dependent truth values, i.e., propositions) (1.14b)  τ ≡ (s → τ ), where τ ∈ Types (for state dependent objects of type τ ) (1.14c)

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

τ1 × τ2 → τ ≡ (τ1 → (τ2 → τ )), where τ1 , τ2 , τ ∈ Types

9

(1.14d)

Folding and Unfolding For sake of space, we may use the following abbreviations for any systems of assignments, by “folding” and “unfolding” the assignments. In the chapter, sometimes for clarity of a point or exposition, the assignment abbreviations are unfolded (folded), even if not strictly necessary. For any terms A1 : σ1 , …, An : σn , An+1 : σn+1 , B1 : τ1 , …, Bk : τk , C, D : τ , and recursion variables (memory locations) p1 : σ1 , …, pn : σn , pn+1 : σn+1 , q1 : τ1 , …, qk : τk , where n, k ≥ 0: 1. Sequence of variables: − → x ≡ x1 , . . . , xn

(1.15)

2. Successive abstraction and application: → λ(− x ) ≡ λ(x1 , . . . , xn ) ≡ λ(x1 ) . . . λ(xn ) − → λ( x )(A) ≡ λ(x1 , . . . , xn )(A) ≡ λ(x1 ) . . . λ(xn )(A) → p(− x ) ≡ p(x , . . . , x ) ≡ p(x ) . . . (x ) 1

n

1

n

− → A( B ) ≡ A(B1 , . . . , Bk ) ≡ A(B1 ) . . . (Bk )

(1.16) (1.17) (1.18) (1.19)

3. Abbreviated sequences of mutually recursive assignments:   − → − → p := A ≡ p1 := A1 , . . . , pn := An (n ≥ 0)

(1.20)

4. Abbreviated sets of sequences of mutually recursive assignments: − → − → → → {− p := A , . . . , − q := B , . . . , } ≡ { p1 :=A1 , . . . , pn := An , . . . , (1.21a) q1 :=B1 , . . . , qk := Bk , . . . , } (n, k ≥ 0)

(1.21b)

That is, the abbreviated set (1.21a)–(1.21b) is the result of appending the sequences of assignments. 5. Abbreviated sequences of replacements: − → − → p := A {C :≡ D} ≡ p1 := A1 {C :≡ D}, . . . , pn := An {C :≡ D}

(n ≥ 0)

(1.22)

10

R. Loukanova

where, for all i = 1, …, n + 1, and j ∈ {1, . . . , k}, Ai {C :≡ D} and B j {C :≡ D} are the result of the replacement of all occurrences of C in Ai , and respectively in B j , by D, without causing variable clashes. 6. Abbreviated recursion terms, for n ≥ 0: 

− →  → A0 where { − p := A }

  ≡ A0 where { p1 := A1 , . . . , pn := An }   − → → p := A , . . . } A0 where { . . . , −   ≡ A0 where { . . . , p1 := A1 , . . . , pn := An , . . . }

(1.23a)

(n ≥ 0)

(1.23b)

7. For any variable assignment g, we abbreviate its update: − → − → → → g{ − p := p , pn+1 := p n+1 , − q := q } ≡ g{ p1 := p 1 , . . . , pn := p n , pn+1 := p n+1 , q1 := q 1 , . . . , qk := q k }

(1.24a) (forn, k ≥ 0)

(1.24b)

where, for all i ∈ {1, . . . , n + 1} and j ∈ {1, . . . , k}, the values pi ∈ Tσi and q j ∈ Tτ j are calculated, according to the clause (D4) of Definition 1.9, by recursion on the rank of p1 , …, pn , pn+1 , q1 , …, qk , assuming that the system of − → − → → → assignments { − p := A , pn+1 := An+1 , − q := B } is acyclic. 8. For any terms A and B, and pure variable u, we use the following notations (1.25a)–(1.25b), where (1.25b) is just a special case of (1.25a): A ≡ A[B1 , . . . , Bk ] ⇐⇒ B1 , . . . , Bk are sub-terms of A (k ≥ 1) A ≡ A[λ(u)B] ⇐⇒ λ(u)B is a sub-term of A

(1.25a) (1.25b)

1.2.4 Denotational Semantics of TTAR λ The language Lar (K ), with a given K = ∅ set of constants, has denotational semantics that is determined by a denotation function according to Definition 1.9, for any given semantic structure based on a frame of typed domains, and an interpreλ (K ), defined in tation function of the constants K . The denotation function of Lar Definition 1.9, depends on the choice of the constants, their interpretation, and λ -terms, in a compositional way. respects the formation structure of the Lar λ Definition 1.6 A Lar (K ) semantic structure is a tuple A(K ) = T, I(K ) , where T, I, and K satisfy the following conditions (S1)–(S3):

(S1)

T is a set (or a class) T = { Tσ | σ ∈ Types }, T is called the frame of A(K ). Depending on the area of application, some Tσ may be allowed to be proper classes. T has basic objects, where Te = ∅ is the set (or a class) of individ-

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

(S2) (S3)

11

uals; Tt = { 0, 1, er } ⊆ Te is the set of the truth values3 ; Ts = ∅ is the set of states. T(τ1 →τ2 ) ⊆ { f | f : Tτ1 → Tτ2 } I is a function I : K → T (called the interpretation function of A) such that, for every constant c ∈ K τ , I(c) = c, for some c ∈ Tτ

When the set of the constants K is understood, we shall write A instead of A(K ). Definition 1.7 (Variable Assignments (Valuations)) For a given semantic structure A, a variable assignment (valuation), called also (variable) valuation, is any (total) function g that assigns semantic objects to the variables, according to their typing, i.e., for each τ ∈ Type and each variable x ∈ PureVτ ∪ RecVτ , the variable assignment of x by g ∈ G A is an object g(x) ∈ Tτ . We denote the set of all variable assignments in A by G A , i.e., G A = { g | g : PureV ∪ RecV →



T,

and, for every x ∈ PureVτ ∪ RecVτ , g(x) ∈ Tτ }

(1.26)

Typically, we shall skip the superscript in G A when the semantic structure A is fixed or understood. The variable assignments g ∈ G are preferably called (variable) valuations to distinguish g ∈ G from the systems of assignments in recursion terms, unless the context clarifies that. Definition 1.8 (Updates of Variable Assignments) For every τ ∈ Type, x, y ∈ PureVτ ∪ RecVτ , and t ∈ Tτ , the function defined by (1.27), and denoted by g{x := t}, is called the update of g by the assignment {x := t}. 

 def g{x := t} (y) =



g(y), if y = x, t, if y = x.

(1.27)

That is, g{x := t} is the assignment having the same values as g for all variables, except possibly for the variable x to which g{x := t} assigns the object t.  Definition 1.9 (Denotation Function) Any function denA : Terms → (G → T) A such that, for each A ∈ Termsσ and each g ∈ G, the value den (A)(g) ∈ Tσ , and λ . the conditions (D1)–(D4) hold, is called denotation function of Lar s (D1) Variables and constants: denA (x)(g) = g(x), A

den (c)(g) = I(c),

3 er

for all x ∈ PureV ∪ RecV

(1.28a)

for all c ∈ K

(1.28b)

is a designated object representing erroneous denotation values of terms that do not have natural denotation, i.e., by it, we avoid using partial functions as denotational values.

12

R. Loukanova

(D2) Application terms: denA (A(B))(g) = denA (A)(g)(denA (B)(g))

(1.29)

(D3) λ-abstraction terms: For all x : τ and B : σ , denA (λ(x)(B))(g) : Tτ → Tσ is the function such that, for every t ∈ Tτ ,

[denA (λ(x)(B))(g)] t = denA (B)(g{x := t})

(1.30)

(D4) Recursion terms: denA (A0 where { p1 := A1 , . . . , pn := An })(g) A

= den (A0 )(g{ p1 := p 1 , . . . , pn := p n })

(1.31a) (1.31b)

where for all i ∈ {1, . . . , n}, and all τi such that pi : τi , the values pi ∈ Tτi are computed by recursion on rank( pi ), so that: pi = denA (Ai )(g{ pi,1 := pi,1 , . . . , pi,ki := pi,ki })

(1.32)

where pi,1 , …, pi,ki are the recursion variables p j ∈ { p1 , . . . , pn } such that rank( p j ) < rank( pi ) For any given set of constants K , any interpretation of constants I(K ), and choices of Tτ , for all τ ∈ Types, so that (S1)–(S3) holds, there is at most one function4 denA that satisfies the clauses (D1)–(D4) of Definition 1.9. A semantic structure A(K ) is standard in case that, for all τ1 , τ2 ∈ Types, T(τ1 →τ2 ) = { f | f : Tτ1 → Tτ2 }

(1.33)

In any standard structure A(K ), there is exactly one well-defined denotation function, denA from terms and variable assignments to objects in the domains of the frame of λ -term A : σ of type σ denotes a A(K ). For any variable assignment g ∈ G, each Lar A uniquely defined object den (A)(g) ∈ Tσ . Thus, in any standard structure A(K ), the clauses (D1)–(D4) provide a recursive definition of the unique denotation function. λ Theorem 1.1 (Type Soundness of Lar ) For every semantic structure A and variable valuation (assignment) in A, g : Vars → T, and for every τ ∈ Types and A ∈ Termsτ , denA (A)(g) ∈ Tτ .

In this chapter, we assume a given, fixed semantic structure A(K ), and often skip A(K ), by writing denA (A), and den(A) instead of denA(K ) (A). 4 There is a tradition in computational semantics, by which the denotation function is often denoted

by [[.]]A .

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

13

The states in Tσ can be defined in various ways. E.g., without any elaboration here, we consider the states as composite objects, instead of primitive, for the purpose of modelling utterance information, by including a speaker agent in an utterance, e.g., see Loukanova [5]. Definition 1.10 (Free Occurrences and Replacement Operation) Assume that A, C, X ∈ Terms are such that, for some type τ ∈ Types, C : τ and5 X : τ . 1. For any given terms X and A, an occurrence of X in A is free (in A) if and only if it is not in the scope of any binding operator (e.g., λ and where operators) that binds some variable having free occurrences in X . In case X is a variable, an occurrence of X is free in A, if it is not in the scope of any binding operator that binds X . 2. The result of the simultaneous replacement of all free (unless otherwise stated) occurrences of X with C in A is denoted by A{ X :≡ C }. 3. The replacement A{ X :≡ C } of X with C in A is free if and only if no (free) occurrence of X in A is in the scope of any operator (e.g., λ and where) that binds some variable having free occurrences in C: i.e., no variable that is free in C becomes bound in A{ X :≡ C }. In such a case, we also say that X is free for C in A. We usually use free replacement applied to all free occurrences of the specified variables, unless otherwise stated. Technically, the replacement operation can be defined formally by induction on term structure. We do not include such details here, in this chapter. Definition 1.11 (Denotational Equivalence) Denotational equivalence, which is also called denotational identity and denotational synonymy, is defined as equality between denotations of terms. For any given semantic structure A and g ∈ G A ; A, g |= A = B ⇐⇒ denA (A)(g) = denA (B)(g) A

A

A

(1.34a)

A

den (A) = den (B) ⇐⇒ den (A)(g) = den (B)(g), for all g ∈ G A (1.34b) A |= A = B ⇐⇒ denA (A) = denA (B) |= A = B ⇐⇒ A |= A = B, for all A

(1.34c) (1.34d)

For a given semantic structure A, when it is understood, we shall denote the denotation function by den without the superscript A, i.e., instead of denA . Theorem 1.2 (Denotational Replacement Property) For every g ∈ G A , (1.35a) and (1.35b) hold:

∈ PureV ∪ RecV ∪K are special cases of the term X, typically used in replacements, but not always. 5X

14

R. Loukanova

den(A{ x :≡ C })(g) = den(A)(g{ x :≡ den(C)(g) }), for every A ∈ Terms, C ∈ Termsτ , x ∈ PureVτ ∪ RecVτ

(1.35a)

den(A{ c :≡ C })(g) = den(A)(g), for every c ∈ K τ , such that den(c)(g) = den(C)(g)

(1.35b)

Proof The replacement equality (1.35a) is proved by induction on the structure of λ the terms of Lar , by using Definitions 1.3 and 1.9 of the denotation function. The replacement equality (1.35b) follows from (1.35b).  Corollary 1.1 For any given terms A and C, any x ∈ PureV ∪ RecV, and any v ∈ PureV, such that v : σ , x : (σ → τ ), C : τ , and the replacement A{ x :≡ λ(v)C } of x with λ(v)C in A is free in A, it holds that, for every g ∈ G A : den(A{ x :≡ λ(v)C })(g) = den(A)(g{ x :≡ den(λ(v)C) })

(1.36)

Corollary 1.2 For every v ∈ PureV and x ∈

PureV ∪ RecV, such that v : σ , x : (σ → τ ), and the replacement A{ x :≡ λ(v) x(v) } is free in A, it holds that, for every assignment g ∈ G A :

den(x)(g) = den(λ(v) x(v) )(g)

den(A)(g) = den(A{ x :≡ λ(v) x(v) })(g)

= den(A)(g{ x :≡ den(λ(v) x(v) )(g) })

(1.37a) (1.37b)

Theorem 1.3 (Denotational Compositionality) For all A ∈ Termsσ , B, C ∈ Termsτ , x ∈ PureVτ , such that the substitutions A{ x :≡ B } and A{ x :≡ C } are free, i.e., do not cause variable collisions: (1) (1.38a)–(1.38b) holds, for every A and every valuation g ∈ G A in A: if den(B)(g) = den(C)(g) then den(A{ x :≡ B })(g) = den(A{ x :≡ C })(g)

(1.38a) (1.38b)

(2) (1.39a)–(1.39b) holds, for every A: if den(B) = den(C) then den(A{ x :≡ B }) = den(A{ x :≡ C }) Proof Follows from Theorem 1.2.

(1.39a) (1.39b) 

Now, we shall define a set of specialised terms, that do not have algorithmic meanings, i.e., immediate terms that obtain their values directly by the variable valuation g ∈ G A and Definition 1.9 of the denotation function:

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

15

Definition 1.12 (Immediate Terms) 1. The set of the immediate terms, which we denote by ImT, is defined as follows: ImT = { X, λ(u 1 ) . . . λ(u n )R(v1 ) . . . (vm ) : (σ1 → . . . → (σn → τ )) | τ, τ j , σi ∈ Types i = 1, . . . , n, j = 1, . . . , m), X ∈ Vars, R ∈ RecV(τ1 →...→(τm →τ )) ,

(1.40)

v j ∈ PureVτ j ( j = 1, . . . , m), u i ∈ PureVσi (i = 1, . . . , n), n ≥ 0, m ≥ 0 } 2. All pure and recursion variables are immediate terms, i.e., Vars ⊆ ImT, by (1.40), which we call trivially applicative terms 3. For every recursion variable, i.e., memory location, R ∈ RecV(τ1 →...→(τm →τ )) , where m ≥ 0, and all pure variables v j ∈ PureVτ j , j = 1, . . . , m, the term R(v1 ) . . . (vm ) : τ is immediate (by (1.40) and the agreement (1.41a)–(1.41b)), and is called immediate applicative term 4. For every recursion variable R ∈ RecV(τ1 →...→(τm →τ )) , where m ≥ 0, and all pure variables u i ∈ PureVσi (i = 1, . . . , n, for n ≥ 1) and v j ∈ PureVτ j ( j = 1, . . . , m), the term λ(u 1 ) . . . λ(u n )R(v1 ) . . . (vm ) : (σ1 → . . . → (σn → τ )) is called immediate λ-term. Note 1.2 We use the notational agreements (1.41a), about type expressions, and (1.41b)–(1.41c), about sequences of applications and λ-abstractions. (σ1 → . . . → (σn → τ )) ≡ τ, for σ1 , . . . , σn , τ ∈ Types, n = 0

(1.41a)

λ(u 1 ) . . . λ(u n )R(v1 ) . . . (vm ) ≡ R(v1 ) . . . (vm ) : τ, for u i , v j ∈ PureV, n = 0, m ≥ 0

(1.41b)

λ(u 1 ) . . . λ(u n )R(v1 ) . . . (vm ) ≡ R : τ,

(1.41c)

for n, m = 0, R ∈ RecVτ

Alternatively, the set of the immediate terms can be defined, by using the extended, typed TBNF notational style, as follows. Definition 1.13 (TBNF Notational Variant of Definition 1.12) The set ImT of immediate terms consists of the terms defined as follows: T τ :≡ X τ | R (τ1 →...→(τm →τ )) (v1τ1 ) . . . (vmτm ) T (σ1 →...→(σn →τ )) :≡

(ImAppT)

λ(u σ11 ) . . . λ(u σnn )R (τ1 →...→(τm →τ )) (v1τ1 ) . . . (vmτm )

(Im λ −T)

16

R. Loukanova

for n ≥ 0, m ≥ 0; u i ∈ PureVσi , for i = 1, . . . , n; v j ∈ PureVτ j , for j = 1, . . . , m; X ∈ PureVτ , R ∈ RecV(τ1 →...→(τm →τ )) . Definition 1.14 (Proper Terms) A term A is proper if and only if it is not immediate, λ e.g., the set PrT of the proper terms of Lar consists of all terms that are not in ImT: PrT = (Terms − ImT)

(1.43)

Intuitions about Distinctions between Proper versus Immediate Terms For a detailed discussion and the distinction between immediate terms and constants, see Moschovakis [21]. Here we present some of the same intuitions with some that are λ , the concept of meaning of a term A is the algorithm our own. In the calculus of Lar for computing the denotation of A. Immediate terms are simple terms that do not have referential intentions, i.e., they do not have algorithmic meanings, while they have denotations, as defined by Definition 1.9 of the denotation function. Intuitively, they denote “immediately”. A recursion variable of functional type p : (τ1 → τ2 ) is represented as a directly accessible memory location for storing the values of the function den( p). The denotation den( p)(g) is provided either directly by the variable assignment g, den( p)(g) = g( p), when it occurs freely in a term A, or − → → p := A }. by an assignment p := P in a recursive term A ≡ A0 where { p := P, − After the value den(P)(g  ), where the assignment g  is the recursive update of g, → p , this value is is computed by recursion on rank( pi ), for pi ∈ { p1 , . . . , pn } ≡ − ‘stored’ in the location p, where it is accessible immediately without any need to be re-computed. In case p is of function type, p : σ → τ , the graph of the values of p, i.e., the set den( p) = { (x, y) | y = den( p)(x), forx ∈ Domain(den( p)) } is ‘stored’ in the location p, e.g., as a table. By this, we assume reasonably large, finite functions. Alternatively, only finite number of values of den( p) can be relevant in the possible variable environments. The domain of the function den( p), Domain(den( p)), can be limited with respected to these environments, so that the graph is reasonably large to cover these values and get stored in the memory location p. The value of p(v) for any pure variable v is immediately accessible in the location p, for a given variable assignment g(v). Another intuition from machine memory is that a pure variable of function type u : (τ1 → τ2 ) is represented by a port. The variable u is immediate and the function den(u) = g(u) denoted by it is accessible immediately. Instead of computing the values of the function den(u) once and storing them in u (because u is pure, not a location), each value den(u(v)) is obtained by a call to that port, which will initiate computation of den(u(v)). Constants have denotations, via the interpretation function, and their denotations may involve computations. For a constant c ∈ K τ , the interpretation I(c) = c, where c ∈ Tτ , is the algorithm for computing den(c)(g). Thus, constants have meanings that may require simple or more complex computational steps. A classic example is the algorithm for computing the value of the number denoted by the constant π . A constant c may have multiple occurrences in a term A. This is why, it is more efficient to compute the denotation of c only once and store it in a location p, by the

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

17

assignment p := c, which then is accessed immediately during the computation of den(c). Recursion variables as memory locations, in biological entities We maintain also another intuition about the role of the recursion variables as memory locations that are bound in recursion terms in canonical forms. E.g., let A ≡ A0 where { p := − → → P, − p := A } be in canonical form, where p : (σ → τ ), i.e., for denoting a function. The term P is explicit and irreducible, i.e., in its simplest form. The computational role of the recursion variable p, with its assignment p := P, is also pattern driven memory efficiency. By the assignment p := P, the computational pattern P is stored in the memory location p, which is not necessary a specific value or a table (set) of values in the domain. In any given context (environment), the stored pattern P is used for valuation and accessing any of the necessary values p(v) for given specific den(P)(g) and g(v). By this, we do not exclude the possibilities for storing sets of values of p(v), for finite number of values g(v). We consider that this intuition is more consistent with neuroscience of memory and other workings of information storage and processing in biological systems. For self-containment of the chapter, we λ give the definition of the canonical forms of the terms and the reduction rules of Lar (and Lrλ ). We use the γ ∗ -rule to extend the reduction calculus, see Loukanova [17].

1.2.5 Canonical Forms For each term A, we define a term, called a canonical form of A and denoted by cf(A), by recursion on the structure of A. In each clause, we assume that the bound recursion variables (locations) are distinct, and distinct from the free recursion variables. Definition 1.15 (Canonical Forms) (CF1) (CF2)

For every c ∈ K τ , cf(c) :≡ c ≡ c where { }; For every x ∈ PureVτ ∪ RecVτ , cf(x) :≡ x ≡ x where { } Assume that A ∈ Terms, and cf(A) is as in (1.44): cf(A) ≡ A0 where { p1 := A1 , . . . , pn := An } (n ≥ 0) − → → p := A } ≡ A where { −

(1.44)

0

(CF2a)

If X is an immediate term, then cf(A(X )) is: cf(A(X )) :≡ A0 (X ) where { p1 := A1 , . . . , pn := An } − → → p := A } ≡ A (X ) where { − 0

(CF2b)

If B is a proper term, and cf(B) is as in (1.46):

(1.45)

18

R. Loukanova

cf(B) ≡ B0 where {q1 := B1 , . . . , qn := Bm } − → → q := B } ≡ B where { −

(1.46)

0

then, cf(A(B)) is: cf(A(B)) :≡ A0 (q0 ) where { p1 := A1 , . . . , pn := An , q0 := B0 , (1.47) q1 := B1 , . . . , qn := Bm } − → − → → → p := A , q := B , − q := B } ≡A (q ) where { − 0

(CF3)

0

0

0

If A ∈ Terms, and cf(A) is as in (1.48): cf(A) ≡ A0 where { p1 := A1 , . . . , pn := An } (n ≥ 0) − → → p := A } ≡ A where { −

(1.48)

0

then, for every u ∈ PureVτ : cf(λ(u)A) :≡ λ(u)A0 where { p1 := λ(u)A1 , . . . , pn := λ(u)An } − → −−−−→ ≡ λ(u)A0 where { p  := λ(u)A } (1.49) where for every i = 1, …, n, the recursion variable pi is fresh and Ai is the result of the replacement of all the free occurrences of p1 , . . . , pn in Ai with p1 (u), . . . , pn (u), respectively, i.e.: Ai ≡ Ai { p1 :≡ p1 (u), . . . , pn :≡ pn (u)} −−→ → ≡ A {− p :≡ p  (u)}

(1.50)

i

(CF4)

If A ∈ Terms, and cf(A) is as in (1.51): cf(A) ≡ A0 where { p1 := A1 , . . . , pn := An } (n ≥ 0) − → → p := A } ≡ A where { −

(1.51)

0

and, for every i = 0, . . . , n, cf(Ai ) is as in (1.52): cf(Ai ) ≡ Ai,0 where { pi,1 := Ai,1 , . . . , pi,ki := Ai,ki } − → → p := A } (k ≥ 0) ≡ A where { − i,0

i

i

(1.52)

i

then: cf(A) :≡ A0,0 where {

p0,1 := A0,1 , . . . , p0,k0 := A0,k0 , (1.53a)

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

≡ A0,0

19

p1 := A1,0 , p1,1 := A1,1 , . . . , p1,k1 := A1,k1 , .. . pn := An,0 , pn,1 := An,1 , . . . , pn,kn := An,kn } − → − → where { p0 := A0 , (1.53b) − → → p := A , p := A , − 1

1,0

1

1

.. .

− → → pn := An } pn := An,0 , −

1.2.6 Standard Reduction Calculi of TTAR The reduction relation between terms, ⇒ ⊆ Terms × Terms, is defined by the λ introduced in this section. reduction rules of Lar Definition 1.16 (Congruence) The congruence relation is the smallest (equivalence) λ relation between Lar -terms, ≡c ⊆ Terms × Terms, that is closed under: 1. reflexivity, symmetricity, transitivity (i.e., an equivalence relation) λ , for constants, variables, 2. term structure, i.e., the term formation rules of Lar application, λ-abstraction, and acyclic recursion 3. renaming bound variables (of each kind, pure and recursion), without causing variable collisions 4. reordering of the assignments within the acyclic sequences of assignments of the recursion terms, i.e., for any permutation function π : {1, . . . , n} → {1, . . . , n}: A0 where { p1 := A1 , . . . , pn := An } ≡c A0 where { pπ(1) := Aπ(1) , . . . , pπ(n) := Aπ(n) }

(1.54)

λ The reduction rules of Lar are as follows:

Congruence: Transitivity:

If A ≡c B, then A ⇒ B If A ⇒ B and B ⇒ C, then A ⇒ C

(cong) (trans)

Compositionality: If A ⇒ A and B ⇒ B  , then A(B) ⇒ A (B  )

(rep1)

If A ⇒ B, then λ(u)(A) ⇒ λ(u)(B)

(rep2)

If Ai ⇒ Bi , for i = 0, . . . , n, then

(rep3)

A0 where { p1 := A1 , . . . , pn := An } ⇒ B0 where { p1 := B1 , . . . , pn := Bn }

20

R. Loukanova

The Head Rule: given that, for all i = 1, …, n, j = 1, …, m, pi does not occur free in B j , and pi = q j : − → − → → → p := A } where {− q := B } A0 where {− − → → − → → p := A , − q := B } ⇒ A where {−



(head)

0

The Bekiˇc-Scott Rule: given that, for all i = 0, …, n, j = 1, …, m, q j does not occur free in Ai , and q j = pi , q j = p:

− → → − → → q := B } , − p := A } A0 where { p := B0 where {− − → → − → → q := B , − p := A } ⇒ A where { p := B , − 0

(B-S)

0

The Recursion-Application Rule: given that, for all i = 1, …, n, pi does not occur free in B: − → − → → → p := A } (B) ⇒ A0 (B) where {− p := A } (A0 where {−

(recap)

The Application Rule: given that B is a proper term and p is a fresh recursion variable:

The λ-rule:

A(B) ⇒ A( p) where { p := B}

(ap)

λ(u)(A0 where { p1 := A1 , . . . , pn := An })

(λ)

⇒ λ(u)A0 where { p1 := λ(u)A1 , . . . , pn := λ(u)An } where, for all i = 1, …, n, pi is a fresh recursion variable, and for all i = 0, …, n, the term Ai is the result of the replacement of the free occurrences of p1 , . . . , pn in Ai with p1 (u), . . . , pn (u), respectively, i.e.: Ai ≡ Ai { p1 :≡ p1 (u), . . . , pn :≡ pn (u)}

(1.59)

The above ten rules define a reduction calculus, and a corresponding relation λ , respectively, between term, which we shall call the standard reduction calculus of Lar the standard reduction relation between terms. λ ) For all A, B ∈ Terms, A ⇒ B (and Definition 1.17 (Standard Reduction of Lar we say that A reduces to B) if and only if B is obtained from A by a finite sequence λ given above. of applications of some of the ten (standard) reduction rules of Lar

The congruence rule (cong) allows reordering of the assignments in any recursion term A0 where { p1 := A1 , . . . , pn := An } without changing the order of the computational steps. For this, we also call the sequence of assignments { p1 := A1 , . . . , pn := An } a set (system) of assignments.

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

21

Definition 1.18 (Term Irreducibility) We say that a term A ∈ Terms is irreducible if and only if (1.60) holds: for all B ∈ Terms, A ⇒ B =⇒ A ≡c B

(1.60)

1.2.7 Some Key Features of the Reduction Calculus of TTAR λ The type theory of recursion Lar (and Lrλ ) introduces a new approach to the mathematical notion of algorithm, which is open for theoretical developments. The reduction λ (and Lrλ ) is effective and has potentials for varieties of applications. The calculus Lar following theorems are major results that are essential for the algorithmic meanings λ -terms. of the Lar

Theorem 1.4 (Criteria for irreducibility) (See Moschovakis [21], Sect. 3.12.) 1. If A ∈ Const ∪ Vars, then A is irreducible. 2. An application term A(B) is irreducible if and only if A is explicit and irreducible and B is immediate. 3. A λ-term λ(x)A is irreducible if and only if A is explicit and irreducible. 4. A recursion term A0 where { p1 := A1 , . . . , pn := An } (n ≥ 0) is irreducible if and only if all of its parts A0 , …, An are explicit and irreducible. Proof By structural induction on terms using the rules of the reduction calculus. See Theorem Sect. 3.12 in [21].  Theorem 1.5 shows that Definition 1.15 correctly determines a term cf(A) (i.e., there exist such a term), which is unique up to congruence. Theorem 1.5 (Standard Canonical Form) (See Moschovakis [21], Sects. 3.1 and 3.14) For every A ∈ Terms, the following holds: 1. (Existence of a canonical form of A) There exist explicit, irreducible terms A0 , …, An (n ≥ 0), such that cf(A) ≡ A0 where { p1 := A1 , . . . , pn := An },

(1.61)

and thus, cf(A) is irreducible 2. A constant c ∈ K or a variable x ∈ Vars occurs freely in cf(A) if and only if it occurs freely in A 3. A ⇒ cf(A) 4. If A is irreducible, then cf(A) ≡c A 5. (Uniqueness of the canonical forms up to congruence) If A ⇒ B, then cf(A) ≡c cf(B) 6. If A ⇒ B and B is irreducible, then B ≡c cf(A), i.e., cf(A) is an unique, up to congruence, irreducible term.

22

R. Loukanova

Proof (1) is proved by structural induction on formation of terms and using the definition of the cf(A); (2) and (3) are proved by induction on terms and using the reduction rules; (4) by induction on the definition of the reduction relation; (5) follows from (3) and (4).  We write A ⇒cf B ⇐⇒ B ≡c cf(A)

(1.62a)

A ⇒cf cf(A)

(1.62b)

The computation of canonical forms is effective. That is, the reduction of each given term A to its canonical form cf(A), which is unique up to congruence, A ⇒cf cf(A), is effective. Theorem 1.6 (Denotational Preservation by Reductions) (See Moschovakis [21], Sect. 3.11.) For any A, B ∈ Terms, if A ⇒ B, then den(A) = den(B) = den(cf(A))

(1.63)

Proof by induction on the definition of the reduction relation and the definition (D1)–(D4) of the denotation function.  Notice that the operator designated by the constant where is one of the important binding operators,6 which has been used in different forms and ways, in mathematics and in computer science, taking it for granted, sometimes informally. The formal theories of recursion introduced by Moschovakis [18–21] provide a computational formalization of that widespread use. The canonical forms have a distinguished feature that is part of their computational (algorithmic) role: they provide algorithmic patterns of semantic computations. The more general terms provide algorithmic patterns that consist of sub-terms with components that are recursion variables; the most basic assignments of recursion variables (of lowest ranks) provide the specific basic data that feeds-up the general computational patterns. The more general terms and sub-terms classify language expressions with respect to their semantics and determine the algorithms for computing the denotations of the expressions.

1.3 Algorithmic Semantics of TTAR The technical definitions of the notion of algorithmic, i.e., (algorithmically) intenλ are given in Moschovakis [21]. Note that, in Moschovakis [21], sional semantics of Lar the concept of intension of a term A is from the perspective of algorithmic computations, while the traditional notion of Carnap intension, which is employed by 6 The operator constant where of Lλ ar

can be renamed, but “where” is a very good English word that reflects the algorithmic role of this operator.

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

23

Gallin [1] and Montague Intensional Logic (IL), see Montague [24], is covered by λ , for terms of state dependent types, A : (s → σ ). the denotation function den of Lar In this section, we restate Theorem 1.7 from [21], which is a major result about algorithmic synonymy, i.e., about algorithmic equivalence between terms, with respect to a given, fixed semantic structure A.

1.3.1 Recursors and Algorithms: Referential Intensions Recall that, we consider a given, fixed semantic structure A, and that algorithmic equivalence is with respect to the denotations of the constants and the variable valuations in A. This is expressed by the concept of reference in the notion of referential intensions, i.e., referential algorithms for computing denotational values in the referred A. Definition 1.19 (Acyclic Recursor) An acyclic recursor is any tuple of functions f = ( f 0 , f 1 , . . . , f n ) (n ≥ 0) that satisfy the following conditions 1. For some σ0 , σ1 , . . . , σn ∈ Types f i : G × Tσ1 × · · · × Tσn → Tσi ,

for all i ∈ { 0, . . . , n }

(1.64)

2. (Acyclicity constraint for recursors) There exists a function rank rank : { 0, . . . , n } → { 0, . . . , n }

(1.65)

such that rank(0) > rank(i),

for all i ∈ { 1, . . . , n }

(1.66)

and (1.67a)–(1.67c) hold for every g ∈ G. For all d1 , d1 ∈ Tσ1 , . . . , dn , dn ∈ Tσn

(1.67a)

if d j = d j for all j ( j ∈ { 1, . . . , n }) such that rank ( j) < rank (i), (1.67b) then f i (g, d1 , . . . , dn ) = f i (g, d1 , . . . , dn )

for all i ∈ { 0, . . . , n }

(1.67c)

An acyclic recursor f = ( f 0 , f 1 , . . . , f n ) is also called an acyclic recursor from G to Tσ0 , with internal type σ1 × · · · × σn , and dimension n ≥ 0, denoted by f = ( f 0 , f 1 , . . . , f n ) : G  Tσ0

(1.68)

where G is the domain and Tσ0 is its range of values. The function f 0 is called the head of an acyclic recursor f = ( f 0 , f 1 , . . . , f n ). The notation (1.68) emphasises that f depends on g ∈ G, while, for each g ∈ G, the values of f 0 “internally” depend on the functions f 1 , …, f n . That is, f = ( f 0 , f 1 , . . . , f n ) determines uniquely a function f

24

R. Loukanova

f : G → Tσ0

(1.69)

f (g) = f 0 (g, d1 , . . . , dn ), for every g ∈ G

(1.70)

as follows: where d1 , . . . , dn is the unique solution of the system of equations di = f i (g, d1 , . . . , dn ), i = { 1, . . . , n }

(1.71)

For every g ∈ G, the unique solution d1 , . . . , dn of the system (1.71) are guaranteed by the acyclicity constraint for recursors, i.e., by (1.67b)–(1.67c). In case n = 0, the recursor consists of a single function f 0 , and thus, by (1.70): f = f 0 : G → Tσ0

(1.72)

Now, we shall define precisely the referential intensions of the proper terms, i.e., of the terms that have algorithmic sense. Definition 1.20 Assume that A : σ0 is a proper term (i.e., A is non-immediate), and that its canonical form cf(A) (which is unique up to congruence) is cf(A) ≡ A0 where { p1 := A1 , . . . , pn := An } Ai : σi , f ori = 0, . . . , n(n ≥ 0)

(1.73)

The referential intension int(A) of a proper (i.e., non-immediate) term A is determined from the cf(A) according to (1.74)–(1.75), as follows int(A) = ( f 0 , f 1 , . . . , f n )

(1.74)

where, the functions f i , for i ∈ { 0, . . . , n }, are defined by the corresponding parts Ai of cf(A), by (1.75): f i (g, d1 , . . . , dn ) = den(Ai )(g{ p1 := d1 , . . . , pn := dn }), for all g ∈ G and all d1 ∈ Tσ1 , . . . , dn ∈ Tσn

(1.75)

Because of the acyclicity of cf(A), the tuple int(A) = ( f 0 , f 1 , . . . , f n ) of functions satisfy (1.65)–(1.66), and (1.67a)–(1.67c), with rank defined as follows, by (1.76): rank(i) =

rank( pi ), if i ∈ { 1, . . . , n } max1≤ j≤n (rank( p j )) + 1, if i = 0

(1.76)

Thus, int(A) = ( f 0 , f 1 , . . . , f n ) is an acyclic recursor: int(A) : G  Tσ0

(1.77a)

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

int(A) : G → Tσ0

25

(1.77b)

And for every g ∈ G int(A)(g) = den(A)(g) = den(A0 )(g{ p1 := p 1 , . . . , pn := p n })

(1.78)

where p 1 , …, p n are the unique solutions of the system of equations: di = den(Ai )(g{ p1 := d1 , . . . , pn := dn }), i = { 1, . . . , n }

(1.79)

which exist because of the acyclicity of the term cf(A).

1.3.2 Natural Isomorphism and Algorithmic Equivalence An acyclic recursor f = ( f 0 , f 1 , . . . , f n ) defines, for each variable assignment g ∈ G, the system (1.80) of mutually recursive equations ⎧ d1 = f 1 (g, d1 , . . . , dn ) ⎪ ⎪ ⎨ .. . ⎪ ⎪ ⎩ dn = f n (g, d1 , . . . , dn )

(1.80)

For each g ∈ G, the unique solution d1 , . . . , dn of (1.80) (guaranteed by the acyclicity), together with the head function f 0 , determine the value of the function f : G → Tσ0 , by f (g) = f 0 (g, d1 , . . . , dn ) for each g ∈ G. The order of listing the equations in the system (1.80) does not influence the process of computing its unique solution per se, which is determined (in one or other specific way) by a selection of a rank of the recursor f . That is, changing the order of the functions f 1 ,…, f n in any acyclic recursor f = ( f 0 , f 1 , . . . , f n ) does not change the abstract algorithm for computing the values f (g) it determines. We define this concept of equivalence between recursors by Definition 1.21. Definition 1.21 Two acyclic recursors α = (α0 , α1 , . . . , αn ), β = (β0 , β1 , . . . , βm ) : G  Tσ0 where αi : G × Tσ1 × · · · × Tσn → Tσi , for i = 0, . . . , n

(1.81a) (1.81b)

where βi : G × Tτ1 × · · · × Tτm → Tτi , for i = 0, . . . , m

(1.81c)

are naturally isomorphic, and we write α ∼ = β, if m = n, and there is a permutation π : { 0, 1, . . . , n }  { 0, 1, . . . , n }

(1.82)

26

R. Loukanova

such that π(0) = 0, σπ(i) = τi , for i = 0, . . . , n, and (1.83) holds: απ(i) (g, d1 , . . . , dn ) = βi (g, dπ(1) , . . . , dπ(n) ), for g ∈ G, di ∈ Tσi , i = 0, . . . , n

(1.83)

In the rest of the chapter, we assume that A is a given, fixed semantic structure, and often do not write it explicitly. Definition 1.22 (Referentially Algorithmic Equivalence in A) Assume that A is a given semantic structure. Two terms A and B are algorithmically equivalent, i.e., referentially synonymous in A, denoted by A ≈A B, or, simply, by A ≈ B when A is understood, if and only if 1. A and B are immediate and denA (A)(g) = denA (B)(g), for all variable assignments g ∈ G A in A; or 2. A and B are proper and int(A) ∼ = int(B) in A. Definition 1.23 (Algorithmic Equivalence) Two terms A and B are algorithmically equivalent, i.e., logically synonymous, denoted as A ≈l B, if and only if 1. A and B are immediate and den(A) = den(B), i.e., for all A and all g ∈ G A , denA (A)(g) = denA (B)(g); or 2. A and B are proper and for all A, int(A) ∼ = int(B). Theorem 1.7 (Referential Synonymy/Algorithmic Equivalence in A) (This is a slightly extended statement from the one given in Moschovakis [21]) Two terms A, B are algorithmically (i.e., referentially) synonymous, A ≈ B, if and only if one of the following cases holds: 1. both A and B are immediate terms and den(A) = den(B), i.e., for all variable valuations g ∈ G, den(A)(g) = den(B)(g); or 2. both A and B are proper terms, and there are explicit, irreducible terms of corresponding types, A0 : σ0 , …, An : σn , B0 : σ0 , …, Bn : σn (n ≥ 0), such that: Aσ0 ⇒cf Aσ00 where { p1 := Aσ11 , . . . , pn := Aσnn } B σ0 ⇒cf B0σ0 where { p1 := B1σ1 , . . . , pn := Bnσn }

(1.84a) (1.84b)

and for all i = 0, …, n, den(Ai ) = den(Bi ), i.e. den(Ai )(g) = den(Bi )(g), for all g ∈ G FV(Ai ) = FV(Bi )

(1.85)

Informally, A and B are algorithmically equivalent, A ≈ B, in a given semantic structure A, if and only if one of the following cases holds 1. Both A and B are immediate, i.e., do not have any algorithmic meanings, and A and B have the same denotations in A, which are obtained immediately via the values of the free variables that may occur in them, which are provided by g

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

27

2. A and B are proper terms, i.e., A and B both have algorithmic meanings, and the denotations of A and B, in A, are equal and computed by the same algorithm. It is determined by their canonical forms, cf(A) and cf(B), with corresponding basic algorithmic steps, represented by the denotationally equal, irreducible parts Ai and Bi . The denotations of Ai and Bi are computed inductively, i.e., by mutual recursion from the lowest up to the highest induction rank. Note 1.3 Since the reduction of terms to their canonical forms is effective, the referential synonymy A ≈ B can be effectively reduced to systems of denotational equalities Ai = Bi (unique up to congruence), for i = 0, …, n. For practical applications, it is easier to use Theorem 1.7, instead of Definition 1.22, for checking referential synonymy, i.e., algorithmic equivalence, between terms. However, the truth of the equality terms Ai = Bi , for all i = 0, …, n, (used in Theorem 1.7) needs to be decided for arbitrary terms and semantic structures with arbitrary interpretations of constants. Note 1.4 The denotational equality den(A{ c :≡ C })(g) = den(A)(g) in (1.35b), can not be validly generalized to algorithmic equivalence, i.e., to referential intensions, for arbitrary variable assignment g ∈ G, terms A : σ , C : τ , and constants c : τ , such that den(c)(g) = den(C)(g). E.g., a constant c can fill up an argument of a function (relation) term, as in f (c), where f : σ → τ is a constant. Then, int(A) and int(A{ c :≡ C }) depend, correspondingly, on int(c) and int(C), i.e., on the algorithms for computing den(c) and den(C), not only on den(c) and den(C). E.g., let A ≡ f (c) and C ≡ h(Q), for some explicit, irreducible, proper term Q. Then, A{ c :≡ C } ≈ A, i.e., int(A{ c :≡ C }) = int(A), even if den(c) = den(C), because cf(A{ c :≡ C }) ≈ cf(A). Indeed:

f (h(Q)) ⇒cf

f (c) ⇒cf f ( p) where { p := c} f ( p) where { p := h(q), q := Q}

(1.86) (1.87)

By (1.86), (1.87), and Theorem 1.7, it follows that A{ c :≡ C } ≡ f (c){ c :≡ h(Q) } ≡ f (h(Q)) ≈ f (c) ≡ A

(1.88)

Note 1.5 Recall that immediate terms do not have algorithmic meanings, see Definition 1.12. The denotational values of immediate terms are obtained immediately, without computations. Theorem 1.8 (Compositionality Theorem for Algorithmic Synonymy in A) For all arbitrary A ∈ Termsσ , B, C ∈ Termsτ , x ∈ PureVτ , such that the substitutions A{ x :≡ B } and A{ x :≡ C } are free, i.e., do not cause variable collisions: B≈C

=⇒

A{ x :≡ B } ≈ A{ x :≡ C }

Proof See Moschovakis [21], Sect. 3.22.

(1.89) 

28

R. Loukanova

Table 1.1 The calculus of algorithmic synonymy A⇒B A≈B A≈A

B≈A A≈B

A1 ≈ B1 A2 ≈ B2 A1 (A2 ) ≈ B1 (B2 )

(1.92) A≈B B≈C A≈C A≈B λ(u)A ≈ λ(u)B

(1.93) (1.94)

A0 ≈ B0 A1 ≈ B1 ... An ≈ Bn − → − → − → → A0 where { p := A } ≈ B0 where { − q := B }

(1.95)

|= C = D (∗) C≈D

(1.96)

(C e.i., u ∈ FV(C)) λ(u)C (v) ≈ C{u :≡ v}

(1.97)



where: “e.i.” abbreviates “explicit, irreducible”; (*): C, D are e.i. terms, either both proper, or both immediate, and FreeV(C) = FreeV(D); |= C = D ⇐⇒ for all g ∈ G, den(C)(g) = den(B)(g). u, v ∈ PureV and the substitution C{u :≡ v} is free.

Corollary 1.3 For all explicit, irreducible terms A : σ and B : σ , A≈B

iff

den(A)(g) = den(B)(g), FV(A) = FV(B) for all g ∈ G

(1.90)

Corollary 1.4 For every explicit, irreducible term A : (σ → τ ) and x ∈ PureVσ , x : σ , such that x does not occur in A: λ(x) (A(x)) ≈ A, both proper (immediate)

(1.91)

1.3.3 Underspecified Algorithms λ Definition 1.24 (Underspecified Lar -Terms) For any A ∈ Terms, we call A an underspecified term, in case FreeV(A) ∩ RecV = ∅, i.e., when A has free occurrences of recursion variables; otherwise A is specified. λ In case an Lar -term A is underspecified and in canonical form, A determines an underspecified algorithm for computing the denotation den(A)(g), which can essentially

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

29

depend on values g( p), for p ∈ FreeV(A) ∩ RecV. The term A can be specified by extending it to another canonical form A1 , by adding sequences of assignments − → − → p := P , for irreducible terms P , in the where-scope of A1 . Example 1.1 Reduction of Terms Rendering NL Sentences The natural language (NL) sentence “Every dog barks loudly”, as a pattern for a λ -term E 1 in (1.98a). Then, E 1 is reduced class of sentences, can be rendered to the Lar to the recursion term (1.98b). Note that the term in (1.98b) is in canonical form in λ constant. An inflected verb, e.g., “barks”, should be rendered case barks is a Lar into a complex term, which we abbreviate here by barks, that carries information about time location. Then, the term (1.98b) would be in canonical form by taking barks to be a recursion variable that is assigned to a relevant term and a sequences of assignments. Thus, the additional information carried by the inflection can be − → → represented by extending (1.98b) with suitable assignments barks := B, − q := B , − → for some irreducible terms B and B . render

Every dog barks loudly −−−→ E 1 ≡ every(dog)(loudly(barks)) E 1 ⇒ every(d)(b) where { d := dog, b := loudly(b0 ), b0 := barks }

(1.98a) (1.98b)

Note that the rendering (1.98a), requires a sequence of reductions (1.98b) to the corresponding canonical form cf(E 1 ) that determines the algorithm for computing the denotation den(E 1 ) of the sentence. Alternatively, and efficiently, the class of the sentences of which the NL sentence λ -term E in (1.99), which is in (1.98a) is a special case, can be represented by the Lar underspecified by having free occurrences of recursion variables Q, d, b ∈ RecV. In λ -term E in (1.99) case Q : (( e → t) → (( e → t) →  t)), and d, b : ( e → t), the Lar is the logical form that represents the algorithmic semantics of the class of twoargument quantifiers. E ≡ Q(d)(b) Q ∈ RecV((e→t)→((e→t)→t)) d, b ∈ RecV(e→t)

(1.99) (1.100) (1.101)

Then, efficiently, the algorithmic semantics of the specific sentence (1.102a) can be represented by a term E 2 in canonical form, via instantiating the variables Q, d, b ∈ RecV with appropriate irreducible terms and assignments, in (1.102b): render

Every dog barks loudly −−−→ E 2

(1.102a)

30

R. Loukanova

E 2 ≡ Q(d)(b) where { Q := every, d := dog, b := l(b0 ), L := loudly, b0 := barks }

(1.102b)

1.4 Extended Gamma-Star Reduction Calculi of TTAR λ In this section, we briefly present an extended reduction calculus of Lar , by adding ∗ ∗ a rule (γ ). The result is a γ -reduction that provides reductions to γ ∗ -canonical forms, with more efficient algorithmic computations, see Loukanova [17].

Definition 1.25 ((Strict) γ ∗ -Condition) Assume that, for i = 1, . . . , n (n ≥ 0), τ, ϑ, ϑi ∈ Types, u, u i ∈ PureV, p ∈ RecV, P ∈ Terms, are such that u : ϑ, u i : − → − → − → → u ϑ ) λ(vϑ )(P τ ) : ( ϑ → (ϑ → τ )). ϑi , p : ( ϑ → (ϑ → τ )), P : τ , and thus, λ(− The γ ∗ -Rule:

(γ ∗ )

− → → A ≡ A0 where { − a := A , → p := λ(− u ) λ(v)P, ⇒γ ∗

(1.103a) (1.103b)

− → − → b := B } − → → A0 where { − a := A  , → u )P, p  := λ(−

(1.103c) (1.103d) (1.103e)

− → − → b := B  } → → u )(v) :≡ p  (− u ) } where { ≡ A0 { p(− − → → − → → u ) }, a := A { p(− u )(v) :≡ p  (− − →  p := λ( u )P,

(1.103f) (1.103g) (1.103h) (1.103i)

− → − → → → u )} } b := B { p(− u )(v) :≡ p  (−

(1.103j)

where • the term A ∈ Terms satisfies the strict γ ∗ -condition (given in Definition 1.25) for − → → the assignment p := λ(− u ) λ(v)P : ( ϑ → (ϑ → τ )) → is a fresh recursion variable • p  ∈ RecV(− ϑ →τ ) − → • for each part X i of X in (1.103d)–(1.103f), and (1.103g)–(1.103j), X i is the result → → → u )(v) :≡ p  (− u ) } of all occurrences of p(− u )(v) of the replacements X i ≡ X i { p(− → − →  − by p ( u ), modulo renaming the variables u , v, for i ∈ {0, . . . , n } X



A recursion term A ∈ Terms satisfies the strict γ -condition for an assignment − → − → → p := λ(− u ϑ ) λ(vϑ )(P τ ) : ( ϑ → (ϑ → τ )), with respect to λ(v), if and only if A

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

31

is of the form: (1.104a)–(1.104c): − → → A ≡ A0 where { − a := A , → p := λ(− u ) λ(v)P, − → − → b := B }

(1.104a) (1.104b) (1.104c)

such that the following holds: / FreeV(P) 1. P ∈ Termsτ does not have any free occurrences of v in it, i.e., v ∈ − → − → → 2. All occurrences of p in A0 , A , and B are occurrences in sub-terms p(− u )(v) − → − → that are in the scope of λ( u ) λ(v), modulo renaming the variables u , v. λ Definition 1.26 (γ ∗ -Reduction of Lar ) For all A, B ∈ Terms, A ⇒∗γ ∗ B, also denoted by A ⇒γ ∗ B, (and we say that A γ ∗ -reduces to B) if and only if B is λ , obtained from A by a finite sequence of applications of the reduction rules of Lar ∗ including some (may be zero) applications of the (γ )-rule.

Definition 1.27 (γ ∗ -Irreducibility) We say that a term A ∈ Terms is γ ∗ -irreducible if and only if (1.105) holds: for all B ∈ Terms, A ⇒∗γ ∗ B =⇒ A ≡c B

(1.105)

Theorem 1.9 (γ ∗ -Canonical Form) For every A, B ∈ Terms, the following holds: (1) There is a (unique up to congruence) term denoted by cfγ * (A), such that: A ⇒∗γ ∗ cfγ * (A)

(1.106)

(2) In case A and B are such that (1.107) holds, B is a γ ∗ -canonical form of A, i.e.: A ⇒γ ∗ B and B is γ ∗ -irreducible ⇐⇒ B ≡c cfγ * (A)

(1.107)

(3) B ≡c cfγ * (B) if and only if B ≡c cf(B), and the term B does not satisfy the γ ∗ -Condition Definition 1.25. Often, we use the following notations: A ⇒cfγ ∗ B ⇐⇒ B ≡c cfγ * (A)

(1.108a)

A ⇒cfγ ∗ cfγ * (A)

(1.108b)

λ The algorithmic equivalence, the standard reduction and the γ ∗ -reduction of Lar ∗ λ determine the algorithmic γ -equivalence between Lar terms, reflected in the following Definition 1.28.

32

R. Loukanova

Definition 1.28 (γ ∗ -Equivalence Relation ≈γ ∗ , i.e., γ ∗ -synonymy) For all terms A, B ∈ Terms: A ≈γ ∗ B ⇐⇒ cfγ * (A) ≈ cfγ * (B) (1.109) When A ≈γ ∗ B, we say that A and B are γ ∗ -equivalent, alternatively, that A and B are γ ∗ -synonymous. For details about the (γ ∗ )-rule and the γ ∗ -reduction, see Loukanova [17]. Here we use it by the intuitive explanations provided with the Example 1.2. Example 1.2 (Reduction to (Standard) Canonical Forms and γ ∗ Canonical Forms) See Theorems 1.5, 1.9 and Definitions 1.17, 1.26. λ terms (1.110a)–(1.110e) denote the same function. The Lar A ≡ λ(x) f (x 3 )

(1.110a)

⇒ λ(x)[ f (q) where { q := x }] 3

⇒ λ(x)[ f (q (x))] where { q := λ(x)(x ) } 1

1

3

≡ λ(x)[ f (q (x))] where { q := λ(x)(E(x)(3)) } 1

1



by (ap)

(1.110b)

by (λ)

(1.110c)

by (ap), (rep3)

⇒ λ(x)[ f (q (x))] where { q := λ(x) E(x)(n) where {n := 3} } 1

1

by (ap), (rep2), 2x(rep3)



⇒ λ(x)[ f (q 1 (x))] where { q 1 := λ(x) E(x)(n 1 (x)) where {  n 1 := λ(x)(3) } } by ( λ ), (rep3)

⇒cf λ(x)[ f (q 1 (x))] where { q 1 := λ(x) E(x)(n 1 (x)) , n 1 := λ(x)(3) }

(1.110d) (1.110e)

(1.110f)

(1.110g)

by (B-S)

⇒cfγ ∗ λ(x)[ f (q 1 (x))] where { q 1 := λ(x) E(x)(n) , n := 3 }

(1.110h)



by (γ ) λ , the term (1.110a) can be By using the standard reduction calculus of Lrλ and Lar reduced to the term (1.110g), which is in canonical form. The (denotation of the) term λ(x)(3) in (1.110g) is saved in the local memory location n 1 , via the assignment n 1 := λ(x)(3). Furthermore:

(1) In the term (1.110g), there is an assignment n 1 := λ(x)(3), which is of the form n 1 := λ(x)(P) (2) The term λ(x)(P) is such that P that does not have any free occurrences of x ∈ RecV, i.e., x ∈ / FreeV(P)

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

33

Such a term λ(x)(P) denotes a function that does not depend on the values of its argument expressed by the λ(x)-abstraction (3) Each occurrence of n 1 in (1.110g) is an occurrence in the sub-term n 1 (x) that is in the scope of λ(x) Thus, the values of n 1 (x) are constant, i.e., the number 3, in this example, and do not depend on the value of x, i.e, the computations determined by the two systems of assignments (1.111a) and (1.111b) are the same:

q 1 := λ(x) E(x)(n 1 (x)) , n 1 := λ(x)(3)

q 1 := λ(x) E(x)(n) , n := 3

(1.111a) (1.111b)

By the (γ ∗ )-rule, the term A is reduced to its canonical form cfγ * (A) in (1.110h). Loukanova [16] presented a simplified variant γ -rule inducing γ -reduction, which is weaker, but easier to apply than Loukanova [17]. Simplifications of algorithmic computations, formalized by γ ∗ -reduction, and γ -reduction, are important for practical applications, e.g., in applications to computational semantics of programs and human language. For instance, γ ∗ -reduction, or optionally γ -reduction, supports clearer representations of semantic ambiguities and underspecification in NL expressions with multiple quantifier scopes, see Loukanova [15].

1.5 Sequential Binders Loukanova [14] renders sentences of human language, which contain several quantiλ terms. These terms fiers with multiple scope interpretations, into underspecified Lar contain quantifier expressions Q i , e.g., for i = 1, 2, 3, that can have multiple scope distributions over a joint core relation h, depending on context. The common characteristics of such terms is that regardless of the specified scope distribution of the quantifier subterms Q i , each Q i binds a fixed argument slot of h, i.e., i-th argument of h. Recursion terms in canonical forms provide a very sophisticated and elegant representation of scope distributions. They display the common factors across multiple scope distributions corresponding to a given sentence A with several quantifiers. By λ terms representing diffactoring out the differences, the canonical forms of the Lar ferent scopes give a common underspecified term that represents the set of all scope distributions for A. Such a term has free recursion variables that can be instantiated to specific scope distributions. The technique is based on formal linking of each of the quantifiers Q i with the corresponding i-th argument slot of h that it binds, across λ-abstractions, recursion assignments, and reduction steps. The details of the formalisation of linking the quantifiers to the respective argument slots that they bind across recursive assignments are left open in [14].

34

R. Loukanova

The rest of this chapter elaborates the formalisation of bindig concepts for a broad class of terms that bind argument slots. The class of these terms include terms denoting quantifiers and other binding relations and functions. For sake of rigour and clarity, in Theorem 1.10, we provide detailed assumptions, the formal types (1.113a)–(1.113g), and extra subterms in (1.112a)–(1.112c) and (1.114b)–(1.114i). These details are important for the proof. They can be ignored for understanding the essence of the theorem. Similarly, we provide such details in other theorems and results presented in this chapter. Theorem 1.10 (Reduction of Strong Binders) Let Tm+1 be the following term (1.112a)–(1.112c), given that the types of the sub-terms are such that Tm+1 is a well-formed term:    Tm+1 ≡ Q im λ xim Q i(m−1) λ xi(m−1) Q i(m−2) ...

(1.112a) λ xi( j+1) Q i j [λ xi j Q i( j−1) [λ xi( j−1) Q i( j−2) [

... λ xi3 Q i2 [ . . . ]]] . . .



(1.112b) (1.112c)

λ xi2 Q i1 [λ xi1 H (x1 ) . . . (xn )]] (1.112d)

where we assume that: • m, n ∈ N, m, n ≥ 1 • x1 , . . . , xn ∈ PV are pure variables of types σi , i.e., (xi : σi ), for σi ∈ Types, i = 1, . . . , n • xi1 , . . . , xim ∈ PV are pure variables of types σi j , i.e., (xi j : σi j ), for σi j ∈ Types, i j ∈ N, j = 1, . . . , m • Q i1 , …, Q im , H are terms of the corresponding types in (1.113a)–(1.113g): H : (σ1 → · · · → (σn−1 → (σn → τi0 ))) Q i1 : ((σi1 → τi0 ) → τi1 )

(1.113a) (1.113b)

Q i2 : ((σi2 → τi1 ) → τi2 ) ...

(1.113c)

Q i j : ((σi j → τi j−1 ) → τi j ) Q i j+1 : ((σi j+1 → τi j ) → τi j+1 )

(1.113d) (1.113e)

... Q im−1 : ((σim−1 → τim−2 ) → τim−1 ) Q im : ((σim → τim−1 ) → τim )

(1.113f) (1.113g)

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

35

In addition, we assume the following: (1) (2) (3) (4) (5)

H is a proper, i.e., not immediate, term m≤n x1 , . . . , xn ∈ PV are pairwise different, pure variables xi1 , . . . , xim ∈ PV are pairwise different, pure variables { xi1 , . . . , xim } ⊆ { x1 , . . . , xn }, i.e., { i 1 , . . . , i m } ⊆ { 1, . . . , n }

Then, the term Tm+1 in (1.112a)–(1.112c) can be reduced to the term Rm+1 in (1.114b)–(1.114i):

Q im [Ri0m ] Ri0m

Tm+1 ⇒ Rm+1 ≡

(1.114a)

where {

(1.114b)

:=

(1.114c)

λ(xim )Q i(m−1) [Ri1(m−1) (xim )],

Ri1(m−1) := λ(xim )λ(xi(m−1) )Q i(m−2) [Ri2(m−2) (xim )(xi(m−1) )],

(1.114d)

... m−( j+1) Ri( j+1) m− j

Ri j

j := λ(xim ) . . . λ(xi( j+1) )Q i j [Rim− (xim ) . . . (xi( j+1) )], j

(1.114e)

j−1) := λ(xim ) . . . λ(xi( j+1) )λ(xi j )Q i( j−1) [Rim−( (xim ) . . . (xi j )], ( j−1)

(1.114f)

| for j = m, . . . , 2,

(1.114g)

:= λ(xim ) . . . λ(xi2 )Q i1 [Ri(m−1) (xim ) . . . (xi2 )], 1 − → := λ(x ) . . . λ(x )λ(x )H ( x ) }

(1.114h)

... Ri(m−2) 2 (m−1) Ri 1

im

i2

i1

(1.114i)

for some fresh recursion variables Rkl ∈ RecV of the types (1.115a)–(1.115f): : (σim → · · · → (σi2 → (σi1 → τi0 )) . . . ) Ri(m−1) 1

(1.115a)

: (σim → · · · → (σi2 → τi1 ) . . . ) Ri(m−2) 2

(1.115b)

... m− j Ri j m−( j+1)

Ri( j+1)

: (σim → · · · → (σi j+1 → (σi j → τi j−1 )) . . . )

(1.115c)

: (σim → · · · → (σi j+1 → τi j ) . . . )

(1.115d)

: (σim → (σim−1 → τim−2 ))

(1.115e)

: (σim → τim−1 )

(1.115f)

... Ri1(m−1) Ri0m

Proof The proof is by induction on the number of the terms Q i1 , …, Q im . It uses the λ (and Lrλ ) and verifies the types. reduction rules of Lar

36

R. Loukanova m− j

The superscripts of the variables Ri j are counters of the number of the applications of the λ-rule (λ). For sake of space, we do not include the proof here.  Note 1.6 The types of the terms Q i1 , …, Q im , H do not need to be such that Q i1 , …, Q im denote quantifiers over objects in some domains denoted by the argument slots of H . Quantifiers are in the focus of the work in Loukanova [14]. In this chapter, we investigate the broader class of terms Q i1 , …, Q im , H , such that Q i1 , …, Q im can bind argument slots of the term H . Note 1.7 The requirements (4)–(5) in Theorem 1.10 guarantee that there is binding of existing argument slots of H . That is, the bindings in the term Tm+1 in (1.112a)–(1.112c) are strong, not vacuous. Therefore, the chained bindings by Rm+1 in (1.114b)–(1.114i) are strong too. The term H may still denote a function that does not depend essentially on some of its arguments, including such that are bound by some Q i j . The requirements (4)–(5) in Theorem 1.10 can be removed in a general term Tm+1 of the same form (1.112a)–(1.112c), while the reduction to the term Rm+1 in (1.114b)–(1.114i) holds. Theorem 1.11 The term Rm+1 in (1.114b)–(1.114i) is algorithmically synonymous  in (1.116b)–(1.116h). (equivalent) with the term Rm+1  ≡ Rm+1 ≈ Rm+1

(1.116a)

Q im [λ(xim )Ri0m (xim )] Ri0m Ri1(m−1)

where {

(1.116b)

:=

λ(xim )Q i(m−1) [λ(xi(m−1) )Ri1(m−1) (xim )(xi(m−1) )],

(1.116c)

:=

λ(xim )λ(xi(m−1) )Q i(m−2) [λ(xi(m−2) )Ri2(m−2) (xim )(xi(m−1) ) (xi(m−2) )],

(1.116d)

... m−( j+1) Ri( j+1) m− j

Ri j

j := λ(xim ) . . . λ(xi( j+1) )Q i j [λ(xi j )Rim− (xim ) . . . (xi( j+1) )(xi j )], j (1.116e) j−1) := λ(xim ) . . . λ(xi( j+1) )λ(xi j )Q i( j−1) [λ(xi( j−1) )Rim−( (xim ) . . . ( j−1)

(xi j )(xi( j−1) )],

(1.116f)

| for j = m, . . . , 2, ... := λ(xim ) . . . λ(xi2 )Q i1 [λ(xi1 )Ri(m−1) (xim ) . . . (xi2 )(xi1 )], Ri(m−2) 2 1 (m−1) − → := λ(x ) . . . λ(x )H ( x ) } R i1

im

i1

(1.116g) (1.116h)

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding … m− j

Proof For every i j ∈ { i 1 , . . . , i m }, from (1.115c), we have that Ri j m− j

Ri j ∴ ∴

37

∈ RecV:

(xim ) . . . (xi( j+1) ) : (σi j → τi j−1 )

m− j Ri j (xim ) . . . (xi( j+1) )(xi j )

m− j λ(xi j )Ri j (xim ) . . . (xi( j+1) )(xi j )

(1.117a)

: τi j−1

(1.117b)

: (σi j → τi j−1 )

(1.117c)

m− j

m− j

The terms Ri j (xim ) . . . (xi( j+1) )(xi j ) and λ(xi j )Ri j (xim ) . . . (xi( j+1) )(xi j ) are immediate, and thus explicit, irreducible, because Ri j ∈ RecV are recursion variables, i.e., memory locations of suitable types. Furthermore, for all g ∈ G: m− j

den(Ri j

(xim ) . . . (xi( j+1) ))(g) m− j

= den(λ(xi j )Ri j

(xim ) . . . (xi( j+1) )(xi j ))(g)

(1.118)

By Corollary 1.4, it follows that these terms are algorithmically equivalent, i.e., (1.119) holds: m− j

Ri j

m− j

(xim ) . . . (xi( j+1) ) ≈ λ(xi j )Ri j

(xim ) . . . (xi( j+1) )(xi j )

for every i j ∈ { i 1 , . . . , i m }

(1.119)

From (1.119), by using the rules for algorithmic synonymy in Table 1.1, it follows that  Rm+1 ≈ Rm+1  are algorithmically equivalent. Thus, the terms Rm+1 and Rm+1

(1.120) 

Definition 1.29 (Recursive Distance) Let T be the a term of the form: T ≡ A0 where { pn := An , . . . , pi+1 := Ai+1 , pi := Ai , . . . , p1 := A1 , }

(1.121a) (1.121b) (1.121c)

The recursive distance RDist( pn , H, A1 )= RDist( pn , H, p1 )= RDist(An , H, A1 ) = RDist(An , H, p1 ) of An (or its pn ), from a subterm H of a term A1 (or its recursion memory p1 ), in a recursion term T of the form (1.121a)–(1.121c) (modulo congruence with respect to the order of the assignments), is defined by induction:

38

R. Loukanova

RDist( pi , H, Ai ) = RDist(Ai , H, Ai ) = RDist( pi , H, pi ) = 0, given that H occurs in Ai

(1.122a)

RDist( pi+1 , H, A1 ) = RDist(Ai+1 , H, A1 ) = RDist(  pi+1 , H, p1 ) = RDist(Ai+1 , H, p1 ) = min RDist( pi , H, p1 ) | pi occur sin Ai+1 + 1,

(1.122b)

Note: RDist( pn , H, A1 ) is a partial function. Theorem 1.12 (Binding Across Recursion) Let Rm+1 be a term of the form (1.123a)– (1.123g)–(1.123h), as in Theorem 1.11. Rm+1 ≡ Q im [λ(xim )Ri0m (xim )] where {

(1.123a)

Ri0m

:=

λ(xim )Q i(m−1) [λ(xi(m−1) )Ri1(m−1) (xim )(xi(m−1) )],

(1.123b)

Ri1(m−1)

:=

λ(xim )λ(xi(m−1) )Q i(m−2) [λ(xi(m−2) )Ri2(m−2) (xim )(xi(m−1) ) (xi(m−2) )],

(1.123c)

... m−( j+1) Ri( j+1) m− j

Ri j

j := λ(xim ) . . . λ(xi( j+1) )Q i j [λ(xi j )Rim− (xim ) . . . (xi( j+1) )(xi j )], (1.123d) j j−1) := λ(xim ) . . . λ(xi( j+1) )λ(xi j )Q i( j−1) [λ(xi( j−1) )Rim−( (xim ) . . . ( j−1)

(xi j )(xi( j−1) )], | for j = m, . . . , 2,

(1.123e)

:= λ(xim ) . . . λ(xi2 )Q i1 [λ(xi1 )Ri(m−1) (xim ) . . . (xi2 )(xi1 )], 1

(1.123f)

... Ri(m−2) 2 Ri(m−1) 1

:= λ(xim ) . . . λ(xi1 )H (x1 ) . . . (xn ), − → − → p := A }

(1.123g) (1.123h)

Then, for every i j ∈ { i 1 , . . . , i m }, (1) the term Q i j binds the i j -th argument slot of m− j H , and (2) Ri j is λ-abstraction λ(xim ) . . . λ(xi( j+1) )λ(xi j ) over the i m -th, …, i j -th argument slots of H in this specific order. Proof The proof is by induction on j = 1, . . . , m, i.e., on the recursive distance of m− j Ri j from H in Rim−1 .  1 Theorem 1.13 (Binding Across Recursion) Let Rm+1 be a term of the form (1.124a)– (1.124g)–(1.124h), as in Theorem 1.10:

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

Ri0m

39

Rm+1 ≡ Q im [Ri0m ] where {

(1.124a)

:=

(1.124b)

λ(xim )Q i(m−1) [Ri1(m−1) (xim )],

Ri1(m−1) := λ(xim )λ(xi(m−1) )Q i(m−2) [Ri2(m−2) (xim )(xi(m−1) )],

(1.124c)

... m−( j+1) Ri( j+1) m− j

Ri j

j := λ(xim ) . . . λ(xi( j+1) )Q i j [Rim− (xim ) . . . (xi( j+1) )], j

(1.124d)

j−1) := λ(xim ) . . . λ(xi( j+1) )λ(xi j )Q i( j−1) [Rim−( (xim ) . . . (xi j )], ( j−1)

(1.124e)

| for j = m, . . . , 2, ... Ri(m−2) 2 (m−1) Ri 1

:= λ(xim ) . . . λ(xi2 )Q i1 [Ri(m−1) (xim ) . . . (xi2 )], 1 → := λ(x ) . . . λ(x )λ(x )H (− x ), im

− → − → p := A }

i2

(1.124f) (1.124g)

i1

(1.124h)

Then, for every i j ∈ { i 1 , . . . , i m }, (1) Q i j binds the i j -th argument slot of H , and m− j (2) Ri j is λ-abstraction λ(xim ) . . . λ(xi( j+1) )λ(xi j ) over the i m -th, …, i j -th argument slots of H in this specific order. Proof The proof is by induction on j = 1, . . . , m, i.e., on the recursive distance of m− j Ri j from H in Rim−1 .  1 Now, we show that Theorem 1.10 holds by weakening the requirement (3) in it. Theorem 1.14 (Reduction of Strong Binders) Let Tm+1 be the term (1.125a)– (1.125d):   Tm+1 ≡ Q im λ xim Q i(m−1) λ xi(m−1) Q i(m−2) [

(1.125a)

λ xi(m−2) Q i(m−3) [λ xi(m−3) Q i(m−4) [

(1.125b)

... λ xi( j+1) Q i j [λ xi j Q i( j−1) [λ xi( j−1) Q i( j−2) [ ... λ xi3 Q i2 [λ xi2 Q i1 [λ xi1 H (v1 ) . . . (vk )]]]]]]]]

(1.125c) 

(1.125d)

where we assume that: • m, n ∈ N, m, n ≥ 1 • xi1 , . . . , xim ∈ PV are pure variables of types (xi j : σi j ), for σi j ∈ Types, i j ∈ N, j = 1, . . . , m • Q i1 , …, Q im , H are terms of the corresponding types in (1.113a)–(1.113g):

40

R. Loukanova

In addition, we assume the following: (1) (2) (3) (4) (5)

H is a proper, i.e., not immediate, term m≤n v1 , . . . , vk ∈ PV are pure variables, not necessarily pairwise different. xi1 , . . . , xim ∈ PV are pairwise different, pure variables { xi1 , . . . , xim } ⊆ { v1 , . . . , vk } = { x1 , . . . , xn }, i.e., { i 1 , . . . , i m } ⊆ { 1, . . . , n } (6) x1 , . . . , xn ∈ PV are pairwise different, pure variables Then, the term Tm+1 in (1.125a)–(1.125d) can be reduced to the term Rm+1 in (1.126a)–(1.126h)

Q im [Ri0m ] Ri0m

Tm+1 ⇒ Rm+1 ≡

(1.126a)

where {

(1.126b)

:=

(1.126c)

λ(xim )Q i(m−1) [Ri1(m−1) (xim )],

Ri1(m−1) := λ(xim )λ(xi(m−1) )Q i(m−2) [Ri2(m−2) (xim )(xi(m−1) )],

(1.126d)

... m−( j+1) Ri( j+1) m− j

Ri j

j := λ(xim ) . . . λ(xi( j+1) )Q i j [Rim− (xim ) . . . (xi( j+1) )], j

(1.126e)

j−1) := λ(xim ) . . . λ(xi( j+1) )λ(xi j )Q i( j−1) [Rim−( (xim ) . . . (xi j )], ( j−1)

| for j = m, . . . , 1,

(1.126f)

:= λ(xim ) . . . λ(xi2 )Q i1 [Ri(m−1) (xim ) . . . (xi2 )], 1 − → := λ(x ) . . . λ(x )λ(x )H ( v ) }

(1.126g)

... Ri(m−2) 2 (m−1) Ri 1

im

i2

i1

(1.126h)

for some fresh recursion variables Rkl ∈ RecV of the types (1.115a)–(1.115f). Proof The proof is similar to that of Theorem 1.10.



Similarly, Theorem 1.11 holds by weakening the requirement (3), but we do not present it here for sake of space. Theorem 1.15 (Reduction of Strong Binders) Let Tm+1 be the term7 (1.127a)– (1.127d):   Tm+1 ≡ Q im λ xim Q i(m−1) λ xi(m−1) Q i(m−2) [ λ xi(m−2) Q i(m−3) [λ xi(m−3) Q i(m−4) [ ...

7 The

difference from Theorem 1.14 is that now H is immediate, i.e., not proper.

(1.127a) (1.127b)

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

41

λ xi( j+1) Q i j [λ xi j Q i( j−1) [λ xi( j−1) Q i( j−2) [

(1.127c)

... λ xi3 Q i2 [λ xi2 Q i1 [λ xi1 H (v1 ) . . . (vk )]]  ]]]]]]

(1.127d)

where we assume that: • m, n ∈ N, m, n ≥ 1 • xi1 , . . . , xim ∈ PV are pure variables of types (xi j : σi j ), for σi j ∈ Types, i j ∈ N, j = 1, . . . , m • Q i1 , …, Q im , H are terms of the corresponding types in (1.113a)–(1.113g): In addition, assume the following: (1) (2) (3) (4) (5)

H is an immediate term m≤n v1 , . . . , vk ∈ PV are pure variables, not necessarily pairwise different. xi1 , . . . , xim ∈ PV are pairwise different, pure variables { xi1 , . . . , xim } ⊆ { v1 , . . . , vk }, i.e., { i 1 , . . . , i m } ⊆ { 1, . . . , n }

Then, the term Tm+1 in (1.127a)–(1.127d): can be reduced to the term Rm+1 in (1.128a)–(1.128h), for some fresh recursion variables Rkl ∈ RecV of the types (1.115a)–(1.115f):

Q im [Ri0m ] Ri0m

Tm+1 ⇒ Rm+1 ≡

(1.128a)

where {

(1.128b)

:=

(1.128c)

λ(xim )Q i(m−1) [Ri1(m−1) (xim )],

Ri1(m−1) := λ(xim )λ(xi(m−1) )Q i(m−2) [Ri2(m−2) (xim )(xi(m−1) )],

(1.128d)

... m−( j+1) Ri( j+1) m− j

Ri j

j := λ(xim ) . . . λ(xi( j+1) )Q i j [Rim− (xim ) . . . (xi( j+1) )], j

(1.128e)

j−1) := λ(xim ) . . . λ(xi( j+1) )λ(xi j )Q i( j−1) [Rim−( (xim ) . . . (xi j )], ( j−1)

(1.128f)

| for j = m, . . . , 1,

(1.128g)

:= λ(xim ) . . . λ(xi2 )Q i1 [λ(xi1 )H (v1 ) . . . (vk )]}

(1.128h)

... Ri(m−2) 2

Proof The proof is similar to that of Theorem 1.14.



A result similar to Theorem 1.11, but corresponding to Theorem 1.15, can be obtained for any immediate term H . Theorems 1.10, 1.14, 1.15 still hold after removing the requirements (4)–(5), by allowing vacuous binding.

42

R. Loukanova

1.6 Algorithmic Computations with Restrictions In this section, we give a very brief introduction of an extension of the formal language λ λ to a formal language Lrar of Type Theory of Restricted Acyclic Algorithms Lar (TTofRAA) having a restrictor constant such that. Technical details of the extended TTofRAA are subject to forthcoming article. We mention it here, because we consider λ to computer science, and related computational it important for applications of Lrar sciences, especially to computational semantics of language and neuroscience of language and memory, which is the motivation for this chapter. If the acyclicity λ of typed, restricted constraint (AC) is dropped out, Lrλ is extended to a language Lra λ algorithms with full recursion. The language and theory Lra is a mathematical model λ models the notion of acyclic algorithm. In this of the notion of algorithm, while Lrar λ , with some intuitive explanations, for chapter, we focus on giving the syntax of Lrar an introduction to potential applications of the results in the previous section to model neural connections as result of binding functionality of receptors, or other biological entities with structures that are subject to restricted memory and computation-like activities. λ λ (Lra ), the reduction calculus, The denotational and algorithmic semantics of Lrar and various theoretical results are subject of other, forthcoming work. The language λ λ λ (Lra ) is the result of extending Lar by adding a constant such that and correLrar sponding terms having a component for restrictions, i.e., constraints. Such terms with restrictions designate a restrictor over computations as an operator. The restrictor operator, in combination with the recursion operator designated by where-terms, model algorithmic systems that are equipped with memory cells. Results of computations are storred in the memory cells. Memory cells are typed, i.e., they can hold only data of the respective type. In addition, some of the computations and the memory cells are restricted by propositional conditions. The propositional restrictions can λ and represent properties of objects that have to be fulfilled. Our purpose is to use Lrar λ Lra for modelling functionality of biological entities that have valences or receptors for binding across sequences of structural entities with binding connections, such as neurons and neural networks. λ λ has the same set of types as Lar defined in (1.1), The formal language Lrar λ λ i.e., TypesLrar λ = TypesLλ . The vocabulary of Lrar is the same as that of Lar , i.e., ar λ Lrar has typed constants and two kinds of typed variables: pure variables, for λabstraction operator; and, memory (recursion) variables, for storing information. λ λ of the terms of L The set TermsLrar rar are defined by adding one more structural rule for the operator constant such that to (1.4). λ λ of the terms of L Definition 1.30 The set TermsLrar rar consists of the expressions generated by the following rules in TBNF:

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

A :≡ cτ : τ

(1.129a)

τ

|x :τ |B

43

(σ →τ ) σ

(1.129b) σ

(C ) : τ

(1.129c)

τ

| λ(v ) (B ) : (σ → τ )

| Aσ00 where { p1σ1 := Aσ11 , . . . , pnσn := Aσnn } : σ0

| A0σ0 such that { Cτ11 , . . . , Cτmm } : σ0

(1.129d) (1.129e) (1.129f)

given that: c is a constant; x is a variable of ether kind; A1 : σ1 , …, An : σn , C1 : λ ; pi : σi , i = 1, . . . , n (n ≥ 0) in (1.129e) are pairwise τ1 , . . . , Cm : τm ∈ TermsLrar different recursion variables of respective types, such that the sequence of assignments { p1σ1 := Aσ11 , . . . , pnσn := Aσnn } satisfies the Acyclicity Constraint (AC); and t of state dependent truth values each τi is either the type t of truth values, or the type (see (1.14b)). λ of restricted The results in Sects. 1.2–1.5 hold for the extended language Lrar algorithms. These properties are not in the subject of this chapter because they require λ for reducing extensive mathematical work on extending the reduction calculus of Lar terms with restrictions of the form (1.129f). They are in a forthcoming paper devoted to them. The rules (1.129a)–(1.129f) applied recursively provide very expressive formal terms that represent algorithmic computations that end after finite number of computational steps, because of the Acyclicity Constraint (AC). In particular, combinations of the rules (1.129e) and (1.129f), give terms of recursion and restrictors of the forms (1.130a)–(1.130b) and (1.131a)–(1.131b). Intuitively, terms of the form (1.130a)– (1.130b) designates mutually recursive computations { p1σ1 := Aσ11 , . . . , pnσn := Aσnn } that memorise the results in memory slots, and which are subject to predicative restrictions by Cτ11 , . . . , Cτmm :



Aσ00 where { p1σ1 := Aσ11 , . . . ,  pnσn := Aσnn } such that { Cτ11 , . . . , Cτmm }

(1.130a) (1.130b)

Terms of the form (1.131a)–(1.131b), designate the value of Aσ00 restricted by the propositions Cτ11 , . . . , Cτmm . The head term together with its restrictions Aσ00 such that { Cτ11 , . . . , Cτmm } uses the values that are computed recursively and stored in memory slots { p1σ1 , . . . , pnσn :



Aσ00 such that { Cτ11 , . . . , Cτmm } where

{ p1σ1 pnσn

:= :=

Aσ11 , . . . , Aσnn }



(1.131a) (1.131b)

44

R. Loukanova

1.7 Modelling Algorithmic Neural Networks In this section, we present utilize the recursion terms with constraints for modelling physiological connections, via receptors of certain types, between neurons that can λ -terms be part of neural systems in nature, of living or artificial entities. Certain Lar of represent nuron structures with properties of neural nodes and functional computations.

1.7.1 Procedural and Declerative Neural Networks Neural systems (in peripheral and central nervous systems) of living organisms, even as simple as Drosophila melanogaster, have innate faculty of both procedural and declarative memory, see, e.g., Kandel et al. [3] and Squire and Kandel [23]. Neural Networks of Procedural Memory Here, we propose to model procedural memory by terms having recursive assignments of the form (1.129e), while employing the entire range of term forms (1.129a)– (1.129f). The systems of assignments in terms of the form (1.129e) represent mutually recursive computations of the denotations of the terms Aiσi , which are saved in the corresponding memory cells pi . Procedural memory is modelled via the assignments piσi := Aiσi : p1 : σ1 , . . . , pn : σn { p1σ1 := Aσ11 , . . . , pnσn := Aσnn }

(1.132a) (1.132b)

The system of mutually recursive assignments (1.132b) models the following fundamental phenomena of functional, procedural neural networks: 1. The collection (1.132a) is a recursively linked network of memory cells pi : σi of corresponding types 2. The system (1.132b) has algorithmic, i.e., procedural, nature of a network of memory cells pi : Under completion of the computation of the data Aiσi , i.e., of the denotation of Aiσi , it is saved in the designated memory cell, i.e., in the neuron pi . 3. The rank function, according to the Acyclicity Constraint (AC), guarantees that the network (1.132b) has memorised the corresponding data pieces, after completing the algorithmic computations. Declarative Information Declarative information is modelled by terms of the form A : τ , where τ is either the type t of truth values, or the type t of state dependent truth values (see (1.14b)).

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

45

Neural Networks of Declarative Memory Here, we model declarative memory by the specialised networks, or sub-networks, of systems of assignments of the form (1.133a): t1τ1 := P1τ1 , . . . , tkτk := Pkτk for Pi : τi , where

(1.133a) (1.133b)

τi is either the type t of truth values, or the type t of state dependent truth values

(1.133c) (1.133d)

Here, declarative memory is innately integrated into networks of procedural memory. That is, neural networks of declarative memory (1.133a) are typically integrated as recursive subsystems of more general procedural assignments (1.132b): { t1 : τ1 , . . . , tn : τk } ⊆ { p1 : σ1 , . . . , pn : σn }

(1.134)

1.7.2 Algorithmic Binding of Functional Neuro-Receptors A term Tm+1 of the form (1.135a)–(1.135e) represents a neural network. The head term (1.135a)–(1.135d) is a neural sub-network of sequentially bound neural cells (1.135c), which are sequentially linked by binding functionality. Each subterm λ xi j Q i( j−1) models a neural cell. Its neural body Q i j−1 : ((σi j−1 → τi j−2 ) → τi j−1 ) has a receptor represented by its argument slot of the corresponding type (σi j−1 → τi j−2 ). The λ-abstraction λ xi j in λ xi j Q i( j−1) represents the axon of the neural cell λ xi j Q i( j−1) . Similarly, the λ-abstraction λ xi( j−1) , in λ xi( j−1) Q i( j−2) , represents the axon of λ xi( j−1) Q i( j−2) . In the subsequently bound (linked) neural cells, represented by the subterm of the form (1.135c), Q i( j−1) binds the axon xi( j−1) of λ xi( j−1) Q i( j−2) , for each j = 3, . . . , (m − 3).   Tm+1 ≡ Q im λ xim Q i(m−1) λ xi(m−1) Q i(m−2) [

(1.135a)

λ xi(m−2) Q i(m−3) [λ xi(m−3) Q i(m−4) [

(1.135b)

... λ xi( j+1) Q i j [λ xi j Q i( j−1) [λ xi( j−1) Q i( j−2) [ ... λ xi3 Q i2 [λ xi2 Q i1 [λ xi1 H (x1 ) . . . (xn )]]]]]]]] − → → where { − p := A }

(1.135c) 

(1.135d) (1.135e)

46

R. Loukanova

The term Tm+1 of the form (1.135a)–(1.135e) represents a neural network in its ‘encapsulated’ form, where the algorithmic steps of binding axons by the corresponding receptors are ‘hidden’ below encapsulating membranes. In the canonical form cf(Tm+1 ), the head term of Tm+1 representing the head neural sub-network, i.e., (1.135a)–(1.135d), is reduced to a subterm Rm+1 that have the structural form of Rm+1 in (1.114b)–(1.114i). The term Rm+1 represents the innate, inner algorithmic structure of the same neural sub-network of Tm+1 , inside its encapsulating membrane. On the other hand, the neural network Rm+1 is algorithmically  in (1.116b)–(1.116h), while they are synonymous (equivalent) with the term Rm+1 structurally different.

1.8 Conclusion and Future Work The recursion assignments in Sect. 1.5 include λ-terms binding argument slots of the “innermost” subterm, sequentially by recursion within the scope of the recursion operator where. We have started the exposition by reducing the term (1.112a)– (1.112c) to the term Rm+1 in (1.114b)–(1.114i). That resulted in the specific variables for the λ-abstracts. However, these terms are congruent to terms by renaming variables bound by the λ-operator. There are more interesting results related to linking of the bindings related to these λ-terms and renaming variables abstracted away with λoperator. Such properties of the binding operators Q i j introduced in this chapter have been applied for underspecified semantics representation of multiple quantifiers in natural language (NL), via computational syntax-semantics interfaces in generalised computational grammar CBLG that covers a variety of approaches to computational grammar of NL, see Loukanova [15]. Operators for Computational Representations of Functional Neuro-Receptors In this chapter, we have used examples from English language to demonstrate abstract, mathematical concepts of computation. The computational approach introduced here has a broad perspective for applications to computational theories of natural and formal languages. In a broader sense, natural language systems occur, or potentially can occur, not only for human language, in nature. By the work in this chapter, we maintain a demonstrated view that the phenomena of ambiguity and context dependence are typical not only for human languages, but also, for other language and information systems. These systems can be artificial, e.g., in computer systems for processing data, or in natural, e.g., biological neural functionality based on biological structures and biochemical interactions. Potential applications of the new type-theory of algorithms, in particular acyclic algorithms, include computational semantics of formal and natural languages, and computational neuroscience. A primary application is to semantics of human and programming languages.

1 Type-Theory of Acyclic Algorithms for Models of Consecutive Binding …

47

References 1. Gallin, D.: Intensional and Higher-Order Modal Logic: With Applications to Montague Semantics. North-Holland Publishing Company, Amsterdam and Oxford, and American Elsevier Publishing Company (1975). https://doi.org/10.2307/2271880 2. Hurkens, A.J.C., McArthur, M., Moschovakis, Y.N., Moss, L.S., Whitney, G.T.: The logic of recursive equations. J. Symb. Log. 63(2), 451–478 (1998). https://doi.org/10.2307/2586843 3. Kandel, E., Jessell, T., Siegelbaum, S., Schwartz, J., Hudspeth, A.J. (eds.): Principles of neural science. McGraw-Hill, Health Professions Division (2000) 4. van Lambalgen, M., Hamm, F.: The Proper Treatment of Events. Explorations in Semantics. Wiley-Blackwell, Oxford (2005) 5. Loukanova, R.: Modeling context information for computational semantics with the language of acyclic recursion. In: Pérez, J.B., Corchado, J.M., Moreno, M., Julián, V., Mathieu, P., CanadaBago, J., Ortega, A., Fernández-Caballero, A. (eds.) Highlights in Practical Applications of Agents and Multiagent Systems. Advances in Intelligent and Soft Computing, vol. 89, pp. 265–274. Springer, Berlin (2011). https://doi.org/10.1007/978-3-642-19917-2_32 6. Loukanova, R.: Reference, co-reference and antecedent-anaphora in the type theory of acyclic recursion. In: Bel-Enguix, G., Jiménez-López, M.D. (eds.) Bio-Inspired Models for Natural and Formal Languages, pp. 81–102. Cambridge Scholars Publishing, Newcastle upon Tyne (2011) 7. Loukanova, R.: Semantics with the language of acyclic recursion in constraint-based grammar. In: Bel-Enguix, G., Jiménez-López, M.D. (eds.) Bio-Inspired Models for Natural and Formal Languages, pp. 103–134. Cambridge Scholars Publishing, Newcastle upon Tyne (2011) 8. Loukanova, R.: Syntax-semantics interface for lexical inflection with the language of acyclic recursion. In: Bel-Enguix, G., Dahl, V., Jiménez-López, M.D. (eds.) Biology, Computation and Linguistics—New Interdisciplinary Paradigms. Frontiers in Artificial Intelligence and Applications, vol. 228, pp. 215–236. IOS Press, Amsterdam (2011). http://ebooks.iospress. nl/volumearticle/6487 9. Loukanova, R.: Algorithmic semantics of ambiguous modifiers by the type theory of acyclic recursion. In: IEEE/WIC/ACM International Conference on Web Intelligence and Intelligent Agent Technology, vol. 3, pp. 117–121. IEEE Computer Society, Los Alamitos (2012). http:// doi.ieeecomputersociety.org/10.1109/WI-IAT.2012.246 10. Loukanova, R.: Semantic Information with Type Theory of Acyclic Recursion. In: R. Huang, A.A. Ghorbani, G. Pasi, T. Yamaguchi, N.Y. Yen, B. Jin (eds.) Active Media Technology 8th International Conference, AMT 2012, Macau, China, December 4-7, 2012. Proceedings, Lecture Notes in Computer Science, vol. 7669, pp. 387–398. Springer (2012). URL https://doi. org/10.1007/978-3-642-35236-2_39 11. Loukanova, R.: Algorithmic granularity with constraints. In: Imamura, K., Usui, S., Shirao, T., Kasamatsu, T., Schwabe, L., Zhong, N. (eds.) Brain and Health Informatics. Lecture Notes in Computer Science, vol. 8211, pp. 399–408. Springer International Publishing, Berlin (2013). https://doi.org/10.1007/978-3-319-02753-1_40 12. Loukanova, R.: Algorithmic semantics for processing pronominal verbal phrases. In: Larsen, H.L., Martin-Bautista, M.J., Vila, M.A., Andreasen, T., Christiansen, H., (eds.) Flexible Query Answering Systems. Lecture Notes in Computer Science, vol. 8132, pp. 164–175. Springer, Berlin (2013). https://doi.org/10.1007/978-3-642-40769-7_15 13. Loukanova, R.: A Predicative operator and underspecification by the type theory of acyclic recursion. In: Duchier, D., Parmentier, Y. (eds.) Constraint Solving and Language Processing. Lecture Notes in Computer Science, vol. 8114, pp. 108–132. Springer, Berlin (2013). https:// doi.org/10.1007/978-3-642-41578-4_7 14. Loukanova, R.: Relationships between specified and underspecified quantification by the theory of acyclic recursion. ADCAIJ: Adv. Distrib. Comput. Artif. Intell. J. 5(4), 19–42 (2016). https:// doi.org/10.14201/ADCAIJ2016541942

48

R. Loukanova

15. Loukanova, R.: Computational syntax-semantics interface with type-theory of acyclic recursion for underspecified semantics. In: Osswald, R., Retoré, C., Sutton, P. (eds.) In: Proceedings of the Workshop IWCS 2019 Workshop on Computing Semantics with Types, Frames and Related Structures, pp. 37–48. The Association for Computational Linguistics (ACL) (2019). https:// www.aclweb.org/anthology/W19-1005 16. Loukanova, R.: Gamma-Reduction in Type Theory of Acyclic Recursion. Fundam. Inform. 170(4), 367–411 (2019). https://doi.org/10.3233/FI-2019-1867 17. Loukanova, R.: Gamma-star canonical forms in the type-theory of acyclic algorithms. In: van den Herik, J., Rocha, A.P. (eds.) Agents and Artificial Intelligence, pp. 383–407. Springer International Publishing, Cham (2019). https://doi.org/10.1007/978-3-030-05453-3_18 18. Moschovakis, Y.N.: The formal language of recursion. J. Symb. Log.54(04), 1216–1252 (1989). https://doi.org/10.1017/S0022481200041086 19. Moschovakis, Y.N.: Sense and denotation as algorithm and value. In: Oikkonen, J., Väänänen J. (eds.) Logic Colloquium ’90: ASL Summer Meeting in Helsinki. Lecture Notes in Logic, vol. 2, pp. 210–249. Springer, Berlin (1993). https://projecteuclid.org/euclid.lnl/1235423715 20. Moschovakis, Y.N.: The logic of functional recursion. In: Dalla Chiara, M.L., Doets, K., Mundici, D., van Benthem, J. (eds.) Logic and Scientific Methods, vol. 259, pp. 179–207. Springer, Dordrecht (1997). https://doi.org/10.1007/978-94-017-0487-8_10 21. Moschovakis, Y.N.: A logical calculus of meaning and synonymy. Linguist. Philos. 29(1), 27–89 (2006). https://doi.org/10.1007/s10988-005-6920-7 22. Moschovakis, Y.N.: Abstract recursion and intrinsic complexity. Lecture Notes in Logic, vol. 45. Cambridge University Press, Cambridge (2019) 23. Squire, L., Kandel, E.: Memory: From Mind to Molecules. Roberts & Co. (2009) 24. Thomason, R.H. (ed.).: Formal Philosophy: Selected Papers of Richard Montague. Yale University Press, New Haven (1974)

Chapter 2

Refining Algebraic Hierarchy in Mathematical Repository of Mizar Adam Grabowski, Artur Korniłowicz and Christoph Schwarzweller

Abstract Mathematics, especially algebra, uses plenty of structures: groups, rings, integral domains, fields, vector spaces to name a few of the most basic ones. Classes of structures are closely connected—usually by inclusion—naturally leading to hierarchies that has been reproduced in different forms in different mathematical repositories. We give a brief overview of some existing algebraic hierarchies and report on the latest developments in the Mizar computerized proof assistant system. In particular we present a detailed algebraic hierarchy that has been defined in Mizar and discuss extensions of the hierarchy towards more involved domains, using internal mechanisms available in the system.

2.1 Introduction Since its development at the beginning of the twentieth century abstract algebra has spread over to various branches of mathematics. One reason is the highly reusable results produced, not least due to the hierarchical structure of algebraic domains. This kind of reuse, of course, is also highly desirable in mathematical proof assistants. Consequently one naturally finds various systems in which algebraic hierarchies similar to abstract algebra have been constructed. However, most of them served to facilitate the formalization of a particular theorem or a particular application.

A. Grabowski (B) · A. Korniłowicz Institute of Informatics, University of Białystok, ul. Ciołkowskiego 1 M, 15-245 Białystok, Poland e-mail: [email protected] A. Korniłowicz e-mail: [email protected] C. Schwarzweller Department of Computer Science, University of Gda´nsk, ul. Wita Stwosza 57, 80-952 Gda´nsk, Poland e-mail: [email protected] © Springer Nature Switzerland AG 2020 A. Grabowski et al. (eds.), AI Aspects in Reasoning, Languages, and Computation, Studies in Computational Intelligence 889, https://doi.org/10.1007/978-3-030-41425-2_2

49

50

A. Grabowski et al.

Though not in a proof assistant, but in a computer algebra system the first—to the best of our knowledge—algebraic hierarchy was constructed in Axiom [26]. Started back in 1978—the first release under the name Axiom took place in 1991—this was the first system in which types were connected to mathematical domains: algebraic domains have types in their own right—called categories—that can be used to form hierarchies. So, for example, it is possible to define an operation Fraction that takes an argument of type IntegralDomain and returns its field of fractions. The algebraic hierarchy of Nuprl [25] was developed to support computational abstract algebra. In Coq [10] more than one algebraic hierarchy exists, we name two of them: the first one [12] was constructed as part of the FTA project to prove the fundamental theorem of algebra, another one was used in the formalization of the Feit-Thompson Theorem [13]. In the HOL/Isabelle Archive of Formal Proofs [24] one finds a number of proof libraries devoted to algebraic domains. In ACL2 [1] an algebraic hierarchy has been built in order to support reasoning about Common Lisp programs [23]. The Mizar system [5, 19, 32] provides a methodology to model algebraic domains based on attributed types [4]. Using so-called cluster registrations one can express (and prove) logical implications between attributes, in this way extending subtyping of attributed types. This allows not only to model algebraic domains in a generic way, but also to draw connections between—also already existing—algebraic domains. We claim that this approach is suitable to develop algebraic hierarchies that (a) are generic in the sense that notations and theorems introduced in a class of algebraic domains are automatically available in subclasses; (b) are easily extensible by both algebraic domains and additional notations; (c) can automate a great deal of the natural switching between algebraic domains mathematicians are used to; and (d) are highly convenient for open repositories with lots of authors. To support this claim we present in Sect. 2.2 a detailed hierarchy of rings up to fields, containing such algebraic domains such as unique factorization domains (UFDs), principal ideal domains (PIDs), and others, first focusing on Mizar structures. The presentation will be continued with adjectives and clusters in Sect. 2.4 after the short introduction of how some formal language constructions are implemented in Sect. 2.3. Section 2.5 shows how homomorphisms can be incorporated into this hierarchy and how properties of homomorphisms can be used to automatically infer properties about the underlying algebraic domains. In Sect. 2.6, we discuss how to extend the hierarchy towards more involved domains such as polynomial rings and ordered fields. At the end we draw some conclusions and remarks for future.

2.2 Building Hierarchy of Algebraic Structures In the Mizar library [6], algebraic domains are built based on structure definitions giving the signature—carriers and operations—of the domain. Informally, a ring is understood as an algebraic structure consisting of a set of elements equipped with

2 Refining Algebraic Hierarchy in Mathematical Repository of Mizar

51

binary operations + and · satisfying three sets of axioms. More formally, usually this leads to understanding mathematical structures as ordered tuples, and in the case of a ring we have R, +, ·. This could make potential troubles if we try to define rings through simpler notions, namely groups, which are usually G, +

or

G, ·

(in additive or multiplicative notation, respectively). Of course then, ordinary concatenation of tuples does not work properly. In the Mizar system, structures were implemented as partial functions with the syntax as below. struct (Predecessor_List) Structure_Name (# selector_1 -> type_1, selector_2 -> type_2, ... selector_n -> type_n #);

This could lead to the tree, or rather a forest of 157 structures, as there are primitive structures other than 1-sorted. However, as multiple predecessors are allowed, we should look at the diagram of interconnections as at a net. A part of such structure, dealing with basic algebraic signatures, is shown at Fig. 2.1. So, for example, the central item in this hierarchy is the result of merging [14] of additive and multiplicative notation expressed by definition struct (addLoopStr, multLoopStr_0) doubleLoopStr (# carrier -> set, addF -> BinOp of the carrier, multF -> BinOp of the carrier, OneF -> Element of the carrier ZeroF -> Element of the carrier #); end;

which gives the signature of rings and fields (another one construction of this kind is ModuleStr over F which gives raise to the theory of vector spaces). Note that doubleLoopStr inherits from both addLoopStr and multLoopStr_0, that is it joins the signatures of additive and multiplicative groups. Particular properties such as commutativity or the existence of inverse elements are described by attribute definitions [37]. As a consequence, attributes defined for these become available and need not to be stated again. For some reason, multiplicative notation is much more

52

A. Grabowski et al. 1-sorted

multMagma

multLoopStr

OneStr

ZeroStr

ZeroOneStr

multLoopStr_0

TopStruct

addMagma

addLoopStr

TopaddGrStr

RightModStr over F

doubleLoopStr

ModuleStr over F

BiModStr over F

AlgebraStr over F

Fig. 2.1 Net of basic algebraic structures in the Mizar Mathematical Library

frequently used in the Mizar repository (and popular theorems, as Lagrange theorem, are stated for multiplicative groups, not additive loops), and it seems that there is a need of generic mechanism which allows the user, without unnecessary repetitions, to obtain needed fact in his preferred form.

2.3 Implementation of Adjectives and Registrations Adjectives are widely used in mathematics—they describe properties of nouns which are connected with. Just to list a few popular adjectives, we can mention empty set, increasing function, Abelian group, small category, etc. Some adjectives can be grouped—e.g. non empty finite set, some properties of objects presented as adjectives are consequences of other properties described by other adjectives—e.g. infinite set is always non empty set. So, this is not very surprising, as the Mizar language tries to reflect mathematical vernacular, adjectives are also widely used in Mizar texts. In this section we present how to introduce new adjectives, how to make them processed efficiently by the Mizar verifier, but also present some restrictions in usage of adjectives.

2 Refining Algebraic Hierarchy in Mathematical Repository of Mizar

53

2.3.1 Defining Attributes In the Mizar system adjectives are instantiations of attributes (or, in other words, attributes are constructors of adjectives). Attributes can be defined using standard definitional blocks with the following syntax: definition let x1 be θ1 , x2 be θ2 , . . . , xn be θn ; attr xn is α means :ident: (x1 , x2 , . . . , xn ); end; It is important that the subject of the attribute should be the last locus in the list of all loci (xn in the example). Otherwise, there would be unused loci in the definition with the error number 100 (“Unused locus”). It is also possible to define attributes with so-called visible arguments: definition let x1 be θ1 , x2 be θ2 , . . . , xn be θn ; attr xn is x1 x2 . . . xn−1 α means :ident: (x1 , x2 , . . . , xn ); end; They allow to introduce notions like n-dimensional space or, using the list of arguments, m,n-sized matrix. Also in this case, the subject of the attribute must be the last locus in the list of all loci.

2.3.2 Clustering Adjectives with Nouns When an attribute is defined, one can write formulas like {} is empty or f is one-to-one, where f is a function. Such formulas are called adjective formulas. But things get a little bit more complicated, if one wants to write formulas of the form ex f being one-to-one Function st f is onto; or NAT is infinite set; that is formulas where adjectives occur with nouns.

54

A. Grabowski et al.

2.3.3 Existential Registration In the above case, an appropriate cluster must be registered using the following syntax: registration let x1 be θ1 , x2 be θ2 , . . . , xn be θn ; cluster α1 . . . αm for θ ; existence proof thus ex a being θ st a is α1 . . . αm ; end; end; Such an existential registration registers the existence of an object of the type θ equipped with adjectives listed in α1 . . . αm what allows to use types like α1 . . . αm θ. At this point we would like to underline the word for between the list of adjectives α1 . . . αm and the θ in the registration. Assume that the θ consists of some adjectives itself, let say β1 , β2 . The for separates adjectives β1 , β2 of the already existing type θ from the list of adjectives which existence is being proved. In such cases, in older versions of the Mizar language the θ had to be surrounded by parentheses (). Observe that for is used also to denote a general quantifier. Older versions of the Mizar system required parentheses around types not only within existential registrations, but also in other contexts when adjectives where used with types. Let us consider a situation when an attribute α is defined for a type θα (the subject of α must be of the type θα ). Next, let us assume that θα is the type βθβ , where adjective β is defined for θβ , and θβ is the type γ θγ , where adjective γ is defined for θγ . Now, several questions about the correctness of some types can be asked: (a) whether the type αβγ θγ is correct or not (of course taking into account the correctness with respect to the Mizar system); (b) whether the type βαγ θγ is correct or not; (c) whether the type γβαθγ is correct or not. Of course, there are other permutations of adjectives α, β, and γ to be asked for, but the three mentioned above illustrate the problem. Answers to both questions (b) and (c) are negative—neither βαγ θγ nor γβαθγ is correct. The answer to the question (a) depends. In recent versions of the Mizar system the answer is positive, but in older ones was negative. In older versions the type αβγ θγ had to be written with additional parentheses, that is α(β(γ θγ )). The key point in this discussion is the algorithm of identification of notions. Roughly speaking, in the case of adjectives, before an adjective is identified, first comes the identification of the type to which the adjective is added. It should be pointed out, that the order of adjectives used in a formula is important.

2 Refining Algebraic Hierarchy in Mathematical Repository of Mizar

55

2.3.4 Conditional Registration Probably the most important construction for building all the hierarchy of algebraic structures [18] is called the conditional registration and follows the syntax: registration let x1 be θ1 , x2 be θ2 , . . . , xn be θn ; cluster α1 . . . αm − > αm+1 . . . αm+1+k for θ ; coherence proof thus for a being θ st a is α1 . . . αm holds a is αm+1 . . . αm+1+k ; end; end; It means that if the object of the type θ satisfies the assumptions expressed in the form of adjectives α1 , . . . , αm , then also αm+1 , . . . , αm+1+k can be deduced. In the proof of correctness (coherence) the appropriate theorem should be proven. A specific case of this construction is that sometimes adjectives α1 , . . . , αm can be deduced just from the type of θ. It was useful if we expand already existing types with the new adjective. Numerous examples will be given in Sect. 2.4. registration let x1 be θ1 , x2 be θ2 , . . . , xn be θn ; cluster − > α1 . . . αm for θ ; coherence proof thus for a being θ holds a is α1 . . . αm ; end; end; This allows for expanding already established notions with the newly implemented ones [27].

2.3.5 Functorial Registration Usually we use a functor, of which certain properties have to be proven. In order to automatically adjoin them to the type of the functor, we can apply the following construction: registration let x1 be θ1 , x2 be θ2 , . . . , xn be θn ; cluster τ (x1 , x2 , . . . , xn ) − > α1 . . . αm ; coherence

56

A. Grabowski et al.

proof thus τ (x1 , x2 , . . . , xn ) is α1 . . . αm ; end; end; There are cases if we want to force the type of the functor (τ (x1 , . . . , xn )) to be θ, and after that the cluster of attributes α1 , . . . , αm should be added. Then the syntax gets a bit different: registration let x1 be θ1 , x2 be θ2 , . . . , xn be θn ; cluster τ (x1 , x2 , . . . , xn ) − > α1 . . . αm for θ ; coherence proof thus for a being θ st a = τ (x1 , x2 , . . . , xn ) holds a is α1 . . . αm ; end; end; At this point we can use the so-called aggregate, i.e. in the role of the functor we could use e.g. concrete instantiation of the specific structure for fixed values of selectors. One of the examples could be defining the ring of integer numbers in Sect. 2.4. As always, there is a need for the proof behind the automatization.

2.3.6 Synonyms and Antonyms Additionally, authors can introduce the so-called expandable modes as a kind of macro replacing the cluster of attributes; sometimes just to make the notation shorter, in some situations in order to keep the well-established name. Other method to introduce attributes supported by the Mizar language are synonyms and antonyms to keep formal repository as close to various human presentations as it is possible. For example, in one of the articles dealing with Z-modules [11], we introduced the following: notation let GF be Ring; let V be Abelian add-associative right_zeroed right_complementable vector-distributive scalar-distributive scalar-associative scalar-unital non empty ModuleStr over GF; synonym Submodules V for Subspaces V; end;

The notion of a subspace of a vector space was defined in a pretty general setting; we wanted to have the possibility of the appropriate naming in the case of modules.

2 Refining Algebraic Hierarchy in Mathematical Repository of Mizar

57

2.4 Enriching Structures with Attributes A ring is now just a doubleLoopStr with the appropriate collection of attributes: definition mode Ring is Abelian add-associative right_zeroed right_complementable associative well-unital distributive non empty doubleLoopStr; end;

Observe that because the Axiom of Choice is hardcoded in the Mizar checker, the collection of attributes clustered in the above definition of type should be shown to exist for at least one object; otherwise (with the illustrative example of infinite empty set) this should be contradictory. This is called the paradigm of non-emptiness of types in Mizar. One can find a kind of irregularity in the above definition: the associativity property expressed by the adjective add-associative is symmetric, but zeroed and complementable occur in right hand side versions only, i.e. definition let IT be addLoopStr; attr IT is right_zeroed means :: RLVECT_1:def 4 for v being Element of IT holds v + 0.IT = v; end;

A kind of the justification can be found in ALGSTR_1: registration cluster add-associative right_zeroed right_complementable -> left_zeroed Loop-like for non empty addLoopStr; end;

We attach a summary of statistical results in Table 2.1. As structures which have the addition operation associative, have the right zero and the right complement defined for all elements, have also left zero, the latter adjective could be just avoided. It is attached automatically after the inclusion of the ALGSTR_1 to registrations directive. The impact is huge: the canonical collection which appears in the definition of Ring is reused many times, partially also just for overuse of copy-and-paste technique. On the other hand, once we get the set of assumptions, it is relatively hard to avoid some of them, even if the proof could go without them. The lemmas should be formulated only under necessary assumptions, which could lead for the use of longer sets of adjectives instead of informative Field or Ring. The abbreviations NOO and NOF stand for the number of occurrences, and the number of files, respectively. The extremal case is the existence of a left complement, which is explicitly used only 27 times in 4 articles or the existence of left

58

A. Grabowski et al.

Table 2.1 The number of occurrences of certain adjectives No. Adjective name NOO

NOF

1. 2. 3. 4. 5. 6. 7.

right_complementable left_complementable right_zeroed left_zeroed Abelian add-associative commutative

2537 27 2705 191 1519 2628 2323

161 4 162 21 148 163 168

zero element—191 times in 21 articles. Standard adjectives, as add-associativity, the existence of right complement or the commutativity property appears approximately 2.5 thousand times in over 160 articles. More interesting are different subclasses of rings that form a hierarchy according to their additional properties, e.g. rings ⊇ commutative rings ⊇ integral domains ⊇ ⊇ GC D domains ⊇ U F Ds ⊇ P I Ds ⊇ ⊇ Euclidean domains ⊇ f ields to mention the most common ones. Practically all the objects from this collection was implemented in the Mizar Mathematical Library, with the exception of UFD, which is still under development. This challenge is summarized in Fig. 2.2. Each such subclass is easily characterized by adding an attribute describing its defining property, for example definition let L be non empty doubleLoopStr; attr L is PID means for I being Ideal of L holds I is principal; end;

Note that the definition does not use integral domains—in fact not even rings, but just their signature. The property of an ideal being principal just not relies on other properties such as commutativity or the absence of zero divisors (at least when defining the property; later on more properties may be necessary to show that this one is fulfilled in a particular domain, like in the paper of Schwarzweller [39]). The above hierarchy can now be established by observing that one defining property implies another—just like in mathematical textbooks:

2 Refining Algebraic Hierarchy in Mathematical Repository of Mizar

Fig. 2.2 Diagram illustrating stepwise refinement of the hierarchy of types

59

60

A. Grabowski et al. registration cluster Euclidean -> PID for comRing; end;

This way of defining the hierarchy has two major advantages. Firstly, a proof of the implication has to be given. This may be obvious, but we like to emphasize at this point, that proofs are an indispensable part of a repository. Note also, that the registration is about commutative rings, not about integral domains. Analogous to the definition of the attribute PID this points out, that Euclid’s property implies that every ideal of the ring is principal even in presence of zero divisors—although both domains are usually defined as integral domains with the appropriate additional property. Secondly, and more important here, cluster registrations extend automation of proving in Mizar, that is after the above registration the theorem like theorem for R being Euclidean domRing holds R is PID domRing;

becomes obvious. Here domRing denotes integral domain, where in the attribute domRing-like the commutativity is not taken into account. Such granularity allows for better reuse of knowledge. As a secondary consequence all notations— definitions, predicates and also theorems—established for the subclass now are available for the superclass, too. In practice, this means that notations are generic: there is no need to define, for example, greatest common divisors in Euclidean domains. They can be already introduced in GCD domains [22] and are therefore available in Euclidean domains, once Euclidean domains have been incorporated into the hierarchy. The proofs necessary to built the above-mentioned hierarchy of rings have been carried out in a number of Mizar articles [2, 30, 33, 38]. Together they establish an environment in which arguing about different kinds of rings—and switching between them—can be performed in a way very similar to the usual mathematical processing. The summary of the stepwise refining of such environment can be seen in the form of the diagram (Fig. 2.2). First of all, the hierarchy can easily be extended when necessary or convenient: for example Noetherian rings are integral domains (rings) in which every ideal is finitely generated. Thus every PID is a Noetherian ring. The corresponding part of the hierarchy looks as follows: definition let L be non empty doubleLoopStr; attr L is Noetherian means for I being Ideal of L holds I is finitely_generated; end;

2 Refining Algebraic Hierarchy in Mathematical Repository of Mizar

61

An this is an ideal place for the use of the conditional registration of a cluster. registration cluster PID -> Noetherian for non empty doubleLoopStr; end;

Furthermore, concrete domains such as the ring of integers or the field of real numbers can be integrated in a straightforward way: a concrete domain is an instance of an abstract domain and can be introduced by just defining its concrete carriers and operations. The ring of integers, for example, is then given by definition func INT.Ring -> doubleLoopStr equals doubleLoopStr (# INT, addint, multint, In(1,INT), In(0,INT) #); end;

and the constructions In(1,INT) and In(0,INT) force the analyser to get the type of numerals of zero and one as elements of the set of all integer numbers INT, that is, elements of the carrier of the structure under consideration. Next, the following registrations then show that INT.Ring is both an integral and a Euclidean domain, hence connect INT.Ring with the hierarchy. registration cluster INT.Ring -> non degenerated add-associative right_zeroed right_complementable distributive commutative associative Abelian domRing-like; end;

registration cluster INT.Ring -> Euclidean; end;

With these registrations all notations—definitions, predicates and theorems— established for the abstract domains become available for INT.Ring, too. Note that from this in particular follows—without any further proof, because this has been proven inside the hierarchy—that the ring of integers is both UFD and Noetherian, that is theorem INT.Ring is UFD domRing;

and

62

A. Grabowski et al. theorem INT.Ring is Noetherian domRing;

are obvious. Moreover, it even does not matter which domain—Noetherian rings or the ring of integers—is added to the hierarchy first. In both cases the above theorems are obvious for the Mizar checker. Note however that in order to make this automation working, it is convenient to have a bunch of useful examples of concrete mathematical structures (just to assure that at least one object with desired properties exists). At the end of this section it should be noted that the formal proof that UFDs are GCD domains has not been completed yet, but the formalization of the fundamental theorem of arithmetic gives a blueprint for the proof [29]. Taking into account, we do not include unique factorization domains in Fig. 2.2.

2.5 Ring Homomorphisms When working with algebraic domains (ring-) homomorphisms are indispensable. Therefore homomorphisms are an essential part of an algebraic hierarchy. Homomorphisms are essentially mappings between rings with additional properties, that hence can again be defined by adding attributes describing these properties: definition let R be Ring, S be R-homomorphic Ring; mode Homomorphism of R,S is additive multiplicative unity-preserving Function of R,S; end;

The attribute homomorphic for S is necessary here, because Mizar does not allow empty modes: for each pair of parameters R and S it has to be proved that there exists a homomorphism from R into S. Therefore the definition of homomorphisms can take into account only such rings S, for which such a homomorphism indeed exists. This is ensured by adding the attribute homomorphic, which has the ring R as a parameter: definition let R,S be Ring; attr S is R-homomorphic means ex f being Function of R,S st f is additive multiplicative unity-preserving; end;

Note that together with the hierarchy presented in Sect. 2.2 this definition provides homomorphisms for all kinds of rings up to fields. By the way, homomorphisms are functions preserving the unity and the zero, but the latter one can be deduced (and really is in this framework) automatically, hence it is not explicitly given in this

2 Refining Algebraic Hierarchy in Mathematical Repository of Mizar

63

collection of attributes. Therefore additional properties of homomorphisms for more advanced rings can now be easily incorporated, for example that homomorphisms between fields are actually monomorphisms: registration let F be Field, E be F-homomorphic Field; cluster -> monomorphism for Homomorphism of F,E; end;

The property of being monomorphic is then automatically added when later working with homomorphisms of fields. The same holds naturally for properties of the image of homomorphisms: registration let F be comRing, E be F-homomorphic Ring, f be Homomorphism of F,E; cluster Image f -> commutative; end;

says that the image of a commutative ring is a commutative ring. So there is no need to distinguish homomorphisms between different kind of rings. In fact—as the last registration shows—it is even sufficient to claim that the homomorphism’s codomain is an ordinary ring. For a small example illustrating these techniques consider now rings R and S and a homomorphism f : R −→ S. The first isomorphism theorem then states that R/(ker f ) ∼ = Image f . Quotient rings have been defined in [28]. The image of f is here understood as the subring of S with carrier range f , the operations of Image f are then just restrictions of the ones of S. This gives definition let R be Ring, S be R-homomorphic Ring, f be Homomorphism of R,S; func Image f -> Ring means the carrier of it = rng f & the addF of it = (the addF of S) || (rng f) & the multF of it = (the multF of S) || (rng f) & the OneF of it = 1.S & the ZeroF of it = 0.S; end;

Now the homomorphism h : R/(ker f ) −→ Image f given by [a] → f (a) for a ∈ R can easily be defined and shown to be bijective [30], so theorem for R being Ring, S being R-homomorphic Ring,

64

A. Grabowski et al. f being Homomorphism of R,S holds R / (ker f), Image f are_isomorphic;

Note that if R is a field we get that R/(ker f ) is a field also: If R is a field, so is Image f , and hence its isomorphic copy R/(ker f ). This argument can now be automated by observing that homomorphic images of fields are fields—as in the case of commutative rings from above—and reformulating the isomorphism theorem as a registration using the attribute isomorphic that is defined analogously to homomorphic. registration let F be Field, E be F-homomorphic Ring, f be Homomorphism of F,E; cluster Image f -> almost_left_invertible; end; registration let R be Ring, S be R-homomorphic Ring, f be Homomorphism of R,S; cluster R / (ker f) -> (Image f)-isomorphic; end;

These two registrations hence automate the argument above and therefore the following theorems are now obvious, that is are accepted by the Mizar checker without further proof. theorem for F being Field, R being F-homomorphic Ring, f being Homomorphism of F,R holds Image f is Field;

Equivalently, we can use also a notion of a quotient field. theorem for F being Field, R being F-homomorphic Ring, f being Homomorphism of F,R holds F/(ker f) is Field;

2.6 Extending the Hierarchy New domains are not always built solely by adding new properties, but may contain other (abstract) domains as parameters. The standard example here are vector spaces or modules that are built over a field or a ring, respectively. They, however, define new classes of algebraic domains.

2 Refining Algebraic Hierarchy in Mathematical Repository of Mizar

65

Although we focus in this work rather on extending the hierarchy of rings up to fields, not necessarily on modules, it should be noted that obviously as modules and vector spaces can use rings or fields as parameters, the extension we describe improves also this hierarchy. Furthermore, we revised hierarchy of Z-modules available in the repository of Mizar texts from the concrete to abstract approach (instead of using the set of all integer numbers as a parameter and then defining certain operation from scratch, we reused the ring of integers), completely eliminated a structure Z_ModuleStruct replacing it in all the places by ModuleStr over INT.Ring and removing over 5 thousand lines of unnecessary code [17] only in ten articles, but with wider impact on more than 150 Mizar articles.

2.6.1 Polynomial Rings More interesting are polynomial rings R[X ] realizing an operator within the class of rings. The standard definition of polynomial rings is well-known: polynomials over R are sequences over R or functions p : N −→ R, on which addition and multiplication are defined appropriately [31]: definition let R be Ring; func Polynom-Ring R -> non empty doubleLoopStr equals doubleLoopStr (# Polys R, addpoly R, multpoly R, 1_.R, 0_.R #); end;

Using registrations Polynom-Ring R can now be incorporated as usual into the hierarchy by showing that the carrier—the set of polynomials—fulfills the necessary properties, for example registration let R be Ring; cluster Polynom-Ring R -> add-associative right_zeroed right_complementable; end;

In fact it is not necessary for R to be a ring to prove each individual property— even when defining R[X ]. In this registration, for example, distributivity and that polynomial addition forms a group are sufficient [31]. However, the hierarchy is able to deal with more involved properties of R[X ] also. For example, if R is without zero divisors, so is R[X ], which is described by the following registration. registration let R be domRing; cluster Polynom-Ring R -> domRing-like; end;

66

A. Grabowski et al.

In this way additional properties of R[X ] are added depending on properties of R. When working with the hierarchy Mizar now automatically adds such properties to R[X ], if R fulfills the conditions of the registration. In fact, the parameter R can even be a field F—based on the hierarchy of Sect. 2.2 the Mizar checker infers that F is a ring, so the notation Polynom-Ring F exists and one can formulate registration let F be Field; cluster Polynom-Ring F -> Euclidean; end;

So we automatically get that F[X ] is a PID and that gcds for polynomials over a field exist. Note also that F_Real is the field of real numbers; therefore real polynomials are now just given by Polynom-Ring F_Real. In the context of polynomials another notation also becomes interesting: the notion of a subring—⊆ for short—giving relations such as Z ⊆ Q, Q ⊆ R or Z[X ] ⊆ R[X ]—and for polynomial rings one often reads R ⊆ R[X ] (compare Weintraub textbook [41]). Now, the notation of a subring is easily defined by definition let R be Ring; mode Subring of R -> Ring means the carrier of it c= the carrier of R & the addF of it = (the addF of R) || the carrier of it & the multF of it = (the multF of R) || the carrier of it & 1.it = 1.R & 0.it = 0.R; end;

Then theorems for the above relations can easily be shown, for example theorem INT.Ring is Subring of F_Real;

However, even if quite simple formulated for concrete real algebraic structures, we discovered pretty recently that there are at least two implementation of the ring of integers modulo 3: the first one, very old, in MOD_2, in terms of enumerating all cases: definition func Z_3 -> strict doubleLoopStr equals :: MOD_2:def 20 doubleLoopStr (# {0,1,2}, add3, mult3, unit3, zero3 #); end;

and the other, based on abstract properties, efficiently using property of Euclidean algorithm.

2 Refining Algebraic Hierarchy in Mathematical Repository of Mizar

67

definition let n be natural Number; func INT.Ring(n) -> doubleLoopStr equals :: INT_3:def 12 doubleLoopStr (# Segm(n), addint(n), multint(n), In (1,Segm(n)), In (0,Segm(n)) #); end;

Note the correspondence with the definition of INT.Ring shown in Sect. 2.4. It uses the von Neumann’s construction of natural numbers claimed in Mizar, that is, for every natural number n, we have: n = {0, 1, 2, . . . , n − 1}. Obviously 0 = ∅, and it is easy to see that both notions coincide. Independently, there is only one concrete application of the above definition of INT.Ring (n), namely for n = 2 (although, all needed abstract properties are proven). theorem Polynom-Ring INT.Ring is Subring of Polynom-Ring F_Real;

The property R ⊆ R[X ], however, cannot be shown; it is just not true: an element a ∈ R is not a polynomial, so the carrier of R is not included in the carrier of R[X ] as it contains sequences or functions, that is ordinary set inclusion between carriers does not work here. The solution is found in the literature [41]: We regard F ⊂ F[X ] by identifying the element a ∈ F with the constant polynomial a ∈ F[X ]. More precisely, the identification i : R −→ R[X ], a → a(x), is a monomorphism, and therefore allows to embed R into R[X ]. To formally reconstruct this identification in a repository one now has to construct a new ring R with the corresponding carrier (R[X ]\{ p ∈ R[X ] : p is constant}) ∪ R and adapted addition and multiplication. This is both tedious and technical, but, which is more important, R does not solve the problem, either. Though now one has R ⊆ R , of course, R is not exactly the polynomial ring R[X ] in the above sense, but only an isomorphic copy of it.

68

A. Grabowski et al.

Modifying the definition of subring in the sense that a ring R is a subring of R if R can be embedded into R —that would allow to prove that R is a subring of R[X ]—is too liberal: it destroys the simplicity and elegance of the subring notation. As a consequence in mathematical repositories this kind of using the definition of subring can be modelled only at the level of morphisms, e.g. via theorems such as theorem for R being Ring ex R’ being Ring st R c= R’ & R’,Polynom-Ring R are_isomorphic;

or, making type Subring more explicit: theorem for R being Ring ex R’ being Subring of Polynom-Ring R st R,R’ are_isomorphic;

2.6.2 Ordered Fields There are situations in which the extension of an algebraic domain can be realized in more than one way. The standard example here is the neutral element e, that is, for example added to semigroups in order to construct monoids. e can be introduced solely as an adjective in an attribute definition then claiming the existence of e—or as an additional part of the underlying structure then just claiming a ∗ e = a for all a in the carrier, where e is now the element given by the new part of the structure. Usually the second alternative is used here, because this allows for an equational definition of e’s properties. A similar situation occurs when the additional properties to be defined do not concern the domain at hand itself, but are described based on additional notations. A typical example are ordered domains, here the newly added properties concern a relation over the domain. A standard definition, for example, is: An ordered field is a pair (F, ≤), where F is a field and ≤ is a (total) relation being compatible with the field operations. So, ordered structures can be easily built using the second alternative from above by just adding an additional part for the relation to the underlying structure definition. definition struct (doubleLoopStr) ordereddoubleLoopStr (# carrier -> set, addF, multF -> BinOp of the carrier, OneF, ZeroF -> Element of the carrier, OrdF -> Order of the carrier #); end;

2 Refining Algebraic Hierarchy in Mathematical Repository of Mizar

69

Then, based on an attribute compatible_with describing compatibility of the order with the field operations, one defines the mode orderedField. This allows to formalize and prove theorems such as follows: theorem for F being orderedField holds 0.F set, Source, Target -> Function of the Edges, the Vertices #); end;

Observe the absence of an antecedent of this construction. Hence, there is no selector called carrier. However, soon after, the structure was incorporated into the hierarchy of those available in the MML, renaming the first selector Vertices in order to make ancestor/predecessor relation working—into carrier. Leaving Edges as the second name could be slightly confusing, so 2-sorted was introduced as a prefix structure ideally fitting this concrete situation. Another selector was called carrier’—not explaining too much, but still as general, as it could be. As it was no longer used, the name of the selector Vertices was reused as an identifier for a Mizar functor. definition struct (2-sorted) MultiGraphStruct (# carrier, carrier’ -> set, Source, Target -> Function of the carrier’, the carrier #); end;

where the carriers play a role of the set of vertices and edges. In order not to confuse the authors with names, leaving them with a puzzle of which one is the set of edges, two additional modes were added. definition let G be MultiGraphStruct; mode Vertex of G is Element of the carrier of G; mode Edge of G is Element of the carrier’ of G; end;

3 Extending Formal Topology in Mizar by Uniform Spaces

83

Apart from that, there is another representation of a graph: definition struct (1-sorted) SimpleGraphStruct (# carrier -> set, SEdges -> Subset of TWOELEMENTSETS (the carrier) #); end;

In this alternative approach, we deal with undirected edges, so we could use rather two-element subsets instead of functions. There are quite obvious limitations of both above approaches, namely if instead of working in a fixed graph, one wants to expand or restrict sets of vertices or edges retaining the original standpoint. The completely new view for graphs—which was intended to be more flexible—is just treating them as finite functions with a domain as a subset of the set of all natural numbers. The elements of the domain play the role of ordinary selectors for accessing the components of the structure. Even the namespace was a little bit conservative: definition mode GraphStruct is finite NAT-defined Function; end;

especially because Mizar structures are not used here at all. definition let G be GraphStruct; attr G is [Graph-like] means :: GLIB_000:def 10 VertexSelector in dom G & EdgeSelector in dom G & SourceSelector in dom G & TargetSelector in dom G & the_Vertices_of G is non empty set & the_Source_of G is Function of the_Edges_of G, the_Vertices_of G & the_Target_of G is Function of the_Edges_of G, the_Vertices_of G; end;

Following this path, the attribute defining graphs [Graph-like] can be formulated as above. We leave the decision on choosing their preferred approach to authors, shifting this development in order to be more accessible. Such decision was accepted, when the Library Committee of the Association of Mizar Users moved the first article in this series into the classical part of the library. GLIB_000 is now numbered 148. on this list, while STRUCT_0 is on the position number 326 (the original positions were 890 and second in Addenda list, respectively). The ordering of Mizar articles matters; as the database is created linearly, the list according to which it is done, not necessarily reflects the real timeline of the acceptance of submissions into the MML. The file mml.lar is contained in every Mizar distribution, which can be browsed under the address http://mizar.org/version/current/.

84

A. Grabowski and R. Coghetto

3.4.2 Selectors and Aggregates A structure definition contains a list of selectors to denote its fields, characterized by their name and type, e.g.: definition struct (1-sorted) multMagma (# carrier -> set, multF -> BinOp of the carrier #); end;

where multMagma is the name of a structure with two selectors: an arbitrary set called its carrier and a binary operation on it, called multF. This structure can be used to define a group, but also upper and lower semilattices, so in fact any notion that is based on a set and a binary operation on it. It should be noted that the above structure does not define a group yet (nor any other more concrete object), because there is no information available on the properties of multF. The structure is just a basis for developing a theory. In practice, after introducing a required structure, a series of attributes is also defined to describe the properties of certain fields. As mentioned before, the above multMagma structure can be used to define notions which are not only groups. Still, the operation in such structures inherit the name multF, because the current Mizar implementation does not provide a mechanism to introduce synonyms for selectors (or whole structures). Therefore, in cases when a different name is frequently used in standard mathematical practice, it may be better to introduce a different structure. For example, lattice operations are commonly called meet and join, so a lower semilattice may be better encoded as: definition struct (1-sorted) /\-SemiLattStr (# carrier -> set, L_meet -> BinOp of the carrier #); end;

Mizar supports multiple inheritance of structures that makes a whole hierarchy of interrelated structures available in the Mizar library, with the 1-sorted structure being the common ancestor of almost all other structures. For example, formalizing topological groups in Mizar can be done by independently defining and developing group theory and the theory of topological spaces, and then merging these two theories together based on a new structure, e.g.: definition struct (1-sorted) TopStruct (# carrier -> set, topology -> Subset-Family of the carrier #); end;

3 Extending Formal Topology in Mizar by Uniform Spaces

85

The mechanism of multiple inheritance of structures is supported in Mizar, and in mathematics it really shows its usefulness. definition struct (multMagma, TopStruct) TopGrStr (# carrier -> set, multF -> BinOp of the carrier, topology -> Subset-Family of the carrier #); end;

The advantage of this approach is that all notions and facts concerning groups and topological spaces are naturally applicable to topological groups. Let us note that when introducing a new structure, the inherited selectors can be listed in any order, as far as relations between them are preserved. The list of names of ancestor structures is put in brackets before the name of the structure being defined. Figure 3.1 shows only the part of the net of all over 150 structures defined in MML which are used for formalizing topology: we can find there topological groups, topological relational structures, or real linear spaces equipped with a topology, just to mention a few important ones. The structure TopStruct is in the middle as the most important one, and together with RelStr crucial in the formalization of CCL [3]. The right hand side of the diagram was recently developed and used extensively by the authors; it is useful both for alternative formal approach to topological spaces which which will be shown in Sect. 3.7 and an important starting point for the theory of uniform spaces given by the second author. The left hand side of Fig. 3.1 is devoted to algebraic structures, but they are needed for merging with topologies in order to obtain some useful examples of real topologies.

1-sorted

ZeroStr

addLoopStr

addMagma

TopStruct

TopaddGrStr

RLSStruct

RLTopStruct

Fig. 3.1 The net of topological structures in MML

multMagma

TopGrStr

RelStr

TopRelStr

86

A. Grabowski and R. Coghetto

Concrete mathematical objects, e.g. the additive group of integers are introduced with so called aggregates—special term constructors defined automatically by the definition of a structure, e.g.: multMagma(#INT,addint#), where INT is the set of integers, and addint represents the addition function. It is necessary that all terms used in the aggregate have the respective types declared in the structure’s definition. In our example INT is obviously a set, and addint must be of type BinOp of INT. In the case of topologies, things get a bit more complicated as types needed as the second selector in a structure TopStruct could be not obtained from scratch. If we want to consider relatively simple examples, as discrete or anti-discrete topological spaces, we should probably cope with casting functions, or some auxiliary functors. If we will try to define an example of the latter, anti-discrete space (that is, the only open sets are the empty set and the whole universe), we should start with something quite useful: definition let D be set; func cobool D -> Subset-Family of D equals :: TEX_1:def 2 {{},D}; end;

This is nearly trivial, but on the other hand the Mizar type checker does not know (without any additional typing) that it is a family of subsets of D. If we write functorial registration of a cluster, stating that this returns always non empty set, as follows: registration let D be set; cluster cobool D -> non empty; end;

we can use cobool D as an example of concrete family of subsets, for a given universe. Then the rest is straightforward and such defined object can serve as a proper indiscrete topological space (that cobool D satisfies properties of a topology, is nearly trivial due as the automatization of the boolean operations works). definition let D be set; func ADTS (D) -> TopStruct equals :: TEX_1:def 3 TopStruct (# D, cobool D #); end;

All needed adjectives can be added automatically via cluster registration mechanism. registration let D be set; cluster ADTS (D) -> strict anti-discrete TopSpace-like; end;

3 Extending Formal Topology in Mizar by Uniform Spaces

87

Potentially, instead of ADTS D, we can use the aforementioned aggregate construction, just as TopStruct (# D, cobool D #). The functor however is just shorter and easier to use. Every structure defines implicitly a special attribute, strict. The corresponding adjective’s meaning is that an object of a structure type contains nothing more, but the fields defined for that structure. For example, a term with structural type based on TopGrStr may be strict TopGrStr, but it is neither strict multMagma, nor strict TopStruct. Clearly, every term constructed using a structure’s aggregate is strict. Finally, the Mizar language has means to restrict a given term with a complex structure type to its well-defined subtype. This special term constructor, the forgetful functor also utilizes the structure’s name, e.g. the multMagma of G, where G has a potentially wider type which inherits the multMagma structure. Again, such terms are strict, with respect to the given structure type. The (part of) hierarchy of algebraic structures deliver only a signature for corresponding algebras; the real semantics is given by axioms. In Mizar formalism, axioms are defined as adjectives (called also attributes). The details of the algebraic hierarchy in the Mizar Mathematical Library are presented in Chap. 2 of this volume, which is an extension of the joint work of the first author [20].

3.5 Topology Formalized In this section we will describe the existing current definition of topological spaces within MML. Following Engelking [7], we can choose open sets as the basic notion and so it was decided to be the base in the MML: we have a structure of a topological space together with the only adjective of which name suggests its technical character. We can originally choose between point-free topology and that with points; in MML we deal with the earlier approach. Obviously, the backbone corresponding structure is TopStruct as explained in Sect. 3.4.

3.5.1 Basic Notions Similarly as in the algebraic case, structures can be understood as partial functions on the selectors (in the abovementioned example, the carrier which is a set on which a topology can be defined, and the topology, i.e. the family of open sets). But the real properties of the topology (both ∅ and the whole universe should be open; the family should be closed for finite intersections and arbitrary unions) is given by the Mizar attribute which is in fact an adjective (TopSpace-like).

88

A. Grabowski and R. Coghetto definition let IT be TopStruct; attr IT is TopSpace-like means :: PRE_TOPC:def 1 the carrier of IT in the topology of IT & (for a being Subset-Family of IT st a c= the topology of IT holds union a in the topology of IT) & for a,b being Subset of IT st a in the topology of IT & b in the topology of IT holds a /\ b in the topology of IT; end;

Making appropriate hierarchy for well-established notions is really crucial for the repository of formal texts; if we are interested only in pure predicates and computergenerated proofs, readability is something which does not really matters (and this is the case of the part of Isabelle’s Archive of Formal Proofs [4] devoted to software verification), however from a viewpoint of reusability of adjectives, when large databases are involved, this is a question of efficiency. As a simple nontrivial example, we can mention the net of cross-linked properties of rough approximation operators under various conditions as reflexivity, symmetry, transitivity—as canonical examples, but also with seriality, positive and negative alliance as less straightforward ones. We can see that essentially the whole series of Mizar articles dealing with topology uses more or less the type defined as the structure with the single adjective as described in this section—the Mizar mode TopSpace is not very convenient starting point for further generalizations. One can notice that we do not need in the abovementioned definition the assumption that the empty set is an element of the topology: the union of ∅ is just ∅, and the thesis is trivial as any topology is closed under arbitrary unions. Bourbakists define topological spaces just  by means of finite intersections and arbitrary unions, but one the other hand the set ∅ is not well-defined in ZermeloFraenkel set theory. We can see a topological operator either from the view of Mizar functors, as it can be recognized now as a base; as they are typed, we can read that the closure of an arbitrary subset of given topological space T is again the subset of T . But alternatively, we can use another way around: first we can define a function which returns the closure for arbitrary argument. Of course, one should define for such a map the domain and the range properly; in our specific case this could be a (total) function defined on the boolean of the carrier of T . Among various approaches to topological spaces the two are especially important: the first one deals with the family of subsets of a given universe possessing certain properties; the other deals with closure operators in sense of Kuratowski. definition let T be TopStruct, P be Subset of T; attr P is open means :: PRE_TOPC:def 2 P in the topology of T; end;

3 Extending Formal Topology in Mizar by Uniform Spaces

89

It should be noted however, that in the original approach claimed in the MML, the starting point was not the closure operator, but rather topological axioms defining family of open sets.

3.5.2 The Closure Operator Closed sets are precisely those, of which complements are open; similarly the closure of given subset A can be defined just as the minimal closed set containing A. definition let GX be TopStruct, A be Subset of GX; func Cl A -> Subset of GX means :: PRE_TOPC:def 7 for p being set st p in the carrier of GX holds p in it iff for G being Subset of GX st G is open holds p in G implies A meets G; end;

Of course, the above is definitely not the only possible definition—we can define the closure as the intersection of all closed supersets of A, but the obvious and important connection between the closures and closed sets is that closed subsets are fixed points with respect to the closure operators. In the Mizar formalism, the predicate A meets G means exactly A ∩ G = ∅. Hence we can formulate and prove the following characterization of the closure and closed sets. theorem :: PRE_TOPC:22 for A being Subset of T holds (A is closed implies Cl A = A) & (T is TopSpace-like & Cl A = A implies A is closed);

As a consequence, the above theorem can be considered as an equivalent definition of a closed set as the fixed point under closure operator; this will be explained from another viewpoint (and reused) later. It is worth to note that the assumption TopSpace-like is needed only to prove the right-to-left implication, as the opposite can be proven directly from the definition of closed set and of the closure (such formulation is a bit stronger than the form of equivalence as the assumptions are weaker).

90

A. Grabowski and R. Coghetto

3.5.3 Introducing Uniformity Even if topological space on the Euclidean plane was thoroughly explored during the construction of the formal proof of the Jordan Curve Theorem (simple closed curve was just a certain subset of such space), various formal models of metric spaces were constructed in order to follow fundamental textbooks in analysis. We can mention here the outline of the formalization of the common generalization of topological groups and metric spaces. Uniform spaces, which are credited to Weil [37] and more systematic formal approach—to the group of Bourbakists (which is quite nice coincidence as the Mizar project implements main postulates of formalization of mathematics which were fundamental to Bourbaki group), appeared to be a useful framework explaining the concept of rough sets in terms of both equivalence and tolerance relations. Formally, uniform spaces are based on Mizar structures definition struct (1-sorted) UniformSpaceStr (# carrier -> set, entourages -> Subset-Family of [:the carrier, the carrier:] #); end;

where French entourages means surroundings. The real topological flavour of these quite general constructions is given by defining an open subset O of X if and only if for every x ∈ O there exists an entourage Vx such that Vx is a subset of O. For more details of fundamental systems of entourages treated formally, we refer to [5, 6] containing thorough encoding of the theory—almost seven thousand lines of code, i.e. about 90 pages of formal definitions, theorems, and proofs.

3.5.4 Axiomatization of Uniform Spaces Uniform spaces are sets with a uniform structure (called also uniformity) —a collection of subsets U ⊆ X × X defined as follows: 1. If U ∈ , then  ⊆ U, where  is the diagonal of X . 2. If U ∈ , then U −1 ∈  (where U −1 is the converse relation of U ). 3. If U ∈ , then there exists V ∈  such that V ◦ V ⊆ U (where V ◦ V denotes the composition of binary relation V with itself). 4. If U ∈  and U ⊆ V ⊆ X × X, then V ∈ . 5. If U ∈  and V ∈ , then U ∩ V ∈ . The following formal version of the above can be presented: definition let US be UniformSpaceStr; attr US is axiom_U1 means

3 Extending Formal Topology in Mizar by Uniform Spaces

91

:: UNIFORM2:def 9 for S being Element of the entourages of US holds id the carrier of US c= S; end;

The diagonal mentioned in the first axiom is just the identity relation, where binary relations are defined as subsets of the Cartesian square of the given set. definition let US be UniformSpaceStr; attr US is axiom_U2 means :: UNIFORM2:def 10 for S being Element of the entourages of US holds S[˜] in the entourages of US; end;

Here, potentially the original converse relation from the MML could be used, we wanted however to obtain proper typing, hence the use of synonymous notation [˜]. definition let US be UniformSpaceStr; attr US is axiom_U3 means :: UNIFORM2:def 11 for S being Element of the entourages of US holds ex W being Element of the entourages of US st W [*] W c= S; end;

The connections of the first two axioms with the reflexivity and symmetry of the notion of “closeness” is quite clear. Also the last one has clear topological interpretation. The attributes axiom_UP1, axiom_UP2, and axiom_UP3 describe analogous properties to that of U1, U2, and U3, but not in terms of spaces, but surroundings. Following these lines, rho can be defined exactly as ρ from Sect. 3.3. definition let X be set, R be Relation of X; func rho(R) -> non empty Subset-Family of [:X,X:] equals :: UNIFORM3:def 20 {S where S is Subset of [:X,X:] : R c= S}; end;

The next three theorems shows the connections of the considered axioms with well-known properties of binary relations. This will be crucial for the theory of rough sets. theorem :: UNIFORM3:45 for R being total reflexive Relation of X holds rho(R) is axiom_UP1;

92

A. Grabowski and R. Coghetto theorem :: UNIFORM3:46 for R being symmetric Relation of X holds rho(R) is axiom_UP2; theorem :: UNIFORM3:47 for R being total transitive Relation of X holds rho(R) is axiom_UP3;

The essential notion is the uniformity induced by the general binary relation: definition let X be set, R be Relation of X; func uniformity_induced_by(R) -> upper cap-closed strict UniformSpaceStr equals :: UNIFORM3:def 21 UniformSpaceStr (# X, rho(R) #); end;

with rho defined above. Adding underlying properties to a binary relation, it turns out that we obtain axioms defining basic classes of (semi-)uniform spaces. The full connection between theory of uniform spaces and rough sets is expressed in two important corollaries: definition let X be set, R be Tolerance of X; redefine func uniformity_induced_by(R) -> strict Semi-UniformSpace; end;

The essence is that the functor defined in the definition 21 could serve as an example of semi-uniform spaces and uniform spaces. It can be expressed either as a registration of a cluster, redefinition, or simply a theorem. theorem :: UNIFORM3:51 for X being set, R being Equivalence_Relation of X holds uniformity_induced_by(R) is UniformSpace;

The difference between Semi-UniformSpace and UniformSpace is in the application of axiom_U3. Even if usually uniform spaces are meant to be topological spaces equipped with additional information (reflecting metric part), this extension is absent in the above definition. This time we presented purely topological properties in terms of Mizar adjectives (instead of fixed topology we use appropriate notions in terms of entourages). The surroundings occurred here have clear topological flavour, as they are just neighbourhoods.

3 Extending Formal Topology in Mizar by Uniform Spaces

93

3.6 The Issue of Equivalent Characterizations In mathematics we often experience the situation when we have equivalent sets of axioms for the same mathematical object. The motivation of using them both in the same time can be quite rich: either the approaches were developed in as sense independently, without knowing each other, and after that they were proved to be equivalent definitions of the same notion, or just the newly proposed set is preferred because of its simplicity or usefulness. Such considerations are especially often in lattice theory, where we deal with the fixed set of operations (as the supremum, the infimum and the complementation). The situation gets slightly more complicated if the collections of operations are distinct. Of course, the canonical example here is delivered again in the world of lattices, where we have, among the ordinary binary operations and (or, to be more precise, instead of them at first) the ordering relation ≤. In this case, the original idea to show the correspondence was to define two Mizar functors transforming posets into lattices [14, 21], and vice versa. When we consider things informally, it is enough to have such construction; but then, we cannot be in these two universes in the same time and we have to choose only a single framework to work with (and redefine construction really supports such approach). Some time ago, as a part of the aforementioned formalization of the Jordan Curve Theorem, we did similar work: essentially we have shown that the notion of an open set defined for subset of the set of real numbers coincides with that of an open set in the natural topology of the real line. Of course, having basic properties proven in both settings is important, but soon we should face the problem of how much theory to be developed in parallel.

3.6.1 Finite Formal Topological Spaces As an interesting direction of research in the area of topology [10] we can point out the beginnings of the so-called theory of finite topological spaces as defined by Imura and Eguchi [25]. Based on relational structures, the authors define new operator which is just the set of all elements of the universe which are in the internal relation with the given point. definition let FT be RelStr; let x be Element of FT; func U_FT x -> Subset of FT equals :: FIN_TOPO:def 1 Class (the InternalRel of FT,x); end;

The Mizar functor Class meant originally the class of abstraction w.r.t. the given equivalence relation. In the process of generalizing notions all underlying attributes

94

A. Grabowski and R. Coghetto

were removed from the assumptions of this definition, but the name remains the same. One of the basic properties of neighbourhoods states that any point should be a member of its neighbourhood. Although the above definition does not need any additional assumptions, now we have to add a variant of reflexivity of the relational structure, with the new synonymical name, filled. Of course, having just a new name for the old notion does not bring too much additional information; but now we can express the reflexivity in terms of neighbourhoods. definition let IT be non empty RelStr; redefine attr IT is filled means :: FIN_TOPO:def 4 for x being Element of IT holds x in U_FT x; end;

The original submissions to the Mizar Mathematical Library, in the form unchanged during revisions of the library, are available under the address http://alioth.uwb.edu.pl/~mml/originals/, and this is also reflected in the published paper in Formalized Mathematics journal. Tracing back to the original stored there (dated on 1992), we can note that the original point of view was to treat finite formal topological spaces as pairs of the form X, f , where f is a function from X into 2 X , called a neighbourhood map. Then for arbitrary x which is an element of such formal topological space, U (x) is just the value f (x). Such an approach can be treated just as abundance of notions from topological viewpoint, but not as such from the starting point of rough sets. Here the use of such mapping is quite natural [9]. Figure 3.2 shows how the hierarchy of structures connected with topology can be expanded. Of course, TopStruct is still near the center, with its descendant RLTopStruct. All algebraic part was omitted, and there are finite formal topological spaces on the left hand side, and brand new structures dealing with abstract topological operators in the middle. On the right hand side there is, at the moment not fully incorporated into the net of structures, UniformSpaceStr.

1-sorted

FMT_Space_Str

2ndOpStr

TwoOpStruct

1stOpStr

2TopStruct

Fig. 3.2 The net of new topological structures in MML

TopStruct

1TopStruct

UniformSpaceStr

3 Extending Formal Topology in Mizar by Uniform Spaces

95

3.6.2 Relational Operators The basic topological definitions like the interior or the closure, called Ai and Ab in this formalism, recall the well-known notions of rough approximations from Sect. 3.3. definition let FT be non empty RelStr; let A be Subset of FT; func Aˆi -> Subset of FT equals :: FIN_TOPO:def 8 {x:U_FT x c= A}; end;

The upper index “i” stands for “interior”; dually, “b” can be recognized as the abbreviation of “boundary”. definition let FT be non empty RelStr; let A be Subset of FT; func Aˆb -> Subset of FT equals :: FIN_TOPO:def 9 {x:U_FT x meets A}; end;

In the above definitions, F T is just a non empty relational structure, but the next in the series of articles devoted to such formal topologies, with MML identifier FINTOPO2 [29], recalls such structure once more: definition struct (1-sorted) FMT_Space_Str (# carrier -> set, BNbd -> Function of the carrier, bool bool the carrier #); end;

This time, BNbd returns for arbitrary element of the carrier, a subset of the carrier. The new functor U_FMT corresponds with the earlier U_FT. In terms of FMT_Space_Str, the interior of the subset A is just definition let FMT,A; func AˆFoi -> Subset of FMT equals :: FINTOPO2:def 11 {x:ex V st V in U_FMT x & V c= A}; end;

Open (and similarly closed) subsets can be defined as fixpoints with respect to such operation. The series started with [25] is not really exhaustive and, frankly, the first article in this series remained practically unused for eight years, but the connections with other areas of mathematics are obvious.

96

A. Grabowski and R. Coghetto

3.7 Attribute Splitting The first step in our proposed approach was to have the new naming scheme. We decided to use again a postfix -like to suggest that if a family of subsets satisfies the conjunction of properties, it can be treated as the family of open sets (i.e. it is a topology). definition let X be set; let F be Subset-Family of X; attr F is topology-like means {} in F & X in F & F is union-closed cap-closed; end;

Later, such adjectives were meant to be replaced by more self-explaining names. But in fact, the first conjunct is just the negation of already present in MML with_non-empty_elements, and the second one can be named as with_universe or something similar. Observe that there are two main differences between the definition from Sect. 3.5 (TopSpace-like) and the current one. The first one is that the latter is on the concrete level, i.e. it does not use the notion of the structure. Of course, it is easy to lift such definition to the abstract (i.e. structural) level: one can define appropriate field to have such properties. The second difference is that the old one is the conjunction of three instead of four adjectives, as one of them can be deduced from the combination of remaining ones and in this sense the approach proposed here is similar to the one developed in the case of σ -fields ˇ of subsets. In such a manner, we deal with Cech preclosure and Kuratowski closure operators, respectively. definition let X be set, O be Function of bool X, bool X; attr O is preclosure means O is extensive \/-preserving empty-preserving; end; definition let X be set, O be Function of bool X, bool X; attr O is closure means O is extensive idempotent \/-preserving empty-preserving; end;

The crucial issue here is about the structure on which we can establish the connection between closed sets and fixed points w.r.t. maps. We decided not to use concrete relational structures, but we introduced new structures, 1TopStruct which are ancestors of topological structures enriched by maps on X , i.e. functions from the set 2 X into itself.

3 Extending Formal Topology in Mizar by Uniform Spaces

97

theorem :: ROUGHS_4:2 for T being with_properly_defined_topology 1TopStruct, A being Subset of T holds A is op-closed iff A is closed;

Under such defined attributes, showing that if the operator satisfies the properties of preclosure, it generates an abstract topological space. registration cluster with_preclosure -> TopSpace-like for with_properly_defined_topology 1TopStruct; end;

The question of defining the family of open sets (i.e. the most usual definition of topology) might arise; the answer is immediate—as the family of fixed points under the closure operator. So the topology is collected from these objects which are subsets of the considered universe which are f-closed, where f stands for the map under consideration (an abstract closure operator). definition let X be set, f be Function of bool X, bool X; func GenTop f -> Subset-Family of X means :: ROUGHS_4:def 25 for x being object holds x in it iff ex S being Subset of X st S = x & S is f-closed; end;

In fact, this is another formulation of the property expressed by the attribute with_properly_defined_topology. theorem :: ROUGHS_4:5 for X being set, f being Function of bool X, bool X st f is preinterior holds GenTop f is topology-like;

Obviously then, if map f has the properties of preinterior, then generated family of sets satisfies ordinary properties of topology. registration let C be set, I be (Relation of C), f be topology-like Subset-Family of C; cluster TopRelStr (#C,I,f#) -> TopSpace-like; end;

Finally, composing the above theorem and functor registration, we deduce that if the map which occurs as the selector in the merged structure satisfies the properties of a preclosure (expressed by attribute topology-like), the result of this merging

98

A. Grabowski and R. Coghetto

has all the desired properties of topological spaces, as defined in PRE_TOPC (see Sect. 3.5). Relational part of the object is represented above as I , which is a binary relation defined on a set C. An important example of the reuse of such structure is given in the next section. We wanted to make certain assumptions on the aforementioned relational part I , which finally could be an equivalence relation defined on C, hence generating the partition of the universe.

3.8 Merging Topologies and Rough Sets The notion of a rough set was defined by Pawlak [32] to reflect the situation of an incomplete knowledge about the universe of objects. We formalized the notion in Mizar [11] and pretty recently observed that this is almost identical to the approach described in Sect. 3.6. Any element of the universe can be viewed through a binary relation which can unify potentially distinct objects if the available information about their properties is the same. Such relation, called indiscernibility relation, can possess basic mathematical properties of relations: if we assume R to be reflexive, symmetric, and transitive (so it is an equivalence relation), we have the original approach of Pawlak. definition let A be non empty RelStr; let X be Subset of A; func LAp X -> Subset of A equals :: ROUGHS_1:def 4 { x where x is Element of A : Class (the InternalRel of A, x)c= X}; end;

The comparison of this formalized definition of LAp X with the aforementioned quoted in Sect. 3.6, we can see that we do not assume anything additional about the relational structure. As the definition is formulated at the most general level, we are not obliged to add them later. Obviously, if they will be needed to prove some characteristic properties of approximations, we will do it. The functor Class is introduced for arbitrary binary relations as a generalization of the class of abstraction for equivalences. Dually, we can define the upper approximation UAp X, but only based on the earlier, we can proceed. definition let T be non empty TopRelStr; attr T is naturally_generated means :: ROUGHS_4:def 28 the topology of T = GenTop LAp T; end;

Essentially then, the family of open sets under consideration is precisely given by lower approximations with respect to the indiscernibility relation—the relational

3 Extending Formal Topology in Mizar by Uniform Spaces

99

ingredient of T . Having said that, we can conclude that in such spaces the subsets are topologically closed if and only if they are equal to their upper approximations. theorem :: ROUGHS_4:10 for T being naturally_generated non empty with_equivalence TopRelStr, A being Subset of T holds A is closed iff UAp A = A;

As both notions coincide (the upper approximation operator in rough sets and closure operator in underlying topological spaces and similarly in the dual case), reusing these areas of mathematics we have obtained concrete results: the characterization of rough sets in terms of Isomichi classification of domains, and the view for rough sets from the viewpoint of Kuratowski closure-complement problem (known also as fourteen sets of Kuratowski) [11]. We will mention here a variant of this question, namely the mixture of the closure and the interior operators, which in extremal case gives at most seven sets. As you can conclude from Fig. 3.3 (arrows denote inclusions between subsets), seven is only a very rough upper bound as we have the following equalities true in all rough tolerance spaces: UAp LAp UAp A = UAp A LAp UAp LAp A = LAp A For rough approximation spaces, i.e. if the indiscernibility relation is an equivalence relation, we have even more:

Fig. 3.3 The diagram of seven combinations of lower and upper approximations

LAp A

LAp UAp LAp A

UAp LAp A

A

UAp LAp UAp A

UAp A

LAp UAp A

100

A. Grabowski and R. Coghetto theorem :: ROUGHS_1:34 LAp LAp X = UAp LAp X;

Both terms are equal to LAp X and the diagram gets really simpler. It shows its full richness only if we try to study—in a spirit of reverse mathematics—which properties of the indiscernibility relation should be assumed in order to have characteristic properties of rough approximation operators. registration let T be with_equivalence naturally_generated non empty TopRelStr, A be Subset of T; cluster Cl A -> open; end;

Formally, as it can be seen from the above functorial registration of a cluster, we proved that the closure of every set is open, hence in the case of equivalence-based approximation spaces with naturally generated topology we obtain an extremally disconnected topological space. As such characteristic properties of rough approximations we can list [39] either UAp U = U or LAp X ⊆ X, called co-normality, and contraction, respectively (U is just the universe considered equal to the carrier of an approximation space, and the latter should hold for X —an arbitrary subset of this space). For example, there is also a property which expresses that the lower approximation operator is multiplicative, i.e. for arbitrary subsets X, Y ⊆ U LAp X ∩ LAp Y = LAp (X ∩ Y ), which is true for arbitrary relational structures, without any additional assumptions. On the other hand, we can deal with reflexivity, symmetry, and transitivity of the binary relation, which is nearly canonical now, but also with serial, mediate, positive alliance or negative alliance relations, which seem to be slightly less known. As always, we can be skeptical about defining the mathematical object as one of the fields in the structure: it could be well illustrated based on the notion of the complementation operator in the lattice structure. On the one hand, it is really natural to have it as a separate field, as it was in case of ortholattices. When it is just a part of the signature of language, it reflects the ordinary mathematical definition [19]. registration let T be naturally_generated non empty with_equivalence TopRelStr, A be Subset of T; cluster UAp A -> closed; end;

3 Extending Formal Topology in Mizar by Uniform Spaces

101

In such a situation, the registration of an identification shows its usefulness. registration let T be with_equivalence naturally_generated non empty TopRelStr; let A be Subset of T; identify Cl A with UAp A; end;

As the identification is not implemented as symmetric in the current version of the Mizar verifier [27] (the matching is only in one direction), we had to provide two copies of the above registration, the other in the opposite direction. The construction was introduced for the first time in the verifier version 7.11.01 in order to provide the matching between terms on the left hand side of the with keyword with the term on the right hand side. Here, the simplified syntax was applied, as within the newly introduced TopRelStr both notions are semantically available (i.e., the types of variables allow to do that). This is not necessarily the general case: one of the illustrating examples could be the lattice of all natural numbers ordered by the divisibility relation, where we want to identify lattice-theoretical notions (defined in the abstract part of the MML) and the classical least common multiple lcm for natural numbers. Of course, an important part of the proper understanding of notions is the correct construction the environment for a Mizar article to properly handle all the interconnections [31]. registration let p, q be Element of Nat_Lattice; let m, n be Nat; identify p "\/" q with m lcm n when p = m, q = n; end;

Registering the identification of Cl A and UAp A would allow for mixed use of the lower approximation instead of interior operator and vice versa, without any explicit reference for the equality. The only drawback of this approach is that to obtain pure context of uniform space (i.e. strict topological space or strict tolerance approximation space), we have to use Mizar forgetful functor the. The above unification of the world of topological spaces and of rough sets allowed us to fully benefit from the results placed in the area of general topology, previously obtained: we can easily observe the connection of approximation spaces with the classification of domains proposed by Isomichi or the problems of Kuratowski sets, giving the combination of closure, interior, and complementation operators [13], without explicit reference to those theories.

102

A. Grabowski and R. Coghetto

3.9 Conclusion and Future Work We tried to show how theoretically straightforward examples can lead to difficult problems during their translation from informal presentation in natural human language into formalism of the Mizar language, a variant of mathematical vernacular. Based on the example of topological spaces we could observe that even if the approach is given in a not satisfactory way, it can be corrected in a process of the so-called revision of the repository of formal texts [22]. The part of the work could be less problematic—the splitting of the original definition as we proposed and automatic replacement of the references into new ones. The level of generality is obviously higher in our approach, so we hope to open some new paths in the formalization of general topology, especially in more abstract form. The second part, which could be done gradually and with the possible use of automatic tools, is that this proposed new version should be consumed in the MML— the theorems and definitions which can be formalized in the more general way, should be formulated so. This would also enable reusing purely topological constructions in another areas of mathematics—for example, fourteen Kuratowski sets can be expressed in the language of group theory and abstract maps with accompanying properties. This also opened the way for explaining rough sets in topological terms and will not be restricted for the Mizar library only, as the translation from the Mizar formalism into other formal languages are available [24]. Additionally, we hope to unify the existing approach with newly developed theory of uniform spaces. Furthermore, we want to include in our common root the presentation of finite formal topological spaces, with its further possible use in the theory of computer image analysis. In the informal form of a mathematical publication written by people in natural language, such process could (and eventually led in real life, as it was in the world of rough sets) to the sequence of papers generalizing the approach gradually. Hence it is also a kind of a problem for repository storing the knowledge. In our case, the Mizar Mathematical Library allows for some automatic enhancements. We removed repetitions, compressed the files, and cleared the path to improve the overall algebraic framework available in the Mizar Mathematical Library. The library could be tested independently for its correctness by popular theorem provers [35]. Also the experiments with the new tools for proof reconstruction via lemma or common blocks extraction are quite dynamic recently [33]. The use of external SAT solvers is also a promising field of research [30]. Although natural language is rather flexible, we believe that formal counterpart benefits from the relative coherence of the existing approaches.

3 Extending Formal Topology in Mizar by Uniform Spaces

103

References 1. Bancerek, G., Byli´nski, C., Grabowski, A., Korniłowicz, A., Matuszewski, R., Naumowicz, A., P¸ak, K., Urban, J.: Mizar: State-of-the-art and beyond. In: Kerber, M., Carette, J., Kaliszyk, C., Rabe, F., Sorge, V. (eds.) Intelligent Computer Mathematics – International Conference, CICM 2015, Washington, DC, USA, July 13–17, 2015. Proceedings. Lecture Notes in Computer Science, vol. 9150, pp. 261–279. Springer (2015). https://doi.org/10.1007/978-3-319-206158_17 2. Bancerek, G., Byli´nski, C., Grabowski, A., Korniłowicz, A., Matuszewski, R., Naumowicz, A., P¸ak, K.: The role of the Mizar Mathematical Library for interactive proof development in Mizar. J. Autom. Reason. 61(1), 9–32 (2018). https://doi.org/10.1007/s10817-017-9440-6 3. Bancerek, G., Rudnicki, P.: A Compendium of Continuous Lattices in Mizar (formalizing recent mathematics). J. Autom. Reason. 29(3/4), 189–224 (2002). https://doi.org/10.1023/A: 1021966832558 4. Blanchette, J., Haslbeck, M., Matichuk, D., Nipkow, T.: Mining the Archive of Formal Proofs. In: Kerber, M. (ed.) Conference on Intelligent Computer Mathematics (CICM 2015). Lecture Notes in Computer Science, vol. 9150, pp. 3–17, Springer (2015). https://doi.org/10.1007/9783-319-20615-8_1 5. Coghetto, R.: Quasi-uniform space. Form. Math. 24(3), 205–214 (2016). https://doi.org/10. 1515/forma-2016-0017 6. Coghetto, R.: Uniform space. Form. Math. 24(3), 215–226 (2016). https://doi.org/10.1515/ forma-2016-0018 7. Engelking, R.: General Topology, Monografie Matematyczne, vol. 60. PWN—Polish Scientific Publishers, Warsaw (1977) 8. Gierz, G., Hofmann, K., Keimel, K., Lawson, J., Mislove, M., Scott, D.: A Compendium of Continuous Lattices. Springer, Berlin (1980) 9. Gomoli´nska, A.: A comparative study of some generalized rough approximations. Fundam. Inform. 51, 103–119 (2002) 10. Grabowski, A.: Solving two problems in general topology via types. In: Filliâtre, J., PaulinMohring, C., Werner., B. (eds.) Types for Proofs and Programs, International Workshop, TYPES 2004, Jouy-en-Josas, France, December 15–18, 2004. Revised Selected Papers. Lecture Notes in Computer Science, vol. 3839, pp. 138–153 (2004). Springer. https://doi.org/10. 1007/11617990_9 11. Grabowski, A.: On the computer-assisted reasoning about rough sets. In: Dunin-K¸eplicz, B., Jankowski, A., Skowron, A., Szczuka., M. (eds.) International Workshop on Monitoring, Security, and Rescue Techniques in Multiagent Systems Location. Advances in Soft Computing, vol. 28, pp. 215–226. Springer, Berlin (2005). https://doi.org/10.1007/3-540-323708_15 12. Grabowski, A.: Automated discovery of properties of rough sets. Fundam. Inform. 128(1–2), 65–79 (2013). https://doi.org/10.3233/FI-2013-933 13. Grabowski, A.: Efficient rough set theory merging. Fundam. Inform. 135(4), 371–385 (2014). https://doi.org/10.3233/FI-2014-1129 14. Grabowski, A.: Mechanizing complemented lattices within Mizar type system. J. Autom. Reason. 55(3), 211–221 (2015). https://doi.org/10.1007/s10817-015-9333-5 15. Grabowski, A.: Lattice theory for rough sets—a case study with Mizar. Fundam. Inform. 147(2–3), 223–240 (2016). https://doi.org/10.3233/FI-2016-1406 16. Grabowski, A.: Computer certification of generalized rough sets based on relations. In: ´ ezak, D., Zielosko, B. (eds.) Polkowski, L., Yao, Y., Artiemjew, P., Ciucci, D., Liu, D., Sl¸ Rough Sets, International Joint Conference on Rough Sets, IJCRS 2017. Lecture Notes in Artificial Intelligence, vol. 10313, pp. 83–94. Springer (2017). https://doi.org/10.1007/978-3319-60837-2_7 17. Grabowski, A., Coghetto, R.: Topological structures as a tool for formal modelling of rough sets. In: Ganzha, M., Maciaszek, L.A., Paprzycki, M. (eds.) Position Papers of the 2017 Federated

104

18. 19.

20.

21.

22.

23. 24.

25. 26.

27. 28.

29. 30.

31.

32. 33. 34.

35.

A. Grabowski and R. Coghetto Conference on Computer Science and Information Systems. Annals of Computer Science and Information Systems, vol. 12, pp. 11–18. IEEE (2017). https://doi.org/10.15439/2017F553 Grabowski, A., Korniłowicz, A., Naumowicz, A.: Four decades of Mizar. J. Autom. Reason. 55(3), 191–198 (2015). https://doi.org/10.1007/s10817-015-9345-1 Grabowski, A., Korniłowicz, A., Schwarzweller, C.: Equality in computer proof-assistants. In: Ganzha, M., Maciaszek, L.A., Paprzycki, M. (eds.) Proceedings of the 2015 Federated Conference on Computer Science and Information Systems. Annals of Computer Science and Information Systems, vol. 5, pp. 45–54. IEEE (2015). https://doi.org/10.15439/2015F229 Grabowski, A., Korniłowicz, A., Schwarzweller, C.: On algebraic hierarchies in mathematical repository of Mizar. In: Ganzha, M., Maciaszek, L.A., Paprzycki, M. (eds.) Proceedings of the 2016 Federated Conference on Computer Science and Information Systems. Annals of Computer Science and Information Systems, vol. 8, pp. 363–371. IEEE (2016). https://doi. org/10.15439/2016F520 Grabowski, A., Moschner, M.: Managing heterogeneous theories within a mathematical knowledge repository. In: Asperti, A., Bancerek, G., Trybulec, A. (eds.) Mathematical Knowledge Management, Third International Conference, MKM 2004, Bialowieza, Poland, September 19– 21, 2004. Proceedings. Lecture Notes in Computer Science, vol. 3119, pp. 116–129. Springer (2004). https://doi.org/10.1007/978-3-540-27818-4_9 Grabowski, A., Schwarzweller, C.: Revisions as an essential tool to maintain mathematical repositories. In: Kauers, M., Kerber, M., Miner, R., Windsteiger, W. (eds.) Towards Mechanized Mathematical Assistants, 6th International Conference, MKM 2007, Calculemus 2007. Lecture Notes in Computer Science, vol. 4573, pp. 235–249. Springer, Berlin (2007). https://doi.org/ 10.1007/978-3-540-73086-6_20 Hammer, P.C.: Extended topology: the continuity concept. Math. Mag. 36(2), 101–105 (1963) Iancu, M., Kohlhase, M., Rabe, F., Urban, J.: The Mizar Mathematical Library in OMDoc: Translation and applications. J. Autom. Reason. 50(2), 191–202 (2013). https://doi.org/10. 1007/s10817-012-9271-4 Imura, H., Eguchi, M.: Finite topological spaces. Form. Math. 3(2), 189–193 (1992) Järvinen, J.: Lattice theory for rough sets. In: Transactions on Rough Sets VI. Lecture Notes in Computer Science (LNAI), vol. 4374, pp. 400–498 (2007). https://doi.org/10.1007/978-3540-71200-8_22 Korniłowicz, A.: Definitional expansions in Mizar. J. Autom. Reason. 55(3), 257–268 (2015). https://doi.org/10.1007/s10817-015-9331-7 Lee, G., Rudnicki, P.: Alternative aggregates in Mizar. In: Kauers, M., Kerber, M., Miner, R., Windsteiger, W. (eds.) Towards Mechanized Mathematical Assistants, MKM 2007, Calculemus 2007. Lecture Notes in Computer Science, vol. 4573, pp. 327–341. Springer (2007). https://doi.org/10.1007/978-3-540-73086-6_26 Liu, G., Fuwa, Y., Eguchi, M.: Formal topological spaces. Form. Math. 9(3), 537–543 (2001) Naumowicz, A.: Automating Boolean set operations in Mizar proof checking with the aid of an external SAT solver. J. Autom. Reason. 55(3), 285–294 (2015). https://doi.org/10.1007/ s10817-015-9332-6 Naumowicz, A.: Tools for MML environment analysis. In: Kerber, M., Carette, J., Kaliszyk, C., Rabe, F., Sorge, V. (eds.) Intelligent Computer Mathematics – International Conference, CICM 2015, Washington, DC, USA, July 13–17, 2015, Proceedings. Lecture Notes in Computer Science, vol. 9150, pp. 348–352. Springer (2015). https://doi.org/10.1007/978-3-319-206158_26 Pawlak, Z.: Rough sets. Int. J. Parallel Program. 11, 341–356 (1982) P¸ak, K.: Improving legibility of formal proofs based on the close reference principle is NP-hard. J. Autom. Reason. 55(3), 295–306 (2015). https://doi.org/10.1007/s10817-015-9337-1 Trybulec, A., Korniłowicz, A., Naumowicz, A., Kuperberg, K.: Formal mathematics for mathematicians. J. Autom. Reason. 50(2), 119–121 (2013). https://doi.org/10.1007/s10817-0129268-z Urban, J., Rudnicki, P., Sutcliffe, G.: ATP and presentation service for Mizar formalizations. J. Autom. Reason. 50(2), 229–241 (2013). https://doi.org/10.1007/s10817-012-9269-y

3 Extending Formal Topology in Mizar by Uniform Spaces

105

36. Vlach, M.: Topologies of approximation spaces of rough set theory. In: Huynh, V.N., Nakamori, Y., Ono, Y., Lawry, J., Kreinovich, V., Nguyen, H.T. (eds.) Interval/Probabilistic Uncertainty and Non-Classical Logics. Advances in Soft Computing, vol. 46, pp. 176–186. Springer (2008). https://doi.org/10.1007/978-3-540-77664-2_14 37. Weil, A.: Sur les espaces a structure uniforme et sur la topologie generale. Actuar. Sci. India 551, Paris (1937) 38. Yao, Y., Yao, B.: Covering based rough set approximations. Inf. Sci. 200, 91–107 (2012). https://doi.org/10.1016/j.ins.2012.02.065 39. Zhu, W.: Generalized rough sets based on relations. Inf. Sci. 177(22), 4997–5011 (2007). https://doi.org/10.1016/j.ins.2007.05.037