diff options
author | Aren Babikian <aren.babikian@mail.mcgill.ca> | 2021-01-14 13:11:21 -0500 |
---|---|---|
committer | Aren Babikian <aren.babikian@mail.mcgill.ca> | 2021-01-14 13:11:21 -0500 |
commit | be2fd000db012b3738211ebee8db36001235c918 (patch) | |
tree | b642948cc40fa1576bbf4eeedcd00bf086e0e8b8 /Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic | |
parent | forgot to commit some changes to Application (diff) | |
download | VIATRA-Generator-be2fd000db012b3738211ebee8db36001235c918.tar.gz VIATRA-Generator-be2fd000db012b3738211ebee8db36001235c918.tar.zst VIATRA-Generator-be2fd000db012b3738211ebee8db36001235c918.zip |
complete change of real representation BigDecimal->Double
Diffstat (limited to 'Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic')
4 files changed, 8 insertions, 8 deletions
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicModelInterpretation.xtend b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicModelInterpretation.xtend index cdcbb48a..b49eb6aa 100644 --- a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicModelInterpretation.xtend +++ b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicModelInterpretation.xtend | |||
@@ -85,9 +85,9 @@ interface LogicModelInterpretation { | |||
85 | /** | 85 | /** |
86 | * Returns all real numbers relevant to the logic structure. Not all integer is necessarily used. | 86 | * Returns all real numbers relevant to the logic structure. Not all integer is necessarily used. |
87 | */ | 87 | */ |
88 | def SortedSet<BigDecimal> getAllRealsInStructure() | 88 | def SortedSet<Double> getAllRealsInStructure() |
89 | 89 | ||
90 | def Map<TermDescription, BigDecimal> getAllRealsWithInterpretation() { | 90 | def Map<TermDescription, Double> getAllRealsWithInterpretation() { |
91 | allRealsInStructure.toMap [ real | | 91 | allRealsInStructure.toMap [ real | |
92 | (LogiclanguageFactory.eINSTANCE.createRealLiteral => [value = real]) as TermDescription | 92 | (LogiclanguageFactory.eINSTANCE.createRealLiteral => [value = real]) as TermDescription |
93 | ] | 93 | ] |
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicProblemBuilder.xtend b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicProblemBuilder.xtend index fa97cbef..c8ff0b28 100644 --- a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicProblemBuilder.xtend +++ b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicProblemBuilder.xtend | |||
@@ -481,9 +481,9 @@ class LogicProblemBuilder{ | |||
481 | def Pow(TermDescription left, TermDescription right) {createPow => [leftOperand = left.toTerm rightOperand = right.toTerm]} | 481 | def Pow(TermDescription left, TermDescription right) {createPow => [leftOperand = left.toTerm rightOperand = right.toTerm]} |
482 | def asTerm(boolean value) { createBoolLiteral => [x|x.value = value] } | 482 | def asTerm(boolean value) { createBoolLiteral => [x|x.value = value] } |
483 | def asTerm(int value) { createIntLiteral => [x|x.value = value] } | 483 | def asTerm(int value) { createIntLiteral => [x|x.value = value] } |
484 | def asTerm(double value) { BigDecimal.valueOf(value).asTerm } | 484 | def asTerm(double value) { createRealLiteral => [x|x.value = value] } |
485 | def asTerm(float value) { BigDecimal.valueOf(value).asTerm } | 485 | def asTerm(float value) { createRealLiteral => [x|x.value = value] } |
486 | def asTerm(BigDecimal value) { createRealLiteral => [x|x.value = value] } | 486 | // def asTerm(BigDecimal value) { createRealLiteral => [x|x.value = value] } |
487 | def asTerm(String value) { createStringLiteral => [x|x.value = value]} | 487 | def asTerm(String value) { createStringLiteral => [x|x.value = value]} |
488 | def InstanceOf(TermDescription term, TypeDescriptor type) { | 488 | def InstanceOf(TermDescription term, TypeDescriptor type) { |
489 | createInstanceOf => [ | 489 | createInstanceOf => [ |
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicSolver.xtend b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicSolver.xtend index e62a3cb7..51d315b4 100644 --- a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicSolver.xtend +++ b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicSolver.xtend | |||
@@ -96,7 +96,7 @@ public class TypeScopes { | |||
96 | public var minNewIntegers = 0 | 96 | public var minNewIntegers = 0 |
97 | public var maxNewIntegers = Unlimited | 97 | public var maxNewIntegers = Unlimited |
98 | 98 | ||
99 | public var SortedSet<BigDecimal> knownReals = new TreeSet | 99 | public var SortedSet<Double> knownReals = new TreeSet |
100 | /** | 100 | /** |
101 | * Sets the number of Reals that has to be used to solve the problem. | 101 | * Sets the number of Reals that has to be used to solve the problem. |
102 | */ | 102 | */ |
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicStructureBuilder.xtend b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicStructureBuilder.xtend index 7ca67d83..507e4bfd 100644 --- a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicStructureBuilder.xtend +++ b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicStructureBuilder.xtend | |||
@@ -146,7 +146,7 @@ class LogicStructureBuilder{ | |||
146 | } | 146 | } |
147 | 147 | ||
148 | def protected dispatch Term toTerm(Integer o) { createIntLiteral=>[value = o] } | 148 | def protected dispatch Term toTerm(Integer o) { createIntLiteral=>[value = o] } |
149 | def protected dispatch Term toTerm(BigDecimal o) { createRealLiteral=>[value = o]} | 149 | def protected dispatch Term toTerm(Double o) { createRealLiteral=>[value = o]} |
150 | def protected dispatch Term toTerm(Boolean o) { createBoolLiteral=>[value = o]} | 150 | def protected dispatch Term toTerm(Boolean o) { createBoolLiteral=>[value = o]} |
151 | def protected dispatch Term toTerm(SymbolicDeclaration o) { createSymbolicValue=>[symbolicReference = o]} | 151 | def protected dispatch Term toTerm(SymbolicDeclaration o) { createSymbolicValue=>[symbolicReference = o]} |
152 | def public Term termDescriptiontoTerm(TermDescription term) { | 152 | def public Term termDescriptiontoTerm(TermDescription term) { |
@@ -171,7 +171,7 @@ class LogicStructureBuilder{ | |||
171 | // Atomic resoulutions | 171 | // Atomic resoulutions |
172 | def protected dispatch Object resolve(IntLiteral literal, LogicModelInterpretation interpretation, Map<Variable,Object> variableBinding) { return literal.value as Integer } | 172 | def protected dispatch Object resolve(IntLiteral literal, LogicModelInterpretation interpretation, Map<Variable,Object> variableBinding) { return literal.value as Integer } |
173 | def protected dispatch Object resolve(BoolLiteral literal, LogicModelInterpretation interpretation, Map<Variable,Object> variableBinding) { return literal.value } | 173 | def protected dispatch Object resolve(BoolLiteral literal, LogicModelInterpretation interpretation, Map<Variable,Object> variableBinding) { return literal.value } |
174 | def protected dispatch Object resolve(RealLiteral literal, LogicModelInterpretation interpretation, Map<Variable,Object> variableBinding) { return literal.value as BigDecimal } | 174 | def protected dispatch Object resolve(RealLiteral literal, LogicModelInterpretation interpretation, Map<Variable,Object> variableBinding) { return literal.value as Double } |
175 | def protected dispatch Object resolve(StringLiteral literal, LogicModelInterpretation interpretation, Map<Variable,Object> variableBinding) { return literal.value } | 175 | def protected dispatch Object resolve(StringLiteral literal, LogicModelInterpretation interpretation, Map<Variable,Object> variableBinding) { return literal.value } |
176 | 176 | ||
177 | def protected dispatch Object resolve(Not not, LogicModelInterpretation interpretation, Map<Variable,Object> variableBinding) { | 177 | def protected dispatch Object resolve(Not not, LogicModelInterpretation interpretation, Map<Variable,Object> variableBinding) { |