Skip to content

Attributes of refined objects in graph transformations not accessible #388

@FabianMarcoBauer

Description

@FabianMarcoBauer

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;
}
  1. In the BoardPatterns.gt, add a pattern containing two Boulders:
abstract pattern twoBoulders {
	fig: Boulder

	fig2: Boulder
}
  1. 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
}
  1. Rebuild the SolobanRules project.
  2. 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'..

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions