MatrixAI / Emergence

Distributed Infrastructure Orchestration
Apache License 2.0
1 stars 0 forks source link

Graph Rewriting #58

Open jeannieyeliu opened 5 years ago

jeannieyeliu commented 5 years ago

https://en.wikipedia.org/wiki/Graph_rewriting

jeannieyeliu commented 5 years ago

Graph rewriting

the technique of creating a new graph out of an. original graph algorithmically.

basic idea

structure

how to apply the rule to the host graph:

  1. searching for an occurrence of the pattern graph L. (pattern matching )
  2. replace the found occurrences with the replacement graph R.
jeannieyeliu commented 5 years ago

Graph rewirting approaches

Algebraic approach

CMCDragonkai commented 5 years ago

It's important that we figure out how to use this for configuration changes and dealing with atomicity and action at a distance problems. Please look these up @imliuye and I will expand on this examples later.

jeannieyeliu commented 5 years ago

Double pushout graph rewriting

DPO Graph rewriting allows the specification of graph transformations by specifying a pattern of fixed size and composition to be found and replaced, where part of the pattern can be preserved.

structure

two steps for rewritting

jeannieyeliu commented 5 years ago

Single pushout graph rewriting

in contrast a graph rewriting rule of the SPO approach is a single morphism in the category of labeled multigraphs and partial mappings that preserve the multigraph structure: r: L -> R. Thus a rewriting step is defined by a single pushout diagram. Practical understanding of this is similar to the DPO approach. The difference is, that there is no interface between the host graph G and the graph G' being the result of the rewriting step.

From the practical perspective, the key distinction between DPO and SPO is how they deal with the deletion of nodes with adjacent edges, in particular, how they avoid that such deletions may leave behind "dangling edges". The DPO approach only deletes a node when the rule specifies the deletion of all adjacent edges as well (this dangling condition can be checked for a given match), whereas the SPO approach simply disposes the adjacent edges, without requiring an explicit specification.

There is also another algebraic-like approach to graph rewriting, based mainly on Boolean algebra and an algebra of matrices, called matrix graph grammars

jeannieyeliu commented 5 years ago

Determinate graph rewriting

Yet another approach to graph rewriting, known as determinate graph rewriting, came out of logic and database theory. In this approach, graphs are treated as database instances, and rewriting operations as a mechanism for defining queries and views; therefore, all rewriting is required to yield unique results (up to isomorphism), and this is achieved by applying any rewriting rule concurrently throughout the graph, wherever it applies, in such a way that the result is indeed uniquely defined.

jeannieyeliu commented 5 years ago

Term graph rewriting

involves the processing or transformation of term graphs (also known as abstract semantic graphs) by a set of syntactic rewrite rules.

Term graphs are a prominent topic in programming language research since term graph rewriting rules are capable of formally expressing a compiler's operational semantics. Term graphs are also used as abstract machines capable of modelling chemical and biological computations as well as graphical calculi such as concurrency models. Term graphs can perform automated verification and logical programming since they are well-suited to representing quantified statements in first order logic. Symbolic programming software is another application for term graphs, which are capable of representing and performing computation with abstract algebraic structures such as groups, fields and rings.

The TERMGRAPH conference focuses entirely on research into term graph rewriting and its applications.

jeannieyeliu commented 5 years ago

This idea might somehow related to #issue 54 consider the following situation: The change of constraints when new resources are available,

in the following example, when a new Hardware N2 is added, constraints should be redefined and automatons A1, A2, A3, A4 should be reallocated. resources reallocation could be somehow changed by a graph rewriting system image

And vice versa, when N2 is down, resource should be reallocated image

jeannieyeliu commented 5 years ago

Now we need to figure out what rules should be defined in the graph rewritting system

jeannieyeliu commented 5 years ago

Another idea is to translate abstract description into more concrete representations. In the emergence system for instance: img