diff options
3 files changed, 15 insertions, 3 deletions
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.logic2ecore/src/hu/bme/mit/inf/dslreasoner/logic2ecore/Logic2Ecore.xtend b/Framework/hu.bme.mit.inf.dslreasoner.logic2ecore/src/hu/bme/mit/inf/dslreasoner/logic2ecore/Logic2Ecore.xtend index 92deeae6..08c6b7b7 100644 --- a/Framework/hu.bme.mit.inf.dslreasoner.logic2ecore/src/hu/bme/mit/inf/dslreasoner/logic2ecore/Logic2Ecore.xtend +++ b/Framework/hu.bme.mit.inf.dslreasoner.logic2ecore/src/hu/bme/mit/inf/dslreasoner/logic2ecore/Logic2Ecore.xtend | |||
@@ -20,6 +20,8 @@ import org.eclipse.emf.ecore.EcorePackage | |||
20 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TermDescription | 20 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TermDescription |
21 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicProblemBuilder | 21 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicProblemBuilder |
22 | import java.util.Map | 22 | import java.util.Map |
23 | import org.eclipse.emf.ecore.EAttribute | ||
24 | import java.math.BigDecimal | ||
23 | 25 | ||
24 | class Logic2Ecore { | 26 | class Logic2Ecore { |
25 | val extension LogicStructureBuilder structureBuilder = new LogicStructureBuilder | 27 | val extension LogicStructureBuilder structureBuilder = new LogicStructureBuilder |
@@ -92,7 +94,7 @@ class Logic2Ecore { | |||
92 | list += l.key | 94 | list += l.key |
93 | } else { | 95 | } else { |
94 | try { | 96 | try { |
95 | sourceObject.eSet(attributeType,l.key) | 97 | sourceObject.eSet(attributeType,translateType(attributeType.EAttributeType,l.key)) |
96 | } catch(Exception e) { | 98 | } catch(Exception e) { |
97 | e.printStackTrace | 99 | e.printStackTrace |
98 | } | 100 | } |
@@ -107,6 +109,16 @@ class Logic2Ecore { | |||
107 | return element2Object.values.root | 109 | return element2Object.values.root |
108 | } | 110 | } |
109 | 111 | ||
112 | def translateType(EDataType type, Object value) { | ||
113 | if(type == EcorePackage.eINSTANCE.EFloat) { | ||
114 | val bd = value as BigDecimal | ||
115 | return bd.floatValue | ||
116 | } else if( type == EcorePackage.eINSTANCE.EDouble ) { | ||
117 | val bd = value as BigDecimal | ||
118 | return bd.doubleValue | ||
119 | } else return value | ||
120 | } | ||
121 | |||
110 | 122 | ||
111 | // if(attributeType.EAttributeType.isSuperTypeOf(targetObject.eClass)) { | 123 | // if(attributeType.EAttributeType.isSuperTypeOf(targetObject.eClass)) { |
112 | // val expression = ecore2Logic.IsAttributeValue(forwardTrace,sourceElement,targetElement,attributeType) | 124 | // val expression = ecore2Logic.IsAttributeValue(forwardTrace,sourceElement,targetElement,attributeType) |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/rules/RefinementRuleProvider.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/rules/RefinementRuleProvider.xtend index f2efc87a..1e7f1d2b 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/rules/RefinementRuleProvider.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/rules/RefinementRuleProvider.xtend | |||
@@ -184,7 +184,7 @@ class RefinementRuleProvider { | |||
184 | if(containmentReferences.contains(relation)) { | 184 | if(containmentReferences.contains(relation)) { |
185 | val targetTypeInterpretation = getTypeInterpretation(i, relation, 1) | 185 | val targetTypeInterpretation = getTypeInterpretation(i, relation, 1) |
186 | if(!(targetTypeInterpretation as PartialComplexTypeInterpretation).interpretationOf.isIsAbstract) { | 186 | if(!(targetTypeInterpretation as PartialComplexTypeInterpretation).interpretationOf.isIsAbstract) { |
187 | val inverseAnnotation = p.assertions.filter(InverseRelationAssertion).filter[it.inverseA === relation || it.inverseB === relation] | 187 | val inverseAnnotation = p.annotations.filter(InverseRelationAssertion).filter[it.inverseA === relation || it.inverseB === relation] |
188 | if(!inverseAnnotation.empty) { | 188 | if(!inverseAnnotation.empty) { |
189 | val onlyInverseAnnotation = if(inverseAnnotation.head.inverseA===relation) { | 189 | val onlyInverseAnnotation = if(inverseAnnotation.head.inverseA===relation) { |
190 | inverseAnnotation.head.inverseB | 190 | inverseAnnotation.head.inverseB |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/visualisation/PartialInterpretation2Gml.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/visualisation/PartialInterpretation2Gml.xtend index 2b42a8b1..190b5c94 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/visualisation/PartialInterpretation2Gml.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/visualisation/PartialInterpretation2Gml.xtend | |||
@@ -107,7 +107,7 @@ class PartialInterpretation2Gml { | |||
107 | } | 107 | } |
108 | 108 | ||
109 | def protected transormTitle(DefinedElement object) { | 109 | def protected transormTitle(DefinedElement object) { |
110 | if(object.name!= null)object.name | 110 | if(object.name!= null)object.name.replace("\"", "") |
111 | else "null" | 111 | else "null" |
112 | } | 112 | } |
113 | 113 | ||