The Class of -Continuous Chomsky Algebras is Closed under Matrix - - PowerPoint PPT Presentation

the class of continuous chomsky algebras is closed under
SMART_READER_LITE
LIVE PREVIEW

The Class of -Continuous Chomsky Algebras is Closed under Matrix - - PowerPoint PPT Presentation

The Class of -Continuous Chomsky Algebras is Closed under Matrix Rings Hans Lei leiss@cis.uni-muenchen.de Universit at M unchen Centrum f ur Informations- und Sprachverarbeitung CSL 2016, Aug.29 Sept.1, Universit e


slide-1
SLIDE 1

The Class of µ-Continuous Chomsky Algebras is Closed under Matrix Rings

Hans Leiß leiss@cis.uni-muenchen.de Universit¨ at M¨ unchen Centrum f¨ ur Informations- und Sprachverarbeitung CSL 2016, Aug.29 – Sept.1, Universit´ e Marseille

1 / 29

slide-2
SLIDE 2

Content

  • 1. Chomsky-algebras: idemp. semirings “with least fixed points”
  • 2. Reducing n-ary µ to unary µ without ω-completeness
  • 3. µ-continuity of + and · and the equational theory of CFGs
  • 4. if M is a Chomsky algebra, so is Matn,n(M)
  • 5. if M is a µ-continuous Chomsky algebra, so is Matn,n(M)

2 / 29

slide-3
SLIDE 3

Chomsky Algebras

A Chomsky algebra (M, +, ·, 0, 1) is an idempotent semiring where every finite system of polynomial inequations x1 ≥ p1(x1, . . . , xn, y1, . . . , ym), . . .

  • r

¯ x ≥ ¯ p(¯ x, ¯ y), xn ≥ pn(x1, . . . , xn, y1, . . . , ym), (1) has least solutions, i.e. for all ¯ b ∈ Mm there is a (unique) least ¯ a = a1, . . . , an ∈ Mn such that ai ≥ pM

i (¯

a, ¯ b) for i = 1, . . . , n. Here ≤ is the natural partial order on M defined by a ≤ b iff a + b = b. The system ¯ x ≥ ¯ p(¯ x, ¯ y) is a context-free grammar with nonterminals ¯ x = x1, . . . , xn and terminals ¯ y = y1, . . . , ym.

3 / 29

slide-4
SLIDE 4

Example

Let (X ∗, ·, ǫ) be the monoid of all finite words of elements of X. Its power set is an idempotent semiring: (PX ∗, +, ·, 0, 1), with := ∅, 1 := {ǫ}, A + B := A ∪ B, A · B := {a · b | a ∈ A, b ∈ B}. For a vector ¯ B of m languages, ¯ x ≥ ¯ p(¯ x, ¯ y) leads to an increasing sequence ¯ Ak = (Ak,1, . . . , Ak,n) of language vectors by A0,i := ∅, Ak+1,i := pPX ∗

i

(¯ Ak, ¯ B), i = 1, . . . , n. The least solution of the inequation system, relative to ¯ B, is ¯ A :=

Ak | k ∈ N}. Therefore, (PX ∗, +, ·, 0, 1) is a Chomsky algebra.

4 / 29

slide-5
SLIDE 5

The inclusion ¯ A ⊇ ¯ p PX ∗(¯ A, ¯ B) follows from the fact that + and · are compatible with arbitrary unions (sup-continuous): for all A, B ⊆ X ∗ and ∅ = C ⊆ PX ∗, A +

  • C

=

  • {A + C | C ∈ C},

A ·

  • C · B

=

  • {A · C · B | C ∈ C}.

Example

Rel (X) := (P(X × X), +, ·, 0, 1), the set of all binary relations on X with union as +, relation composition ; as ·, the empty relation as 0 and the identity relation as 1.

5 / 29

slide-6
SLIDE 6

Example

The set CX ∗ of context-free languages over X is the smallest L ⊆ PX ∗ such that (i) each finite subset of X ∪ {ǫ} is in L, and (ii) if ¯ x ≥ ¯ p(¯ x, ¯ y) is a polynomial system and ¯ B ∈ Lm, then the least ¯ A ∈ (PX ∗)n with ¯ A ⊇ ¯ p PX ∗(¯ A, ¯ B) belongs to Ln. With the operations inherited from PX ∗, (CX ∗, +, ·, 0, 1) is a Chomsky algebra. Likewise:

◮ the set C(X 2) ⊆ P(X 2) of context-free relations on the set X, ◮ the set CM ⊆ PM of context-free subsets of a monoid M.

The regular languages over X do not form a Chomsky algebra, as they don’t have solutions for inequations like axb + 1 ≤ x.

6 / 29

slide-7
SLIDE 7

Goals of this talk: For any Chomsky algebra M:

◮ The matrix ring Matn,n(M) is also a Chomsky algebra. ◮ If least solutions of systems ¯

x ≥ ¯ t can be computed in M iteratively, they can so be computed in Matn,n(M). Chomsky algebras were introduced by Grathwohl, Henglein, Kozen 2013 in providing an infinitary complete axiom system for the equational theory of context-free grammars as fixed-point terms.

Theorem (Grathwohl,Henglein,Kozen FICS 2013)

The axioms of idempotent semirings and µ-continuity are sound and complete for the equational theory of the context-free languages.

7 / 29

slide-8
SLIDE 8

µ-terms and Park µ-semirings

Let X be an infinite set of variables. The µ-terms over X are defined by t := x | 0 | 1 | (s · t) | (s + t) | µxt. A term t is is algebraic or a polynomial if it does not contain µ .

◮ free(t) is the set of variables having a free occurrence in t.

t(x1, . . . , xn) indicates free(t) ⊆ {x1, . . . , xn}.

◮ t[x/s] is the result of substituting all free occurrences of x in t

by s, renaming bound variables of t to avoid variable capture.

◮ The µ-depth of a term is: 0 for x, 0, 1; is µ-depth(t) + 1 for

µxt; and is max{µ-depth(s), µ-depth(t)} for (s + t), (s · t). Note: We’ll write µx.t[y/s] for µx(t[y/s]), using . to save the brackets of the metalanguage. (We prefer µx(t + s) over µx.t + s.)

8 / 29

slide-9
SLIDE 9

A partially ordered µ-semiring (M, +, ·, 0, 1, ≤) is a semiring (M, +, ·, 0, 1) with a partial order ≤ on M, where every µ-term t defines a function tM : (X → M) → M, so that for all variables x ∈ X, terms s, t and valuations g, h : X → M we have: 1. 0M(g) = 0, 1M(g) = 1, xM(g) = g(x), (s + t)M(g) = sM(g) + tM(g), (s · t)M(g) = sM(g) · gM(g), (µ-rule) if sM ≤ tM, then µxsM ≤ µxtM,

  • 2. (monotonicity) if g ≤ h pointwise, then tM(g) ≤ tM(h),
  • 3. (coincidence) if g, h agree on free(t), then tM(g) = tM(h),
  • 4. (substitution) t[x/s]M(g) = tM(g[x/sM(g)]).

For tM(g) we also write tM[x1/a1, . . . , xn/an] or tM(a1, . . . , an). A first-order formula built from (in)equations holds in M if it is true for every valuation g : X → M.

9 / 29

slide-10
SLIDE 10

A Park µ-semiring is a partially ordered µ-semiring M where for all terms t and variables x, y, the following “Park axioms” hold in M: t[x/µxt] ≤ µxt, (2) t[x/y] ≤ y → µxt ≤ y. (3) Then the following also hold in M: t[x/µxt] = µxt, µy.t[x/y] = µxt, for y / ∈ free(t). Park’s axioms imply that µxtM(g) is the least solution of t ≤ x in M, g, i.e. the least a ∈ M such that tM(g[x/a]) ≤ a.

10 / 29

slide-11
SLIDE 11

Lemma (c.f. Grathwohl/Henglein/Kozen 2013)

Every Chomsky algebra M is an idempotent, partially ordered µ-semiring, if for all terms t, variables x and valuations g : X → M µxtM(g) := the least a ∈ M such that tM(g[x/a]) ≤ a. (4) Moreover, every inequation system ¯ t(¯ x, ¯ y) ≤ ¯ x with µ-terms ¯ t(¯ x, ¯ y) has least solutions in M, i.e. for all parameters ¯ b from M there is a least tuple ¯ a in M such that ¯ tM(¯ a, ¯ b) ≤ ¯ a. Proof: Simultaneously by induction on the µ-depth of terms.

Corollary

Every Chomsky algebra M, in particular CX ∗, is a Park µ-semiring. For every µ-term and g : X → CX ∗, tCX ∗(g) = tPX ∗(g).

11 / 29

slide-12
SLIDE 12

Vector versions and matrix ring of Park µ-semirings

To name the least solution of a system ¯ x ≥ ¯ t of n inequations, one might introduce terms µ¯ x¯ t using an n-ary fixed-point operator µ. As is well-known, a unary µ normally suffices:

Theorem (Beki´ c 1984)

Let (M, ≤) be a partially ordered set in which every countable increasing chain A = {ai | i ∈ N} has a least upper bound, A. Suppose f , g : M2 → M are continuous in each component, i.e. f ( A, b) = {f (a, b) | a ∈ A} for countable chains A, etc. Then the least solution of the system (x, y) ≥ (f (x, y), g(x, y)) can be obtained from least solutions of single inequations: µ(x, y)(f (x, y), g(x, y)) (5) = (µx.f (x, µy.g(x, y)), µy.g(µx.f (x, y), y).

12 / 29

slide-13
SLIDE 13

For an n-dimensional inequation system ¯ x ≥ ¯ t, we define an n-tuple µ¯ x¯ t of µ-terms by recursively using Beki´ c’s equations (5).

◮ If n = 1, then µ¯

x¯ t := µx1t1.

◮ If n > 1, ¯

x = (¯ y, ¯ z) and ¯ t = (¯ r,¯ s) with term vectors ¯ r,¯ s of lengths |¯ y|, |¯ z| < n, then µ¯ x¯ t is1 µ(¯ y, ¯ z)(¯ r,¯ s) := (µ¯ y.¯ r[¯ z/µ¯ z¯ s], µ¯ z.¯ s[¯ y/µ¯ y¯ r]). (6) However, Beki´ c’s theorem does not imply that µ¯ x¯ t denotes the least solution of ¯ x ≥ ¯ t in Chomsky algebras, like CX ∗, as these need not be closed under unions of countable increasing chains. To see that µ¯ x¯ t denotes the least solution of ¯ x ≥ ¯ t in a Chomsky algebra M, we show that Park’s axioms for term vectors hold in M.

1Recall that µxt[y/s] differs from µx.t[y/s] := µx(t[y/s]). 13 / 29

slide-14
SLIDE 14

For term vectors ¯ s, ¯ t of the same dimension, let ¯ s = ¯ t resp. ¯ s ≤ ¯ t be the conjunction of all si = ti resp. si ≤ ti. For ¯ t = (t1, . . . , tn) we write ¯ tM(g) for (tM

1 (g), . . . , tM n (g)).

Lemma

Let M be a Park µ-semiring. For all vectors ¯ t of terms and ¯ x, ¯ y of variables, of the same dimension, the vector versions of (2) and (3), ¯ t[¯ x/µ¯ x¯ t] ≤ µ¯ x¯ t, (7) ¯ t[¯ x/¯ y] ≤ ¯ y → µ¯ x¯ t ≤ ¯ y, (8) hold in M. Moreover, for any g : X → M, µ¯ x¯ t[¯ y/¯ s]M(g) = µ¯ x¯ tM(g[¯ y/¯ sM(g)]), (9) if no variable of ¯ x is free in the terms ¯ s. Proof: induction on dimension, simultaneously for (7), (8) and (9).

14 / 29

slide-15
SLIDE 15

Corollary

For any Chomsky algebra M and valuation g : X → M, µ¯ x¯ tM(g) is the least ¯ a such that ¯ tM(g[¯ x/¯ a]) ≤ ¯ a.

Corollary

If M is a Park µ-semiring, the vector version of the µ-rule holds: for vectors ¯ s, ¯ t of terms and ¯ x of different variables, all of the same dimension, if ¯ sM ≤ ¯ tM, then µ¯ x¯ sM ≤ µ¯ x¯ tM.

15 / 29

slide-16
SLIDE 16

Theorem (´ Esik/L. 2004)

If M is a Park µ-semiring, so is N := Matn,n(M). Proof: With matrix operations, (N, +, ·, 0, 1) is a semiring, as M

  • is. To define the term functions tN : (X → N) → N, for each

variable x ∈ X we fix n2 fresh distinct variables xi,j, 1 ≤ i, j ≤ n. For each term t, define a vector t′ of n2 terms recursively by x′ := (xi,j), 0′ := 0n,n, 1′ := 1n,n, (s + t)′ := s′ + t′, (s · t)′ := s′ · t′, (µxt)′ := µx′t′, using the usual matrix operations for matrices of terms, and µx′t′ is the term vector µ¯ x¯ t defined by Beki´ c for the inequations x′ ≥ t′.

16 / 29

slide-17
SLIDE 17

Any valuation g : X → N is obtained from a valuation ˆ g : X → M by g(x) = (ai,j), where ai,j = ˆ g(xi,j) for 1 ≤ i, j ≤ n. Define the term function tN by tN(g) := (t′

i,j M(ˆ

g)), where t′

i,j is the (i, j)-th entry of t′. (10)

N is a partially ordered µ-semiring:

  • 1. µ-rule: since the vector version of the µ-rule holds in M.

2.,3. monotonicity and coincidence for term function tN: from those of the of the term functions t′M

i,j.

  • 4. substitution: since its vector version holds in M.

N is a Park µ-semiring:

  • 5. the vector versions of Park’s axioms hold in M.

17 / 29

slide-18
SLIDE 18

Theorem

If M is a Chomsky algebra, so is N := Matn,n(M). Proof We saw that M is an idempotent Park µ-semiring, whose matrix ring N also is and so satisfies the vector versions of Park’s

  • axioms. In particular, every system ¯

x ≥ ¯ p(¯ x, ¯ y) of polynomial inequations has least solutions in N. So, N is a Chomsky algebra. In Park µ-semirings, we know that µ¯ x¯ t denotes the minimal solution of ¯ x ≥ ¯

  • t. We don’t know whether minimal solutions can

be iteratively approximated.

18 / 29

slide-19
SLIDE 19

µ-Continuity

The usual way to compute the simultaneous least fixed point ¯ A of ¯ x ≥ ¯ t(¯ x, ¯ y) in PX ∗ relative to ¯ B is to approximate it by its finite stages ¯ Am and (componentwise) take their union, i.e. ¯ A :=

  • m∈N

¯ Am, where ¯ A0 := ¯ ∅, ¯ Am+1 := ¯ t PX ∗(¯ Am, ¯ B). The continuity of + and · in PX ∗ imply that ¯ A = µ¯ x¯ t PX ∗(¯ B).

Lemma

In M = PX ∗ or M = CX ∗, all term functions are continuous: for a term t, valuation g : X → M and increasing chain {Ai | i ∈ N} of elements whose union is in M, tM(g[y/

  • i∈N

Ai]) =

  • i∈N

tM(g[y/Ai]). (11)

19 / 29

slide-20
SLIDE 20

A Chomsky algebra M is µ-continuous, if for all µ-terms t(x, ¯ y) and all a, b, ¯ c ∈ M, the on the rhs exists and a · µxtM[¯ y/¯ c] · b =

  • {a · (mxt)M[¯

y/¯ c] · b | m ∈ N}, (12) where the term mxt, the m-fold iteration of t in x, is defined by 0xt := 0, (m + 1)xt := t[x/mxt]. (A Kleene algebra is ∗-continuous if ac∗b = {acmb | m ∈ N}.)

Theorem (Grathwohl,Henglein,Kozen 2013)

The Chomsky algebra CX ∗ of all context-free languages over X is µ-continuous. Hence, for all terms t and valuations g : X → CX ∗, µxt CX ∗(g) =

  • {mxt CX ∗(g) | m ∈ N}.

20 / 29

slide-21
SLIDE 21

The iterative computation of least fixed points is used in [2] to interpret µ-terms in the semiring CX ∗: The canonical interpretation L of µ-terms over X in CX ∗ is L(x) = {x} L(0) = ∅ L(1) = {ǫ} L(s + t) = L(s) ∪ L(t) L(s · t) = {uv | u ∈ L(s), v ∈ L(t)} L(µxt) = {L(mxt) | m ∈ N}. By the previous theorem, L(t) = t CX ∗(L) for all terms t.

Remark Grathwohl e.a. prove that an idempotent semiring M with

an interpretation of µ-terms satisfying µ-continuity also satisfies Park’s axioms.

21 / 29

slide-22
SLIDE 22

The next lemma says that with L, for any system ¯ x ≥ ¯ t, the value

  • f µ¯

x¯ t is the union of the values of the iterations m¯ x¯ t, where 0¯ x¯ t := ¯ 0, (m + 1)¯ x¯ t := ¯ t[¯ x/m¯ x¯ t].

Lemma

For all vectors ¯ x, ¯ y, ¯ z of pairwise distinct variables and vectors ¯ t,¯ r,¯ s of µ-terms with |¯ x| = |¯ t|, |¯ y| = |¯ r| and |¯ z| = |¯ s|, we have:

  • 1. L(µ¯

x¯ t) = {L(m¯ x¯ t) | m ∈ N},

  • 2. L(¯

s[¯ x/µ¯ x¯ t]) = {L(¯ s[¯ x/m¯ x¯ t]) | m ∈ N},

  • 3. L(µ¯

z.¯ s[¯ y/µ¯ y¯ r]) = {L(m¯ z.¯ s[¯ y/k¯ y¯ r]) | m, k ∈ N}. Proof (lengthy): by simultaneous induction on the vector length of |¯ x| = |¯ y| + |¯ z| with |¯ y|, |¯ z| < |¯ x|. The proof uses the vector version of the substitution property, and the definition of L in 1. for |¯ t| = 1.

22 / 29

slide-23
SLIDE 23

The following lemma will help us to transfer the vector version of the µ-continuity condition from L resp. CX ∗ to an arbitrary µ-continuous Chomsky algebra.

Lemma (Grathwohl,Henglein,Kozen 2013)

Let M be a µ-continuous Chomsky algebra and g : X → M. Then, for all µ-terms s, t, u, (stu)M(g) =

  • {(swu)M(g) | w ∈ L(t)},

where, for x1 · · · xk ∈ X ∗, (x1 · · · xk)M(g) := g(x1) ·M . . . ·M g(xk).

23 / 29

slide-24
SLIDE 24

Corollary

For any vectors ¯ s,¯ t, ¯ u of µ-terms of equal length, any µ-continuous Chomsky-algebra M and valuation g : X → M, (¯ s · ¯ t · ¯ u)M(g) =

  • {(¯

s · ¯ w · ¯ u)M(g) | ¯ w ∈ L(¯ t)}. (13) Applied to L(µ¯ x¯ t) this gives the vector version of µ-continuity:

Corollary

Let M be a µ-continuous Chomsky algebra and g : X → M. Then ¯ a · µ¯ x¯ tM(g) · ¯ b =

a · m¯ x¯ tM(g) · ¯ b | m ∈ N}, for any term vector ¯ t and vectors ¯ a, ¯ b of elements of M of the same length as ¯ t.

24 / 29

slide-25
SLIDE 25

The matrix ring of a µ-continuous Chomsky algebra

Theorem

If M is a µ-continuous Chomsky algebra, so is N := Matn,n(M).

  • Proof. We saw that N is a Chomsky algebra, since M is.

Suppose M is µ-continuous and n > 1. Let A, B ∈ N, t(x, ¯ y) a µ-term and g : X → N. We have to show A · µxtN(g) · B =

  • {A · mxtN(g) · B | m ∈ N}.

(14) By definition, µxtN(g) = ((µxt)′M

i,j(ˆ

g)), where (µxt)′ = µx′t′ is

  • btained from the matrices

x′ = (xi,j) and t′ = (ti,j)

  • f new variables xi,j and µ-terms ti,j(x′, ¯

y′) using Beki´ c’s definition for the n2 inequations t′ ≤ x′. Accordingly, we have a square term matrix (mxt)′ = mx′t′ for the m-th iteration of t′ in x′.

25 / 29

slide-26
SLIDE 26

Concerning µ-continuity of matrix multiplication, consider the (i, j)-th entry and use (*) the vector version of µ-continuity in M: (A · µxtN(g) · B)i,j =

  • k,l≤n

ai,k ·M (µxtN(g))k,l ·M bl,j =

  • k,l≤n

ai,k ·M (µxt)′M

k,l(ˆ

g) ·M bl,j =

  • k,l≤n
  • {ai,k ·M (mxt)′M

k,l(ˆ

g) ·M bl,j | m ∈ N} (*) =

  • {
  • k,l≤n

ai,k ·M (mxt)′M

k,l(ˆ

g) ·M bl,j | m ∈ N} =

  • {
  • k,l≤n

ai,k ·M ((mxt)N(g))k,l ·M bl,j | m ∈ N} =

  • {(A · mxtN(g) · B)i,j | m ∈ N}

26 / 29

slide-27
SLIDE 27

Questions

◮ Can the result be proven by induction on the matrix

dimension (instead of the vector dimension)? If so, is the Kleene algebra case an instance of the proof? Recall that for matrices A over a Kleene algebra M µX(AX + 1) = A∗, and there is a recursion formula to compute A∗ by induction

  • n its dimension.

◮ For an upper triangular Boolean matrix A, Valiant’s algorithm

computes the reflexive transitive closure A∗ = µX(A + 1 + XX)

  • efficiently. Can it be extended to arbitrary Boolean matrices?

27 / 29

slide-28
SLIDE 28

◮ M.Hopkins (2008) has an algebraic theory which defines, for

any monoid M, a Chomsky hierarchy RM ⊂ CM ⊂ T M ⊂ PM

  • f the regular, context-free, turing (r.e.) and arbitrary subsets,

each of which form an idempotent semiring.

◮ Is CM ⊆ PM as definied above the same as Hopkins’ CM? ◮ Is T closed under matrix ring formation? ◮ Is CM the ideal closure of M for suitabe “µ-ideals” I ⊆ M?

◮ If we adjoin to an idempotent semiring M a solution to a

polynomial inequation x ≥ p(x), which other inequations x ≥ q(x) get solvable?

28 / 29

slide-29
SLIDE 29

Hans Beki´

  • c. Definable operations in general algebras, and the

theory of automata and flowcharts. Springer LNCS 177, pp.30–55, 1984. Niels Grathwohl, Fritz Henglein, Dexter Kozen. Infinitary axio- matization of the equational theory of context-free languages.

  • Proc. FICS 2013, pp. 44–55, EPTCS 126, 2013.

Mark Hopkins. The algebraic approach I, II: The algebraization

  • f the Chomsky hierarchy.

Proc.10th RelMiCS, Springer LNCS 4988, pp.155–190, 2008. Dexter Kozen. A completeness theorem for Kleene algebras and the algebra of regular events.

  • Proc. 6th LICS, Computer Society Press, 1991

Hans Leiß. Towards Kleene Algebra with Recursion.

  • Proc. CSL’91, pp 242–256. Springer LNCS 626, 1991.

Hans Leiß, Zoltan ´

  • Esik. Algebraically complete semirings and

Greibach normal form. Annals of Pure and Applied Logic, 133:173–203, 2005.

29 / 29