Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attributes of refined objects in graph transformations not accessible #388

Open
FabianMarcoBauer opened this issue Feb 28, 2019 · 1 comment
Assignees
Labels

Comments

@FabianMarcoBauer
Copy link
Contributor

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'..
@anthonyanjorin
Copy link
Contributor

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.

@anthonyanjorin anthonyanjorin removed their assignment Sep 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants