diff options
Diffstat (limited to 'Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src')
2 files changed, 20 insertions, 6 deletions
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/AlloyModelInterpretation.xtend b/Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/AlloyModelInterpretation.xtend index d00291e0..53674ca3 100644 --- a/Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/AlloyModelInterpretation.xtend +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/AlloyModelInterpretation.xtend | |||
@@ -286,10 +286,7 @@ class AlloyModelInterpretation implements LogicModelInterpretation{ | |||
286 | override getInterpretation(ConstantDeclaration constant) { | 286 | override getInterpretation(ConstantDeclaration constant) { |
287 | constant.lookup(this.constant2Value) | 287 | constant.lookup(this.constant2Value) |
288 | } | 288 | } |
289 | 289 | ||
290 | override getMinimalInteger() { this.minInt } | ||
291 | override getMaximalInteger() { this.maxInt } | ||
292 | |||
293 | // Alloy term -> logic term | 290 | // Alloy term -> logic term |
294 | def private atomLabel2Term(String label) { | 291 | def private atomLabel2Term(String label) { |
295 | if(label.number) return Integer.parseInt(label) | 292 | if(label.number) return Integer.parseInt(label) |
@@ -306,6 +303,19 @@ class AlloyModelInterpretation implements LogicModelInterpretation{ | |||
306 | return false | 303 | return false |
307 | } | 304 | } |
308 | } | 305 | } |
306 | |||
307 | override getAllIntegersInStructure() { | ||
308 | throw new UnsupportedOperationException("TODO: auto-generated method stub") | ||
309 | } | ||
310 | |||
311 | override getAllRealsInStructure() { | ||
312 | throw new UnsupportedOperationException("TODO: auto-generated method stub") | ||
313 | } | ||
314 | |||
315 | override getAllStringsInStructure() { | ||
316 | throw new UnsupportedOperationException("TODO: auto-generated method stub") | ||
317 | } | ||
318 | |||
309 | } | 319 | } |
310 | 320 | ||
311 | /** | 321 | /** |
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 65fdcfdf..e5c443f6 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 | |||
@@ -279,10 +279,14 @@ class Logic2AlloyLanguageMapper { | |||
279 | it.number = typeMapper.getUndefinedSupertypeScope(config.typeScopes.maxNewElements,trace) | 279 | it.number = typeMapper.getUndefinedSupertypeScope(config.typeScopes.maxNewElements,trace) |
280 | it.exactly = (config.typeScopes.maxNewElements == config.typeScopes.minNewElements) | 280 | it.exactly = (config.typeScopes.maxNewElements == config.typeScopes.minNewElements) |
281 | ] | 281 | ] |
282 | if(config.typeScopes.maxIntScope == LogicSolverConfiguration::Unlimited) throw new UnsupportedOperationException( | 282 | if(config.typeScopes.maxNewIntegers == LogicSolverConfiguration::Unlimited) throw new UnsupportedOperationException( |
283 | '''An integer scope have to be specified for Alloy!''') | 283 | '''An integer scope have to be specified for Alloy!''') |
284 | it.typeScopes += createALSIntScope => [ | 284 | it.typeScopes += createALSIntScope => [ |
285 | number = Integer.SIZE-Integer.numberOfLeadingZeros(config.typeScopes.maxIntScope) | 285 | val knownIntegerMax = config.typeScopes.knownIntegers.max |
286 | val knownIntegerMin = config.typeScopes.knownIntegers.min | ||
287 | val needNewPlaces = Math.max(knownIntegerMax - knownIntegerMin - config.typeScopes.maxNewIntegers,0) | ||
288 | val maxAbsoluteValue = Math.max(Math.abs(knownIntegerMax)+needNewPlaces+1/2, Math.abs(knownIntegerMin)+needNewPlaces/2) | ||
289 | number = Integer.SIZE-Integer.numberOfLeadingZeros(maxAbsoluteValue) | ||
286 | ] | 290 | ] |
287 | // for(definedScope : config.typeScopes.allDefinedScope) { | 291 | // for(definedScope : config.typeScopes.allDefinedScope) { |
288 | // it.typeScopes += createALSSigScope => [ | 292 | // it.typeScopes += createALSSigScope => [ |