diff options
author | 2019-03-05 13:37:02 -0500 | |
---|---|---|
committer | 2019-03-05 13:37:02 -0500 | |
commit | df12163128073296c4d811fa67b02e37ceb20179 (patch) | |
tree | 7509fdd478d6ff3d908d0ab5aa39ed9a8260f0b0 /Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_ScopeMapper.xtend | |
parent | Begin handing of scope and fix type definitions. (diff) | |
download | VIATRA-Generator-df12163128073296c4d811fa67b02e37ceb20179.tar.gz VIATRA-Generator-df12163128073296c4d811fa67b02e37ceb20179.tar.zst VIATRA-Generator-df12163128073296c4d811fa67b02e37ceb20179.zip |
Implement type scope handling
Diffstat (limited to 'Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_ScopeMapper.xtend')
-rw-r--r-- | Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_ScopeMapper.xtend | 69 |
1 files changed, 29 insertions, 40 deletions
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_ScopeMapper.xtend b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_ScopeMapper.xtend index 84aa521d..4b7ea3d0 100644 --- a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_ScopeMapper.xtend +++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/src/ca/mcgill/ecse/dslreasoner/vampire/reasoner/builder/Logic2VampireLanguageMapper_ScopeMapper.xtend | |||
@@ -18,7 +18,6 @@ class Logic2VampireLanguageMapper_ScopeMapper { | |||
18 | def dispatch public void transformScope(LogicSolverConfiguration config, Logic2VampireLanguageMapperTrace trace) { | 18 | def dispatch public void transformScope(LogicSolverConfiguration config, Logic2VampireLanguageMapperTrace trace) { |
19 | val VLSVariable variable = createVLSVariable => [it.name = "A"] | 19 | val VLSVariable variable = createVLSVariable => [it.name = "A"] |
20 | 20 | ||
21 | |||
22 | // 1. make a list of constants equaling the min number of specified objects | 21 | // 1. make a list of constants equaling the min number of specified objects |
23 | val List<VLSConstant> instances = newArrayList | 22 | val List<VLSConstant> instances = newArrayList |
24 | for (var i = 0; i < config.typeScopes.minNewElements; i++) { | 23 | for (var i = 0; i < config.typeScopes.minNewElements; i++) { |
@@ -28,47 +27,37 @@ class Logic2VampireLanguageMapper_ScopeMapper { | |||
28 | ] | 27 | ] |
29 | instances.add(cst) | 28 | instances.add(cst) |
30 | } | 29 | } |
31 | |||
32 | |||
33 | // TODO: specify for the max | ||
34 | |||
35 | 30 | ||
36 | // 2. Create initial fof formula to specify the number of elems | 31 | // TODO: specify for the max |
37 | val cstDec = createVLSFofFormula => [ | 32 | if (config.typeScopes.minNewElements != 0) { |
38 | it.name = "typeScope" | 33 | // 2. Create initial fof formula to specify the number of elems |
39 | it.fofRole = "axiom" | 34 | val cstDec = createVLSFofFormula => [ |
40 | it.fofFormula = createVLSUniversalQuantifier => [ | 35 | it.name = "typeScope" |
41 | it.variables += support.duplicate(variable) | 36 | it.fofRole = "axiom" |
42 | // check below | 37 | it.fofFormula = createVLSUniversalQuantifier => [ |
43 | it.operand = createVLSEquivalent => [ | 38 | it.variables += support.duplicate(variable) |
44 | it.left = support.topLevelTypeFunc | 39 | // check below |
45 | it.right = support.unfoldOr(instances.map [ i | | 40 | it.operand = createVLSEquivalent => [ |
46 | createVLSEquality => [ | 41 | it.left = support.topLevelTypeFunc |
47 | it.left = createVLSVariable => [it.name = variable.name] | 42 | it.right = support.unfoldOr(instances.map [ i | |
48 | it.right = i | 43 | createVLSEquality => [ |
49 | ] | 44 | it.left = createVLSVariable => [it.name = variable.name] |
50 | ]) | 45 | it.right = i |
46 | ] | ||
47 | ]) | ||
48 | ] | ||
51 | ] | 49 | ] |
52 | ] | 50 | ] |
53 | ] | 51 | trace.specification.formulas += cstDec |
54 | trace.specification.formulas += cstDec | 52 | |
55 | 53 | // TODO: specify for scope per type | |
56 | 54 | // 3. Specify uniqueness of elements | |
57 | // TODO: specify for scope per type | 55 | val uniqueness = createVLSFofFormula => [ |
58 | 56 | it.name = "typeUniqueness" | |
59 | 57 | it.fofRole = "axiom" | |
60 | 58 | it.fofFormula = support.establishUniqueness(instances) | |
61 | // 3. Specify uniqueness of elements | 59 | ] |
62 | val uniqueness = createVLSFofFormula => [ | 60 | trace.specification.formulas += uniqueness |
63 | it.name = "typeUniqueness" | 61 | } |
64 | it.fofRole = "axiom" | ||
65 | it.fofFormula = support.unfoldOr(instances.map [ i | | ||
66 | createVLSEquality => [ | ||
67 | it.left = createVLSVariable => [it.name = variable.name] | ||
68 | it.right = i | ||
69 | ] | ||
70 | ]) | ||
71 | ] | ||
72 | trace.specification.formulas += cstDec | ||
73 | } | 62 | } |
74 | } | 63 | } |