Scheduler: Allow configuring max number of iterations of rewrites
- Lingua principale
- Haskell
- Stelle
- 98
- Fork
- 17
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
As mentioned in #42, in `runEqualitySaturation`, we seemingly stop after 30 iterations.
This both seems ad-hoc and would be useful if it were configurable, so users could iteratively experiment running a few iterations of rewrites and observing it afterwards without reaching saturation.
I was thinking we could implement this by adding a method "`maxRewriteIterations`" to the `Scheduler` class. We try reaching saturation up to `maxRewriteIterations` and there we simply exit.
Then, we could have some datatype + instance like
```
newtype WithMaxIterations (n :: Nat) a = WithMaxIterations a
instance (KnownNat a, Scheduler a) => Scheduler n a where
maxIterations (WithMaxIterations @n) = natVal (Proxy @n)
-- for other methods delegate to `Scheduler a`
```
From a user perspective, to run N iterations of equality saturation you'd now have:
```diff
- runEqualitySaturation defaultBackoffScheduler
+ runEqualitySaturation (WithMaxIterations @5 defaultBackoffScheduler)
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.