Commit e7e43255 authored by André Pacak's avatar André Pacak
Browse files

functional implementation of typechecker (sumtypes) in IncA

parent 63d6f349
<?xml version="1.0" encoding="UTF-8"?>
<product version="3" modelHash="38ljy552qfh2iomoj0kzvpz6k9ker5h" />
<product version="3" modelHash="85le4py341fiig315xuchyor7xqg6kf" />
......@@ -34,30 +34,31 @@ public final class QuerySpecificationHints extends MPSQuerySpecificationHints {
this.conceptFeatures = new HashSet<SConceptFeature>();
this.conceptFeatures.add(MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eba8aaL, 0x1a4a252762eba8afL, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getProperty(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eba873L, 0x65862e756f28fc0aL, "name1"));
this.conceptFeatures.add(MetaAdapterFactory.getProperty(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eba873L, 0x65862e756f28fc0cL, "name2"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb92d7L, 0x1a4a252762eb92dcL, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb9302L, 0x1a4a252762eb930bL, "t2"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb937fL, 0x1a4a252762eb9384L, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb9302L, 0x1a4a252762eb9307L, "t1"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb933aL, 0x1a4a252762eb934eL, "bound"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb936bL, 0x1a4a252762eb9378L, "t2"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb9390L, 0x1a4a252762eb9395L, "ty1"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb9312L, 0x1a4a252762eb9317L, "t1"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb93f1L, 0x1a4a252762eb93f6L, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb933aL, 0x1a4a252762eb9352L, "body"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eba873L, 0x1a4a252762eba878L, "matchee"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb93faL, 0x1a4a252762eb93ffL, "ty"));
this.conceptFeatures.add(MetaAdapterFactory.getReferenceLink(0xb802a05692a24fbcL, 0x902ef8e5004c331fL, 0x7980b687ac7456feL, 0x7980b687ac7456ffL, "parent"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eba873L, 0x1a4a252762eba8b6L, "c1"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb9390L, 0x1a4a252762eb9399L, "ty2"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eba873L, 0x1a4a252762eba8b6L, "t1"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb9322L, 0x1a4a252762eb9336L, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb937fL, 0x1a4a252762eb93d5L, "ty"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb9362L, 0x1a4a252762eb9367L, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb9359L, 0x1a4a252762eb935eL, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb9312L, 0x1a4a252762eb931bL, "t2"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb936bL, 0x1a4a252762eb9374L, "t1"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb93dcL, 0x1a4a252762eb93e5L, "ty2"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb92d7L, 0x1a4a252762eb92dcL, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb9302L, 0x1a4a252762eb930bL, "t2"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb933aL, 0x1a4a252762eb934eL, "bound"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb93f1L, 0x1a4a252762eb93f6L, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb9390L, 0x1a4a252762eb9399L, "ty2"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb9322L, 0x1a4a252762eb9336L, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb9312L, 0x1a4a252762eb931bL, "t2"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eba873L, 0x1a4a252762eba8bdL, "c2"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eba873L, 0x1a4a252762eba8bdL, "t2"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb93dcL, 0x1a4a252762eb93e1L, "ty1"));
this.languages = new HashSet<SLanguage>();
......
......@@ -95,22 +95,22 @@ public final class Typing_CheckErrorQuerySpecification extends MPSQuerySpecifica
body.setSymbolicParameters(exportedParameters);
PVariable var__tmp_31 = body.getOrCreateVariableByName("tmp_31");
PVariable var__7315585726604365126 = body.newVirtualVariable();
PVariable var__tmp_33 = body.getOrCreateVariableByName("tmp_33");
PVariable var__term = body.getOrCreateVariableByName("term");
PVariable var__tmp_32 = body.getOrCreateVariableByName("tmp_32");
PVariable var__7315585726604313631 = body.newConstantVariable(Integer.parseInt("0"));
PVariable var__7315585726623308137 = body.newConstantVariable(Integer.parseInt("0"));
PVariable var__7315585726623356034 = body.newVirtualVariable();
new TypeConstraint(body, Tuples.flatTupleOf(var_out_1), new ConceptKey(MetaAdapterFactory.getConcept(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x10802efe25aL, "jetbrains.mps.lang.core.structure.BaseConcept")));
new TypeConstraint(body, Tuples.flatTupleOf(var__term), new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb92d1L, "SumTypes.structure.Term")));
new PositivePatternCall(body, Tuples.flatTupleOf(var__term, var__tmp_31), Typing_RequiredQuerySpecification.instance().getInternalQueryRepresentation());
new NegativePatternCall(body, Tuples.flatTupleOf(var__term), Typing_CheckQuerySpecification.instance().getInternalQueryRepresentation());
new Equality(body, var__tmp_32, var__7315585726604313631);
new Equality(body, var__tmp_32, var__7315585726623308137);
new ExpressionEvaluation(body, new IExpressionEvaluator() {
@Override
public String getShortDescription() {
return "7315585726604365126";
return "7315585726623356034";
}
@Override
......@@ -123,8 +123,8 @@ public final class Typing_CheckErrorQuerySpecification extends MPSQuerySpecifica
return String.format("check failed");
}
}, var__7315585726604365126, false);
new Equality(body, var__tmp_33, var__7315585726604365126);
}, var__7315585726623356034, false);
new Equality(body, var__tmp_33, var__7315585726623356034);
new Equality(body, var__tmp_32, var_out_0);
new Equality(body, var__term, var_out_1);
new Equality(body, var__tmp_33, var_out_2);
......
......@@ -86,12 +86,12 @@ public final class Typing_Lookup_0_switchCommonQuerySpecification extends MPSQue
exportedParameters.add(new ExportedParameter(body, var_v, p_v));
body.setSymbolicParameters(exportedParameters);
PVariable var__tmp_140 = body.getOrCreateVariableByName("tmp_140");
PVariable var__tmp_137 = body.getOrCreateVariableByName("tmp_137");
new TypeConstraint(body, Tuples.flatTupleOf(var_term), new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb92d1L, "SumTypes.structure.Term")));
new TypeConstraint(body, Tuples.flatTupleOf(var_v), new ConceptKey(MetaAdapterFactory.getConcept(0x8d2332833fa47ceL, 0x89dfdaaa7554f251L, 0x1a4a252762eb92e0L, "SumTypes.structure.Var")));
new PositivePatternCall(body, Tuples.flatTupleOf(var_term, var__tmp_140), Typing_AllvarsQuerySpecification.instance().getInternalQueryRepresentation());
new Equality(body, var__tmp_140, var_v);
new PositivePatternCall(body, Tuples.flatTupleOf(var_term, var__tmp_137), Typing_AllvarsQuerySpecification.instance().getInternalQueryRepresentation());
new Equality(body, var__tmp_137, var_v);
SetSequence.fromSet(bodies).addElement(body);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment