The fundamental principle of identity for strings is informally given as follows.

Similar documents
This is already grossly inconvenient in present formalisms. Why do we want to make this convenient? GENERAL GOALS

Lecture 5 - Axiomatic semantics

3.7 Denotational Semantics

Lecture 4. First order logic is a formal notation for mathematics which involves:

Chapter Seven: Regular Expressions

Propositional Logic Formal Syntax and Semantics. Computability and Logic

Formal Syntax and Semantics of Programming Languages

Introduction to Automata Theory. BİL405 - Automata Theory and Formal Languages 1

Hoare Logic: Proving Programs Correct

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/27

Software Properties as Axioms and Theorems

1.3. Conditional expressions To express case distinctions like

The Invariant Problem for Binary String Structures and the Parallel Complexity Theory of Queries

Computation Club: Gödel s theorem

Formal Syntax and Semantics of Programming Languages

Hoare Logic. COMP2600 Formal Methods for Software Engineering. Rajeev Goré

Lecture Note: Types. 1 Introduction 2. 2 Simple Types 3. 3 Type Soundness 6. 4 Recursive Types Subtyping 17

Non-Standard Models of Arithmetic

Chapter 6. Curves and Surfaces. 6.1 Graphs as Surfaces

DSAS Laboratory no 4. Laboratory 4. Logic forms

Handout 9: Imperative Programs and State

CMSC 330: Organization of Programming Languages. Formal Semantics of a Prog. Lang. Specifying Syntax, Semantics

Typed Lambda Calculus

5200/7200 Fall 2007 Concurrence theorems for triangles

Mathematics and Statistics, Part A: Graph Theory Revision Exercises: Sheet 3

Foundations of Computer Science Spring Mathematical Preliminaries

Hw 4 Due Feb 22. D(fg) x y z (

Formal Calculi of Fuzzy Relations

Exercises on Semantics of Programming Languages

What if current foundations of mathematics are inconsistent? Vladimir Voevodsky September 25, 2010

Regular Expressions. Chapter 6

if s has property P and c char, then c s has property P.

Operational Semantics

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages

Database Theory VU , SS Codd s Theorem. Reinhard Pichler

CMPSCI 250: Introduction to Computation. Lecture #28: Regular Expressions and Languages David Mix Barrington 2 April 2014

Typed Lambda Calculus for Syntacticians

Lecture 3: Constructing the Natural Numbers

Lectures 20, 21: Axiomatic Semantics

Three-Dimensional Coordinate Systems

Baby Steps Toward an Implementation of Axiomatic Language

3. According to universal addressing, what is the address of vertex d? 4. According to universal addressing, what is the address of vertex f?

Propositional Logic. Part I

Lecture 6,

Intro to semantics; Small-step semantics Lecture 1 Tuesday, January 29, 2013

Natural Numbers. We will use natural numbers to illustrate several ideas that will apply to Haskell data types in general.

Towards a Logical Reconstruction of Relational Database Theory

Revision Problems for Examination 2 in Algebra 1

Embedding a graph-like continuum in some surface

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Sections p.

Recursive Functions. Recursive functions are built up from basic functions by some operations.

Math 5593 Linear Programming Lecture Notes

Formal Semantics of Programming Languages

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur

POLYHEDRAL GEOMETRY. Convex functions and sets. Mathematical Programming Niels Lauritzen Recall that a subset C R n is convex if

Lecture 12: Cleaning up CFGs and Chomsky Normal

CAS 701 Presentation. Ackermann's Function. Qinglei Zhang, Nov. 20, 2008.

Context-Free Languages & Grammars (CFLs & CFGs) Reading: Chapter 5

Math Introduction to Advanced Mathematics

Glynda, the good witch of the North

Formal Semantics of Programming Languages

Semantics with Applications 3. More on Operational Semantics

Slides for Faculty Oxford University Press All rights reserved.

Introduction to the Lambda Calculus

Ambiguous Grammars and Compactification

Programming Languages Third Edition

Syntax Analysis. Martin Sulzmann. Martin Sulzmann Syntax Analysis 1 / 38

Lecture 5: Formation Tree and Parsing Algorithm

Introduction to the λ-calculus

Topic 1: What is HoTT and why?

Fundamental Concepts. Chapter 1

Deductive Methods in Computer Science

Functional Programming

The Inverse of a Schema Mapping

Lecture 1: Conjunctive Queries

Specification and Verification I

From Types to Sets in Isabelle/HOL

Principles of AI Planning. Principles of AI Planning. 7.1 How to obtain a heuristic. 7.2 Relaxed planning tasks. 7.1 How to obtain a heuristic

Foundations of Schema Mapping Management

The Rule of Constancy(Derived Frame Rule)

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 4 MODULE, SPRING SEMESTER MATHEMATICAL FOUNDATIONS OF PROGRAMMING ANSWERS

Regular Expressions. A Language for Specifying Languages. Thursday, September 20, 2007 Reading: Stoughton 3.1

ROUGH MEMBERSHIP FUNCTIONS: A TOOL FOR REASONING WITH UNCERTAINTY

15-819M: Data, Code, Decisions

Unit 4 Relational Algebra (Using SQL DML Syntax): Data Manipulation Language For Relations Zvi M. Kedem 1

Automated Reasoning PROLOG and Automated Reasoning 13.4 Further Issues in Automated Reasoning 13.5 Epilogue and References 13.

Module 6. Knowledge Representation and Logic (First Order Logic) Version 2 CSE IIT, Kharagpur

Proving the Correctness of Distributed Algorithms using TLA

Vector Calculus: Understanding the Cross Product

Lecture 5: Duality Theory

Warm-Up Problem. Let L be the language consisting of as constant symbols, as a function symbol and as a predicate symbol. Give an interpretation where

Unit-IV Boolean Algebra

Local Specialization in Open-Axiom

Pure Lambda Calculus. Lecture 17

Automata & languages. A primer on the Theory of Computation. The imitation game (2014) Benedict Cumberbatch Alan Turing ( ) Laurent Vanbever

This book is licensed under a Creative Commons Attribution 3.0 License

Computer Science Technical Report

X'=Y',. X=Y..., X'=O (1) THE USE OP METASYSTEM TRANSITION IN THEOREM PROVING AND PROGRAM OPTIMIZATION

Lecture Orientations, Directed Cuts and Submodular Flows

CS5371 Theory of Computation. Lecture 8: Automata Theory VI (PDA, PDA = CFG)

Transcription:

A4 Theories of strings 1. General Ideas About Strings and String Addition...2 2. A Mostly Formal Theory of Finite Strings...3 3. A Formal Theory of Finite Strings...4 4. Base-One Arithmetic...4 5. Other Definitions...5

2 Hardegree, MetaLogic 1. General Ideas About Strings and String Addition One can prove things about formulas and other syntactic expressions based on the premise that all such items are strings of symbols. In order to facilitate these proofs, we examine some of the basic principles about strings and string addition. First, in addition to the string addition (infix) operator +, we posit an infinite sequence of oneplace function signs e 1, e 2, e 3,, which are intuitively defined as follows. e 1 (σ) = the first component of σ; e 2 (σ) = the second component of σ; For example, if then σ = abc, e 1 (σ) = a e 2 (σ) = b e 3 (σ) = c e 4 (σ) = nothing e 5 (σ) = nothing The fundamental principle of identity for strings is informally given as follows. a1: α = β e 1 (α) = e 1 (β) & e 2 (α) = e 2 (β) & Making this completely formal requires induction. It also requires that we construe the component identity claims as implicitly conditional for example, e 2 (α) = e 2 (β) is short for if either e 1 (α) or e 2 (α) exists, then e 2 (α) = e 2 (β). Strings divide naturally into two categories finite and infinite which are informally defined as follows. a2: A string σ is infinite if and only if: e 1 (σ) exists & e 2 (σ) exists & e 3 (σ) exists & A string σ is finite if and only if it is not infinite. a3: n{e![e n (σ)] m{m<n E![e m (σ)]}}

Appendix 4 : Theories of Strings 3 Here, E! is the existence predicate E![τ] = df ν[ν=τ]. First, Last first(σ) = df e 1 (σ) n{e![e n (σ)] & E![e n+1 (σ)]. last(σ) = e n (σ)} Examples of Theorems t1. a is finite; b is finite; t2. if α and β are finite, then α+β is finite. t3. α+(β+γ) = (α+β)+γ. t4. α+β=β+α α=β. t5. α+β=α+γ β=γ. t6. first(α+β) = first(α). t7. last(α+β) = last(β). 2. A Mostly Formal Theory of Finite Strings So far, we have discussed strings both finite and infinite. Every expression in a formal language is a finite string, so it is worthwhile to consider a theory of finite strings. First, we propose a mostly formal theory; then we propose a formal theory. The first theory is formulated in a first-order language based on the following non-logical vocabulary. (v1) is an atomic string one-place predicate A[α] (v2) is a string one-place predicate S[β] (v3) plus two-place function sign (α+β) [Note: we regard the terms symbol and atomic string to be synonymous; also, in programming contexts, the term character is used.] The following are axioms for this theory. (a1) x{ax Sx} (a2) x y{sx & Sy. S[x+y]} (a3) x{ax yz{sy & Sz & x=y+z}} (a4) xyz[x+(y+z) = (x+y)+z] (a5) xyz[x+y = x+z y=z] (a6) xyz[x+z = y+z x=y] (a7) xy z[x+y+z = x] (a8) y x 1 x 2 x m : Ax 1 & Ax 2 & Ax m & y = x 1 +x 2 + +x m The reason that this theory is not fully formal is axiom (a8) which is informal. This axiom intends to convey the following principle about strings. every string is a finite concatenation of atomic strings.

4 Hardegree, MetaLogic 3. A Formal Theory of Finite Strings In order to render the theory of (finite) strings purely formal, we use the Peano technique. Furthermore, in order to render the theory as similar as possible, we introduce the concept of null or empty string, which we denote by. The null string is the zero element in the algebra of strings. The formal theory in question is based on the following non-logical vocabulary. (v0) the null string proper noun (v1) is an atomic string one-place predicate A[α] (v2) is a string one-place predicate S[β] (v3) super-plus two-place function sign (α + β) (s1) is a string. (s2) if σ is a string, and α is an atomic string, then σ + α is a string. (s3) nothing else is a string. (s4) xy{sx & Ay & =x + y} (s5) xyz{sx & Sy & Az. x + z=y + z x=y} As usual, the strict formalization of (s3) requires induction; this is given schematically as follows. (s3*) x(ax [x]) & x{sx & [x]. y{ay [x + y]}. x{sx [x]} The formal theory of finite strings is analogous to the formal theory of numbers. The difference is that, numbers have single-succession, strings have multiple-succession a string has arbitrarily-many successors, not just one. As in the case of arithmetic, we can define addition inductively. First, the inductive definition of numerical addition goes as follows, where the variables m and n range over numbers. (1) m+0 = df m (2) m+n + = df (m+n) + The inductive definition of string addition is analogous. The difference is that it is defined for every form of succession [every atomic string]. (b) σ 1 +α = df σ + 1 α (i) σ 1 +(σ + 2 α) = df (σ 1 +σ 2 ) + α Here the σ-variables range over strings, and α ranges over atomic strings. Note carefully the subtle orthographic difference between + and +. The latter is the multiple-successor operator for strings; the former is the general string addition operator. 4. Base-One Arithmetic Evidently, Peano Arithmetic is a special case of the theory of strings. Specifically, one obtains arithmetic by restricting the class of atomic strings to just one, let us designate this string. So in

Appendix 4 : Theories of Strings 5 addition to the null string, which we identify as zero, there are all the molecular strings obtained by successive applications of the one and only successor operator, which appends to the string. Let us use quotes around nothing as an alternative name of the null string [as in many programming languages]. Then we have the following examples. zero + = one + = two + = three What we have reproduced here is, in all probability, the original formulation of arithmetic, which may be called base-one arithmetic. To use this symbolic language is quite simple One makes a mark, or uses a digit (i.e., finger), for each application of the successor operation, thereby counting (e.g., the number of mouths one must feed!) 5. Other Definitions Although it is not crucial to the formal account of strings, we include numbers in some of the following definitions. (f ) first( ) = nothing (f+) first(σ + α) = first(σ), if it exists = α, otherwise (l ) last( ) = nothing (l+) last(σ + α) = α (L ) len( ) = 0 (L+) len(σ + α) = len(σ)+1 (e) e m (σ) = α if σ = σ 1 +σ 2 and len(σ 1 ) = m and last(σ 1 ) = α