File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
lib/AST/RequirementMachine Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -447,6 +447,17 @@ void RewriteSystem::computeCandidateConformancePaths(
447447 continue ;
448448 }
449449
450+ // A concrete conformance rule (T.[concrete: C : P] => T) implies
451+ // the existence of a conformance rule (V.[P] => V) where T == U.V.
452+ //
453+ // Record an equation allowing the concrete conformance to be
454+ // expressed in terms of the abstract conformance:
455+ //
456+ // (T.[concrete: C : P]) := (U.[domain(V)])(V.[P])
457+ //
458+ // and also vice versa in the case |V| == 0:
459+ //
460+ // (T.[P]) := (T.[concrete: C : P])
450461 if (lhs.isAnyConformanceRule () &&
451462 lhs.getLHS ().back ().getKind () == Symbol::Kind::ConcreteConformance) {
452463 MutableTerm t (lhs.getLHS ().begin (), lhs.getLHS ().end () - 1 );
Original file line number Diff line number Diff line change @@ -514,16 +514,15 @@ unsigned RewriteLoop::getDecomposeCount(
514514 return DecomposeCount;
515515}
516516
517- // / Returns true if the loop contains at least one concrete protocol typealias rule,
518- // / which have the form ([P].A.[concrete: C] => [P].A ).
517+ // / Returns true if the loop contains at least one concrete protocol typealias rule.
518+ // / See Rule::isDerivedFromConcreteProtocolTypeAliasRule( ).
519519bool RewriteLoop::hasConcreteTypeAliasRule (
520520 const RewriteSystem &system) const {
521521 const_cast <RewriteLoop *>(this )->recompute (system);
522522 return HasConcreteTypeAliasRule;
523523}
524524
525- // / The number of Decompose steps, used by the elimination order to prioritize
526- // / loops that are not concrete simplifications.
525+ // / Returns true if the loop contains any rules in empty context.
527526bool RewriteLoop::isUseful (
528527 const RewriteSystem &system) const {
529528 const_cast <RewriteLoop *>(this )->recompute (system);
You can’t perform that action at this time.
0 commit comments