<<

Tables, Memorized and Applications Cyrille Bertelle, Gérard Henry Edmond Duchamp, Khalaf Khatatneh

To cite this version:

Cyrille Bertelle, Gérard Henry Edmond Duchamp, Khalaf Khatatneh. Tables, Memorized Semirings and Applications. 2005. ￿hal-00004303￿

HAL Id: hal-00004303 https://hal.archives-ouvertes.fr/hal-00004303 Preprint submitted on 19 Feb 2005

HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. ccsd-00004303, version 1 - 19 Feb 2005 [email protected] Keywords: nteae fwa ol ecalled be structures could what contributiongebraic of a area be the to in intended is following The Introduction 0 structures. algebraic efficient structures, ee epeetanwsmrn wt sev- applied (with be can which new structures) a semiring eral present we provided detail. full Here, be in will out worked Examples and among and, semirings. structures them, different can one many them, obtain on operations the and Varying scalars computable. the fast eas- and coefficients), implemented the ily and vary words can the (one letters, versatile the is (finite) it [6], Eilenberg the coefficients. of sets generalizes some with structure with second This filled the is raw and kinds data first words The special new arrays. are a two-raws which of construct tables, and the define structure, we fact, In ∗ § ‡ † yil.etleui-ear.r gerard.duchamp@lip [email protected], IA,Fcl´ e cecse e ehius 62 Mont- 76821 Techniques, des et Sciences Facult´eLIFAR, des IN ntttGlle nvri´ ai II9,avenue 99, XIII Universit´e Galil´ee Paris - Institut LIPN, I,LbrtiedIfraiu uHve 5rePiip L Philippe rue 25 Havre, du d’Informatique Laboratoire LIH, a ls eoie eiig n Applications and Semirings Memorized Tables, Tables, or ffiin aastructures data efficient k sbes ffiin data efficient -subsets, ´ rr .E Duchamp E. G´erard H. ffiin al- efficient hlfKhatatneh Khalaf yil Bertelle Cyrille k -sets and . 1 g mretognzto rmidvda be- models. individual haviour from organization man- emergent to is age methodology a systems, showing multi-agent by to announced linked second, in The entries with semiring. matrices this over the squaring addresses solve peated with to suited path semir- specially shortest memorized is then a latter and ing.The instance, tables for the “for- of obtaining, in process the information to linked getting” is presented. first are The product) applications of complemented Sum, groups Two max, : (min, be erations namely op- Fuzzy will product, laws Cauchy They product, structures Hadamard several These properties. with of endowed bunch com- view. a a of present from structures point new binatorial basic this the of also of present purpose elements to multi- The is account/paper processing this problems. automatic behaviour of agents needs the to enBpit leet 33 iltnue France Villetaneuse, Cl´ement, 93430 Jean-Baptiste n.univ-paris13.fr, an-innCdx France Cedex, Saint-Aignan bn P50708L ar ee,France cedex, Havre Le 76058 540 BP ebon, , ∗ ‡§ † rbe yre- by problem 1 Description of the data and for the second row the values or (coeffi- structure cients)of the table. The order of the columns is not relevant. Thus, a table reads 1.1 Tables and operations on tables indices of words I(T ) (1) The input alphabet being set by the automaton  values bottom row V (T ) under consideration, we will here rather focus The laws defined on tables will be of two types: on the definition of semirings providing transi- pointwise type (subscript p) and convolution tion coefficients. For convenience, we first be- type (subscript c). gin with various laws on R := [0, + [ includ- Now, we can define the pointwise composition + ∞ ing (or product) of two tables, noted . ∗p Let us consider, two tables T1, T2 and a law 1. + (ordinary sum) ∗ u1 u2 uk T1 = · · · 2. (ordinary product) p1 p2 pk × · · · and 3. min (if over [0, 1], with neutral 1, oth- erwise must be extended to [0, + ] and v1 v2 vl ∞ T2 = · · · then, with neutral + ) or max q q ql ∞ 1 2 · · · x y then T pT is defined by Ti[w] if w I(Ti) 4. +a defined by x +a y := loga(a + a ) 1 ∗ 2 ∈ and w / I(T −i) and by T [w] T [w] if w (a> 0) ∈ 3 1 ∗ 2 ∈ I(T ) I(T ) 1 ∩ 2 5. + (H¨older laws) defined by x + y := In particular one has I(T1 pT2)= I(T1) I(T2). [n] [n] ∗ ∪ √n xn + yn Note 1 i) At this stage one do no need any neutral. The structure automatically creates it 6. +s (shifted sum, x +c y := x + y 1, over − (see algebraic remarks below for full explana- whole R, with neutral 1) tion). ii) The above is a considerable generalization of 7. c (complemented product, x + y xy, × − an idea appearing in [3], aimed only to semir- can be extended also to whole R, stabi- ings with units. lizes the range of probabilities or fuzzy [0, 1] and is distributive over the shifted For convolution type, one needs two laws, say sum) , , the second being distributive over the ⊕ ⊗ first, i.e. identically A table T is a two-rows array, the first row x (y z) = (x y) (x z) and being filled with words taken in a given free ⊗ ⊕ ⊗ ⊕ ⊗ (y z) x = (y x) (z x) (2) (see [4], [7] in this conference or [8]). ⊕ ⊗ ⊗ ⊕ ⊗ The set of words which are present in the first (see row will be called the indices of the table (I(T )) http://mathworld.wolfram.com/

2 Semiring.html). are involved). This paragraph is devoted to showing that, un- The set of indices of T T (I(T T )) is the der these conditions, the axioms of Semirings 1 ∗c 2 1 ∗c 2 concatenation of the two (finite) langages I(T1) are by no means arbitrary and in fact unavoid- and I(T2) i.e. the (finite) set of words able. A weighted graph is an oriented graph to- gether with a weight mapping ω : A K from I(T )I(T )= uv . (3) 7→ 1 2 { }(u,v)∈I(T1 )×I(T2) the set of the arrows (A) to some set of coef- ficients K, an arrow is drawn with its weight then, for w I(T1)I(T2), one defines α ∈ (cost) above as follows a = q1 q2. → For such objects, one has the general conven- T c T [w]= T [u] T [v] (4) 1 ⊗ 2 1 ⊗ 2 tions of graph theory. uvM=w   the interesting fact is that the constructed t(a) := q1 (tail) structure (call it for tables) is then a semiring • T ( , p, c) (provided is commutative and - h(a) := q2 (head) T ⊕ ⊗ ⊕ • generally - without units, but this is sufficient w(a) := α (weight). to perform matrix computations). There is, in • fact no mystery in the definition (3) above, as A path is a sequence of arrows c = a a an 1 2 · · · every table can be decomposed in elementary such that h(ak) = t(ak ) for 1 k n 1. +1 ≤ ≤ − bits The preceding functions are extended to paths by t(c) = t(a1), h(c) = h(an), w(c) = k w(a1)w(a2) w(an) (product in the set of co- u1 u2 uk ui · · · T1 = · · · = (5) efficients). p1 p2 pk pi · · · Mi=1 For example with a path of length 3 and (k = one has, thanks to distributivity, to understand N), the convolution of these indecomposable ele- 2 3 5 u = p q r s (7) ments, which is, this time, very natural → → → one has t(u)= p, h(u)= s, w(u) = 30. u1 u2 u1u2 := (6) As was stated above, the (total) weight of a set p p p p 1 Oc 2 1 × 2 of paths with the same head and tail is the sum of the individual weights. For instance, with 1.2 Why semirings ? α In many applications, we have to compute the q1 →β q2 (8) weights of paths in some weighted graph (short- → est path problem, enumeration of paths, cost the weigth of this set of paths est α + β. From computations, automata, transducers to cite the rule that the weights multiply in series and only a few) and the computation goes with two add in parallel one can derive the necessity of main rules: multiplication in series (i.e. along a the axioms of the semirings. The following di- path), and addition in parallel (if several paths agrams shows how this works.

3 Diagram Identity http:// α encyclopedia.thefreedictionary.com/ →β %20category p q α + (β + γ) = (α + β)+ γ →γ http://mathworld.wolfram.com/

α Semiring.html →→ p β q α + β = β + α → α β γ p q r s α(βγ) = (αβ)γ Proposition 1 α→ → → (i) Let (S, ) be a magma, Σ → γ ∗ p β q r (α + β)γ = αγ + βγ an alphabet, and denote T [S] the set of tables → →β ∗ α → with indices in Σ and values in S. Define p p q γ r α(β + γ)= αβ + αγ ∗ → → as in (1.1). Then i) The law is associative (resp. commutative) these identities are familiar and bear the fol- ∗ iff is. Moreover the magma ( [S], ) always lowing names: ∗ T ∗ possesses a neutral, the empty table (i.e. with Line Name an empty set of indices). ii) If (K, , ) is a semiring, then ( K, , ) I Associativity of + ⊕ ⊗ T ⊕ ⊗ II Commutativity of + is a semiring. III Associativity of × IV Distributiveness (right) of over + × Proof. (Sketch) Let S(1) the magma with unit V Distributiveness (left) of over + built over (S e ) by adjunction of a unit. × ∪ { } Then, to each table T , associate the (finite sup- 1.3 Total mass ∗ ported) function fT :Σ S defined by 7→ (1) The total mass of a table is just the sum of the T [w] if w I(T ) coefficients in the bottom row. One can check fT (w)= ∈ (10)  e otherwise that

then, check that fT1 pT2 = fT1 1fT2 (where 1 mass(T 1 T 2) = mass(T 1) + mass(T 2); ∗ ∗ ∗ ∗ ⊕ (Σ ) mass(T 1 T 2) = mass(T 1) mass(T 2)(9) is the standard law on S(1) ) and that the cor- ⊗ · respondence is a . Use a similar this allows, if needed, stochastic conditions. technique for the point (ii) with K0,1 the semir- ing with units constructed over K and show 1.4 Algebraic remarks that the correspondence is one-to-one and has K0,1 Σ as image. We have confined in this paragraph some proofs h i of structural properties concerning the tables. Note 2 1) Replacing Σ∗ by a simple set, the The reader may skip this section with no seri- (i) of proposition above can be extended with- ous harm. out modification (see also K-subsets in [6]). First, we deal with structures with as little as 2) If one replaces the elements of possible requirements, i.e. Magmas and Semir- on the top row by elements of a S ings. For formal definitions, see and admits some colums with a top empty cell,

4 we get the algebra of S(1). to such a table, one can associate 3) Pointwise product can be considered as be- φ(T ) := [ u , u uk , l ] in the memo- { 1 2 · · · } 1 ing constructed with respect to the (Hadamard) rized semiring. It is easy to check that φ c(w)= w w whereas convolution is transports the laws and the neutrals and ⊗ w.r.t. the Cauchy coproduct obtain the result.

c(w)= u v (11) ⊗ uvX=w 2.2 Application to evolutive systems (see [5]). Tables are structured as semirings and are flexible enough to recover and amplify the 2 Applications structures of automata with multiplicities and transducers. They give operational tools for 2.1 Specializations and images modelling agent behaviour for various simu- lations in the of distributed artificial 1. Multiplicities, Stochastic and intelligence [2]. The outputs of automata with Boolean. — multiplicities or the values of tables allow to Whatever the multiplicities, one gets the modelize in some cases agent actions or in other classical automata by emptying the al- cases, probabilities on possible transitions be- phabet (setting Σ = ). For stochastic, tween internal states of agents behaviour. In ∅ one can use the total mass to pin up out- all cases, the algebraic structures associated going conditions. with automata outputs or tables values is very interesting to define automatic computations in 2. Memorized Semiring. — respect with the evolution of agents behaviour We explain here why the memorized during simulation. semiring, devised at first to perform ef- ficient computations on the shortest path One of ours aims is to compute dynamic multi- problem with memory (of addresses) can agent systems formations which emerge from a be considered as an image of a ”table simulation. The use of table operations deliv- semiring” (thus proving without compu- ers calculable automata aggregate formation. tation the central property of [9]). Thus, when table values are probabilities, we Let be here the table semiring with co- are able to obtain evolutions of these aggrega- T efficients in ([0, + ], min, +). Then a ta- tions as adaptive systems do. ∞ ble With the definition of adapted operators com- u uk un T = 1 · · · · · · (12) ing from genetic algorithms, we are able to rep- l lk ln 1 · · · · · · resent evolutive behaviors of agents and so evo- can be written so that l = = lutive systems [1]. Thus, tables and memorized 1 · · · lk < lm for m > k (this amounts semiring are promizing tools for this kind of to say that the set where the mini- implementation which leads to model complex mum is reached is u , u uk ). Then, systems in many domains. { 1 2 · · · }

5 References [5] Duchamp G., Flouret M., Laugerotte E., Luque J-G., Direct and dual laws [1] Bertelle C., Flouret M., Jay V., Olivier for automata with multiplicites, Theo- D., Ponty J.-L., Genetic Algorithms on ret. Comput. Sci. 267 (2001) 105-120. Automata with Multiplicities for Adap- tative Agent Behaviour in Emergent [6] Eilenberg S., Automata, languages and Organisations. machines, Vol A, Acad. Press (1974). [2] Bertelle C., Flouret M., Jay V., Olivier D., Ponty J.-L., Automata with Multi- [7] Laugerotte E., Abbad H., Symbolic plicities as Behaviour Model in Multi- computation on weighted automata, Agent Simulations SCI 2001. JICCSE’04.

[3] Champarnaud J.-M., Duchamp G., [8] Lothaire M., Combinatorics on words, Derivatives of rational expressions Cambridge University Press (new edi- and related theorems, T.C.S. 313 31 tion), 1997. (2004). [4] Duchamp G., Hatem Hadj Kacem, Eric´ [9] Khatatneh K., Construction of a mem- Laugerotte, On the erasure of several orized semiring, DEA ITA Memoir, letter-transitions, JICCSE’04 University of Rouen (2003).

6