Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » EVL: Constraint cross-referencing
EVL: Constraint cross-referencing [message #1717457] Mon, 14 December 2015 07:38 Go to next message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 148
Registered: December 2015
Senior Member
Hi,

How can I refer to a specific constraint which is defined in the other context?
For example, in the following code, the c2 constraint must satisfy the c1 constraint of context1. Here, the code
self.satisfies("context1:c1")
is not functional!

context context1 {
	constraint c1 {
		.
		.
		.
	} 
}

...

context context2 {
	constraint c2 {
		guard: self.satisfies("context1:c1") and ...
		.
		.
		.
	}
}


Kind regards,
Alireza

[Updated on: Sat, 30 January 2016 14:35]

Report message to a moderator

Re: EVL: Constraint cross-referencing [message #1717480 is a reply to message #1717457] Mon, 14 December 2015 10:18 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2182
Registered: July 2009
Location: York, UK
Senior Member

Hi Alireza,

Constraint names in satisfies() cannot be qualified i.e. you should use self.satisfies("c1") instead and EVL will resolve the targeted constraint at runtime.

Cheers,
Dimitris
Re: EVL: Constraint cross-referencing [message #1717489 is a reply to message #1717480] Mon, 14 December 2015 11:09 Go to previous messageGo to next message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 148
Registered: December 2015
Senior Member
Dear Dimitris,

I used the unqualified format of the constraint, but the error message is "constraint c1 not found"!

Kind regards,
Alireza

[Updated on: Mon, 14 December 2015 11:09]

Report message to a moderator

Re: EVL: Constraint cross-referencing [message #1717491 is a reply to message #1717489] Mon, 14 December 2015 11:11 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2182
Registered: July 2009
Location: York, UK
Senior Member

Hi Alireza,

This means that the model element on which you're calling satisfies("c1") is not of a type that defines a "c1" constraint.

Cheers,
Dimitris
Re: EVL: Constraint cross-referencing [message #1717492 is a reply to message #1717491] Mon, 14 December 2015 11:15 Go to previous messageGo to next message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 148
Registered: December 2015
Senior Member
Dear Dimitris,

You're right. Again, the error message for the statement context1.satisfies("c1") remains the same!

Kind regards,
Alireza
Re: EVL: Constraint cross-referencing [message #1717494 is a reply to message #1717492] Mon, 14 December 2015 11:22 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2182
Registered: July 2009
Location: York, UK
Senior Member

Hi Alireza,

Could you please provide a minimal example [1] I can use to reproduce this?

Cheers,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/minimal-examples/

Re: EVL: Constraint cross-referencing [message #1717496 is a reply to message #1717494] Mon, 14 December 2015 11:31 Go to previous messageGo to next message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 148
Registered: December 2015
Senior Member
Dear Dimitris,

Thank you very much.
As you said, the problem resolved by the correct specification of the constraint context.

Kind regards,
Alireza
Re: EVL: Constraint cross-referencing [message #1720904 is a reply to message #1717480] Thu, 21 January 2016 18:00 Go to previous messageGo to next message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 148
Registered: December 2015
Senior Member
Dear Dimitris,

Hi,

I have another problem in this topic. Please, consider the following scenario:
context A {
	constraint A1 {
		.
		.
		.
	} 
		.
		.
		.
	constraint An {
		.
		.
		.
	}
}

context B {
	constraint B1 {
		.
		.
		.
	}
		.
		.
		.
	constraint Bm {
		.
		.
		.
	}
}

context C {
	constraint C1 {
		.
		.
		.
	}
		.
		.
		.
	constraint Ck {
		.
		.
		.
	}
}


How to make the context A involved constraints, i.e., A1 through An, a prerequisite for evaluating other contexts' constraints like B and C here?

In other words, I would like to have the execution semantics as (A and B and C), but the execution order must be first A, and then B and C.

I used the statements like,
guard: A.satisfiesAll("A1", ..., "An")


in the guard section of the context B, but the displayed error is:

Method 'satisfiesAll' not found for: A


Please, help me to resolve this problem. Thank you very much.

Best regards,
Alireza
icon5.gif  Re: EVL: How to cross-reference constraints amongst different contexts [message #1724171 is a reply to message #1720904] Mon, 22 February 2016 05:35 Go to previous messageGo to next message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 148
Registered: December 2015
Senior Member
Hi,

Is there any suggestion or similar trick to solve this problem?

Best regards,
Alireza
Re: EVL: How to cross-reference constraints amongst different contexts [message #1724215 is a reply to message #1724171] Mon, 22 February 2016 10:32 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2182
Registered: July 2009
Location: York, UK
Senior Member

Hi Alireza,

Thanks for the reminder - this somehow fell through the cracks. Your guard should look as follows:

guard: self.satisfiesAll("A1", ..., "An")


Cheers,
Dimitris
Re: EVL: How to cross-reference constraints amongst different contexts [message #1724235 is a reply to message #1724215] Mon, 22 February 2016 12:35 Go to previous message
Alireza Rouhi is currently offline Alireza RouhiFriend
Messages: 148
Registered: December 2015
Senior Member
Dear Dimitris,

Thanks a lot for your suggested solution.

Best regards,
Alireza
Previous Topic:query 2 xml files at the same time
Next Topic:EOL: How to parse Boolean
Goto Forum:
  


Current Time: Wed Sep 25 16:41:16 GMT 2024

Powered by FUDForum. Page generated in 0.04663 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top