-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This large change does a major refactoring of `token::variance`. Operations are now described by traits, invariants now specify bounds, and natural invariants (those that model natural "counting" numbers) have well-defined bounds. This is not quite working yet, but yields some powerful insights. For one, the `union` operator may not be necessary. It propagates unboundedness, which did not happen before when, for example, taking the conjunction of unbounded and invariant variance. Now, this defers to `Bound<B>`, where `B` is the bound type of the invariant. For natural invariants, they yields unbounded when zero and bounded (with an appropriate range) when non-zero. This works naturally for depth: a depth of zero and an unbounded depth remain unbounded, but a depth of one and an unbounded depth yield an open range from that depth to infinity. Consider `a/**` (0 + INF) and `a/b/**` (0 + 1 + 0 + INF). `Repetition` seems to be quite broken too. For example, an invariant (converged) repetition should not only repeat invariants, but also repeat bounds! For example, consider `<<?:1,2>:2>`. The size of the inner repetition is `Variant(Bounded(1,2))`. The outer repetition is invariant, but does not apply a repetition to the bounds! The size of the outer repetition _should_ be `Variant(Bounded(2,4))`. There may be more to figure out regarding `UnitBound`. Such a bound may not be possible. Take a look at the conversions from invariants to `Bound<UnitBound>`.
- Loading branch information
1 parent
a10f507
commit b032530
Showing
9 changed files
with
1,256 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.