diff options
author | 2020-05-08 18:46:10 +0200 | |
---|---|---|
committer | 2020-05-08 18:46:10 +0200 | |
commit | bf0ddbc789689fdaa60d5f648fd35597b2b869b3 (patch) | |
tree | 9b9046ee995107198acf402bdf17bc80fdd76d46 /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner | |
parent | Unit propagation trace fixes (diff) | |
download | VIATRA-Generator-bf0ddbc789689fdaa60d5f648fd35597b2b869b3.tar.gz VIATRA-Generator-bf0ddbc789689fdaa60d5f648fd35597b2b869b3.tar.zst VIATRA-Generator-bf0ddbc789689fdaa60d5f648fd35597b2b869b3.zip |
contained objects instantiated immediately if target class non-abstract
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/rules/RefinementRuleProvider.xtend | 59 |
1 files changed, 30 insertions, 29 deletions
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 b4cb9ec7..7e53f944 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 | |||
@@ -179,36 +179,37 @@ class RefinementRuleProvider { | |||
179 | 179 | ||
180 | if(containmentReferences.contains(relation)) { | 180 | if(containmentReferences.contains(relation)) { |
181 | val targetTypeInterpretation = getTypeInterpretation(i, relation, 1) | 181 | val targetTypeInterpretation = getTypeInterpretation(i, relation, 1) |
182 | 182 | if(!(targetTypeInterpretation as PartialComplexTypeInterpretation).interpretationOf.isIsAbstract) { | |
183 | val inverseAnnotation = p.assertions.filter(InverseRelationAssertion).filter[it.inverseA === relation || it.inverseB === relation] | 183 | val inverseAnnotation = p.assertions.filter(InverseRelationAssertion).filter[it.inverseA === relation || it.inverseB === relation] |
184 | if(!inverseAnnotation.empty) { | 184 | if(!inverseAnnotation.empty) { |
185 | val onlyInverseAnnotation = if(inverseAnnotation.head.inverseA===relation) { | 185 | val onlyInverseAnnotation = if(inverseAnnotation.head.inverseA===relation) { |
186 | inverseAnnotation.head.inverseB | 186 | inverseAnnotation.head.inverseB |
187 | } else { | ||
188 | inverseAnnotation.head.inverseA | ||
189 | } | ||
190 | val inverseRelationInterpretation = i.partialrelationinterpretation.filter[it.interpretationOf === onlyInverseAnnotation].head | ||
191 | for(var times=0; times<number; times++) { | ||
192 | recursiveObjectCreation.get(sourceTypeInterpretation.interpretationOf) += | ||
193 | new ObjectCreationInterpretationData( | ||
194 | i, | ||
195 | targetTypeInterpretation, | ||
196 | relationInterpretation, | ||
197 | inverseRelationInterpretation, | ||
198 | targetTypeInterpretation.getTypeConstructor | ||
199 | ) | ||
200 | } | ||
201 | |||
187 | } else { | 202 | } else { |
188 | inverseAnnotation.head.inverseA | 203 | for(var times=0; times<number; times++) { |
189 | } | 204 | recursiveObjectCreation.get(sourceTypeInterpretation.interpretationOf) += |
190 | val inverseRelationInterpretation = i.partialrelationinterpretation.filter[it.interpretationOf === onlyInverseAnnotation].head | 205 | new ObjectCreationInterpretationData( |
191 | for(var times=0; times<number; times++) { | 206 | i, |
192 | recursiveObjectCreation.get(sourceTypeInterpretation.interpretationOf) += | 207 | targetTypeInterpretation, |
193 | new ObjectCreationInterpretationData( | 208 | relationInterpretation, |
194 | i, | 209 | null, |
195 | targetTypeInterpretation, | 210 | targetTypeInterpretation.getTypeConstructor |
196 | relationInterpretation, | 211 | ) |
197 | inverseRelationInterpretation, | 212 | } |
198 | targetTypeInterpretation.getTypeConstructor | ||
199 | ) | ||
200 | } | ||
201 | |||
202 | } else { | ||
203 | for(var times=0; times<number; times++) { | ||
204 | recursiveObjectCreation.get(sourceTypeInterpretation.interpretationOf) += | ||
205 | new ObjectCreationInterpretationData( | ||
206 | i, | ||
207 | targetTypeInterpretation, | ||
208 | relationInterpretation, | ||
209 | null, | ||
210 | targetTypeInterpretation.getTypeConstructor | ||
211 | ) | ||
212 | } | 213 | } |
213 | } | 214 | } |
214 | } else if(relation.parameters.get(1) instanceof PrimitiveTypeReference) { | 215 | } else if(relation.parameters.get(1) instanceof PrimitiveTypeReference) { |