Giter Site home page Giter Site logo

emoflon / emoflon-ibex Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 4.0 73.86 MB

Shared, eMoflon-specific component for incremental unidirectional and bidirectional graph transformations

License: GNU General Public License v3.0

Java 94.33% Xtend 5.67%
bidirectional graph-transformation graph-transformation-systems incremental model-driven-development model-transformations tgg triple-graph-grammars unidirectional

emoflon-ibex's People

Contributors

adrianmoeller avatar anthonyanjorin avatar arg0n1s avatar arikae avatar bruee avatar dome91 avatar fabianmarcobauer avatar filipgia avatar fstolte avatar isabella-grieser avatar janejose avatar legionarycohort avatar maxkratz avatar nilsweidmann avatar patrickrobrecht avatar rfthssn avatar rolandkluge avatar roppermann avatar saman avatar saschaedwinzander avatar smilicas avatar sneha1602 avatar svenpeldszus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

emoflon-ibex's Issues

Sync with Democles

Hi Greg,

I'm now slowly working on synchronisation...

Currently, I have the problem that I seem to be receiving multiple events for essentially the same match. Every time the handleEvent method is invoked, the MatchEvent is different but its DataFrame retrieved via event.getMatching() is exactly the same object.

Any ideas why this is happening? Is such behaviour expected or is something wrong?

The resource set seems to be perfectly ok, and the matches I am receiving make sense as well, just that I'm getting multiple events for the same match.

Cheers and thanks,
Tony

One event per match is not really suitable for MODELGEN

Incremental pattern matcher throws exactly one Event for each match. This is not suitable for MODELGEN as we can apply the same TGG rule only once on the same context.

A possible strategy would be to apply a rule immediately several times on the same context, perhaps with a random number generated within an intervall. We need to decide what would be useful and what do we want to provide. Then we should implement the strategy to avoid the problem described above.

Implement type specific eq constraints

... like eq_string, eq_int, eq_double, eq_boolean.... The generic eq constraint as we had so far does not suit well to the rest.

TODO is:

  • Remove Eq.java
  • remove the eq decleration when generating AttrCondDefLibrary.tgg
  • Implement java classes of new type-specific constraints (like Eq_string.java)
  • ensure that the new constraints are generated into AttrCondDefLibrary.tgg
  • fix our only test project

Block ignore rule matches

if a rule is ignored, e.g., in forward direction (it does not translate any source element), then its FWD matches must be blocked. The most simple strategy would be to generate check(false) into the respective pattern so that everything else is handled uniquely.

Generate Green Patterns (xtend code) for FWD, BWD, CC...

... and later Modelgen.

In order to handle brute force and normal algorithm in a unified manner, please do not create EMF-edges in these patterns but just Edge-Objects. A procedure will then iterate over (chosen) edges and will invoke eSet.

Note that Source and Target of correpsondences are not edges anymore (as opposed to the old implementation). So you can directly set the source and target of a correpsondence in the xtend code.

Find a TGG example attached
ibex test.zip

Design and implement support for refinements

There are plans to support refinements by pattern invocation. I see two alternatives here:

Alternative 1: Additional restrictions on refinements: no overriding of nodes in refining rules but only enlarging the rule pattern is allowed. Then the refined rule is simply a subpattern of the refining rule.

Alternative 2: pattern invocation only on parts that are not overridden. This requires a detection of what is reused in the refining rule and what is being overridden.

Alternative 1 is easier to support (and I would prefer it) but backward compatibility is again an issue due to additional restrictions

Attributes (3): Handle in-place attribute constraints and assignments in our compiler

Extend the TGG compiler as follows: (i) in each operationalisation, attribute assignments might have to be converted to constraints (if green becomes black). (ii) for in-place attribute constraints and assignments, corresponding parts of Viatra queries should be generated. This should be possible as only constants (EDataTypes) are allowed on the right hand part of the expression.

DEC - handle multiple entry points

Currently what we do when we generate DECs is to search for a possible dangling edge.
Given that we found such, we check if there is some other rule application that is still able to translate it given that we apply the current rule.
The problem is now that there is not necessarily just one possible candidate edge in another rule but possibly many of them.
The question is now what to do with them.
The current approach just takes one of these candidates and checks for them which might not be so clever in case that src- or trg-nodes also have attribute constraints that have to be fulfilled.

Attributes (6): Solve CSP and set values

Extend handling of "green" parts of patterns (ask @erhanleblebici exactly which class does this) to first of all solve the CSP of the rule and then use the determined attribute values in the green parts.

Solving the CSP means:

  1. Sorting the constraints (ask @anthonyanjorin which classes can be taken from eMoflon).
  2. Generating some code to solve the constraints in this order (code generation is probably the easiest here as we have to access and use user implemented constraints in the workspace).
  3. Green pattern handling then takes a "csp object" of some kind with the solution, and uses these values to create the required structure.

Visualisation Framework for Ibex

Reengineer and reimplement visualisations for all relevant models in ibex. Perhaps even for .ecore, .vql and anything else we want to work productively with.

It would be nice to use this as a first bootstrap with ibex for ibex, and make first experiences how the new framework performs in a deployed context.

Allow CSPs with Enums

Editor Tasks:

  • specifying user-defined CSPs with Enum Parameters. For example

#userDefined myCustomCSP(a: EString, b: MyEnumType)

  • using Enum-Literals as Constants when invoking such CSPs in TGG rules. For example

myCustomCPS(foo.name, enum::MyEnumType::MyLiteral)

Compiler Tasks:
Make sure that such CSPs in the editor are transformed to the TGG model and considered in TGG compiler analogously to all other CSPs

Our CDtoDoc example in the repostiroy already provides a source metamodel with enum.

OR invocation in Democles

Is it possible to have a pattern construct in democles where the invocations are combined using OR instead of AND? As far as I know, I could implement it myself, although I'm not sure if that would be unproblematic. The question is if such a construct already exists.

Refactoring: Avoid static methods

for example in utils such as ManipulationUtil. In general, avoiding static methods entirely is a good idea to simplify the code. In ManipulationUtil, for example, introducing state set by the constructor could significantly reduce the number of arguments that have to be passed into all the methods.

Design and implement support for NACs

emoflon.ibex currently doesn't support NACs. There are some open decisions before starting the implementation work:

  • Do we only support NACs with one node/edge as it was the case before? Or we support complex NACs that go beyond single nodes/edges? Do we plan to support nested NACs?

  • If we support complex (and perhaps nested NACs): How should the textual syntax look like? What about backward compatibility?

My impression so far: it won't make any difference for pattern matcher between complex and one node/edge NACs (both are realized via negative pattern invocations). I'm rather concerned about the design and the backward compatibility of textual syntax if we allow complex NACs.
Nested NACs seem to me too ambitious for the first version, but clearly feasible with regard to pattern matching.

Avoid generating code to speed up build times

Viatra can be used without generating code from the .vql files
For our use case we do not require this generated code and should avoid this completely (I'm not quite sure how to do this yet).

If build times are still intolerable, we should also avoid generating any .xtend files and just generate Java code directly.

Redesign the naming of pattern variables for attributes

Currently, pattern variables for attributes are named like:
node.name + "_" + attrExpr.attribute.name in PatternTemplate.xtend

Two things are to do:

  1. Extract this naming to a helper method (see, for example, EdgePatternNaming.java) as we can only control our name conventions if we centralize them.

  2. change the naming such that it is more unlikely to come to clashes.
    @anthonyanjorin how can we avoid name clashes between TGG rule variables and our internal variables? Internal variables are things like edge wrappers, protocol nodes, attribute variables in patterns. What do you think about adding _emoflonIbex suffix everywhere and forbidding this to use in TGG rules?

Democles Demo

Hi @gervarro,

after spending a few hours trying to understand the trainbenchmark (and getting the incr. PM to run for my example based on it) I've basically given up.

I've started a minimal example here: https://github.com/eMoflon/emoflon-ibex/tree/democlesTrial and have added some todos for you.

Basically, all I want to understand for the moment is the initialisation code required to get the incremental pattern matcher up and running with minimal effort. All I need for the moment is to be able to then react to the matches found.

In the project there are trivial source, target and correspondence metamodels under /model. Under /instance there is a trivial input model basically consisting of exactly one source element.

I have also specified a very simple pattern that should match for exactly this source element, i.e., in this example a match should be found and I want to react to it by applying a forward rule (and creating the corresponding target element).

Thanks for your help!
Tony

Create imports in generated pattern files

For every pattern parameter that is an EClass, go up to its containing EPackage, and collect an import for it in a set (to avoid duplicates). Maintain a unique label to access the package such as "pkg_i" with index variable i.

Generate for all collected imports import statements of the form:
import <package_i uri> as pkg_i

The type can then be referred to in the pattern as pkg_i::TypeName (this is a bit verbose but avoids the problem of having types of the same name).

Automate Package registration

For imports in the TGG editor of the form "platform:/resource//.ecore"
we can automatically generate code performing the registration of the ecore file as follows:

Resource r = resourceSet.getResource(URI.createFileURI("../<project>/<pathToEcore>.ecore"));
EPackage p = (EPackage)r.getContents().get(0);
Registry.eINSTANCE.put(r.getURI().toString(), p);
Registry.eINSTANCE.put(p.getNSURI(), p);
Registry.eINSTANCE.put("platform:/resource/<project>/<pathToEcore>.ecore", p);

For all other imports we should generate a TODO for the user:

//TODO: Register EPackage for dependency: <import>

Migrate all Test tggs to ibex

We should soon start trying to migrate Test tggs to ibex (so we can avoid regressions).

Even though we are still missing refinements and NACs, some tggs might already work as soon as we have implemented CSPs...

I also suggest we use the new benchmarx framework for our tests.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.