eMoflon / emoflon-ibex

Shared, eMoflon-specific component for incremental unidirectional and bidirectional graph transformations
GNU General Public License v3.0
12 stars 4 forks source link

Attributes of refined objects in graph transformations not accessible #388

Open FabianMarcoBauer opened 5 years ago

FabianMarcoBauer commented 5 years ago

When creating conditions for attributes in patterns that refine another pattern, only the attributes of the object type specified in the parent pattern can be used for comparisons.

Example:

  1. In the SokobanLanguage, add an attribute to Blocks:
    class Block extends Boulder {  
    attr EInt [1] type;
    }
  2. In the BoardPatterns.gt, add a pattern containing two Boulders:

    abstract pattern twoBoulders {
    fig: Boulder
    
    fig2: Boulder
    }
  3. In the BoardPatterns.gt, add a second pattern refining the previously created pattern, which tries to compare their attributes:

    pattern twoBlocks refines twoBoulders {
    fig2: Block {
        .figId == fig.figId // works
        .type == 1 // works
        .type == fig.type // fails
    }
    
    fig: Block
    }
  4. Rebuild the SolobanRules project.
  5. In Boardpatterns.gt in the pattern twoBlocks, the second occurrence of type in the line .type == fig.type is marked with Could not find attribute 'type'..
anthonyanjorin commented 5 years ago

Thanks @FabianMarcoBauer This is probably a bug in the scope provider for gt files. I guess the candidates for referenced attributes do not take refinements into account.