Commit Graph

14 Commits

Author SHA1 Message Date
Kavon Farvardin
102ccbc70b Test: updates for NoncopyableGenerics
These tests of the type system are being updated because of the new
presence of Copyable and Escapable conformances & conformance
requirements.
2024-03-14 23:10:44 -07:00
Kavon Farvardin
f296d8e158 NCGenerics: mass XFAIL tests
It's easier to get a handle on regressions while working through
failures if the tests that are known to not pass are XFAIL'd for
NoncopyableGenerics.
2024-02-20 18:26:05 -05:00
Slava Pestov
4d097da73c RequirementMachine: Re-use requirement machines constructed by minimization for queries
Fixes rdar://problem/88135641.
2022-03-26 00:56:41 -04:00
Slava Pestov
653977a51c RequirementMachine: Rule sharing
All the pieces are now in place so that the RuleBuilder can assemble
a confluent rewrite system for downstream protocol dependencies,
instead of building rules from protocol requirement signatures.
2022-03-16 00:58:30 -04:00
Slava Pestov
f06f59a18a RequirementMachine: Generalize relations so they look more like rules 2022-01-13 00:02:31 -05:00
Slava Pestov
3a92d2fc53 AST: Remove legacy GSB-based GenericSignature query implementation 2022-01-12 12:33:34 -05:00
Slava Pestov
56450af673 RequirementMachine: Record identity conformances in the property map 2022-01-11 21:43:55 -05:00
Slava Pestov
1057b56395 RequirementMachine: Rename HomotopyGenerator to RewriteLoop
Also, stop talking about 2-cells and 3-cells.
2021-10-27 01:28:24 -04:00
Slava Pestov
5689d046d4 RequirementMachine: Always add a rule for the trivial [P].[P] => [P] conformance
Completion adds this rule when a same-type requirement equates the Self of P
with some other type parameter conforming to P; one example is something like this:

  protocol P {
    associatedtype T : P where T.T == Self
  }

The initial rewrite system looks like this:

  (1) [P].T => [P:T]
  (2) [P:T].[P] => [P:T]
  (3) [P:T].[P:T] => [P]

Rules (2) and (3) overlap on the term

  [P:T].[P:T].[P]

Simplifying the overlapped term with rule (2) produces

  [P:T].[P:T]

Which further reduces to

  [P]

Simplifying the overlapped term with rule (3) produces

  [P].[P]

So we get a new rule

  [P].[P] => [P]

This is not a "real" conformance rule, and homotopy reduction wastes work
unraveling it in rewrite loops where this rule occurs. Instead, it's better
to introduce it as a permanent rule that is not subject to homotopy reduction
for every protocol.
2021-10-27 00:34:04 -04:00
Slava Pestov
8850380896 RequirementMachine: Update tests for change in -dump-requirement-machine output 2021-09-24 08:59:51 -04:00
Slava Pestov
fe2f42bc72 RequirementMachine: Rename -debug-requirement-machine flag to -dump-requirement-machine 2021-08-19 22:14:58 -04:00
Slava Pestov
9738d4eef6 RequirementMachine: PropertyMap can use Terms instead of MutableTerms as keys
Also, we don't have to sort rules in term order before adding them to
the map; a bucket sort by term length is sufficient.
2021-08-06 14:17:20 -04:00
Slava Pestov
d3db1b6753 RequirementMachine: EquivalenceClassMap => PropertyMap
EquivalenceClass is now PropertyBag.
2021-07-23 17:21:57 -04:00
Slava Pestov
91b81cbdc8 RequirementMachine: Add a test that used to fail with the GSB
I have a lot more known-failing GSB test cases, but the limiting factor
now is the GSB's minimization algorithm, which runs first before the
requirement machine gets to see anything. Replacing that with a new
algorithm based on the rewrite system is the next step here.
2021-07-17 14:27:51 -04:00