diff options
Diffstat (limited to 'Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder')
-rw-r--r-- | Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/Logic2AlloyLanguageMapper.xtend | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/Logic2AlloyLanguageMapper.xtend b/Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/Logic2AlloyLanguageMapper.xtend index ee7c092a..5c16f406 100644 --- a/Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/Logic2AlloyLanguageMapper.xtend +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/Logic2AlloyLanguageMapper.xtend | |||
@@ -97,6 +97,7 @@ class Logic2AlloyLanguageMapper { | |||
97 | 97 | ||
98 | it.incqueryEngine = ViatraQueryEngine.on(new EMFScope(problem)) | 98 | it.incqueryEngine = ViatraQueryEngine.on(new EMFScope(problem)) |
99 | ] | 99 | ] |
100 | specification.transformRandomisation(config.randomise) | ||
100 | 101 | ||
101 | typeMapper.transformTypes(problem.types,problem.elements,this,trace) | 102 | typeMapper.transformTypes(problem.types,problem.elements,this,trace) |
102 | 103 | ||
@@ -146,7 +147,24 @@ class Logic2AlloyLanguageMapper { | |||
146 | return new TracedOutput(specification,trace) | 147 | return new TracedOutput(specification,trace) |
147 | } | 148 | } |
148 | 149 | ||
149 | 150 | def transformRandomisation(ALSDocument document, int randomisation) { | |
151 | if(randomisation !== 0) { | ||
152 | document.signatureBodies += createALSSignatureBody => [ | ||
153 | val declaration = createALSSignatureDeclaration => [ | ||
154 | it.name = support.toID(#["language","util","randomseed"]) | ||
155 | ] | ||
156 | it.declarations += declaration | ||
157 | it.multiplicity = ALSMultiplicity::ONE | ||
158 | for(i : 1..randomisation) { | ||
159 | it.fields+=createALSFieldDeclaration => [ | ||
160 | it.name = support.toID(#["language","util","randomseedField",i.toString]) | ||
161 | it.multiplicity = ALSMultiplicity::ONE | ||
162 | it.type = createALSReference => [referred = declaration] | ||
163 | ] | ||
164 | } | ||
165 | ] | ||
166 | } | ||
167 | } | ||
150 | 168 | ||
151 | def transformInverseAssertion(InverseRelationAssertion assertion, Logic2AlloyLanguageMapperTrace trace) { | 169 | def transformInverseAssertion(InverseRelationAssertion assertion, Logic2AlloyLanguageMapperTrace trace) { |
152 | val a = assertion.inverseA | 170 | val a = assertion.inverseA |