4646//
4747// Also, for a conformance rule (V.[P] => V) to be redundant, a stronger
4848// condition is needed than appearing once in a loop and without context;
49- // the rule must not be a _generating conformance_. The algorithm for computing
50- // a minimal set of generating conformances is implemented in
51- // GeneratingConformances.cpp.
49+ // the rule must not be a _minimal conformance_. The algorithm for computing
50+ // minimal conformances is implemented in MinimalConformances.cpp.
5251//
5352// ===----------------------------------------------------------------------===//
5453
@@ -129,7 +128,7 @@ RewriteLoop::findRulesAppearingOnceInEmptyContext(
129128// / explicit bit to all other rules appearing in empty context within the same
130129// / loop.
131130// /
132- // / When computing generating conformances we prefer to eliminate non-explicit
131+ // / When computing minimal conformances we prefer to eliminate non-explicit
133132// / rules, as a heuristic to ensure that minimized conformance requirements
134133// / remain in the same protocol as originally written, in cases where they can
135134// / be moved between protocols.
@@ -359,17 +358,18 @@ isCandidateForDeletion(unsigned ruleID,
359358 return true ;
360359
361360 // Protocol conformance rules are eliminated via a different
362- // algorithm which computes "generating conformances".
361+ // algorithm which computes "minimal conformances". This runs between
362+ // two passes of homotopy reduction.
363363 //
364364 // The first pass skips protocol conformance rules.
365365 //
366366 // The second pass eliminates any protocol conformance rule which is
367- // redundant according to both homotopy reduction and the generating
367+ // redundant according to both homotopy reduction and the minimal
368368 // conformances algorithm.
369369 //
370- // Later on, we verify that any conformance redundant via generating
370+ // Later on, we verify that any conformance redundant via minimal
371371 // conformances was also redundant via homotopy reduction. This
372- // means that the set of generating conformances is always a superset
372+ // means that the set of minimal conformances is always a superset
373373 // (or equal to) of the set of minimal protocol conformance
374374 // requirements that homotopy reduction alone would produce.
375375 if (rule.isAnyConformanceRule ()) {
@@ -392,11 +392,11 @@ isCandidateForDeletion(unsigned ruleID,
392392// / 1) First, rules that are not conformance rules are deleted, with
393393// / \p redundantConformances equal to nullptr.
394394// /
395- // / 2) Second, generating conformances are computed.
395+ // / 2) Second, minimal conformances are computed.
396396// /
397397// / 3) Finally, redundant conformance rules are deleted, with
398398// / \p redundantConformances equal to the set of conformance rules that are
399- // / not generating conformances.
399+ // / not minimal conformances.
400400Optional<unsigned > RewriteSystem::
401401findRuleToDelete (const llvm::DenseSet<unsigned > *redundantConformances,
402402 RewritePath &replacementPath) {
@@ -524,15 +524,15 @@ void RewriteSystem::minimizeRewriteSystem() {
524524 // First pass: Eliminate all redundant rules that are not conformance rules.
525525 performHomotopyReduction (/* redundantConformances=*/ nullptr );
526526
527- // Now find a minimal set of generating conformances.
527+ // Now compute a set of minimal conformances.
528528 //
529529 // FIXME: For now this just produces a set of redundant conformances, but
530- // it should actually output the canonical generating conformance equation
531- // for each non-generating conformance. We can then use information to
530+ // it should actually output the canonical minimal conformance equation
531+ // for each non-minimal conformance. We can then use information to
532532 // compute conformance access paths, instead of the current "brute force"
533533 // algorithm used for that purpose.
534534 llvm::DenseSet<unsigned > redundantConformances;
535- computeGeneratingConformances (redundantConformances);
535+ computeMinimalConformances (redundantConformances);
536536
537537 // Second pass: Eliminate all redundant conformance rules.
538538 performHomotopyReduction (/* redundantConformances=*/ &redundantConformances);
0 commit comments