Commit Graph

9 Commits

Author SHA1 Message Date
Slava Pestov
dac8d666ee Stop passing -requirement-machine-{abstract,inferred,protocol}-signatures flags in tests
These flags are now no-ops.
2022-05-10 12:56:17 -04:00
Slava Pestov
0111618c50 RequirementMachine: Perform concrete contraction on protocol requirement signatures 2022-05-09 21:21:35 -04:00
Slava Pestov
7d0215e6e0 RequirementMachine: Tweak rule limit non-termination heuristic
Add the length of the longest *initial* rule to the rule length limit
before comparing.

Fixes https://bugs.swift.org/browse/SR-16024.
2022-03-25 01:00:49 -04:00
Slava Pestov
5404754cb7 RequirementMachine: More concise printed output for concrete type and superclass symbols
Types cannot contain Terms, so the Symbol representation uses
GenericTypeParameterTypes whose index refers to an array of
"substitution" Terms.

We can (ab)use the PrintOptions.AlternateTypeNames mechanism
to print those GenericTypeParamTypes as if they were Terms.
2022-02-16 16:27:40 -05:00
Slava Pestov
37be2d5dd7 RequirementMachine: Emit a diagnostic note with the offending rewrite rule if completion failed
This surfaces an implementation detail, but it might be better
than nothing.
2022-02-07 08:20:59 -05:00
Slava Pestov
634ca55764 RequirementMachine: Rework completion limits a bit
- Rename StepLimit to MaxRuleCount, DepthLimit to MaxRuleLength
- Rename command line flags to -requirement-machine-max-rule-{count,length}=
- Check limits outside of PropertyMap::buildPropertyMap()
- Simplify the logic in RequirementMachine::computeCompletion()
2022-02-07 08:20:59 -05:00
Slava Pestov
ae44028117 RequirementMachine: Allow the property map to record induced rules directly
It doesn't actually do this yet, but the idea is to look at the
total rule count before and after, instead of just looking at the
induced rules array (which I will delete in the next commit).
2022-01-25 00:35:11 -05:00
Slava Pestov
7f7bf2fa97 RequirementMachine: Fix subtle bug in Knuth-Bendix algorithm
Filter out trivial overlaps where a rule overlaps entirely with
itself before looking at CheckedOverlaps. Otherwise, we'll miss
overlaps where a rule overlaps with itself at a non-zero
position.
2021-12-10 00:49:46 -05:00
Slava Pestov
3138020e5d RequirementMachine: Diagnose non-confluent rewrite systems instead of asserting
We assert when building a rewrite system for an existing generic
signature, or in AbstractGenericSignatureRequest, where there is no
source location.

In RequirementSignatureRequest and InferredGenericSignatureRequest
we now produce a diagnostic.
2021-12-10 00:49:46 -05:00