diff options
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu')
2 files changed, 40 insertions, 3 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/PartialInterpretationInitialiser.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/PartialInterpretationInitialiser.xtend index f7a1ce4f..d37acb6d 100644 --- a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/PartialInterpretationInitialiser.xtend +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage/src/hu/bme/mit/inf/dslreasoner/viatrasolver/partialinterpretationlanguage/PartialInterpretationInitialiser.xtend | |||
@@ -42,6 +42,7 @@ import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.IntLiteral | |||
42 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RealLiteral | 42 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RealLiteral |
43 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.StringLiteral | 43 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.StringLiteral |
44 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialTypeInterpratation | 44 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialTypeInterpratation |
45 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.RelationDefinition | ||
45 | 46 | ||
46 | @Data class Problem2PartialInterpretationTrace { | 47 | @Data class Problem2PartialInterpretationTrace { |
47 | Map<TypeDeclaration, PartialComplexTypeInterpretation> type2Interpretation | 48 | Map<TypeDeclaration, PartialComplexTypeInterpretation> type2Interpretation |
@@ -233,7 +234,11 @@ class PartialInterpretationInitialiser { | |||
233 | 234 | ||
234 | def private Map<RelationDeclaration, PartialRelationInterpretation> initRelations(PartialInterpretation interpretation, PrimitiveValueTrace trace) { | 235 | def private Map<RelationDeclaration, PartialRelationInterpretation> initRelations(PartialInterpretation interpretation, PrimitiveValueTrace trace) { |
235 | val Map<RelationDeclaration, PartialRelationInterpretation> relation2Interpretation = new HashMap | 236 | val Map<RelationDeclaration, PartialRelationInterpretation> relation2Interpretation = new HashMap |
236 | for(relation : interpretation.problem.relations.filter(RelationDeclaration)) { | 237 | val definedRelationDeclarations = interpretation.problem.relations.filter(RelationDefinition).map[defines] |
238 | val undefinedRelationDeclarations = interpretation.problem.relations.filter(RelationDeclaration).filter[ | ||
239 | declared | !definedRelationDeclarations.exists[defined | defined === declared] | ||
240 | ] | ||
241 | for(relation : undefinedRelationDeclarations) { | ||
237 | val partialInterpretation = relation.initialisePartialRelationInterpretation | 242 | val partialInterpretation = relation.initialisePartialRelationInterpretation |
238 | interpretation.partialrelationinterpretation += partialInterpretation | 243 | interpretation.partialrelationinterpretation += partialInterpretation |
239 | relation2Interpretation.put(relation,partialInterpretation) | 244 | relation2Interpretation.put(relation,partialInterpretation) |
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..bdf402f3 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 | |||
@@ -5,9 +5,13 @@ import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Relation | |||
5 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type | 5 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type |
6 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeDefinition | 6 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.TypeDefinition |
7 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.BinaryElementRelationLink | 7 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.BinaryElementRelationLink |
8 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.BooleanElement | ||
9 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.IntegerElement | ||
8 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialComplexTypeInterpretation | 10 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialComplexTypeInterpretation |
9 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation | 11 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation |
10 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialRelationInterpretation | 12 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialRelationInterpretation |
13 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.RealElement | ||
14 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.StringElement | ||
11 | import java.util.HashMap | 15 | import java.util.HashMap |
12 | import java.util.Map | 16 | import java.util.Map |
13 | import java.util.Set | 17 | import java.util.Set |
@@ -106,10 +110,38 @@ class PartialInterpretation2Gml { | |||
106 | ''' | 110 | ''' |
107 | } | 111 | } |
108 | 112 | ||
109 | def protected transormTitle(DefinedElement object) { | 113 | def protected dispatch transormTitle(DefinedElement object) { |
110 | if(object.name!= null)object.name | 114 | if(object.name !== null) object.name.replace("\"", "") |
111 | else "null" | 115 | else "null" |
112 | } | 116 | } |
117 | def protected dispatch transormTitle(BooleanElement object) { | ||
118 | if(object.valueSet) { | ||
119 | object.value.toString | ||
120 | } else { | ||
121 | "?" | ||
122 | } | ||
123 | } | ||
124 | def protected dispatch transormTitle(IntegerElement object) { | ||
125 | if(object.valueSet) { | ||
126 | object.value.toString | ||
127 | } else { | ||
128 | "?" | ||
129 | } | ||
130 | } | ||
131 | def protected dispatch transormTitle(RealElement object) { | ||
132 | if(object.valueSet) { | ||
133 | object.value.toString | ||
134 | } else { | ||
135 | "?" | ||
136 | } | ||
137 | } | ||
138 | def protected dispatch transormTitle(StringElement object) { | ||
139 | if(object.valueSet) { | ||
140 | object.value.toString | ||
141 | } else { | ||
142 | "?" | ||
143 | } | ||
144 | } | ||
113 | 145 | ||
114 | def protected transformLink( | 146 | def protected transformLink( |
115 | PartialRelationInterpretation reference, | 147 | PartialRelationInterpretation reference, |