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

check that record type contains the same labels as record term (checking for same length)

parent bd0db9af
This diff is collapsed.
......@@ -66,7 +66,7 @@
</node>
<node concept="1JAXSW" id="75UymJIFIuu" role="2EAAKa">
<property role="TrG5h" value="c" />
<node concept="1SCrvP" id="75UymJIFIuR" role="1JAXS8" />
<node concept="1SCrvP" id="6UqcbF4u0HN" role="1JAXS8" />
</node>
</node>
<node concept="228e09" id="75UymJIFIsm" role="1SCrrM">
......
......@@ -8,6 +8,7 @@
<classNode dependClassName="RecordTypes_Checker.model.Typing_LookupFailureQuerySpecification" />
<classNode dependClassName="RecordTypes_Checker.model.Typing_MatchFunFailureQuerySpecification" />
<classNode dependClassName="RecordTypes_Checker.model.Typing_MatchRecordFailureQuerySpecification" />
<classNode dependClassName="RecordTypes_Checker.model.Typing_RecordSameLengthFailureQuerySpecification" />
<classNode dependClassName="io.usethesource.capsule.Map" />
<classNode dependClassName="java.lang.Object" />
<classNode dependClassName="java.lang.String" />
......@@ -873,6 +874,73 @@
<classNode dependClassName="org.inca.core.runtime.plugin.MPSQuerySpecificationHints" />
<classNode extendsClassName="org.inca.core.runtime.plugin.MPSQuerySpecification" />
</dependency>
<dependency className="RecordTypes_Checker.model.Typing_RecordEntriesQuerySpecification">
<classNode dependClassName="RecordTypes_Checker.model.QuerySpecificationHints" />
<classNode dependClassName="java.lang.Class" />
<classNode dependClassName="java.lang.Override" />
<classNode dependClassName="java.lang.String" />
<classNode dependClassName="java.lang.SuppressWarnings" />
<classNode dependClassName="java.util.ArrayList" />
<classNode dependClassName="java.util.Arrays" />
<classNode dependClassName="java.util.HashSet" />
<classNode dependClassName="java.util.List" />
<classNode dependClassName="java.util.Set" />
<classNode dependClassName="jetbrains.mps.internal.collections.runtime.SetSequence" />
<classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.api.ViatraQueryEngine" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.api.scope.QueryScope" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.exception.ViatraQueryException" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.PBody" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.PVariable" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.tuple.Tuples" />
<classNode dependClassName="org.inca.core.runtime.plugin.AbstractPQuery" />
<classNode dependClassName="org.inca.core.runtime.plugin.AbstractScope" />
<classNode dependClassName="org.inca.core.runtime.plugin.ConceptFeatureKey" />
<classNode dependClassName="org.inca.core.runtime.plugin.ConceptKey" />
<classNode dependClassName="org.inca.core.runtime.plugin.MPSGenericPatternMatcher" />
<classNode dependClassName="org.inca.core.runtime.plugin.MPSQuerySpecificationHints" />
<classNode extendsClassName="org.inca.core.runtime.plugin.MPSQuerySpecification" />
</dependency>
<dependency className="RecordTypes_Checker.model.Typing_RecordEntryCountQuerySpecification">
<classNode dependClassName="RecordTypes_Checker.model.QuerySpecificationHints" />
<classNode dependClassName="RecordTypes_Checker.model.Typing_RecordEntriesQuerySpecification" />
<classNode dependClassName="java.lang.Class" />
<classNode dependClassName="java.lang.Integer" />
<classNode dependClassName="java.lang.Override" />
<classNode dependClassName="java.lang.String" />
<classNode dependClassName="java.lang.SuppressWarnings" />
<classNode dependClassName="java.util.ArrayList" />
<classNode dependClassName="java.util.Arrays" />
<classNode dependClassName="java.util.HashSet" />
<classNode dependClassName="java.util.List" />
<classNode dependClassName="java.util.Set" />
<classNode dependClassName="jetbrains.mps.internal.collections.runtime.SetSequence" />
<classNode dependClassName="jetbrains.mps.smodel.adapter.structure.MetaAdapterFactory" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.api.ViatraQueryEngine" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.api.scope.QueryScope" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.exception.ViatraQueryException" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.PBody" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.PVariable" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.PatternMatchCounter" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.tuple.Tuples" />
<classNode dependClassName="org.inca.core.runtime.plugin.AbstractPQuery" />
<classNode dependClassName="org.inca.core.runtime.plugin.AbstractScope" />
<classNode dependClassName="org.inca.core.runtime.plugin.ConceptKey" />
<classNode dependClassName="org.inca.core.runtime.plugin.MPSGenericPatternMatcher" />
<classNode dependClassName="org.inca.core.runtime.plugin.MPSQuerySpecificationHints" />
<classNode extendsClassName="org.inca.core.runtime.plugin.MPSQuerySpecification" />
</dependency>
<dependency className="RecordTypes_Checker.model.Typing_RecordSameLengthFailureQuerySpecification">
<classNode dependClassName="RecordTypes_Checker.model.QuerySpecificationHints" />
<classNode dependClassName="RecordTypes_Checker.model.Typing_RecordSameLengthFailure_0_switchCommonQuerySpecification" />
......@@ -902,6 +970,7 @@
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter" />
......@@ -917,8 +986,13 @@
<dependency className="RecordTypes_Checker.model.Typing_RecordSameLengthFailure_0_switchCommonQuerySpecification">
<classNode dependClassName="RecordTypes_Checker.model.LType" />
<classNode dependClassName="RecordTypes_Checker.model.QuerySpecificationHints" />
<classNode dependClassName="RecordTypes_Checker.model.Typing_RecordEntryCountQuerySpecification" />
<classNode dependClassName="RecordTypes_Checker.model.Typing_RequiredQuerySpecification" />
<classNode dependClassName="java.lang.Class" />
<classNode dependClassName="java.lang.Exception" />
<classNode dependClassName="java.lang.Integer" />
<classNode dependClassName="java.lang.Iterable" />
<classNode dependClassName="java.lang.Object" />
<classNode dependClassName="java.lang.Override" />
<classNode dependClassName="java.lang.String" />
<classNode dependClassName="java.lang.SuppressWarnings" />
......@@ -932,10 +1006,14 @@
<classNode dependClassName="org.eclipse.viatra.query.runtime.api.ViatraQueryEngine" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.api.scope.QueryScope" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.exception.ViatraQueryException" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.PBody" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.PVariable" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint" />
<classNode dependClassName="org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter" />
......
<?xml version="1.0" encoding="UTF-8"?>
<product version="3" modelHash="-7y1d0oo9x9aaa5olbwqqjva1bksxjb2">
<files names="AnalysisResultAccess.java:ConstantDefinitions.java:LType.java:LTypeRecord.java:QuerySpecificationHints.java:Typing_AllvarsQuerySpecification.java:Typing_Allvars_0_switchCommonQuerySpecification.java:Typing_AsLTypeQuerySpecification.java:Typing_AsLTypeRecordQuerySpecification.java:Typing_AsLTypeRecord_0_switchCommonQuerySpecification.java:Typing_AsLTypeRecord_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_LookupFailureQuerySpecification.java:Typing_LookupFailure_0_switchCommonQuerySpecification.java:Typing_LookupQuerySpecification.java:Typing_Lookup_0_switchCommonQuerySpecification.java:Typing_MatchFunFailureQuerySpecification.java:Typing_MatchFunFailure_0_switchCommonQuerySpecification.java:Typing_MatchRecordFailureQuerySpecification.java:Typing_MatchRecordFailure_0_switchCommonQuerySpecification.java:Typing_RecordSameLengthFailureQuerySpecification.java:Typing_RecordSameLengthFailure_0_switchCommonQuerySpecification.java:Typing_RequiredQuerySpecification.java:Typing_Required_0_switchCommonQuerySpecification.java" />
<product version="3" modelHash="165kuhqrgdagnnh7kx2dq4c4zapa769">
<files names="AnalysisResultAccess.java:ConstantDefinitions.java:LType.java:LTypeRecord.java:QuerySpecificationHints.java:Typing_AllvarsQuerySpecification.java:Typing_Allvars_0_switchCommonQuerySpecification.java:Typing_AsLTypeQuerySpecification.java:Typing_AsLTypeRecordQuerySpecification.java:Typing_AsLTypeRecord_0_switchCommonQuerySpecification.java:Typing_AsLTypeRecord_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_LookupFailureQuerySpecification.java:Typing_LookupFailure_0_switchCommonQuerySpecification.java:Typing_LookupQuerySpecification.java:Typing_Lookup_0_switchCommonQuerySpecification.java:Typing_MatchFunFailureQuerySpecification.java:Typing_MatchFunFailure_0_switchCommonQuerySpecification.java:Typing_MatchRecordFailureQuerySpecification.java:Typing_MatchRecordFailure_0_switchCommonQuerySpecification.java:Typing_RecordEntriesQuerySpecification.java:Typing_RecordEntryCountQuerySpecification.java:Typing_RecordSameLengthFailureQuerySpecification.java:Typing_RecordSameLengthFailure_0_switchCommonQuerySpecification.java:Typing_RequiredQuerySpecification.java:Typing_Required_0_switchCommonQuerySpecification.java" />
</product>
<?xml version="1.0" encoding="UTF-8"?>
<product version="3" modelHash="687u1umiwy49egdujyz1uzx7z9606c7" />
<product version="3" modelHash="-4mpi09misgbbjpj3ednaen24tqdn3i4" />
......@@ -37,6 +37,7 @@ public class AnalysisResultAccess {
final ViatraQueryMatcher<IPatternMatch> evaluatorMatchFunFailure = EnginePool.getMatcher(Typing_MatchFunFailureQuerySpecification.instance(), AbstractScope.from(scope), true, ScatteredTimelyReteBackendFactory.INSTANCE);
final ViatraQueryMatcher<IPatternMatch> evaluatorMatchRecordFailure = EnginePool.getMatcher(Typing_MatchRecordFailureQuerySpecification.instance(), AbstractScope.from(scope), true, ScatteredTimelyReteBackendFactory.INSTANCE);
final ViatraQueryMatcher<IPatternMatch> evaluatorLookupFailure = EnginePool.getMatcher(Typing_LookupFailureQuerySpecification.instance(), AbstractScope.from(scope), true, ScatteredTimelyReteBackendFactory.INSTANCE);
final ViatraQueryMatcher<IPatternMatch> evaluatorRecordSameLengthFailure = EnginePool.getMatcher(Typing_RecordSameLengthFailureQuerySpecification.instance(), AbstractScope.from(scope), true, ScatteredTimelyReteBackendFactory.INSTANCE);
final IPatternMatch tup = evaluatorInfer.newMatch(term, null);
final Set<LType.LTypeElement> inferValues = CodeGenerationHelper.getAllValues(evaluatorInfer, "out_1", tup);
......@@ -44,8 +45,9 @@ public class AnalysisResultAccess {
boolean matchFunFailure = CollectionSequence.fromCollection(evaluatorMatchFunFailure.getAllMatches()).isNotEmpty();
boolean matchRecordFailure = CollectionSequence.fromCollection(evaluatorMatchRecordFailure.getAllMatches()).isNotEmpty();
boolean lookupFailure = CollectionSequence.fromCollection(evaluatorLookupFailure.getAllMatches()).isNotEmpty();
boolean recordSameLengthFailure = CollectionSequence.fromCollection(evaluatorRecordSameLengthFailure.getAllMatches()).isNotEmpty();
if (checkError || matchFunFailure || matchRecordFailure || lookupFailure) {
if (checkError || matchFunFailure || matchRecordFailure || lookupFailure || recordSameLengthFailure) {
return false;
}
......@@ -56,18 +58,18 @@ public class AnalysisResultAccess {
boolean isBotAvailable = SetSequence.fromSet(inferValues).any(new IWhereFilter<LType.LTypeElement>() {
public boolean accept(LType.LTypeElement it) {
{
final Object[] values_a0a0a0t0c = {it};
final Object[] values_a0a0a0v0c = {it};
// declare the local variables for the case matchers
Map<String, Object> case_0_a0a0a0a91a2;
Map<String, Object> case_1_b0a0a0a91a2;
Map<String, Object> case_0_a0a0a0a12a2;
Map<String, Object> case_1_b0a0a0a12a2;
if ((case_0_a0a0a0a91a2 = new SequenceMatcher(matcher_a0a0a0a0t0c).match(values_a0a0a0t0c)) != null) {
if ((case_0_a0a0a0a12a2 = new SequenceMatcher(matcher_a0a0a0a0v0c).match(values_a0a0a0v0c)) != null) {
return true;
} else if ((case_1_b0a0a0a91a2 = new SequenceMatcher(WildCardMatcher.INSTANCE).match(values_a0a0a0t0c)) != null) {
} else if ((case_1_b0a0a0a12a2 = new SequenceMatcher(WildCardMatcher.INSTANCE).match(values_a0a0a0v0c)) != null) {
return false;
} else {
throw new PatternMatcherException(values_a0a0a0t0c);
throw new PatternMatcherException(values_a0a0a0v0c);
}
}
}
......@@ -80,21 +82,21 @@ public class AnalysisResultAccess {
final LType.LTypeElement nonBotAnyValue = SetSequence.fromSet(inferValues).findFirst(new IWhereFilter<LType.LTypeElement>() {
public boolean accept(LType.LTypeElement it) {
{
final Object[] values_a0a0a0x0c = {it};
final Object[] values_a0a0a0z0c = {it};
// declare the local variables for the case matchers
Map<String, Object> case_0_a0a0a0a32a2;
Map<String, Object> case_1_b0a0a0a32a2;
Map<String, Object> case_2_c0a0a0a32a2;
Map<String, Object> case_0_a0a0a0a52a2;
Map<String, Object> case_1_b0a0a0a52a2;
Map<String, Object> case_2_c0a0a0a52a2;
if ((case_0_a0a0a0a32a2 = new SequenceMatcher(matcher_a0a0a0a0x0c).match(values_a0a0a0x0c)) != null) {
if ((case_0_a0a0a0a52a2 = new SequenceMatcher(matcher_a0a0a0a0z0c).match(values_a0a0a0z0c)) != null) {
return false;
} else if ((case_1_b0a0a0a32a2 = new SequenceMatcher(matcher_a1a0a0a0x0c).match(values_a0a0a0x0c)) != null) {
} else if ((case_1_b0a0a0a52a2 = new SequenceMatcher(matcher_a1a0a0a0z0c).match(values_a0a0a0z0c)) != null) {
return false;
} else if ((case_2_c0a0a0a32a2 = new SequenceMatcher(WildCardMatcher.INSTANCE).match(values_a0a0a0x0c)) != null) {
} else if ((case_2_c0a0a0a52a2 = new SequenceMatcher(WildCardMatcher.INSTANCE).match(values_a0a0a0z0c)) != null) {
return true;
} else {
throw new PatternMatcherException(values_a0a0a0x0c);
throw new PatternMatcherException(values_a0a0a0z0c);
}
}
}
......@@ -188,9 +190,9 @@ public class AnalysisResultAccess {
}
}
private static final IDataMatcher matcher_a0a0a0a0t0c = new CompositeMatcher(LType.Bot.class);
private static final IDataMatcher matcher_a0a0a0a0x0c = new CompositeMatcher(LType.Bot.class);
private static final IDataMatcher matcher_a1a0a0a0x0c = new CompositeMatcher(LType.Any.class);
private static final IDataMatcher matcher_a0a0a0a0v0c = new CompositeMatcher(LType.Bot.class);
private static final IDataMatcher matcher_a0a0a0a0z0c = new CompositeMatcher(LType.Bot.class);
private static final IDataMatcher matcher_a1a0a0a0z0c = new CompositeMatcher(LType.Any.class);
private static final IDataMatcher matcher_a0a0e_0 = new CompositeMatcher(LType.Nat.class);
private static final IDataMatcher matcher_a1a0e = new CompositeMatcher(LType.Fun.class);
private static final IDataMatcher matcher_a2a0e_0 = new CompositeMatcher(LType.Record.class, new SimpleMatcher("ltypev"));
......
......@@ -638,6 +638,27 @@ public class LType implements ILatticeOperationProvider<LType.LTypeElement>, IPo
}
}
}
public int recordSize(LType.LTypeElement t) {
{
final Object[] values_a0w = {t};
// declare the local variables for the case matchers
Map<String, Object> case_0_a0a22;
Map<String, Object> case_1_b0a22;
Map<String, Object> case_2_c0a22;
if ((case_0_a0a22 = new SequenceMatcher(matcher_a0a0w).match(values_a0w)) != null) {
LTypeRecord.LTypeRecordElement ty_a0a0a22 = (LTypeRecord.LTypeRecordElement) case_0_a0a22.get("ty");
return LTypeRecord.instance().size(ty_a0a0a22);
} else if ((case_1_b0a22 = new SequenceMatcher(matcher_a1a0w).match(values_a0w)) != null) {
return Integer.MAX_VALUE;
} else if ((case_2_c0a22 = new SequenceMatcher(WildCardMatcher.INSTANCE).match(values_a0w)) != null) {
return Integer.MIN_VALUE;
} else {
throw new PatternMatcherException(values_a0w);
}
}
}
public final IMultisetAggregationOperator<?, ?, ?> aggregator_lub = new AbstractTreeBasedLatticeAggregationOperator<LType.LTypeElement>(new AugmentedNodeFactory<LType.LTypeElement>(new _FunctionTypes._return_P2_E0<LType.LTypeElement, LType.LTypeElement, LType.LTypeElement>() {
public LType.LTypeElement invoke(final LType.LTypeElement left, final LType.LTypeElement right) {
......@@ -731,4 +752,6 @@ public class LType implements ILatticeOperationProvider<LType.LTypeElement>, IPo
private static final IDataMatcher matcher_a1a0s = new CompositeMatcher(LType.Any.class);
private static final IDataMatcher matcher_a0a0u = new CompositeMatcher(LType.Record.class, new SimpleMatcher("ty"));
private static final IDataMatcher matcher_a1a0u = new CompositeMatcher(LType.Any.class);
private static final IDataMatcher matcher_a0a0w = new CompositeMatcher(LType.Record.class, new SimpleMatcher("ty"));
private static final IDataMatcher matcher_a1a0w = new CompositeMatcher(LType.Any.class);
}
......@@ -226,31 +226,48 @@ public class LTypeRecord implements ILatticeOperationProvider<LTypeRecord.LTypeR
}
}
}
public int size(LTypeRecord.LTypeRecordElement ty) {
{
final Object[] values_a0k_0 = {ty};
// declare the local variables for the case matchers
java.util.Map<String, Object> case_0_a0a01_0;
java.util.Map<String, Object> case_1_b0a01_0;
if ((case_0_a0a01_0 = new SequenceMatcher(matcher_a0a0k_0).match(values_a0k_0)) != null) {
return Integer.MAX_VALUE;
} else if ((case_1_b0a01_0 = new SequenceMatcher(matcher_a1a0k_0).match(values_a0k_0)) != null) {
Map.Immutable<String, LType.LTypeElement> map_a0b0a01 = (Map.Immutable<String, LType.LTypeElement>) case_1_b0a01_0.get("map");
return map_a0b0a01.size();
} else {
throw new PatternMatcherException(values_a0k_0);
}
}
}
public boolean leq(LTypeRecord.LTypeRecordElement l, LTypeRecord.LTypeRecordElement r) {
{
final Object[] values_a0l = {l, r};
final Object[] values_a0n = {l, r};
// declare the local variables for the case matchers
java.util.Map<String, Object> case_0_a0a11;
java.util.Map<String, Object> case_1_b0a11;
java.util.Map<String, Object> case_2_c0a11;
java.util.Map<String, Object> case_0_a0a31;
java.util.Map<String, Object> case_1_b0a31;
java.util.Map<String, Object> case_2_c0a31;
if ((case_0_a0a11 = new SequenceMatcher(WildCardMatcher.INSTANCE, matcher_b0a0l).match(values_a0l)) != null) {
if ((case_0_a0a31 = new SequenceMatcher(WildCardMatcher.INSTANCE, matcher_b0a0n).match(values_a0n)) != null) {
return true;
} else if ((case_1_b0a11 = new SequenceMatcher(matcher_a1a0l, WildCardMatcher.INSTANCE).match(values_a0l)) != null) {
} else if ((case_1_b0a31 = new SequenceMatcher(matcher_a1a0n, WildCardMatcher.INSTANCE).match(values_a0n)) != null) {
return false;
} else if ((case_2_c0a11 = new SequenceMatcher(matcher_a2a0l, matcher_b2a0l).match(values_a0l)) != null) {
Map.Immutable<String, LType.LTypeElement> map2_a1c0a11 = (Map.Immutable<String, LType.LTypeElement>) case_2_c0a11.get("map2");
Map.Immutable<String, LType.LTypeElement> map1_a0c0a11 = (Map.Immutable<String, LType.LTypeElement>) case_2_c0a11.get("map1");
// is this method needed? when we only need glb or lub
// check if r is top element because we cannot pattern match to check if empty
if (map1_a0c0a11.size() == 0) {
} else if ((case_2_c0a31 = new SequenceMatcher(matcher_a2a0n, matcher_b2a0n).match(values_a0n)) != null) {
Map.Immutable<String, LType.LTypeElement> map2_a1c0a31 = (Map.Immutable<String, LType.LTypeElement>) case_2_c0a31.get("map2");
Map.Immutable<String, LType.LTypeElement> map1_a0c0a31 = (Map.Immutable<String, LType.LTypeElement>) case_2_c0a31.get("map1");
// check if r is bottom element because we cannot pattern match to check if empty
if (map1_a0c0a31.size() == 0) {
return true;
}
Iterator<java.util.Map.Entry<String, LType.LTypeElement>> it = map1_a0c0a11.entryIterator();
Iterator<java.util.Map.Entry<String, LType.LTypeElement>> it = map1_a0c0a31.entryIterator();
while (it.hasNext()) {
java.util.Map.Entry<String, LType.LTypeElement> entry1 = it.next();
LType.LTypeElement found = map2_a1c0a11.get(entry1.getKey());
LType.LTypeElement found = map2_a1c0a31.get(entry1.getKey());
if (found == null) {
return false;
} else if (!(LType.instance().leq(entry1.getValue(), found))) {
......@@ -259,32 +276,32 @@ public class LTypeRecord implements ILatticeOperationProvider<LTypeRecord.LTypeR
}
return true;
} else {
throw new PatternMatcherException(values_a0l);
throw new PatternMatcherException(values_a0n);
}
}
}
public LTypeRecord.LTypeRecordElement lub(LTypeRecord.LTypeRecordElement l, LTypeRecord.LTypeRecordElement r) {
{
final Object[] values_a0n = {l, r};
final Object[] values_a0p = {l, r};
// declare the local variables for the case matchers
java.util.Map<String, Object> case_0_a0a31;
java.util.Map<String, Object> case_1_b0a31;
java.util.Map<String, Object> case_2_c0a31;
java.util.Map<String, Object> case_0_a0a51;
java.util.Map<String, Object> case_1_b0a51;
java.util.Map<String, Object> case_2_c0a51;
if ((case_0_a0a31 = new SequenceMatcher(matcher_a0a0n, WildCardMatcher.INSTANCE).match(values_a0n)) != null) {
if ((case_0_a0a51 = new SequenceMatcher(matcher_a0a0p, WildCardMatcher.INSTANCE).match(values_a0p)) != null) {
return LTypeRecord.AnyRecord.create();
} else if ((case_1_b0a31 = new SequenceMatcher(WildCardMatcher.INSTANCE, matcher_b1a0n).match(values_a0n)) != null) {
} else if ((case_1_b0a51 = new SequenceMatcher(WildCardMatcher.INSTANCE, matcher_b1a0p).match(values_a0p)) != null) {
return LTypeRecord.AnyRecord.create();
} else if ((case_2_c0a31 = new SequenceMatcher(matcher_a2a0n, matcher_b2a0n).match(values_a0n)) != null) {
Map.Immutable<String, LType.LTypeElement> map2_a1c0a31 = (Map.Immutable<String, LType.LTypeElement>) case_2_c0a31.get("map2");
Map.Immutable<String, LType.LTypeElement> map1_a0c0a31 = (Map.Immutable<String, LType.LTypeElement>) case_2_c0a31.get("map1");
} else if ((case_2_c0a51 = new SequenceMatcher(matcher_a2a0p, matcher_b2a0p).match(values_a0p)) != null) {
Map.Immutable<String, LType.LTypeElement> map2_a1c0a51 = (Map.Immutable<String, LType.LTypeElement>) case_2_c0a51.get("map2");
Map.Immutable<String, LType.LTypeElement> map1_a0c0a51 = (Map.Immutable<String, LType.LTypeElement>) case_2_c0a51.get("map1");
{
Iterator<java.util.Map.Entry<String, LType.LTypeElement>> it = map1_a0c0a31.entryIterator();
Map.Immutable<String, LType.LTypeElement> result = map1_a0c0a31.__putAll(map2_a1c0a31);
Iterator<java.util.Map.Entry<String, LType.LTypeElement>> it = map1_a0c0a51.entryIterator();
Map.Immutable<String, LType.LTypeElement> result = map1_a0c0a51.__putAll(map2_a1c0a51);
while (it.hasNext()) {
java.util.Map.Entry<String, LType.LTypeElement> entry = it.next();
LType.LTypeElement found = map2_a1c0a31.get(entry.getKey());
LType.LTypeElement found = map2_a1c0a51.get(entry.getKey());
if (found != null) {
LType.LTypeElement lub = LType.instance().lub(entry.getValue(), found);
result = result.__put(entry.getKey(), lub);
......@@ -293,31 +310,31 @@ public class LTypeRecord implements ILatticeOperationProvider<LTypeRecord.LTypeR
return LTypeRecord.FinRecord.create(result);
}
} else {
throw new PatternMatcherException(values_a0n);
throw new PatternMatcherException(values_a0p);
}
}
}
public LTypeRecord.LTypeRecordElement glb(LTypeRecord.LTypeRecordElement l, LTypeRecord.LTypeRecordElement r) {
{
final Object[] values_a0p = {l, r};
final Object[] values_a0r = {l, r};
// declare the local variables for the case matchers
java.util.Map<String, Object> case_0_a0a51;
java.util.Map<String, Object> case_1_b0a51;
java.util.Map<String, Object> case_2_c0a51;
java.util.Map<String, Object> case_0_a0a71;
java.util.Map<String, Object> case_1_b0a71;
java.util.Map<String, Object> case_2_c0a71;
if ((case_0_a0a51 = new SequenceMatcher(matcher_a0a0p, WildCardMatcher.INSTANCE).match(values_a0p)) != null) {
if ((case_0_a0a71 = new SequenceMatcher(matcher_a0a0r, WildCardMatcher.INSTANCE).match(values_a0r)) != null) {
return r;
} else if ((case_1_b0a51 = new SequenceMatcher(WildCardMatcher.INSTANCE, matcher_b1a0p).match(values_a0p)) != null) {
} else if ((case_1_b0a71 = new SequenceMatcher(WildCardMatcher.INSTANCE, matcher_b1a0r).match(values_a0r)) != null) {
return l;
} else if ((case_2_c0a51 = new SequenceMatcher(matcher_a2a0p, matcher_b2a0p).match(values_a0p)) != null) {
Map.Immutable<String, LType.LTypeElement> map2_a1c0a51 = (Map.Immutable<String, LType.LTypeElement>) case_2_c0a51.get("map2");
Map.Immutable<String, LType.LTypeElement> map1_a0c0a51 = (Map.Immutable<String, LType.LTypeElement>) case_2_c0a51.get("map1");
Iterator<java.util.Map.Entry<String, LType.LTypeElement>> it = map1_a0c0a51.entryIterator();
} else if ((case_2_c0a71 = new SequenceMatcher(matcher_a2a0r, matcher_b2a0r).match(values_a0r)) != null) {
Map.Immutable<String, LType.LTypeElement> map2_a1c0a71 = (Map.Immutable<String, LType.LTypeElement>) case_2_c0a71.get("map2");
Map.Immutable<String, LType.LTypeElement> map1_a0c0a71 = (Map.Immutable<String, LType.LTypeElement>) case_2_c0a71.get("map1");
Iterator<java.util.Map.Entry<String, LType.LTypeElement>> it = map1_a0c0a71.entryIterator();
Map.Immutable<String, LType.LTypeElement> result = Map.Immutable.of();
while (it.hasNext()) {
java.util.Map.Entry<String, LType.LTypeElement> entry = it.next();
LType.LTypeElement found = map2_a1c0a51.get(entry.getKey());
LType.LTypeElement found = map2_a1c0a71.get(entry.getKey());
if (found != null) {
LType.LTypeElement glb = LType.instance().glb(entry.getValue(), found);
result = result.__put(entry.getKey(), glb);
......@@ -325,7 +342,7 @@ public class LTypeRecord implements ILatticeOperationProvider<LTypeRecord.LTypeR
}
return LTypeRecord.FinRecord.create(result);
} else {
throw new PatternMatcherException(values_a0p);
throw new PatternMatcherException(values_a0r);
}
}
}
......@@ -384,16 +401,18 @@ public class LTypeRecord implements ILatticeOperationProvider<LTypeRecord.LTypeR
private static final IDataMatcher matcher_a0a0i_0 = new CompositeMatcher(LTypeRecord.AnyRecord.class);
private static final IDataMatcher matcher_a1a0i = new CompositeMatcher(LTypeRecord.FinRecord.class, new SimpleMatcher("map"));
private static final IDataMatcher matcher_b0a0l = new CompositeMatcher(LTypeRecord.AnyRecord.class);
private static final IDataMatcher matcher_a1a0l = new CompositeMatcher(LTypeRecord.AnyRecord.class);
private static final IDataMatcher matcher_a2a0l = new CompositeMatcher(LTypeRecord.FinRecord.class, new SimpleMatcher("map1"));
private static final IDataMatcher matcher_b2a0l = new CompositeMatcher(LTypeRecord.FinRecord.class, new SimpleMatcher("map2"));
private static final IDataMatcher matcher_a0a0n = new CompositeMatcher(LTypeRecord.AnyRecord.class);
private static final IDataMatcher matcher_b1a0n = new CompositeMatcher(LTypeRecord.AnyRecord.class);
private static final IDataMatcher matcher_a0a0k_0 = new CompositeMatcher(LTypeRecord.AnyRecord.class);
private static final IDataMatcher matcher_a1a0k_0 = new CompositeMatcher(LTypeRecord.FinRecord.class, new SimpleMatcher("map"));
private static final IDataMatcher matcher_b0a0n = new CompositeMatcher(LTypeRecord.AnyRecord.class);
private static final IDataMatcher matcher_a1a0n = new CompositeMatcher(LTypeRecord.AnyRecord.class);
private static final IDataMatcher matcher_a2a0n = new CompositeMatcher(LTypeRecord.FinRecord.class, new SimpleMatcher("map1"));
private static final IDataMatcher matcher_b2a0n = new CompositeMatcher(LTypeRecord.FinRecord.class, new SimpleMatcher("map2"));
private static final IDataMatcher matcher_a0a0p = new CompositeMatcher(LTypeRecord.AnyRecord.class);
private static final IDataMatcher matcher_b1a0p = new CompositeMatcher(LTypeRecord.AnyRecord.class);
private static final IDataMatcher matcher_a2a0p = new CompositeMatcher(LTypeRecord.FinRecord.class, new SimpleMatcher("map1"));
private static final IDataMatcher matcher_b2a0p = new CompositeMatcher(LTypeRecord.FinRecord.class, new SimpleMatcher("map2"));
private static final IDataMatcher matcher_a0a0r = new CompositeMatcher(LTypeRecord.AnyRecord.class);
private static final IDataMatcher matcher_b1a0r = new CompositeMatcher(LTypeRecord.AnyRecord.class);
private static final IDataMatcher matcher_a2a0r = new CompositeMatcher(LTypeRecord.FinRecord.class, new SimpleMatcher("map1"));
private static final IDataMatcher matcher_b2a0r = new CompositeMatcher(LTypeRecord.FinRecord.class, new SimpleMatcher("map2"));
}
......@@ -29,33 +29,33 @@ public final class QuerySpecificationHints extends MPSQuerySpecificationHints {
this.concepts.add(MetaAdapterFactory.getConcept(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x10802efe25aL, "jetbrains.mps.lang.core.structure.BaseConcept"));
this.dataTypes = new HashSet<SDataType>();
this.dataTypes.add(UniqueDataType.from("jetbrains.mps.lang.core.structure.integer"));
this.dataTypes.add(UniqueDataType.from("jetbrains.mps.lang.core.structure.string"));
this.dataTypes.add(UniqueDataType.from("jetbrains.mps.lang.core.structure.integer"));
this.conceptFeatures = new HashSet<SConceptFeature>();
this.conceptFeatures.add(MetaAdapterFactory.getProperty(0xceab519525ea4f22L, 0x9b92103b95ca8c0cL, 0x110396eaaa4L, 0x110396ec041L, "name"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb936bL, 0x1a4a252762eb9378L, "t2"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb9302L, 0x1a4a252762eb9307L, "t1"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb9390L, 0x1a4a252762eb9395L, "ty1"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1fd8e2cf9df802c6L, 0x1fd8e2cf9df802cbL, "elems"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb936bL, 0x1a4a252762eb9374L, "t1"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb9302L, 0x1a4a252762eb930bL, "t2"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb933aL, 0x1a4a252762eb9352L, "body"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb9312L, 0x1a4a252762eb931bL, "t2"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb92d7L, 0x1a4a252762eb92dcL, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x9229981a3b8f573L, 0x9229981a3b8f58bL, "entries"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb9302L, 0x1a4a252762eb9307L, "t1"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb9390L, 0x1a4a252762eb9399L, "ty2"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb93faL, 0x1a4a252762eb93ffL, "ty"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb937fL, 0x1a4a252762eb9384L, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getReferenceLink(0xb802a05692a24fbcL, 0x902ef8e5004c331fL, 0x7980b687ac7456feL, 0x7980b687ac7456ffL, "parent"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb92d7L, 0x1a4a252762eb92dcL, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb937fL, 0x1a4a252762eb9384L, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb937fL, 0x1a4a252762eb93d5L, "ty"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb9312L, 0x1a4a252762eb9317L, "t1"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb936bL, 0x1a4a252762eb9378L, "t2"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x9229981a3b8f61cL, 0x9229981a3b8f621L, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x2c4ed3ae43d50d92L, 0x2c4ed3ae43d50da6L, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb933aL, 0x1a4a252762eb934eL, "bound"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb936bL, 0x1a4a252762eb9374L, "t1"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x9229981a3b8f573L, 0x9229981a3b8f58bL, "entries"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb9390L, 0x1a4a252762eb9399L, "ty2"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1fd8e2cf9df802c6L, 0x1fd8e2cf9df802cbL, "elems"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1fd8e2cf9df802cfL, 0x1fd8e2cf9df802d4L, "ty"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb9322L, 0x1a4a252762eb9336L, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb9390L, 0x1a4a252762eb9395L, "ty1"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x2c4ed3ae43d50d92L, 0x2c4ed3ae43d50da6L, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x9229981a3b8f61cL, 0x9229981a3b8f621L, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb9312L, 0x1a4a252762eb931bL, "t2"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb93f1L, 0x1a4a252762eb93f6L, "t"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1a4a252762eb9312L, 0x1a4a252762eb9317L, "t1"));
this.conceptFeatures.add(MetaAdapterFactory.getContainmentLink(0x6b642eaa1043424aL, 0x9e0949eb41607114L, 0x1fd8e2cf9df802cfL, 0x1fd8e2cf9df802d4L, "ty"));
this.languages = new HashSet<SLanguage>();
this.languages.add(MetaAdapterFactory.getLanguage(0xb802a05692a24fbcL, 0x902ef8e5004c331fL, "ceab5195-25ea-4f22-9b92-103b95ca8c0c"));
......