API Documentation
Metatheory
Main.Metatheory.Rule
โ TypeStructure representing rewrite rules.
Main.Metatheory.compile_theory
โ MethodCompile a theory to a closure that does the pattern matching job Returns a RuntimeGeneratedFunction, which does not use eval and is as fast as a regular Julia anonymous function ๐ฅ
Main.Metatheory.@compile_theory
โ MacroCompile a theory at runtime to a closure that does the pattern matching job
Metatheory.EGraphs
Main.Metatheory.EGraphs.RhsFunCache
โ TypeType representing a cache of RuntimeGeneratedFunctions
corresponding to right hand sides of dynamic rules
Main.Metatheory.EGraphs.eval_types_in_assertions
โ MethodWhen creating a theory, type assertions in the left hand contain symbols. We want to replace the type symbols with the real type values, to fully support the subtyping mechanism during pattern matching.
Main.Metatheory.EGraphs.genrhsfun
โ MethodGenerates a tuple containing the list of formal parameters (Symbol
s) and the RuntimeGeneratedFunction
corresponding to the right hand side of a :dynamic
Rule
.
Metatheory.EGraphs.Schedulers
Main.Metatheory.EGraphs.Schedulers.AbstractScheduler
โ TypeRepresents a rule scheduler for the equality saturation process
Main.Metatheory.EGraphs.Schedulers.BackoffScheduler
โ TypeA Rewrite Scheduler that implements exponential rule backoff. For each rewrite, there exists a configurable initial match limit. If a rewrite search yield more than this limit, then we ban this rule for number of iterations, double its limit, and double the time it will be banned next time.
This seems effective at preventing explosive rules like associativity from taking an unfair amount of resources.
Main.Metatheory.EGraphs.Schedulers.SimpleScheduler
โ TypeA simple Rewrite Scheduler that applies every rule every time
Main.Metatheory.EGraphs.Schedulers.cansaturate
โ MethodShould return true if the e-graph can be said to be saturated
Main.Metatheory.EGraphs.Schedulers.readstep!
โ MethodThis function is called before pattern matching on the e-graph
Main.Metatheory.EGraphs.Schedulers.shouldskip
โ MethodShould return true if the rule r
should be skipped
Main.Metatheory.EGraphs.Schedulers.writestep!
โ MethodThis function is called after pattern matching on the e-graph
Metatheory.Util
Main.Metatheory.Util
โ ModuleDefinitions of various utility functions for metaprogramming
Main.Metatheory.Util.amp
โ MethodAdd a & expression
Main.Metatheory.Util.bf_walk!
โ MethodBreadth First Walk (Tree Prewalk) on expressions mutates expression in-place.
Main.Metatheory.Util.bf_walk
โ MethodBreadth First Walk (Tree Prewalk) on expressions. Does not mutate expressions.
Main.Metatheory.Util.binarize!
โ MethodHARD FIX of n-arity of operators in Expr
trees
Main.Metatheory.Util.block
โ MethodMake a block expression from an array of exprs
Main.Metatheory.Util.cleanast
โ MethodBinarize n-ary operators (+
and *
) and call rmlines
Main.Metatheory.Util.df_walk!
โ MethodDepth First Walk (Tree Postwalk) on expressions, mutates expression in-place.
Main.Metatheory.Util.df_walk
โ MethodDepth First Walk (Tree Postwalk) on expressions. Does not mutate expressions.
Main.Metatheory.Util.dollar
โ MethodAdd a dollar expression
Main.Metatheory.Util.normalize
โ MethodIterates a function f
on datum
until a fixed point is reached where f(x) == x
Main.Metatheory.Util.normalize_nocycle
โ MethodLike normalize
but keeps a vector of hashes to detect cycles, returns the current datum when a cycle is detected
Main.Metatheory.Util.rmlines
โ MethodRemove LineNumberNode from quoted blocks of code