Bug 500732 - [qvtr] Enforcement/Realized variable search
Summary: [qvtr] Enforcement/Realized variable search
Status: NEW
Alias: None
Product: QVTd
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows NT
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-02 07:30 EDT by Ed Willink CLA
Modified: 2016-09-02 08:35 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2016-09-02 07:30:18 EDT
The following attempt at the PN2SC initialization:

	top relation Net2StateChart {
		domain pn net : Net {};	   
		enforce domain sc statechart : Statechart {
			topState = ts : AND {}
		};
	}

	top relation Place2Basic {
		sc : scMM::Statechart;
		domain pn p : Place {
			cnet = net : Net{}
		};	   
		enforce domain sc b : Basic {
			rcontains = o : OR {
				rcontains = topState : AND {
					Statechart = sc
				}
			}			
		};
		when {
			Net2StateChart(net, sc);
		}
	}

converts a p->cnet to b->o->topState->sc container hierarchy.

b,o are realized
sc is a variable defined by the when

But: topState is also realized when it should be resolved as a pre-existing child.

How do we tell which enforced variables are created (realized) and which discovered?
Comment 1 Ed Willink CLA 2016-09-02 08:35:11 EDT
Workaround:

Express the 'realized' in the pattern
Express the 'referenced' in guards

	sc : scMM::Statechart;
	topState : scMM::AND;
	...   
	enforce domain sc b : Basic {
		rcontains = o : OR {
			rcontains = topState
		}
		{ topState = sc.topState }
	};
	when {
		Net2StateChart(net, sc);
	}

But this requires the programmer to have 'global' insight.

Surely QVTr should sort it out automatically? But it must be done before conversion to QVTc. Is a global QVTr analysis necessary?