Introduction to Kleene Algebras

Similar documents
Axioms of Kleene Algebra

Kleene Algebra and Arden s Theorem. Anshul Kumar Inzemamul Haque

A Weak Bisimulation for Weighted Automata

Kleene Algebras and Algebraic Path Problems

Kleene modules and linear languages

An Overview of Residuated Kleene Algebras and Lattices Peter Jipsen Chapman University, California. 2. Background: Semirings and Kleene algebras

Equivalence of Regular Expressions and FSMs

Introduction to Finite-State Automata

What is this course about?

CMPSCI 250: Introduction to Computation. Lecture #29: Proving Regular Language Identities David Mix Barrington 6 April 2012

CVO103: Programming Languages. Lecture 2 Inductive Definitions (2)

Equational Theory of Kleene Algebra

Introduction to Formal Languages, Automata and Computability p.1/51

BASIC MATHEMATICAL TECHNIQUES

Completeness of Star-Continuity

THE REAL NUMBERS Chapter #4

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

ClC (X ) : X ω X } C. (11)

Introduction to Formal Languages, Automata and Computability p.1/42

On minimal models of the Region Connection Calculus

Language-Processing Problems. Roland Backhouse DIMACS, 8th July, 2003

Applications of Regular Algebra to Language Theory Problems. Roland Backhouse February 2001

1.A Sets, Relations, Graphs, and Functions 1.A.1 Set a collection of objects(element) Let A be a set and a be an elements in A, then we write a A.

Warshall s algorithm

Outline. Nondetermistic Finite Automata. Transition diagrams. A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F)

CSE 311: Foundations of Computing. Lecture 23: Finite State Machine Minimization & NFAs

Linear Temporal Logic and Büchi Automata

3515ICT: Theory of Computation. Regular languages

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism

This lecture covers Chapter 7 of HMU: Properties of CFLs

An Algebraic Approach to Energy Problems I -Continuous Kleene ω-algebras

Finite Automata and Regular Languages

Handout #6 INTRODUCTION TO ALGEBRAIC STRUCTURES: Prof. Moseley AN ALGEBRAIC FIELD

KLEENE algebra is an algebraic structure that captures

TROPICAL SCHEME THEORY

Finite Automata - Deterministic Finite Automata. Deterministic Finite Automaton (DFA) (or Finite State Machine)

GENERATING SETS AND DECOMPOSITIONS FOR IDEMPOTENT TREE LANGUAGES

Characterizing the Equational Theory

Computing and Visualizing Closure Objects using Relation Algebra and RelView

03 Review of First-Order Logic

Regular Expressions and Language Properties

Propositional Logic Language

Finite Automata and Languages

A MODEL-THEORETIC PROOF OF HILBERT S NULLSTELLENSATZ

Chapter 3. Rings. The basic commutative rings in mathematics are the integers Z, the. Examples

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Towards Kleene Algebra with Recursion

Data Cleaning and Query Answering with Matching Dependencies and Matching Functions

On Regularity of Incline Matrices

Parikh s theorem. Håkan Lindqvist

Propositional and Predicate Logic - VII

Lecture 4: Nondeterministic Finite Automata

TR : Binding Modalities

MODERN APPLIED ALGEBRA

Krivine s Intuitionistic Proof of Classical Completeness (for countable languages)

arxiv: v2 [cs.fl] 29 Nov 2013

Ogden s Lemma for CFLs

Chapter 9: Relations Relations

Finite-State Transducers

Automata and Languages

Section Summary. Relations and Functions Properties of Relations. Combining Relations

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

MA/CSSE 474 Theory of Computation

NFA and regex. the Boolean algebra of languages. regular expressions. Informatics 1 School of Informatics, University of Edinburgh

Lecture Notes: Selected Topics in Discrete Structures. Ulf Nilsson

a + b = b + a and a b = b a. (a + b) + c = a + (b + c) and (a b) c = a (b c). a (b + c) = a b + a c and (a + b) c = a c + b c.

Formal Languages and Automata

Properties of the Integers

NPDA, CFG equivalence

: Computational Complexity Lecture 3 ITCS, Tsinghua Univesity, Fall October 2007

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

Notes for Lecture Notes 2

NP-Complete Problems. Complexity Class P. .. Cal Poly CSC 349: Design and Analyis of Algorithms Alexander Dekhtyar..

Theory of Computation

Compositions of Tree Series Transformations

THE EQUATIONAL THEORIES OF REPRESENTABLE RESIDUATED SEMIGROUPS

Lecture 8: Complete Problems for Other Complexity Classes

This Lecture will Cover...

On Fixed Point Equations over Commutative Semirings

CONCATENATION AND KLEENE STAR ON DETERMINISTIC FINITE AUTOMATA

Boolean Algebras. Chapter 2

PS2 - Comments. University of Virginia - cs3102: Theory of Computation Spring 2010

Duality in Probabilistic Automata

Computability and Complexity

Definition: A binary relation R from a set A to a set B is a subset R A B. Example:

Research Statement Christopher Hardin

More on Finite Automata and Regular Languages. (NTU EE) Regular Languages Fall / 41

Notes on Monoids and Automata

Advanced Automata Theory 9 Automatic Structures in General

Algebras with finite descriptions

1 Alphabets and Languages

Logic: The Big Picture

Math 300 Introduction to Mathematical Reasoning Autumn 2017 Axioms for the Real Numbers

Functions on languages:

Properties of Boolean Algebras

On finite congruence-simple semirings

Advanced Automata Theory 7 Automatic Functions

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Harvard CS121 and CSCI E-121 Lecture 2: Mathematical Preliminaries

Dynamic Semantics. Dynamic Semantics. Operational Semantics Axiomatic Semantics Denotational Semantic. Operational Semantics

Transcription:

Introduction to Kleene Algebras Riccardo Pucella Basic Notions Seminar December 1, 2005 Introduction to Kleene Algebras p.1

Idempotent Semirings An idempotent semiring is a structure S = (S, +,, 1, 0) satisfying: a + (b + c) = (a + b) + c a + b = b + a a + a = a a + 0 = 0 + a = a a (b c) = (a b) c a 1 = 1 a = a 0 a = a 0 = 0 a (b + c) = a b + a c (b + c) a = b a + c a Introduction to Kleene Algebras p.2

They Are Not Rings! The theory distinct from that of rings if R is an idempotent semiring such that every element has an additive inverse, then a = 0 for all a a = a + 0 = a + a + a 1 = a + a 1 = 0 Introduction to Kleene Algebras p.3

Some Properties Conventions ab for a b a n = a a (n times) Well-defined partial order induced by + x y iff x + y = y + and monotone with respect to Introduction to Kleene Algebras p.4

Relational Semirings Let X be a set The set of all binary relations on X forms an idempotent semiring under: R + S R S R S S R = {(x, z) y X.(x, y) R, (y, z) S} 0 1 id X The induced ordering is just subset inclusion Introduction to Kleene Algebras p.5

Kleene Algebras A Kleene algebra is a structure K = (K, +,,, 0, 1) where (K, +,, 0, 1) is an idempotent semiring The operation satisfies 1 + xx x 1 + x x x b + ax x a b x b + xa x ba x The axioms say that a b is the unique least solution to b + ax x Captures the notion of iteration Introduction to Kleene Algebras p.6

Relational Kleene Algebras Relational semiring are Kleene algebras under: R n 0 R n In other words, R is the reflexive transitive closure of R Introduction to Kleene Algebras p.7

Boolean Algebras Every Boolean algebra B = (B,,,, 0, 1) is a Kleene algebra under a + b a b a b a b a 1 0 0 1 1 Introduction to Kleene Algebras p.8

Formal Languages Fix a set Σ of symbols A string is a finite sequence of symbols from Σ A language is a set of strings The set of languages forms a Kleene algebra under A + B A B A B {xy x A, y B} A n 0 A n = {x 1... x n n 0, x i A} 0 1 {ɛ} (where ɛ is the empty string) Introduction to Kleene Algebras p.9

Formal Languages, II Take the smallest set of languages that: contains all singletons {x} for x Σ contains and {ɛ} is closed under +,, This is the free Kleene algebra generated by Σ These are exactly the regular sets over Σ Sets of strings recognizable by finite state machines Introduction to Kleene Algebras p.10

The Tropical Algebra Not all Kleene algebras are isomorphic to relational Kleene algebras. Take R +, the nonnegative reals, extended with in the usual way. This forms a Kleene algebra under a + b = min{a, b} a b = a + R b a = 0 R 0 = 1 = 0 R Does not satisfy a 1 a 2 = a Introduction to Kleene Algebras p.11

Matrix Kleene Algebras Given a Kleene algebra K, the set of all n n matrices over K forms a Kleene algebra Mat n (K) under the usual matrix operations, with given inductively as follows: [ A C where F = A + BD C [ ] ] a [a ] [ B F D D CF ] F BD D + D CF BD Introduction to Kleene Algebras p.12

Application 1 All-pairs shortest path problem Given a directed graph G with edge weights (say, representing distances between nodes) Want to compute the length of the shortest path between all pairs of nodes efficiently Step 1 Construct the adjacency matrix E, where E ij is the edge distance between node i and node j, or if there is no edge from i to j Introduction to Kleene Algebras p.13

Application 1 All-pairs shortest path problem Given a directed graph G with edge weights (say, representing distances between nodes) Want to compute the length of the shortest path between all pairs of nodes efficiently Step 2 Consider E as an element of Mat n (R + ) and compute E Introduction to Kleene Algebras p.13

Application 1 All-pairs shortest path problem Given a directed graph G with edge weights (say, representing distances between nodes) Want to compute the length of the shortest path between all pairs of nodes efficiently Step 3 Read off result: (E ) ij is the length of the shortest path from node i to node j ( is no path exists) Introduction to Kleene Algebras p.13

Application 2 Equational reasoning about programs Can think of a program as a way to describe actions to perform Two programs are equivalent if they can perform the same sequences of actions Equivalence is useful to establish correctness of program transformations Introduction to Kleene Algebras p.14

A Simple Programming Language Let A be a set of primitive actions Grammar of a simple nondeterministic programming language: S ::= a A S 1 ; S 2 S 1 or S 2 S E.g., (a; b) ; a Introduction to Kleene Algebras p.15

Semantics We associate to every program the set of execution traces that corresponds to executing the program We use the fact that sets of strings form a Kleene algebra [a] {a} [S 1 ; S 2 ] [S 1 ] [S 2 ] [S 1 or S 2 ] [S 1 ] + [S 2 ] [S ] [S ] Can equationally establish that (a; b) ; a and a; (b; a) are equivalent programs Introduction to Kleene Algebras p.16

Kleene Algebras with Tests As a programming language, the previous language is limited there are no conditionals Consider a special class of Kleene algebras A Kleene algebra with tests is a Kleene algebra such that there exists B {x x 1} B forms a Boolean algebra with +,, 1, 0 as,, 1, 0 Introduction to Kleene Algebras p.17

Formal Languages, III Let Σ be a set of symbols Let P be a set of primitive tests let B P be the free Boolean algebra generated by P The set of languages over Σ and B P forms a Kleene algebra with tests The embedded Boolean algebra consists of {b} for b B P We identify,, 1, 0 and, +, 1, 0 Introduction to Kleene Algebras p.18

Another Programming Language Let A be a set of primitive actions Let P be a set of primitive tests Grammar of a nondeterministic programming language: T ::= p S ::= a T S 1 ; S 2 T 1 T 2 if T then S 1 else S 2 T 1 T 2 while T do S Introduction to Kleene Algebras p.19

Semantics We give a semantics using sets of strings, this time relying on the fact that we have a Kleene algebra with tests Tests T get mapped to elements of the embedded Boolean algebra [p] {p} [ T ] [T ] [T 1 T 2 ] [T 1 ] [T 2 ] [T 1 T 2 ] [T 1 ] + [T 2 ] Introduction to Kleene Algebras p.20

Semantics We give a semantics using sets of strings, this time relying on the fact that we have a Kleene algebra with tests Statements get mapped to sets of strings [a] {a} [S 1 ; S 2 ] [S 1 ] [S 2 ] [if T then S 1 else S 2 ] ([T ] [S 1 ]) + ([T ] [S 2 ]) [while T do S ] ([T ] [S ]) [T ] Introduction to Kleene Algebras p.20

Closing Remarks Classification results? Standard decomposability questions In how many ways can you derive a Kleene algebra from an idempotent semiring? Representation theorems? Under what conditions is a Kleene algebra isomorphic to a relational Kleene algebra? Is there a natural representation for all Kleene algebras? Introduction to Kleene Algebras p.21