Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 331592

Summary: [Interpreter]/[Editor] Application Conditions/Negative Application Conditions don't work as expected
Product: [Modeling] EMFT.Henshin Reporter: Felix Rieger <riegerf>
Component: InterpreterAssignee: Project Inbox <henshin.interpreter-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: critical    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Application Condition/Negative Application Condition tests none

Description Felix Rieger CLA 2010-12-01 14:32:34 EST
Positive/Negative Application Conditions do not work as expected: 
When creating ACs/NACs with the editor, mappings from LHS-->AC/NAC are placed on the same level as mappings from LHS-->RHS.
However, this leads to unexpected results when matching the Rule, i.e. ACs seem to behave like NACs, whereas NACs seem to behave like ACs (there might be slight differences from actual "negated" AC/NAC behaviour; this was not tested, so further research may be necessary).
When moving the mappings from LHS-->AC/NAC into the AC/NAC itself, however, the AC/NAC will work as expected.

So either there is a problem with the Interpreter or with the (Tree-based) rule editor, depending on whether the mappings from LHS-->AC/NAC should be outside or inside the AC/NAC.

See attached code for details.
Comment 1 Felix Rieger CLA 2010-12-01 14:35:35 EST
Created attachment 184291 [details]
Application Condition/Negative Application Condition tests

To be run as a JUnit plugin test.

- See HenshinNacTest.java for details on the model and rules.
- henshin rules are located in testhenshinrules/nactest.henshin
- model instance is located in testmodelinstances/fourLayer.testmodelmodel
Comment 2 Enrico Biermann CLA 2010-12-02 08:42:24 EST
Mappings for application conditions are not defined on the same level as LHS->RHS mappings.

LHS->RHS mappings are defined in the rule.
Mappings for any application condition are defined in its corresponding NestedApplication.

For example a single application condition for the LHS of a rule (LHS->AC), the mappings would be contained in the NestedCondition which contains the graph AC as the conclusion as well as the mappings between LHS and AC. The NestedCondition is again contained in the graph for which the condition is defined, in this case the graph LHS.
LHS
->NestedCondition
-->AC
-->Mappings between LHS and AC