? ext Ty <. TPH in Unify eingefuegt

This commit is contained in:
Martin Plümicke 2015-03-11 16:36:05 +01:00
parent 3b258c3880
commit 8cc1c79c67

View File

@ -445,11 +445,26 @@ public class Unify
{
if(p.OperatorSmaller())
{
if (p.TA1 instanceof ObjectType) {
//5. Menge
//Greater auf den Typen bilden, und mit den Ergebnissen neue Paare bilden.
Vector<ObjectType> grErg = greater((ObjectType)p.TA1,fc_tto);
cartProduktSets.add(generateSetOfSetOfPair(p.TA2,grErg));
}
else if (p.TA1 instanceof ExtendsWildcardType) { // eingefuegt 15-3-11 PL
Vector<ObjectType> grErg1 = greater(((ExtendsWildcardType)p.TA1).getContainedType(),fc_tto);
Vector<Type> grErg2 = grErg1.stream().map(ty -> new SuperWildcardType(ty.getOffset(), ty.clone())).collect(Vector::new, Vector::add, Vector::addAll);
Vector<Type> grErg = new Vector<>();
grErg.addAll(grErg1);
grErg.addAll(grErg2);
cartProduktSets.add(generateSetOfSetOfPair(p.TA2,grErg));
}
else if (p.TA1 instanceof SuperWildcardType) {// eingefuegt 15-3-11 PL
Vector<Type> erg = new Vector<> ();
erg.addElement(p.TA1);
cartProduktSets.add(generateSetOfSetOfPair(p.TA2,erg));
}
}
else if(p.OperatorSmallerExtends())
{
if(p.TA1 instanceof ExtendsWildcardType)
@ -1055,24 +1070,37 @@ throws MatchException
// ERASE1 luar 15-04-07
if(P.OperatorSmaller())
{
if((P.TA1 instanceof RefType) == false || ((RefType)P.TA1).get_ParaList() == null)
{
if((P.TA2 instanceof RefType) == false || ((RefType)P.TA2).get_ParaList() == null)
{
if (P.TA1 instanceof ObjectType) {
Vector<ObjectType> greaters = greater((ObjectType)P.TA1,fc_tto);
//Ist ObjectType weil P.OperatorSmaller, kann kein Wildcard sein
//System.out.println(P.TA2.toString());
// "P.TA2.toString() != null" angefügt von Andreas Stadelmeier a10023
if(P.TA2.toString() != null && greaters.contains(P.TA2))
if (greaters.contains(P.TA2))
{
inferencelog.debug(" ================================");
inferencelog.debug(" ERASE1");
inferencelog.debug(" ERASE1 ObjectType");
inferencelog.debug(" ================================");
bRegel = true;
continue;
}
}
else if (P.TA1 instanceof ExtendsWildcardType) {
ObjectType pta1 = ((ExtendsWildcardType)P.TA1).getContainedType();
Vector<ObjectType> greaters = greater((ObjectType)pta1,fc_tto);
if (greaters.contains(P.TA2))
{
inferencelog.debug(" ================================");
inferencelog.debug(" ERASE1 ExtendsWildcardType");
inferencelog.debug(" ================================");
bRegel = true;
continue;
}
}
}
else if (P.TA1 instanceof SuperWildcardType) {
if( P.isEqual()) {
inferencelog.debug(" ================================");
inferencelog.debug(" ERASE1 SuperWildcardType");
inferencelog.debug(" ================================");
bRegel = true;
continue;
}
}
//ERASE2 luar 15-04-07