20 lines
1 KiB
Plaintext
20 lines
1 KiB
Plaintext
[comment encoding = UTF-8 /]
|
|
[module toLTL('http://simplepdl')]
|
|
|
|
|
|
[template public processToLTL(aProcess : Process)]
|
|
[comment @main/]
|
|
[file (aProcess.name + '.ltl', false, 'UTF-8')]
|
|
[let wds : OrderedSet(WorkDefinition) = aProcess.getWDs() ]
|
|
[for (wds) before ('[] <> ((') separator (') /\\ (') after ('));')]['(' + self.name + '_idle /\\ -' + self.name + '_running /\\ -' + self.name + '_finished) \\/ (-' + self.name + '_idle /\\ ' + self.name + '_running /\\ -' + self.name + '_finished) \\/ (-' + self.name + '_idle /\\ -' + self.name + '_running /\\ ' + self.name + '_finished)'/][/for]
|
|
[for (wds) before ('[] <> ((') separator (') /\\ (') after ('));')][self.name + '_finished => [](-' + self.name + '_running' + ' /\\ -' + self.name + '_idle /\\ ' + self.name + '_started)'/][/for]
|
|
[/let]
|
|
[/file]
|
|
[/template]
|
|
|
|
|
|
[query public getWDs(p: Process) : OrderedSet(WorkDefinition) =
|
|
p.processElements->select( e | e.oclIsTypeOf(WorkDefinition) )
|
|
->collect( e | e.oclAsType(WorkDefinition) )
|
|
->asOrderedSet()
|
|
/] |