Declarative Specification Generation
Steps
1. Let us take the example of Simple UML Class Diagrams as the input meta-model in the directory:
"platform:/resource/Pramana/demo/MDD4DRES/SimpleUMLCD/input/metamodel/simpleUML_MM.km"
2. Open the file "platform:/resource/Pramana/demo/MDD4DRES/SimpleUMLCD/bin/metamodel2AlloyModel.kmt"
3. You can now set the parameters in this file. In the operation initialize of the Class Main you will find the following options.
operation initialize():Void is do
//Setting Input Kermeta Meta-model Path
self.inputModelPath := "platform:/resource/Pramana/demo/MDD4DRES/SimpleUMLCD/input/metamodel/simpleUML_MM.km"
//Setting Output Meta-model Path
self.outputModelPath := "platform:/resource/Pramana/demo/MDD4DRES/SimpleUMLCD/output/alloyModel/simpleUML_MM_gts.als"
//Setting Synthesis Scope for Classes
self.synthesisScope := 20
//Setting Synthesis Scope for Integer
self.integerScope := 5
//Setting Synthesis Scope for Sequences
self.sequenceScope := 5
//Setting Synthesis Scope for String
self.stringScope := 5
//Use Integer instead of String
self.useIntForString := true
//Setting Experiment/Strategy
self.experimentSelection := Experiment.GenerateAndTestSimple
//self.experimentSelection := Experiment.GenerateAndTestCustom
//self.experimentSelection := Experiment.ModelFragmentsAllRanges
//self.experimentSelection := Experiment.ModelFragmentsAllPartitions
end
4. To Generate an Alloy Model : Right Click -> Run As -> Kermeta Application
5. An Alloy model is generated for the GenerateAndTestSimple strategy in:
"platform:/resource/Pramana/demo/MDD4DRES/SimpleUMLCD/output/alloyModel/simpleUML_MM_gts.als"