Skip to content

Commit

Permalink
A bit better isomorphic sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
KacperFKorban committed Aug 26, 2021
1 parent 0db2031 commit a8b819d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class IsomorphismMatchQualityService(val db: InkuireDb) extends BaseMatchQuality
}

/** Classes thet generally mean loss of some information */
final val genericAF = Set(
final val avoid = Set(
"Any",
"Object",
"AnyVal",
Expand All @@ -43,8 +43,8 @@ class IsomorphismMatchQualityService(val db: InkuireDb) extends BaseMatchQuality
final val varToConcreteCost = 200
final val concreteToVarCost = 5000
final val andOrOrTypeCost = 50
final val dealiasCost = 10
final val subTypeCost = 100
final val dealiasCost = 2
final val subTypeCost = 4
final val typeLambdaCost = 1
final val varToVarCost = 1

Expand Down Expand Up @@ -110,7 +110,7 @@ class IsomorphismMatchQualityService(val db: InkuireDb) extends BaseMatchQuality
db.typeAliases.get(supr.itid.get).toList.flatMap(alias => dealias(supr, alias)).map((typ, _, dealiasCost))
)
.++(db.types.get(typ.itid.get).toList.flatMap(node => specializeParents(typ, node)).map {
case t: Type if t.isGeneric != typ.isGeneric || genericAF.contains(t.name) =>
case t: Type if t.isGeneric != typ.isGeneric || avoid.contains(t.name) =>
(t, supr, losingInformationCost)
case t => (t, supr, subTypeCost)
})
Expand Down

0 comments on commit a8b819d

Please sign in to comment.