projet-mini-genie-logiciel-.../livrables/SimplePDL-invariants.mtl

20 lines
1 KiB
Plaintext
Raw Permalink Normal View History

2021-10-20 14:36:15 +00:00
[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()
/]