diff options
Diffstat (limited to 'Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder')
-rw-r--r-- | Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/Logic2AlloyLanguageMapper_TypeScopeMapping.xtend | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/Logic2AlloyLanguageMapper_TypeScopeMapping.xtend b/Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/Logic2AlloyLanguageMapper_TypeScopeMapping.xtend index 378c9553..a270cb73 100644 --- a/Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/Logic2AlloyLanguageMapper_TypeScopeMapping.xtend +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/Logic2AlloyLanguageMapper_TypeScopeMapping.xtend | |||
@@ -1,4 +1,3 @@ | |||
1 | <<<<<<< HEAD | ||
2 | package hu.bme.mit.inf.dlsreasoner.alloy.reasoner.builder | 1 | package hu.bme.mit.inf.dlsreasoner.alloy.reasoner.builder |
3 | 2 | ||
4 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type | 3 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type |
@@ -42,49 +41,4 @@ class Logic2AlloyLanguageMapper_AsConstraint implements Logic2AlloyLanguageMappe | |||
42 | ] | 41 | ] |
43 | ] | 42 | ] |
44 | } | 43 | } |
45 | ======= | ||
46 | package hu.bme.mit.inf.dlsreasoner.alloy.reasoner.builder | ||
47 | |||
48 | import hu.bme.mit.inf.dslreasoner.logic.model.logiclanguage.Type | ||
49 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.ALSDocument | ||
50 | import hu.bme.mit.inf.dslreasoner.alloyLanguage.AlloyLanguageFactory | ||
51 | |||
52 | interface Logic2AlloyLanguageMapper_TypeScopeMapping { | ||
53 | def void addLowerMultiplicity(ALSDocument document, Type type, int lowerMultiplicty, Logic2AlloyLanguageMapper mapper, Logic2AlloyLanguageMapperTrace trace) | ||
54 | def void addUpperMultiplicity(ALSDocument document, Type type, int upperMultiplicty, Logic2AlloyLanguageMapper mapper, Logic2AlloyLanguageMapperTrace trace) | ||
55 | } | ||
56 | |||
57 | class Logic2AlloyLanguageMapper_AsConstraint implements Logic2AlloyLanguageMapper_TypeScopeMapping { | ||
58 | val extension AlloyLanguageFactory factory = AlloyLanguageFactory.eINSTANCE | ||
59 | val Logic2AlloyLanguageMapper_Support support = new Logic2AlloyLanguageMapper_Support; | ||
60 | val Logic2AlloyLanguageMapper_TypeMapper typeMapper | ||
61 | |||
62 | new(Logic2AlloyLanguageMapper_TypeMapper mapper) { | ||
63 | this.typeMapper = mapper | ||
64 | } | ||
65 | |||
66 | override addLowerMultiplicity(ALSDocument document, Type type, int lowerMultiplicty, Logic2AlloyLanguageMapper mapper, Logic2AlloyLanguageMapperTrace trace) { | ||
67 | document.factDeclarations += createALSFactDeclaration => [ | ||
68 | it.name = support.toID(#["LowerMultiplicity",support.toID(type.name),lowerMultiplicty.toString]) | ||
69 | it.term = createALSLeq => [ | ||
70 | it.leftOperand = createALSCardinality => [ | ||
71 | it.operand = support.unfoldPlus(typeMapper.transformTypeReference(type,mapper,trace).map[t|createALSReference => [it.referred = t]].toList) | ||
72 | ] | ||
73 | it.rightOperand = createALSNumberLiteral => [it.value = lowerMultiplicty] | ||
74 | ] | ||
75 | ] | ||
76 | } | ||
77 | |||
78 | override addUpperMultiplicity(ALSDocument document, Type type, int upperMultiplicty, Logic2AlloyLanguageMapper mapper, Logic2AlloyLanguageMapperTrace trace) { | ||
79 | document.factDeclarations += createALSFactDeclaration => [ | ||
80 | it.name = support.toID(#["UpperMultiplicity",support.toID(type.name),upperMultiplicty.toString]) | ||
81 | it.term = createALSMeq => [ | ||
82 | it.leftOperand = createALSCardinality => [ | ||
83 | it.operand = support.unfoldPlus(typeMapper.transformTypeReference(type,mapper,trace).map[t|createALSReference => [it.referred = t]].toList) | ||
84 | ] | ||
85 | it.rightOperand = createALSNumberLiteral => [it.value = upperMultiplicty] | ||
86 | ] | ||
87 | ] | ||
88 | } | ||
89 | >>>>>>> 25a4b1b5... VAMPIRE: post-submission push | ||
90 | } \ No newline at end of file | 44 | } \ No newline at end of file |