Tree Automata for Extracting Consensus from Partial Replicas of a Structured Document

In an asynchronous cooperative editing workflow of a structured document, each of the co-authors receives in the different phases of the editing process, a copy of the document to insert its contribution. For confidentiality reasons, this copy may be only a partial replica containing only parts of the (global) document which are of demonstrated interest for the considered co-author. Note that some parts may be a demonstrated interest over a co-author; they will therefore be accessible concurrently. When it's synchronization time (e.g. at the end of an asynchronous editing phase of the process), we want to merge all contributions of all authors in a single document. Due to the asynchronism of edition and to the potential existence of the document parts offering concurrent access, conflicts may arise and make partial replicas unmergeable in their entirety: they are inconsistent, meaning that they contain conflictual parts. The purpose of this paper is to propose a merging approach said by consensus of such partial replicas using tree automata. Specifically, from the partial replicas updates, we build a tree automaton that accepts exactly the consensus documents. These documents are the maximum prefixes containing no conflict of partial replicas merged.


Introduction
A significant proportion of documents handled and/or exchanged by applications has a regular structure defined by a grammatical model (DTD: Document Type Definition, schema [1]): they are called structured documents.The everincreasing power of communication networks in terms of throughput and security, as well as efficiency is concerned, has revolutionized the way of editing such documents.Indeed, to the classical model of an author, editing locally and autonomously his document, was added the (asynchronous) cooperative editing in which, several authors located on geographically distant sites, coordinate to edit asynchronously a same structured document (Figure 1): it is an asynchronous cooperative editing workflow.
In such editing workflows (Figure 2), the desynchronized editing phases in which each co-author edits on his site his copy of the document, alternate with the synchronization-redistribution phases in which the different contributions (local replicas) are merged (on a dedicated site) into a single document, which is then redistributed to the various co-authors for the continuation of the edition.This pattern is repeated until the document is completely edited.
In the literature, there are several cooperative editing systems offering, for some, a concurrent collaborative edition of the same document (Etherpad [2], Google Docs [3], Fidus Writer [4], …), or on the other hand, a truly distributed and asynchronous edition (Wikis [5] [6], Git [7] [8], …) in which the co-authors work on replicas of the document; replication techniques as well as reconciliation strategies must then be addressed.If the collectively edited document is structured, it may in some cases be desirable for reasons of confidentiality, for example, a co-author has access only to certain information, meaning that he only has access to certain parts of the document belonging to certain given types (sorts 1 ) of the document model.Thus, the replica i t edited by co-author i c from the site i may be only a partial replica of the (global2 ) document t, obtained via a projection operation, which conveniently eliminates from global  document t parts which are not accessible to the co-author in question.We call "view" of a co-author, the set of sorts that he can access [9].G obtained from the global model G.
When asynchronous local editions are done on partial replicas, it can be assumed that each co-author has on his site a local document model guiding him in his edition.This local model can help to ensure that for any update maj i t of a partial replica i t (conform to the considered (local) model), there is at least one document t conform to the global model so that maj i t is a partial replica of t: for this purpose, the local model should be coherent towards the global one 3 .Thus, because of the asynchronism of the editing, the only inconsistencies that we can have when the synchronization time arrives are those from the concurrent edition of the same node 4 (in the point of view of the global document) by several co-authors: the partial replicas concerned are said to be in conflict.This paper proposes an approach of detection and resolution of such conflicts by consensus during the synchronisation-redistribution phase, using a tree automaton said of consensus, to represent all documents that are the consensus of competing editions realised on the different partial replicas.A structured document t is intentionally represented by a tree that possibly contains buds5 [9] (see Figure 3).Intuitively, synchronizing or merging consensually the updates 1 , , n t t of n partial replicas of a document t, consists in finding a document c t conform to the global model, integrating all the nodes of i t not in conflict and in which, all the conflicting nodes are replaced by buds.
Consensus documents are therefore the largest prefixes without conflicts in merged documents.The algorithm of consensual merging presented in this paper is an adaptation of the fusion algorithm presented in [9] which does not handle conflicts.Technically, the process for obtaining the documents forming part of the consensus is: It only remains to generate the set of trees (or those most representative) accepted by the automaton A , to obtain the consensus documents.In the subsequent sections, after the presentation (Section 2) of some concepts and definitions related to the cooperative editing and tree automata, we expose (Section 3) the construction process of the operator ⊗ and a proof of cor- rection of the algorithm proposed for its implementation.The Section 4 is devoted to the conclusion.In the appendices, we fully unfold the example introduced in Section 3 highlighting the major concepts outlined in this paper (Appendix A), as well as some screenshots of an asynchronous cooperative editor prototype operating in a distributed environment that we have developed for the experimental purposes of the algorithms described in this paper (Appendix B). Figure 3.An intentional representation of a document containing buds.

Structured Document, Edition and Conformity
In the XML 6 community, the document model is typically specified using a Document Type Definition (DTD) or a XML Schema [1].It is shown that these DTD are equivalent to (regular) grammars with special characteristics called XML grammars [10].The (context free) grammars are therefore a generalization of the DTD and on the basis of the studies they have undergone, mainly as formal models for the specification of programming languages, they provide an ideal framework for formal study of the transformations involved in XML technologies.That's why we use them in our work as tools for specifying the structure of documents.
We will therefore represent the abstract structure of a structured document by a tree and its model by an abstract context free grammar; a valid structured document will then be a derivation tree for this grammar.A context free grammar defines the structure of its instances (the documents that are conform to it) by means of the productions.A production, generally denoted is comparable in this context, to a structuring rule which show how the symbol 0 X located in the left part of the production is divided into a sequence of other symbols 1 n X X located on its right side.More formally.
Definition 1.A abstract context free grammar is given by ( ) , , A =  S P composed of a finite set S of grammatical symbols or sorts corresponding to the different syntactic categories involved, a particular grammatical symbol A ∈ S called axiom, and a finite set * ⊆ × P S S of productions.A production , , , : and P denotes the length of the right hand side of P. A production with the symbol X as left part is called a X-production.
For certain treatments on trees (documents) it is necessary to designate precisely a particular node.Several indexing techniques exist, among them, the so-called Dynamic Level Numbering [11] based on identifiers with variable lengths inspired by the Dewey decimal classification (see Figure 4).According to this indexing system, a tree can be defined as follows: Definition 2. A tree whose nodes are labelled in an alphabet S is a partial map is the root label); the integer n is the arity of the node whose address is u. ( ) with ( ) Let t be a document and

( )
, , A =  S P a grammar.t is a derivation tree for  if its root node is labelled by the axiom A of  , and if for all internal node 0 n labelled by the sort 0 X , and whose sons 1 , , n n n , are respectively labelled by the sorts 1 , , n X X , there is one production P ∈P such that, and P n = .It is also said in this case that t belongs to the language generated by  from the symbol A and it is denoted ( ) There is a bijective correspondence between the set of derivation trees of one grammar and all its Abstract Syntax Tree (AST).In an AST, nodes are labelled by the names of the productions., , for all 1 i n ≤ ≤ .AST are used to show that a given tree labelled with grammatical symbols is an instance of a given grammar.
A structured document being edited is represented by a tree containing buds (or open nodes) which indicate in a tree, the only places where editions (i.e.updates) are possible 7 .Buds are typed; a bud of sort X is a leaf node labelled by X ω : it can only be edited (i.e extended to a sub-tree) by using a X-production of the form which have as effect, 1) the replacement of X ω labelled bud by a P labelled node and, 2) the creation of n buds labelled respectively by ,1 i X i n ω ≤ ≤ .Thus, a structured document being edited and that have the grammar ( ) as model, is a derivation tree for the extended grammar ( ) S S P S obtained from  as follows: for all sort X, we not only add in the set S of sorts a new sort X ω , but we also add a new ε-production : X X ω ε Ω → in the set P of productions; so we have: When we look at the productions of a grammar, we can notice that each sort is associated with a set of productions.From this point of view, therefore, we can consider a grammar as an application [ ] ( ) which associates to each sort a list of pairs formed by a production name and the list of sorts in the right hand side of this production.Such an observation suggests that a grammar can be interpreted as a (descending) tree automaton that can be used for recognition or for the generation of its instances.
Definition 4. A (descending) tree automaton defined on Σ is a quadruplet of a set Σ of symbols; its elements are the labels of the nodes of the trees to be generated (or recognized), a set Q of states, a particular state 0 q Q ∈ called initial state, and a finite set , n q q is the list of states accessible from the q state by crossing a transition labelled σ .
denotes the set of transitions associated to the state q, we denote ( ) ( ) , q σ → is called final transition and a state possessing this transition is a final state.
One can interpret a grammar ( ) as a (descending) tree automaton [13] ( ) considering that: 1) Σ =P is the type of labels of the nodes forming the tree to recognize.2) Q = S is the type of states and, 3)   [ ] ( ) 1 , , , n q q q σ → is a transition of the automaton when the pair , , , n q q σ appears in the list ( ) gram q 8 .We note  A the tree auto- maton derived from  .
To obtain the set AST A of AST generated by a tree automaton A from an initial state 0 q , you must: 1) Create a root node r, associate the initial state 0 q and add it to the set AST A initially empty.2) Remove from AST A an AST t under construction i.e with at least one leaf node node unlabelled.Let q be the state associated to node .For all transition ( ) 1 , , n q q q σ  → of A , add in AST A the trees t′ which are replicas of t in which the node node has been substituted by a node node′ labelled σ and possessing n (unlabelled) sons, each associated to a (distinct) state i q of [ ] 1 , , n q q .3) Iterate step (2) until you obtain trees with all the leaf nodes labelled (they are consequently associated to the final states of A ): these are AST.We note t q  A the fact that the tree automaton A accepts the tree t from the initial state q, and ( ) , q L A (tree language) the set of trees generated by the automaton A from the initial state q.Thus, ( ) ( ) ( ) As for automata on words, one can define a synchronous product on tree automata to obtain the automaton recognizing the intersection, the union, …, of 8 Reminder: gram is the application obtained by abstraction of  and have as type: [ ] ( ) regular tree languages [13].We introduce below the definition of the synchronous product of k tree automata whose adaptation will be used in the next section for the derivation of the consensual automaton.
Definition 5. Synchronous product of k automata: be k tree automata.The synchronous product of these k automata defined as follows: 1) Its states are vectors of states : ; 2) Its initial state is the vector formed by the initial states of the different automata : ; 3) Its transitions are given by:

View, Associated Projection and Merging
The derivation tree giving the (global) representation of a structured document edited in a cooperative way makes visible the set of grammatical symbols of the grammar that participated in its construction.As we mentioned in Section 1 above, for reasons of confidentiality (accreditation degree), a co-author manipulating such a document will not necessarily have access to all of these grammatical symbols; only a subset of them can be considered relevant for him: it is his view.A view V is then a subset of grammatical symbols ( ⊆ V S ).
A partial replica of t according to the view V , is a partial copy of t obtained by deleting in t all the nodes labelled by symbols that are not in V .Figure 5 shows a document t (center) and two partial replicas Practically, a partial replica is obtained via a projection operation denoted π .
We therefore denote ( ) V the fact that t V is a partial replica obtained by projection of t according to the view V .

Let's note
the fact that the document i maj t V is an update of the document i t V , i.e. i maj t V is obtained from i t V by replacing some of its buds by trees.In an asynchronous cooperative editing process, there are synchronization points 9 in which one tries to merge all contributions i maj t V of the various coauthors to obtain a single comprehensive document f t 10 .A merging algorithm that does not incorporate conflict management and that relies on a solution to the reverse projection problem is given in [9].

Partial Replica and Reverse Projection (Expansion)
The reverse projection (also call the expansion) of an updated partial replica relatively to a given grammar ( ) . A solution to this problem using tree automata is given in [9]; in that solution, productions of the grammar  are used, to bind to a view i ⊆ V S a tree automaton A such as the trees he recognizes from an initial state built from i maj t V are exactly those having this partial replica as projection according to the view i V : . Practically, a state q of the automaton , Tag X ts where X is a grammatical symbol, ts is a forest (tree set), and Tag is a label that is either Open or Close and indicates whether the concerned state q can be used to generate a closed node or a bud.The states of is of type X.We also have a function named typeState which, when applied to a state returns its type 11 .A transition from one state q is of one of the forms ( ) [ ] ( ) , , , n Close X ts p q q → is used to generate AST of type X (i.e.those whose root is labelled by a X-production) admitting "ts" for projection according to the view i V if X does not belong to i V , and " [ ] X ts " otherwise.Similarly, a transition of the form is used to generate a single AST reduced to a bud of type X.
The interested reader may consult [9] for a more detailed description of the process of associating a tree automaton with a view and Appendix A for an illustration.

Issue and Principle of the Solution of Reconciliation by Consensus
There are generally two distinct phases when synchronizing replicas of a 9 A synchronization point can be defined statically or triggered by a co-author as soon as certain properties are satisfied. 10 It may happen that the edition must be continued after the merging (this is the case if there are still buds in the merged document): we must redistribute to each of the n co-authors a (partial) replica for the continuation of the editing process.Studies on reconciling a document versions are based on heuristics [15] insofar as there is no general solution to this problem.In our case, since all editing actions are reversible 13 and it is easy to locate conflicts when trying to merge the partial replicas (see Section 3.2), we have a canonical method to eliminate conflicts: when merging, we replace any node (of the global document) whose replicas are in conflict by a bud.Thus, we prune at the nodes where a conflict appears, replacing the corresponding sub-tree with a bud of the appropriate type, indicating that this part of the document is not yet edited: the documents obtained are called consensus.These are the maximum prefixes without conflicts of the fusion of the documents resulting from the different expansions of the various updated partial replicas.For example, in Figure 8, the parts highlighted (blue backgrounds) in trees (f) and (g) are in conflict; they are replaced in the consensus tree (h) by a bud of type C (node labelled C ω ).
The problem of the consensual merging of k updated partial replica whose global model is given by a grammar

( )
, , A =  S P can therefore be stated as follows : Problem of the consensual merging: Given k views ( ) V and k partial replica ( ) , merge consensually the family ( ) is to find the most large documents maj t S conforming to  such that, for any document t conforming to  and admitting i maj t V as projection according to the view i V , maj t S and t are eventually updates each for other.i.e. (formula 2): ( ) ( ) The solution that we propose to this problem stems from an instrumentalization of that proposed for the expansion (Section 2.2.2).Indeed, we use an associative and commutative operator noted ⊗ to synchronize the tree auto- mata A constructed to carry out the various expansions in order to generate the tree automaton of consensual merging.Noting This is particularly the case if there is at least one node of the global document accessible by more than one co-author and edited by at least two of them using different productions.Reminder: the editing actions made on a partial replica may be cancelled as long as they do not have been incorporated into the global document.
documents of the consensus are the trees of the language generated by the automaton ( ) sc A from an initial state built from the vector made of the initial states of the automata . 2) Using the operator ⊗ , compute the automaton generating the consensus language

Consensus Calculation
Before presenting the consensus calculation algorithm, let us specify using the concepts introduced in Section 2.1 the notion of (two) documents in conflict.Let    Trees we handle are AST and therefore, the nodes are labelled by productions names.Any node labelled by a X-production is said of type X.Furthermore, there is a function type Node such that type Node (t(w)) returns the type of the node located at the address w in t. 16 It may then be noted that two documents (AST) admit no consensus if their roots are of different types.However, for applications that interest us, namely structured editing, since the editions are done from the root (which is always of the type of the axiom) to the leaves using productions, the documents we manipulate always admit at least a consensus. ))

Consensus among Multiple (Two) Documents
( ) Figure 7 present the document resulting from the consensual merging of the Figure 7. Document resulting from the consensual merging of the documents in Figure 6.
documents in Figure 6.We have prume at the level of nodes 2.1 in both documents who are in conflict.When t t t = ⊗ , there may be nodes of 1 t and those of 2 t which are updates of the nodes of c t : it is said in this case that 1 t (resp. 2 t ) and c t are updates each for other.Definition 6. 1 2 , t t be two documents that are not in conflict.It will be said that they are updates each for other and it is noted 1 2 t t ≅ , if there exists at least two addresses , w w′ of their respective domains such that ( ) ( ) 2 t w′ ) is a bud and ( ) 2 t w (resp.( ) 1 t w′ ) is not.

Construction of Consensus Automaton
Consideration of documents with buds requires the readjustment of some models.For example, in the following, we will handle the tree automata with exit states instead of tree automata introduced in definition 4. Intuitively, a state q of an automaton is called an exit state if there is a unique transition [ ] ( ) X ω → associated to it for generating a tree reduced to a bud of type X ∈ Σ : q is then of the form (Open X, []).
A tree automata with exit states A is a quintuplet ( ) designate the same objects as those introduced in the definition 4, and exit is a predicate defined on the states ( ).Any state q of Q for which exit q is True is an exit state.
A type for automata with exit states can be defined in Haskell [16] [17] by: In Section 3.2.1 above, we said that, when two nodes are in conflict, "they appear in the consensus tree as a (unique) bud".From the point of view of automata synchronization, the concept of "nodes in conflict" is the counterpart of the concept of "states in conflict" (as we specify below) and the above extract is reflected in the automata context by "when two state are in conflict, they appear in the consensus automaton in the form of a (single) exit state".Thus, if we consider two states of the same type 1 0 q and 2 0 q (which are not exit states) of two automata 1 auto and 2 auto with associated transitions families re- spectively ( ) ( )  , we say that the states 1 0 q and 2 0 q are in conflict (and we note there is no transition starting from each of them and with the same label, i.e.

( ) ( ) { } ( ) { }
( ) This can be coded in Haskell by the following function: If X is the type of two states q and q′ in conflict, they admit a single con-  .It is therefore obvious that two given automata admit a consensual automaton when their initials states are of the same type.The following function performs this test.
The operator ⊗ used to calculate the synchronized consensual automaton A is a relaxation of the operator used for calculating the automata product presented in the definition 5.
is an automaton with exit states and is constructed as follows: • Its states are vectors of states : • its initial state is formed by the vector of initial states of different automata: • For the exit function , it is considered that when a given automaton reached an exit state 17 , it no longer contributes to behavior, but is not opposed to the synchronization of the others automata: it is said "asleep" (see listing "Consensus Listing" below, lines 16, 18 and 23).So, a state ( ) 1 , , k q q q = is an exit state if: (a) all composite states i q are asleep (see listing "Consensus Listing" below, line 5) or (b) there exist any two states i q and , j q i j ≠ , components of q that are in conflict (see listing "Consensus Listing" below, line j exit q q exit q i k i j i j q q ⇔ ∀ ∈ ∃ ≠ • Its transitions are given by: is the unique transition of q; X is the type of q. b) Else a) reflects the fact that if a state q is an exit one, we associate a single transition for generating a tree reduced to a bud of the type of q (see listing "Consensus Listing" below, line 11).
With (b1) we say that, if the component ( ) i q of q is an exit state, then for all composite state , (1 j n ≤ ≤ ) appearing in the right hand side in the transition (b), the i th component should be asleep.Since it must not prevent other non-asleep states to synchronize, it must be of the form where X is the type of the other states ( ) l j q (being yet synchronized) belonging 17 The corresponding node in the reverse projection of the document is a bud and reflects the fact that the corresponding author did not publish it.In the case that this node is shared with another co-author who published it in its (partial) replica, it is the edition made by the latter that will be retained when merging. to (see function forward Sleep State defined in listing "Consensus Listing" below line 23 and used in lines 16 and 18).Finally, with (b2) we then for all composite state , (1 j n ≤ ≤ ) appearing in the right part in the transition (b) above, the i th component is ( ) q (see listing "Consensus Listing" below, lines 12 to 15).
Consensus Listing Proposition 7. The tree automaton ( ) recognizes/generates from the initial state ( ) all the trees from the consensual merging trees recognized/generated by each automaton q .Moreover, these trees are the biggest prefixes without conflicts of merged trees.
Proof.A tree t is recognized by the synchronized automaton ( )

and only if, one can label each of its nodes by a state of the automaton in accordance
with what is specified by the transitions of the automaton.Moreover, all the leaf nodes of t must be labelled by using final transitions; in our case, they are of the form [ ] ( ) , q p → .This means that if a node whose initial label is a is labelled by the state q and if it admits n successors respectively labelled by 1 , , n q q , then ( ) 1 , , a n q q q  → must be a transition of the automaton.As the automaton is deterministic 18 this labelling is unique elsewhere (including the initial state attached to the root of the tree).By focusing our attention both on the state q labelling a node and its i th component i q , on each of the branches of t, 1) we cut as soon as we reach an exit state in relation to the automaton an exit state), or, 2) if q is an exit state (in this case we are handling a leaf) and i q is not, relative to ( ) i A (in this case, i q was in conflict with at least one other component j q of q); we replace that node with any sub-tree i t′ that can be generated by since a state of A is an exit one if and only if each of its components is (in the i A ) or if at least two of its components are in conflict.
Conversely, suppose ( ) , by definition of the synchronized consensual automaton, we have ) Suppose that t is recognized by ( ) ⊗ A ; thus there is a labelling of its nodes with the states of ( ) and as the transitions used for the labelling of its leaves are final.Let p t be a prefix of t.Let us show that p t is not recognized by ( ) using the fact that any labelling of p t has at least one leaf node labelled by a state that is not associated to a final transition.The labels associated to the nodes of p t are the same as those associated to the nodes of same addresses in t because p t is a prefix of t and ( ) t is obtained from t by pruning some sub-trees of t; so naturally he has a (non-zero) number of leaf nodes that can be developed to obtain t.Let us choose a such node and call it f n .Suppose that it is labelled p and was associated with a state ( ) when labelling t.The p_transition that permit to recognize f n is not a final transition.Indeed, f n has in t p sons whose labels can be suppose to be the states f p q qf .This means according to the labelling process and considering the fact that ( ) is deterministic, that the single transition used for labelling f n and of its p sons is ( ) which is not a final transition.Therefore, p t is not recognized by ( )

Illustration
Figure 8 is an illustration of an asynchronous cooperative editing process generating partial replicas (Figure 8(c) and Figure 8(e)) in conflict 19 from the grammar having as productions: generation of consensus trees (Figure 8(h)).Remember that this example is fully unfold in Appendix A: therein, we present the different manipulated automata and a set of the simplest consensus documents (Figure 9).

Conclusions
We presented in this paper a reconciliation approach said by consensus, of partial replicas of a document submitted to an asynchronous cooperative editing process: so we opted for a partial optimistic replication approach [12].The approach proposed is based on a relaxation of the synchronous product of automata to construct an automaton capable of generating consensus documents.
The approach proposed in this paper is supported by mathematical proofs of the proposals.The presented algorithms have been implemented in Haskell [16] and experienced in many examples (including the one introduced in Section 3.3 and fully unfold in Appendix A) with convincing results.These algorithms can be also experienced in a truly distributed environment via the graphical editor prototype that we have built for this need; some screenshots are provided in Appendix B.
The deployment and use of this prototype will probably be better off if one incorporates a publishing environment generator which, from a specification of an asynchronous cooperative editing process describing in a DSL (Domain Specific Language) [19], the model of licit documents (grammar), various coauthors, their publishing sites and views, etc., will generate for each co-author her dedicated publishing environment including, for example, among others: a dedicated editor with conventional facilities of currents editors (syntax highlighting, code completion, etc.), tools for asking synchronizations, tools for backup and restoration of partial replicas being edited etc.

B w P
These schemas are obtained from the grammar productions [9] and the pairs , i X w are states where X is a grammatical symbol and i w a forest encoded in the Dyck language.The first schema for example, states that the Abstract Syntax Tree (AST) generated from the state

B w B w C w
The linearization of the partial replica 2 tv (Figure 8(e)) is

2
A associates to this replica has as Table 1.Automaton accepting updates of the (partial) replica tv1.
Let's note that, the state 2 Table 2. Automaton accepting updates of the (partial) replica tv2.
This prototype is used following a networked client-server model.Its user interface offers to the user facilities for creating workflows: grammars, actors and views, initial document, … (Figure 10), editing and validation of partial replicas, connecting to a local or remote workflow (Figure 11).Moreover, this interface also offers him functionality to experience the concepts of projection, expansion and consensual merging (Figure 12).This prototype is designed using Java and Haskell languages.

Figure 1 . 1 A
Figure 1.The desynchronized cooperative editing of partial replicas of a structured document.1 A sort is a datum used to define the structuring rules (syntax) in a document model.Example: a non-terminal symbol in a context free grammar, an ELEMENT in a DTD.

Figure 2 .
Figure 2.An orchestration diagram of an asynchronous cooperative editing workflow.

Figure 1
is an illustration of such a cooperative edition in which, the edition and the merging of the (global) document in conformity to the (global) model G of documents are perform on site 1; while on site 2 and 3, other co-authors perform the edition of the partial replicas in accordance with projected models of documents 1 G and 2

Figure 4 .
Figure 4. Example of an indexed tree.
) obtained respectively by projections from the views

Figure 5 .
Figure 5. Example of projections made on a document and partial replicas obtained.

,
typeState Close X ts X = document[14]: the updates detection phase which consists of recognizing the different replica nodes (locations) where updates have been made since the last synchronization, and the propagation phase which consists in combining the updates made on the various replicas to produce a new synchronized state (document) for each replica.In an asynchronous cooperative editing workflow of several partial replicas of a document, when you reach a synchronization point, you can end up with unmergeable replicas in their entirety as they contain not compatible updates12 they must be reconciled.This can be done by questioning (cancelling) some local editing actions in order to resolve conflicts and result in a coherent global version said of consensus.

Figure 6 .
Figure 6.Example of documents in conflict.

Figure 6
Figure 6 shows two conflicting documents.In fact, at address 2.1 we have two nodes of the same type ("C") but edited with different C-productions: production C C C → in the first document, and production C A C → in the

A⊗
being deterministic (see proposition 3.3.3of[18]), A is deterministic as synchronous product of deterministic automata.

7 ,
C w is reduced to a bud of type C (C is the symbol located at the left hand side of 7 P ).

Figure 10 .
Figure 10.Some prototype screenshots showing windows for the creation of a cooperative editing workflow.

Figure 11 .
Figure 11.Some prototype screenshots showing the authentication window of a co-author (Auteur1) as well as those displaying the different workflows, local and remote in which he is implicated.

1 -
Workflow name, synchronization server and then, click on "Next" 2-Definitions of productions, axiom of the grammar and various views.3-Informations on workflow owner and on different co-authors 4-Creation of the global initial document

Figure 12 .
Figure 12.An illustration of the consensual merging in the prototype.