srtree-2.0.0.2: A general library to work with Symbolic Regression expression trees.
Copyright(c) Fabricio Olivetti 2021 - 2024
LicenseBSD3
Maintainer[email protected]
Stabilityexperimental
Portability
Safe HaskellNone
LanguageHaskell2010

Algorithm.EqSat

Description

Equality Saturation for SRTree Heavily based on hegg (https:/github.comalt-romes/hegg by alt-romes)

Synopsis

Documentation

type Scheduler a = State (IntMap Int) a Source #

The Scheduler stores a map with the banned iterations of a certain rule . TODO: make it more customizable.

eqSat :: forall (m :: Type -> Type). Monad m => Fix SRTree -> [Rule] -> CostFun -> Int -> EGraphST m (Fix SRTree) Source #

runs equality saturation from an expression tree, a given set of rules, and a cost function. Returns the tree with the smallest cost.

recalculateBest :: forall (m :: Type -> Type). Monad m => CostFun -> EClassId -> EGraphST m (Fix SRTree) Source #

recalculates the costs with a new cost function

runEqSat :: forall (m :: Type -> Type). Monad m => CostFun -> [Rule] -> Int -> EGraphST m (Bool, Int) Source #

run equality saturation for a number of iterations

applySingleMergeOnlyEqSat :: forall (m :: Type -> Type). Monad m => CostFun -> [Rule] -> EGraphST m () Source #

apply a single step of merge-only equality saturation

matchWithScheduler :: Int -> Int -> Rule -> Scheduler [Rule] Source #

matches the rules given a scheduler