Commit cae4687d authored by André Pacak's avatar André Pacak

working type checker for variant types in IncA

parent e961a976
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -60,8 +60,8 @@
<node concept="2EAAUw" id="2WR4rosZKeN" role="2EAAYI">
<property role="2EAAUF" value="x" />
<property role="2EAAUB" value="a" />
<node concept="1SCrvK" id="2WR4rosZKfk" role="2EAAUK">
<node concept="1SCrv7" id="2WR4rosZKfz" role="1SCrvV">
<node concept="1SCrvK" id="2aex7X3sfep" role="2EAAUK">
<node concept="1SCrv7" id="2aex7X3BVSy" role="1SCrvV">
<property role="TrG5h" value="x" />
</node>
</node>
......
<?xml version="1.0" encoding="UTF-8"?>
<product version="3" modelHash="-dcaaagmtsc4zwga1i2u72sgifz1qadk">
<files names="AnalysisResultAccess.java:ConstantDefinitions.java:LType.java:LTypeVariant.java:QuerySpecificationHints.java:Typing_AllvarsQuerySpecification.java:Typing_Allvars_0_switchCommonQuerySpecification.java:Typing_AsLTypeQuerySpecification.java:Typing_AsLTypeVariantQuerySpecification.java:Typing_AsLTypeVariant_0_switchCommonQuerySpecification.java:Typing_AsLTypeVariant_WrappedQuerySpecification.java:Typing_AsLType_0_switchCommonQuerySpecification.java:Typing_CheckErrorQuerySpecification.java:Typing_CheckQuerySpecification.java:Typing_Check_0_switchCommonQuerySpecification.java:Typing_ConditionCaseQuerySpecification.java:Typing_InferQuerySpecification.java:Typing_Infer_0_switchCommonQuerySpecification.java:Typing_Infer_WrappedQuerySpecification.java:Typing_LookupFailureQuerySpecification.java:Typing_LookupFailure_0_switchCommonQuerySpecification.java:Typing_LookupQuerySpecification.java:Typing_Lookup_0_switchCommonQuerySpecification.java:Typing_MatchFunFailureQuerySpecification.java:Typing_MatchFunFailure_0_switchCommonQuerySpecification.java:Typing_MatchVariantFailureQuerySpecification.java:Typing_MatchVariantFailure_0_switchCommonQuerySpecification.java:Typing_RequiredQuerySpecification.java:Typing_Required_0_switchCommonQuerySpecification.java" />
<product version="3" modelHash="-4nzcpijfivju6eh0cfzixwuwn2aw52x">
<files names="AnalysisResultAccess.java:ConstantDefinitions.java:LType.java:LTypeVariant.java:QuerySpecificationHints.java:Typing_AllvarsQuerySpecification.java:Typing_Allvars_0_switchCommonQuerySpecification.java:Typing_AsLTypeQuerySpecification.java:Typing_AsLTypeVariantQuerySpecification.java:Typing_AsLTypeVariant_0_switchCommonQuerySpecification.java:Typing_AsLTypeVariant_WrappedQuerySpecification.java:Typing_AsLType_0_switchCommonQuerySpecification.java:Typing_CheckErrorQuerySpecification.java:Typing_CheckQuerySpecification.java:Typing_Check_0_switchCommonQuerySpecification.java:Typing_InferQuerySpecification.java:Typing_Infer_0_switchCommonQuerySpecification.java:Typing_Infer_WrappedQuerySpecification.java:Typing_LookupCaseConditionQuerySpecification.java:Typing_LookupFailureQuerySpecification.java:Typing_LookupFailure_0_switchCommonQuerySpecification.java:Typing_LookupQuerySpecification.java:Typing_Lookup_0_switchCommonQuerySpecification.java:Typing_MatchFunFailureQuerySpecification.java:Typing_MatchFunFailure_0_switchCommonQuerySpecification.java:Typing_MatchVariantFailureQuerySpecification.java:Typing_MatchVariantFailure_0_switchCommonQuerySpecification.java:Typing_RequiredQuerySpecification.java:Typing_Required_0_switchCommonQuerySpecification.java" />
</product>
<?xml version="1.0" encoding="UTF-8"?>
<product version="3" modelHash="7v8yim2dozt66lahfvwazszvidjayra" />
<product version="3" modelHash="-5obnfbt0696why2dq7au4vsg3bazvn0" />
......@@ -89,14 +89,14 @@ public final class Typing_AsLTypeVariantQuerySpecification extends MPSQuerySpeci
exportedParameters.add(new ExportedParameter(body, var_out_1, p_out_1));
body.setSymbolicParameters(exportedParameters);
PVariable var__2490073326105409166 = body.getOrCreateVariableByName("2490073326105409166");
PVariable var__2490073326105409163 = body.getOrCreateVariableByName("2490073326105409163");
PVariable var__2490073326105409171 = body.newVirtualVariable();
PVariable var__2490073326117308852 = body.getOrCreateVariableByName("2490073326117308852");
PVariable var__2490073326117308849 = body.getOrCreateVariableByName("2490073326117308849");
PVariable var__2490073326117308857 = body.newVirtualVariable();
new TypeConstraint(body, Tuples.flatTupleOf(var_type), new ConceptKey(MetaAdapterFactory.getConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1fd8e2cf9df802c6L, "VariantTypes.structure.VariantType")));
new PositivePatternCall(body, Tuples.flatTupleOf(var_type, var__2490073326105409163), Typing_AsLTypeVariant_WrappedQuerySpecification.instance().getInternalQueryRepresentation());
new AggregatorConstraint(new BoundAggregator(LTypeVariant.instance().aggregator_lub, LTypeVariant.LTypeVariantElement.class, LTypeVariant.LTypeVariantElement.class), body, Tuples.flatTupleOf(var_type, var__2490073326105409166), Typing_AsLTypeVariant_WrappedQuerySpecification.instance().getInternalQueryRepresentation(), var__2490073326105409171, 1);
new Equality(body, var_out_1, var__2490073326105409171);
new PositivePatternCall(body, Tuples.flatTupleOf(var_type, var__2490073326117308849), Typing_AsLTypeVariant_WrappedQuerySpecification.instance().getInternalQueryRepresentation());
new AggregatorConstraint(new BoundAggregator(LTypeVariant.instance().aggregator_lub, LTypeVariant.LTypeVariantElement.class, LTypeVariant.LTypeVariantElement.class), body, Tuples.flatTupleOf(var_type, var__2490073326117308852), Typing_AsLTypeVariant_WrappedQuerySpecification.instance().getInternalQueryRepresentation(), var__2490073326117308857, 1);
new Equality(body, var_out_1, var__2490073326117308857);
SetSequence.fromSet(bodies).addElement(body);
}
......
......@@ -92,30 +92,30 @@ public final class Typing_AsLTypeVariant_WrappedQuerySpecification extends MPSQu
exportedParameters.add(new ExportedParameter(body, var_out_1, p_out_1));
body.setSymbolicParameters(exportedParameters);
PVariable var__tmp_292 = body.getOrCreateVariableByName("tmp_292");
PVariable var__tmp_293 = body.getOrCreateVariableByName("tmp_293");
PVariable var__tmp_294 = body.getOrCreateVariableByName("tmp_294");
PVariable var__tmp_295 = body.getOrCreateVariableByName("tmp_295");
PVariable var__ty = body.getOrCreateVariableByName("ty");
PVariable var__tmp_278 = body.getOrCreateVariableByName("tmp_278");
PVariable var__tmp_274 = body.getOrCreateVariableByName("tmp_274");
PVariable var__2490073326117332551 = body.newVirtualVariable();
PVariable var__elem = body.getOrCreateVariableByName("elem");
PVariable var__tmp_275 = body.getOrCreateVariableByName("tmp_275");
PVariable var__tmp_296 = body.getOrCreateVariableByName("tmp_296");
PVariable var__l = body.getOrCreateVariableByName("l");
PVariable var__tmp_276 = body.getOrCreateVariableByName("tmp_276");
PVariable var__2490073326105437179 = body.newVirtualVariable();
PVariable var__tmp_277 = body.getOrCreateVariableByName("tmp_277");
new TypeConstraint(body, Tuples.flatTupleOf(var_type), new ConceptKey(MetaAdapterFactory.getConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1fd8e2cf9df802c6L, "VariantTypes.structure.VariantType")));
new PositivePatternCall(body, Tuples.flatTupleOf(), Typing_AsLTypeVariant_0_switchCommonQuerySpecification.instance().getInternalQueryRepresentation());
new TypeConstraint(body, Tuples.staticArityFlatTupleOf(var_type, var__tmp_274), new ConceptFeatureKey(MetaAdapterFactory.getContainmentLink(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1fd8e2cf9df802c6L, 0x1fd8e2cf9df802cbL, "elems")));
new Equality(body, var__elem, var__tmp_274);
new TypeConstraint(body, Tuples.staticArityFlatTupleOf(var__elem, var__tmp_275), new ConceptFeatureKey(MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")));
new Equality(body, var__l, var__tmp_275);
new TypeConstraint(body, Tuples.staticArityFlatTupleOf(var__elem, var__tmp_276), new ConceptFeatureKey(MetaAdapterFactory.getContainmentLink(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1fd8e2cf9df802cfL, 0x1fd8e2cf9df802d4L, "ty")));
new PositivePatternCall(body, Tuples.flatTupleOf(var__tmp_276, var__tmp_277), Typing_AsLTypeQuerySpecification.instance().getInternalQueryRepresentation());
new Equality(body, var__ty, var__tmp_277);
new TypeConstraint(body, Tuples.staticArityFlatTupleOf(var_type, var__tmp_292), new ConceptFeatureKey(MetaAdapterFactory.getContainmentLink(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1fd8e2cf9df802c6L, 0x1fd8e2cf9df802cbL, "elems")));
new Equality(body, var__elem, var__tmp_292);
new TypeConstraint(body, Tuples.staticArityFlatTupleOf(var__elem, var__tmp_293), new ConceptFeatureKey(MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")));
new Equality(body, var__l, var__tmp_293);
new TypeConstraint(body, Tuples.staticArityFlatTupleOf(var__elem, var__tmp_294), new ConceptFeatureKey(MetaAdapterFactory.getContainmentLink(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1fd8e2cf9df802cfL, 0x1fd8e2cf9df802d4L, "ty")));
new PositivePatternCall(body, Tuples.flatTupleOf(var__tmp_294, var__tmp_295), Typing_AsLTypeQuerySpecification.instance().getInternalQueryRepresentation());
new Equality(body, var__ty, var__tmp_295);
new ExpressionEvaluation(body, new IExpressionEvaluator() {
@Override
public String getShortDescription() {
return "2490073326105437179";
return "2490073326117332551";
}
@Override
......@@ -128,9 +128,9 @@ public final class Typing_AsLTypeVariant_WrappedQuerySpecification extends MPSQu
return LTypeVariant.instance().singleton((CodeGenerationHelper.demandWrapString(valueProvider.getValue("l"))), ((LType.LTypeElement) valueProvider.getValue("ty")));
}
}, var__2490073326105437179, false);
new Equality(body, var__tmp_278, var__2490073326105437179);
new Equality(body, var__tmp_278, var_out_1);
}, var__2490073326117332551, false);
new Equality(body, var__tmp_296, var__2490073326117332551);
new Equality(body, var__tmp_296, var_out_1);
SetSequence.fromSet(bodies).addElement(body);
}
......@@ -144,8 +144,8 @@ public final class Typing_AsLTypeVariant_WrappedQuerySpecification extends MPSQu
exportedParameters.add(new ExportedParameter(body, var_out_1, p_out_1));
body.setSymbolicParameters(exportedParameters);
PVariable var__tmp_279 = body.getOrCreateVariableByName("tmp_279");
PVariable var__2490073326105437197 = body.newVirtualVariable();
PVariable var__2490073326117332569 = body.newVirtualVariable();
PVariable var__tmp_297 = body.getOrCreateVariableByName("tmp_297");
new TypeConstraint(body, Tuples.flatTupleOf(var_type), new ConceptKey(MetaAdapterFactory.getConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1fd8e2cf9df802c6L, "VariantTypes.structure.VariantType")));
new PositivePatternCall(body, Tuples.flatTupleOf(), Typing_AsLTypeVariant_0_switchCommonQuerySpecification.instance().getInternalQueryRepresentation());
......@@ -153,7 +153,7 @@ public final class Typing_AsLTypeVariant_WrappedQuerySpecification extends MPSQu
@Override
public String getShortDescription() {
return "2490073326105437197";
return "2490073326117332569";
}
@Override
......@@ -166,9 +166,9 @@ public final class Typing_AsLTypeVariant_WrappedQuerySpecification extends MPSQu
return LTypeVariant.instance().empty();
}
}, var__2490073326105437197, false);
new Equality(body, var__tmp_279, var__2490073326105437197);
new Equality(body, var__tmp_279, var_out_1);
}, var__2490073326117332569, false);
new Equality(body, var__tmp_297, var__2490073326117332569);
new Equality(body, var__tmp_297, var_out_1);
SetSequence.fromSet(bodies).addElement(body);
}
......
......@@ -94,23 +94,23 @@ public final class Typing_CheckErrorQuerySpecification extends MPSQuerySpecifica
exportedParameters.add(new ExportedParameter(body, var_out_2, p_out_2));
body.setSymbolicParameters(exportedParameters);
PVariable var__2490073326105387286 = body.newConstantVariable(Integer.parseInt("0"));
PVariable var__2490073326117286513 = body.newConstantVariable(Integer.parseInt("0"));
PVariable var__term = body.getOrCreateVariableByName("term");
PVariable var__tmp_28 = body.getOrCreateVariableByName("tmp_28");
PVariable var__tmp_27 = body.getOrCreateVariableByName("tmp_27");
PVariable var__2490073326105434027 = body.newVirtualVariable();
PVariable var__2490073326117329294 = body.newVirtualVariable();
PVariable var__tmp_26 = body.getOrCreateVariableByName("tmp_26");
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(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d1L, "VariantTypes.structure.ExpTerm")));
new TypeConstraint(body, Tuples.flatTupleOf(var__term), new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d1L, "VariantTypes.structure.Term")));
new PositivePatternCall(body, Tuples.flatTupleOf(var__term, var__tmp_26), Typing_RequiredQuerySpecification.instance().getInternalQueryRepresentation());
new NegativePatternCall(body, Tuples.flatTupleOf(var__term), Typing_CheckQuerySpecification.instance().getInternalQueryRepresentation());
new Equality(body, var__tmp_27, var__2490073326105387286);
new Equality(body, var__tmp_27, var__2490073326117286513);
new ExpressionEvaluation(body, new IExpressionEvaluator() {
@Override
public String getShortDescription() {
return "2490073326105434027";
return "2490073326117329294";
}
@Override
......@@ -123,8 +123,8 @@ public final class Typing_CheckErrorQuerySpecification extends MPSQuerySpecifica
return String.format("\"check failed\"");
}
}, var__2490073326105434027, false);
new Equality(body, var__tmp_28, var__2490073326105434027);
}, var__2490073326117329294, false);
new Equality(body, var__tmp_28, var__2490073326117329294);
new Equality(body, var__tmp_27, var_out_0);
new Equality(body, var__term, var_out_1);
new Equality(body, var__tmp_28, var_out_2);
......
......@@ -70,7 +70,7 @@ public final class Typing_InferQuerySpecification extends MPSQuerySpecification
private static final class GeneratedPQuery extends AbstractPQuery {
private final PParameter p_term = new PParameter("term", "VariantTypes.structure.ExpTerm", new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d1L, "VariantTypes.structure.ExpTerm")));
private final PParameter p_term = new PParameter("term", "VariantTypes.structure.Term", new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d1L, "VariantTypes.structure.Term")));
private final PParameter p_out_1 = new PParameter("out_1", "VariantTypes_Checker.model.LType", new LatticeInputKey("VariantTypes_Checker.model.LType", LType.instance()));
private static final Typing_InferQuerySpecification.GeneratedPQuery INSTANCE = new Typing_InferQuerySpecification.GeneratedPQuery();
......@@ -89,14 +89,14 @@ public final class Typing_InferQuerySpecification extends MPSQuerySpecification
exportedParameters.add(new ExportedParameter(body, var_out_1, p_out_1));
body.setSymbolicParameters(exportedParameters);
PVariable var__2490073326105409108 = body.getOrCreateVariableByName("2490073326105409108");
PVariable var__2490073326105409105 = body.getOrCreateVariableByName("2490073326105409105");
PVariable var__2490073326105409113 = body.newVirtualVariable();
PVariable var__2490073326117308794 = body.getOrCreateVariableByName("2490073326117308794");
PVariable var__2490073326117308791 = body.getOrCreateVariableByName("2490073326117308791");
PVariable var__2490073326117308799 = body.newVirtualVariable();
new TypeConstraint(body, Tuples.flatTupleOf(var_term), new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d1L, "VariantTypes.structure.ExpTerm")));
new PositivePatternCall(body, Tuples.flatTupleOf(var_term, var__2490073326105409105), Typing_Infer_WrappedQuerySpecification.instance().getInternalQueryRepresentation());
new AggregatorConstraint(new BoundAggregator(LType.instance().aggregator_glb, LType.LTypeElement.class, LType.LTypeElement.class), body, Tuples.flatTupleOf(var_term, var__2490073326105409108), Typing_Infer_WrappedQuerySpecification.instance().getInternalQueryRepresentation(), var__2490073326105409113, 1);
new Equality(body, var_out_1, var__2490073326105409113);
new TypeConstraint(body, Tuples.flatTupleOf(var_term), new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d1L, "VariantTypes.structure.Term")));
new PositivePatternCall(body, Tuples.flatTupleOf(var_term, var__2490073326117308791), Typing_Infer_WrappedQuerySpecification.instance().getInternalQueryRepresentation());
new AggregatorConstraint(new BoundAggregator(LType.instance().aggregator_glb, LType.LTypeElement.class, LType.LTypeElement.class), body, Tuples.flatTupleOf(var_term, var__2490073326117308794), Typing_Infer_WrappedQuerySpecification.instance().getInternalQueryRepresentation(), var__2490073326117308799, 1);
new Equality(body, var_out_1, var__2490073326117308799);
SetSequence.fromSet(bodies).addElement(body);
}
......
......@@ -13,7 +13,6 @@ import org.inca.core.runtime.plugin.AbstractPQuery;
import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
import org.inca.core.runtime.plugin.ConceptKey;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
import java.util.Set;
import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
import org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException;
......@@ -30,10 +29,10 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
import java.util.Arrays;
@SuppressWarnings("all")
public final class Typing_ConditionCaseQuerySpecification extends MPSQuerySpecification {
public final class Typing_LookupCaseConditionQuerySpecification extends MPSQuerySpecification {
private Typing_ConditionCaseQuerySpecification() {
super(Typing_ConditionCaseQuerySpecification.GeneratedPQuery.INSTANCE);
private Typing_LookupCaseConditionQuerySpecification() {
super(Typing_LookupCaseConditionQuerySpecification.GeneratedPQuery.INSTANCE);
}
@Override
......@@ -51,29 +50,26 @@ public final class Typing_ConditionCaseQuerySpecification extends MPSQuerySpecif
return AbstractScope.class;
}
public static Typing_ConditionCaseQuerySpecification instance() {
return Typing_ConditionCaseQuerySpecification.LazyHolder.INSTANCE;
public static Typing_LookupCaseConditionQuerySpecification instance() {
return Typing_LookupCaseConditionQuerySpecification.LazyHolder.INSTANCE;
}
@SuppressWarnings("all")
private static final class LazyHolder {
private static final Typing_ConditionCaseQuerySpecification INSTANCE = make();
private static final Typing_LookupCaseConditionQuerySpecification INSTANCE = make();
public static Typing_ConditionCaseQuerySpecification make() {
return new Typing_ConditionCaseQuerySpecification();
public static Typing_LookupCaseConditionQuerySpecification make() {
return new Typing_LookupCaseConditionQuerySpecification();
}
}
private static final class GeneratedPQuery extends AbstractPQuery {
private final PParameter p_wName = new PParameter("wName", "VariantTypes.structure.Var", new ConceptKey(MetaAdapterFactory.getConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92e0L, "VariantTypes.structure.Var")));
private final PParameter p_wTerm = new PParameter("wTerm", "VariantTypes.structure.ExpTerm", new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d1L, "VariantTypes.structure.ExpTerm")));
private final PParameter p_gName = new PParameter("gName", "jetbrains.mps.lang.core.structure.string", new JavaTransitiveInstancesKey(String.class));
private final PParameter p_gTerm = new PParameter("gTerm", "VariantTypes.structure.ExpTerm", new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d1L, "VariantTypes.structure.ExpTerm")));
private final PParameter p_term = new PParameter("term", "VariantTypes.structure.Term", new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d1L, "VariantTypes.structure.Term")));
private static final Typing_ConditionCaseQuerySpecification.GeneratedPQuery INSTANCE = new Typing_ConditionCaseQuerySpecification.GeneratedPQuery();
private static final Typing_LookupCaseConditionQuerySpecification.GeneratedPQuery INSTANCE = new Typing_LookupCaseConditionQuerySpecification.GeneratedPQuery();
@Override
protected Set<PBody> doGetContainedBodies() throws QueryInitializationException {
......@@ -81,26 +77,19 @@ public final class Typing_ConditionCaseQuerySpecification extends MPSQuerySpecif
{
PBody body = new PBody(this);
PVariable var_wName = body.getOrCreateVariableByName("wName");
PVariable var_wTerm = body.getOrCreateVariableByName("wTerm");
PVariable var_gName = body.getOrCreateVariableByName("gName");
PVariable var_gTerm = body.getOrCreateVariableByName("gTerm");
PVariable var_term = body.getOrCreateVariableByName("term");
List<ExportedParameter> exportedParameters = new ArrayList<ExportedParameter>();
exportedParameters.add(new ExportedParameter(body, var_wName, p_wName));
exportedParameters.add(new ExportedParameter(body, var_wTerm, p_wTerm));
exportedParameters.add(new ExportedParameter(body, var_gName, p_gName));
exportedParameters.add(new ExportedParameter(body, var_gTerm, p_gTerm));
exportedParameters.add(new ExportedParameter(body, var_term, p_term));
body.setSymbolicParameters(exportedParameters);
PVariable var__tmp_123 = body.getOrCreateVariableByName("tmp_123");
PVariable var__parent = body.getOrCreateVariableByName("parent");
PVariable var__tmp_29 = body.getOrCreateVariableByName("tmp_29");
new TypeConstraint(body, Tuples.flatTupleOf(var_wName), new ConceptKey(MetaAdapterFactory.getConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92e0L, "VariantTypes.structure.Var")));
new TypeConstraint(body, Tuples.flatTupleOf(var_wTerm), new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d1L, "VariantTypes.structure.ExpTerm")));
new TypeConstraint(body, Tuples.flatTupleOf(var_gTerm), new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d1L, "VariantTypes.structure.ExpTerm")));
new TypeConstraint(body, Tuples.staticArityFlatTupleOf(var_wName, var__tmp_123), new ConceptFeatureKey(MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name")));
new Equality(body, var__tmp_123, var_gName);
new Equality(body, var_wTerm, var_gTerm);
new TypeConstraint(body, Tuples.flatTupleOf(var_term), new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d1L, "VariantTypes.structure.Term")));
new TypeConstraint(body, Tuples.staticArityFlatTupleOf(var_term, var__tmp_29), new ConceptFeatureKey(MetaAdapterFactory.getReferenceLink(0xb802a05692a24fbcL, 0x902ef8e5004c331fL, 0x7980b687ac7456feL, 0x7980b687ac7456ffL, "parent")));
new Equality(body, var__parent, var__tmp_29);
new TypeConstraint(body, Tuples.flatTupleOf(var__parent), new ConceptKey(MetaAdapterFactory.getConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x9229981a3b8f721L, "VariantTypes.structure.Case")));
SetSequence.fromSet(bodies).addElement(body);
}
......@@ -110,17 +99,17 @@ public final class Typing_ConditionCaseQuerySpecification extends MPSQuerySpecif
@Override
public String getFullyQualifiedName() {
return "Typing.conditionCase";
return "Typing.lookupCaseCondition";
}
@Override
public List<PParameter> getParameters() {
return Arrays.asList(p_wName, p_wTerm, p_gName, p_gTerm);
return Arrays.asList(p_term);
}
@Override
public List<String> getParameterNames() {
return Arrays.asList("wName", "wTerm", "gName", "gTerm");
return Arrays.asList("term");
}
}
......
......@@ -94,9 +94,9 @@ public final class Typing_LookupFailureQuerySpecification extends MPSQuerySpecif
exportedParameters.add(new ExportedParameter(body, var_out_2, p_out_2));
body.setSymbolicParameters(exportedParameters);
PVariable var__2490073326105434000 = body.newVirtualVariable();
PVariable var__term = body.getOrCreateVariableByName("term");
PVariable var__2490073326105407085 = body.newConstantVariable(Integer.parseInt("0"));
PVariable var__2490073326117297625 = body.newConstantVariable(Integer.parseInt("0"));
PVariable var__2490073326117329267 = body.newVirtualVariable();
PVariable var__v = body.getOrCreateVariableByName("v");
PVariable var__match_a0a0a0e = body.getOrCreateVariableByName("match_a0a0a0e");
PVariable var__tmp_24 = body.getOrCreateVariableByName("tmp_24");
......@@ -109,12 +109,12 @@ public final class Typing_LookupFailureQuerySpecification extends MPSQuerySpecif
new TypeConstraint(body, Tuples.flatTupleOf(var__match_a0a0a0e), new ConceptKey(MetaAdapterFactory.getConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92e0L, "VariantTypes.structure.Var")));
new Equality(body, var__v, var__match_a0a0a0e);
new NegativePatternCall(body, Tuples.flatTupleOf(var__term, var__v, var__tmp_23), Typing_LookupQuerySpecification.instance().getInternalQueryRepresentation());
new Equality(body, var__tmp_24, var__2490073326105407085);
new Equality(body, var__tmp_24, var__2490073326117297625);
new ExpressionEvaluation(body, new IExpressionEvaluator() {
@Override
public String getShortDescription() {
return "2490073326105434000";
return "2490073326117329267";
}
@Override
......@@ -127,8 +127,8 @@ public final class Typing_LookupFailureQuerySpecification extends MPSQuerySpecif
return String.format("\"variable not bound\"");
}
}, var__2490073326105434000, false);
new Equality(body, var__tmp_25, var__2490073326105434000);
}, var__2490073326117329267, false);
new Equality(body, var__tmp_25, var__2490073326117329267);
new Equality(body, var__tmp_24, var_out_0);
new Equality(body, var__term, var_out_1);
new Equality(body, var__tmp_25, var_out_2);
......
......@@ -65,7 +65,7 @@ public final class Typing_LookupFailure_0_switchCommonQuerySpecification extends
private static final class GeneratedPQuery extends AbstractPQuery {
private final PParameter p_term = new PParameter("term", "VariantTypes.structure.ExpTerm", new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d1L, "VariantTypes.structure.ExpTerm")));
private final PParameter p_term = new PParameter("term", "VariantTypes.structure.Term", new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d1L, "VariantTypes.structure.Term")));
private static final Typing_LookupFailure_0_switchCommonQuerySpecification.GeneratedPQuery INSTANCE = new Typing_LookupFailure_0_switchCommonQuerySpecification.GeneratedPQuery();
......@@ -82,7 +82,7 @@ public final class Typing_LookupFailure_0_switchCommonQuerySpecification extends
body.setSymbolicParameters(exportedParameters);
new TypeConstraint(body, Tuples.flatTupleOf(var_term), new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d1L, "VariantTypes.structure.ExpTerm")));
new TypeConstraint(body, Tuples.flatTupleOf(var_term), new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92d1L, "VariantTypes.structure.Term")));
SetSequence.fromSet(bodies).addElement(body);
}
......
......@@ -10,22 +10,15 @@ import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
import org.eclipse.viatra.query.runtime.api.scope.QueryScope;
import org.inca.core.runtime.plugin.AbstractScope;
import org.inca.core.runtime.plugin.AbstractPQuery;
import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
import org.inca.core.runtime.plugin.ConceptKey;
import jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory;
import java.util.Set;
import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
import org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException;
import jetbrains.mps.internal.collections.runtime.SetSequence;
import java.util.HashSet;
import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
import java.util.List;
import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
import java.util.ArrayList;
import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
import java.util.Arrays;
@SuppressWarnings("all")
......@@ -67,8 +60,6 @@ public final class Typing_Lookup_0_switchCommonQuerySpecification extends MPSQue
private static final class GeneratedPQuery extends AbstractPQuery {
private final PParameter p_term = new PParameter("term", "VariantTypes.structure.ITerm", new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x31cba602171a9c1L, "VariantTypes.structure.ITerm")));
private final PParameter p_var = new PParameter("var", "VariantTypes.structure.Var", new ConceptKey(MetaAdapterFactory.getConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92e0L, "VariantTypes.structure.Var")));
private static final Typing_Lookup_0_switchCommonQuerySpecification.GeneratedPQuery INSTANCE = new Typing_Lookup_0_switchCommonQuerySpecification.GeneratedPQuery();
......@@ -78,20 +69,11 @@ public final class Typing_Lookup_0_switchCommonQuerySpecification extends MPSQue
{
PBody body = new PBody(this);
PVariable var_term = body.getOrCreateVariableByName("term");
PVariable var_var = body.getOrCreateVariableByName("var");
List<ExportedParameter> exportedParameters = new ArrayList<ExportedParameter>();
exportedParameters.add(new ExportedParameter(body, var_term, p_term));
exportedParameters.add(new ExportedParameter(body, var_var, p_var));
body.setSymbolicParameters(exportedParameters);
PVariable var__tmp_122 = body.getOrCreateVariableByName("tmp_122");
new TypeConstraint(body, Tuples.flatTupleOf(var_term), new ConceptKey(MetaAdapterFactory.getInterfaceConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x31cba602171a9c1L, "VariantTypes.structure.ITerm")));
new TypeConstraint(body, Tuples.flatTupleOf(var_var), new ConceptKey(MetaAdapterFactory.getConcept(0x3ace5b6c22d54933L, 0x9217595f2ebf8d6aL, 0x1a4a252762eb92e0L, "VariantTypes.structure.Var")));
new PositivePatternCall(body, Tuples.flatTupleOf(var_term, var__tmp_122), Typing_AllvarsQuerySpecification.instance().getInternalQueryRepresentation());
new Equality(body, var__tmp_122, var_var);
SetSequence.fromSet(bodies).addElement(body);
}
......@@ -106,12 +88,12 @@ public final class Typing_Lookup_0_switchCommonQuerySpecification extends MPSQue
@Override
public List<PParameter> getParameters() {
return Arrays.asList(p_term, p_var);
return Arrays.asList();
}
@Override
public List<String> getParameterNames() {
return Arrays.asList("term", "var");
return Arrays.asList();
}
}
......
......@@ -96,16 +96,16 @@ public final class Typing_MatchFunFailureQuerySpecification extends MPSQuerySpec
PVariable var__tmp_1 = body.getOrCreateVariableByName("tmp_1");
PVariable var__tmp_2 = body.getOrCreateVariableByName("tmp_2");
PVariable var__2490073326105433828 = body.newVirtualVariable();
PVariable var__ty = body.getOrCreateVariableByName("ty");
PVariable var__tmp_3 = body.getOrCreateVariableByName("tmp_3");
PVariable var__2490073326105406943 = body.newConstantVariable(false);
PVariable var__tmp_4 = body.getOrCreateVariableByName("tmp_4");
PVariable var__2490073326105433812 = body.newVirtualVariable();
PVariable var__tmp_5 = body.getOrCreateVariableByName("tmp_5");
PVariable var__2490073326117329079 = body.newVirtualVariable();
PVariable var__tmp_6 = body.getOrCreateVariableByName("tmp_6");
PVariable var__2490073326105406951 = body.newConstantVariable(Integer.parseInt("0"));
PVariable var__2490073326117297491 = body.newConstantVariable(Integer.parseInt("0"));
PVariable var__2490073326117297483 = body.newConstantVariable(false);
PVariable var__app = body.getOrCreateVariableByName("app");
PVariable var__2490073326117329095 = body.newVirtualVariable();
new TypeConstraint(body, Tuples.flatTupleOf(var_out_1), new ConceptKey(MetaAdapterFactory.getConcept(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x10802efe25aL, "jetbrains.mps.lang.core.structure.BaseConcept")));
new PositivePatternCall(body, Tuples.flatTupleOf(), Typing_MatchFunFailure_0_switchCommonQuerySpecification.instance().getInternalQueryRepresentation());
......@@ -117,7 +117,7 @@ public final class Typing_MatchFunFailureQuerySpecification extends MPSQuerySpec
@Override
public String getShortDescription() {
return "2490073326105433812";
return "2490073326117329079";
}
@Override
......@@ -130,16 +130,16 @@ public final class Typing_MatchFunFailureQuerySpecification extends MPSQuerySpec
return LType.instance().isFun(((LType.LTypeElement) valueProvider.getValue("ty")));
}
}, var__2490073326105433812, false);
new Equality(body, var__tmp_3, var__2490073326105433812);
new Equality(body, var__tmp_4, var__2490073326105406943);
}, var__2490073326117329079, false);
new Equality(body, var__tmp_3, var__2490073326117329079);
new Equality(body, var__tmp_4, var__2490073326117297483);
new Equality(body, var__tmp_3, var__tmp_4);
new Equality(body, var__tmp_5, var__2490073326105406951);
new Equality(body, var__tmp_5, var__2490073326117297491);
new ExpressionEvaluation(body, new IExpressionEvaluator() {
@Override
public String getShortDescription() {
return "2490073326105433828";
return "2490073326117329095";
}
@Override
......@@ -152,8 +152,8 @@ public final class Typing_MatchFunFailureQuerySpecification extends MPSQuerySpec
return String.format("\"not a function\"");
}
}, var__2490073326105433828, false);
new Equality(body, var__tmp_6, var__2490073326105433828);
}, var__2490073326117329095, false);
new Equality(body, var__tmp_6, var__2490073326117329095);
new Equality(body, var__tmp_5, var_out_0);
new Equality(body, var__app, var_out_1);
new Equality(body, var__tmp_6, var_out_2);
......@@ -174,15 +174,15 @@ public final class Typing_MatchFunFailureQuerySpecification extends MPSQuerySpec
PVariable var__tmp_11 = body.getOrCreateVariableByName("tmp_11");
PVariable var__tmp_10 = body.getOrCreateVariableByName("tmp_10");
PVariable var__2490073326117297524 = body.newConstantVariable(Integer.parseInt("0"));
PVariable var__ty = body.getOrCreateVariableByName("ty");
PVariable var__2490073326105406976 = body.newConstantVariable(false);
PVariable var__lam = body.getOrCreateVariableByName("lam");
PVariable var__2490073326105433857 = body.newVirtualVariable();
PVariable var__2490073326117329124 = body.newVirtualVariable();
PVariable var__2490073326117297516 = body.newConstantVariable(false);
PVariable var__tmp_7 = body.getOrCreateVariableByName("tmp_7");
PVariable var__tmp_8 = body.getOrCreateVariableByName("tmp_8");
PVariable var__tmp_9 = body.getOrCreateVariableByName("tmp_9");
PVariable var__2490073326105406984 = body.newConstantVariable(Integer.parseInt("0"));
PVariable var__2490073326105433873 = body.newVirtualVariable();
PVariable var__2490073326117329140 = body.newVirtualVariable();
new TypeConstraint(body, Tuples.flatTupleOf(var_out_1), new ConceptKey(MetaAdapterFactory.getConcept(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x10802efe25aL, "jetbrains.mps.lang.core.structure.BaseConcept")));
new PositivePatternCall(body, Tuples.flatTupleOf(), Typing_MatchFunFailure_0_switchCommonQuerySpecification.instance().getInternalQueryRepresentation());
......@@ -193,7 +193,7 @@ public final class Typing_MatchFunFailureQuerySpecification extends MPSQuerySpec
@Override
public String getShortDescription() {
return "2490073326105433857";
return "2490073326117329124";
}
@Override
......@@ -206,16 +206,16 @@ public final class Typing_MatchFunFailureQuerySpecification extends MPSQuerySpec
return LType.instance().isFun(((LType.LTypeElement) valueProvider.getValue("ty")));
}
}, var__2490073326105433857, false);
new Equality(body, var__tmp_8, var__2490073326105433857);
new Equality(body, var__tmp_9, var__2490073326105406976);
}, var__2490073326117329124, false);
new Equality(body, var__tmp_8, var__2490073326117329124);
new Equality(body, var__tmp_9, var__2490073326117297516);
new Equality(body, var__tmp_8, var__tmp_9);
new Equality(body, var__tmp_10, var__2490073326105406984);
new Equality(body, var__tmp_10, var__2490073326117297524);
new ExpressionEvaluation(body, new IExpressionEvaluator() {
@Override
public String getShortDescription() {
return "2490073326105433873";
return "2490073326117329140";
}
@Override
......@@ -228,8 +228,8 @@ public final class Typing_MatchFunFailureQuerySpecification extends MPSQuerySpec
return String.format("\"not a function\"");
}
}, var__2490073326105433873, false);
new Equality(body, var__tmp_11, var__2490073326105433873);
}, var__2490073326117329140, false);
new Equality(body, var__tmp_11, var__2490073326117329140);
new Equality(body, var__tmp_10, var_out_0);