Module type Generic.GRAPH_API
This module GRAPH_API
represents the interface through which EClass analyses can interact with an EGraph.
val freeze : rw t -> ro t
freeze graph
returns a read-only reference to the EGraph.Note: it is safe to modify
graph
after passing it to freeze, this method is mainly intended to allow using the read-only APIs of the EGraph when you have a RW instance of the EGraph.
val class_equal : ro t -> Id.t -> Id.t -> bool
class_equal graph cls1 cls2
returns true if and only ifcls1
andcls2
are congruent in the EGraphgraph
.
val iter_children : ro t -> Id.t -> Id.t shape Iter.t
iter_children graph cls
returns an iterator over the children of the current EClass.
val set_data : rw t -> Id.t -> data -> unit
set_data graph cls data
sets the analysis data for EClasscls
in EGraphgraph
to bedata
.
val get_data : ro t -> Id.t -> data
get_data graph cls
returns the analysis data for EClasscls
in EGraphgraph
.
val get_analysis : rw t -> analysis
get_analysis graph
returns the persistent analysis sate for an EGraph.