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

GIPSL: Shortcut for filter overlap #196

Open
maxkratz opened this issue Dec 19, 2024 · 0 comments
Open

GIPSL: Shortcut for filter overlap #196

maxkratz opened this issue Dec 19, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@maxkratz
Copy link
Member

Currently, there are many constraints in GIPSL that have filter expressions for overlapping the GT pattern/rule (context) with the set of mappings (that also have the same GT pattern/rule) as context. This is in most but not all occurrences because of #195.

Besides the "complete" overlap of a pattern/rule context to a mapping, there is sometimes the need to overlap only parts of the two. Example:

pattern pa {
    o1 : Object
    o2 : Object
    x : SomeOtherType
}

pattern pb {
    o1 : Object
    o2 : Object
    y : AnotherType
}

mapping m with pa;

constraint -> pattern::pb {
    mappings.m->filter(map | map.nodes().o1 == self.o1 & map.nodes().o2 == self.o2)->[...]
}

These filter expressions only get longer and more "wordy" if the respective patterns/rules have more nodes that must be overlapped.
It would be nice to have some kind of shortcut for the overlap, e.g.:

constraint -> pattern::pb {
    mappings.m->overlap(o1=o1 & o2=o2)->[...]
}
@maxkratz maxkratz added the enhancement New feature or request label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant