alt-romes / alt-romes/hegg

Scheduler: Allow configuring max number of iterations of rewrites

Aperta
#43 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
enhancement good first issue help wanted
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.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.