diff options
author | 2018-06-13 13:27:33 +0200 | |
---|---|---|
committer | 2018-06-13 13:27:33 +0200 | |
commit | 354f378b6b8ed4d50fc4f378fe48217f9881505c (patch) | |
tree | 35676794eb6870ca67b006b452d58b43cf3abb44 /Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/statecoder | |
parent | type multiplicity is refined to 0 (diff) | |
download | VIATRA-Generator-354f378b6b8ed4d50fc4f378fe48217f9881505c.tar.gz VIATRA-Generator-354f378b6b8ed4d50fc4f378fe48217f9881505c.tar.zst VIATRA-Generator-354f378b6b8ed4d50fc4f378fe48217f9881505c.zip |
Updated partial model representation handling
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/statecoder')
2 files changed, 18 insertions, 2 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/statecoder/IdentifierBasedStateCoderFactory.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/statecoder/IdentifierBasedStateCoderFactory.xtend index c421ace6..f55a501a 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/statecoder/IdentifierBasedStateCoderFactory.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/statecoder/IdentifierBasedStateCoderFactory.xtend | |||
@@ -18,6 +18,8 @@ import org.eclipse.viatra.dse.statecode.IStateCoderFactory | |||
18 | import org.eclipse.viatra.query.runtime.api.IPatternMatch | 18 | import org.eclipse.viatra.query.runtime.api.IPatternMatch |
19 | import org.eclipse.xtend.lib.annotations.Accessors | 19 | import org.eclipse.xtend.lib.annotations.Accessors |
20 | import org.eclipse.xtend.lib.annotations.Data | 20 | import org.eclipse.xtend.lib.annotations.Data |
21 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialPrimitiveInterpretation | ||
22 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialComplexTypeInterpretation | ||
21 | 23 | ||
22 | class IdentifierBasedStateCoderFactory implements IStateCoderFactory{ | 24 | class IdentifierBasedStateCoderFactory implements IStateCoderFactory{ |
23 | 25 | ||
@@ -116,7 +118,13 @@ class IdentifierBasedStateCoder implements IStateCoder{ | |||
116 | } else if(element instanceof PartialRelationInterpretation) { | 118 | } else if(element instanceof PartialRelationInterpretation) { |
117 | return element.interpretationOf.name.hashCode | 119 | return element.interpretationOf.name.hashCode |
118 | } else if(element instanceof PartialTypeInterpratation) { | 120 | } else if(element instanceof PartialTypeInterpratation) { |
119 | return element.interpretationOf.name.hashCode | 121 | if(element instanceof PartialPrimitiveInterpretation) { |
122 | element.class.simpleName.hashCode | ||
123 | } else if (element instanceof PartialComplexTypeInterpretation){ | ||
124 | return element.interpretationOf.name.hashCode | ||
125 | } else { | ||
126 | throw new UnsupportedOperationException('''Unsupported type: «element.class.simpleName»''') | ||
127 | } | ||
120 | } else { | 128 | } else { |
121 | println(element) | 129 | println(element) |
122 | throw new UnsupportedOperationException('''Unsupported type: «element.class.simpleName»''') | 130 | throw new UnsupportedOperationException('''Unsupported type: «element.class.simpleName»''') |
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/statecoder/NeighbourhoodBasedStateCoderFactory.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/statecoder/NeighbourhoodBasedStateCoderFactory.xtend index 5fb85b0c..65a8207e 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/statecoder/NeighbourhoodBasedStateCoderFactory.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/statecoder/NeighbourhoodBasedStateCoderFactory.xtend | |||
@@ -30,6 +30,8 @@ import java.util.Set | |||
30 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeDeclaration | 30 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeDeclaration |
31 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RelationDeclaration | 31 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RelationDeclaration |
32 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.neighbourhood.PartialInterpretation2NeighbourhoodRepresentation | 32 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.neighbourhood.PartialInterpretation2NeighbourhoodRepresentation |
33 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialComplexTypeInterpretation | ||
34 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialPrimitiveInterpretation | ||
33 | 35 | ||
34 | class NeighbourhoodBasedStateCoderFactory implements IStateCoderFactory { | 36 | class NeighbourhoodBasedStateCoderFactory implements IStateCoderFactory { |
35 | val List<NeighbourhoodBasedPartialInterpretationStateCoder> statecoders = new LinkedList | 37 | val List<NeighbourhoodBasedPartialInterpretationStateCoder> statecoders = new LinkedList |
@@ -142,7 +144,13 @@ class NeighbourhoodBasedPartialInterpretationStateCoder implements IStateCoder{ | |||
142 | } else if(o instanceof PartialRelationInterpretation) { | 144 | } else if(o instanceof PartialRelationInterpretation) { |
143 | return o.interpretationOf.name | 145 | return o.interpretationOf.name |
144 | } else if(o instanceof PartialTypeInterpratation) { | 146 | } else if(o instanceof PartialTypeInterpratation) { |
145 | return o.interpretationOf.name | 147 | if(o instanceof PartialPrimitiveInterpretation) { |
148 | o.class.simpleName.hashCode | ||
149 | } else if (o instanceof PartialComplexTypeInterpretation){ | ||
150 | return o.interpretationOf.name.hashCode | ||
151 | } else { | ||
152 | throw new UnsupportedOperationException('''Unsupported type: «o.class.simpleName»''') | ||
153 | } | ||
146 | } else { | 154 | } else { |
147 | throw new UnsupportedOperationException('''Unsupported type: «o.class.simpleName»''') | 155 | throw new UnsupportedOperationException('''Unsupported type: «o.class.simpleName»''') |
148 | } | 156 | } |