This repository has been archived by the owner on Sep 17, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First commit of the tfsmandactivity operator
- Loading branch information
1 parent
b131f68
commit aaa4861
Showing
5 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
official_samples/bcool_TFSMAndActivity/language_workbench/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/gemoc-gen/ |
17 changes: 17 additions & 0 deletions
17
official_samples/bcool_TFSMAndActivity/language_workbench/.project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.gemoc.sample.bcool.tfsmandactivity</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.gemoc.bcool.model.xtext.bcoolbuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.gemoc.bcool.model.xtext.bcoolnature</nature> | ||
</natures> | ||
</projectDescription> |
14 changes: 14 additions & 0 deletions
14
official_samples/bcool_TFSMAndActivity/language_workbench/operator/TfsmAndActivities.bcool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
TfsmAndActivities | ||
|
||
ImportLib "platform:/resource/org.gemoc.sample.bcool.tfsmandactivity/operator/facilities.bcoollib" | ||
ImportLib "platform:/resource/org.gemoc.sample.bcool.tfsmandactivity/operator/facilities.moccml" | ||
|
||
ImportInterface "platform:/resource/org.modelexecution.operationalsemantics.ad.concurrent.ecl/model/ActivitiyDiagramV2.ecl" as activity | ||
ImportInterface "platform:/resource/org.gemoc.sample.tfsm.eclmoc2as/ecl/TFSM.ecl" as tfsm | ||
|
||
|
||
Operator SyncFSMEventsAndActions (FSMEvents : tfsm::occurs, ActionExecute : activity::executeIt) | ||
when FSMEvents.name = ActionExecute.name; | ||
CoordinationRule: | ||
facilities.RendezVous(FSMEvents, ActionExecute ) | ||
end operator; |
14 changes: 14 additions & 0 deletions
14
official_samples/bcool_TFSMAndActivity/language_workbench/operator/facilities.bcoollib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
BCoolLibrary facilities{ | ||
|
||
|
||
relationDeclarations { | ||
RelationDeclaration RendezVous {} | ||
, RelationDeclaration Causality {} | ||
} | ||
|
||
|
||
expressionDeclarations { | ||
ExpressionDeclaration SampledBy{} | ||
} | ||
|
||
} |
68 changes: 68 additions & 0 deletions
68
official_samples/bcool_TFSMAndActivity/language_workbench/operator/facilities.moccml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
AutomataConstraintLibrary ModeAutomataCoordination{ | ||
import "platform:/plugin/fr.inria.aoste.timesquare.ccslkernel.model/ccsllibrary/kernel.ccslLib" as kernel; | ||
import "platform:/plugin/fr.inria.aoste.timesquare.ccslkernel.model/ccsllibrary/CCSL.ccslLib" as CCSLLib; | ||
|
||
|
||
RelationLibrary CCSLBasedRelations { | ||
|
||
RelationDefinition RendezVousDef[RendezVous]{ | ||
Relation RendezVousrelat[Coincides]( Clock1->ClockA, Clock2->ClockB) | ||
} | ||
|
||
RelationDefinition CausalityDef[Causality]{ | ||
Relation Causalityrelat[Causes]( LeftClock->ClockLeft, RightClock->ClockRight) | ||
} | ||
|
||
RelationDefinition RendezVouswithGlobalClockDef[RendezVouswithGlobalClock]{ | ||
Expression sampledStartAction = SampledBy (Sampled -> globalClock, Trigger-> startAction) | ||
Expression sampledOccurs = SampledBy (Sampled -> globalClock, Trigger-> occurs) | ||
|
||
Relation RendezVousSamples[Coincides]( Clock2-> sampledStartAction , Clock1-> sampledOccurs ) | ||
} | ||
|
||
AutomataRelationDefinition RendenVousAfterTwoDef[RendenVousAfterTwo]{ | ||
init: initState | ||
|
||
from initState to firstOccurs : initStateTofirstOccurs | ||
-> ( ) | ||
|
||
from firstOccurs to secondOccurs : firstOccurstoSecondOccurs | ||
-> ( when eventA ) | ||
|
||
from secondOccurs to firstOccurs : secondOccurstoFirstOccurs | ||
-> ( when eventA , eventB) | ||
|
||
State initState( out : initStateTofirstOccurs ) | ||
State firstOccurs ( in : initStateTofirstOccurs, secondOccurstoFirstOccurs out : firstOccurstoSecondOccurs) | ||
State secondOccurs ( in : firstOccurstoSecondOccurs out : secondOccurstoFirstOccurs) | ||
} | ||
|
||
RelationDeclaration RendezVous (ClockA:clock, ClockB:clock) | ||
RelationDeclaration Causality (ClockLeft:clock, ClockRight:clock) | ||
RelationDeclaration RendezVouswithGlobalClock (startAction: clock , occurs: clock, globalClock: clock ) | ||
|
||
RelationDeclaration RendenVousAfterTwo( | ||
eventA:clock, | ||
eventB:clock | ||
) | ||
} | ||
|
||
ExpressionLibrary BCOolfilters{ | ||
ExpressionDefinition FilterNDef [FilterN]{ | ||
root=filterN_result | ||
Expression filterN_result = Periodic | ||
( PeriodicBaseClock->WaitingClock, PeriodicPeriod -> WaitingValue, PeriodicOffset -> four) | ||
} | ||
|
||
ExpressionDefinition SampledDef [SampledBy]{ | ||
root=Sample_result | ||
Expression Sample_result = SampledOn(SampledOnTrigger -> Trigger, SampledOnSampledClock ->Sampled) | ||
} | ||
|
||
ExpressionDeclaration SampledBy(Trigger: clock, Sampled: clock):clock | ||
ExpressionDeclaration FilterN(WaitingClock: clock, WaitingValue: int):clock | ||
|
||
} | ||
|
||
|
||
} |