File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed
Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,8 @@ mod set_cost;
3434pub use set_cost:: * ;
3535mod size;
3636pub use size:: * ;
37+ mod stats;
38+ pub use stats:: * ;
3739
3840pub fn new_experimental_egraph ( ) -> EGraph {
3941 let mut egraph = EGraph :: default ( ) ;
@@ -48,4 +50,7 @@ pub fn new_experimental_egraph() -> EGraph {
4850 . add_command ( "run-schedule" . into ( ) , Arc :: new ( RunExtendedSchedule ) )
4951 . unwrap ( ) ;
5052 egraph
53+ . add_command ( "egraph-detailed-stats" . into ( ) , Arc :: new ( EgraphDetailedStats ) )
54+ . unwrap ( ) ;
55+ egraph
5156}
Original file line number Diff line number Diff line change 567567(let tgt (Div one sqrt5))
568568(run 6)
569569(check (= e14 tgt))
570+
571+ ; Get detailed statistics
572+ (egraph-detailed-stats)
573+
570574(pop)
Original file line number Diff line number Diff line change 1+ ; Test the egraph-detailed-stats command
2+
3+ (datatype Math)
4+ (constructor add (Math Math) Math)
5+ (constructor mul (Math Math) Math)
6+ (constructor num (i64) Math)
7+
8+ ; Add some terms
9+ (num 1)
10+ (num 2)
11+ (add (num 1) (num 2))
12+ (mul (num 1) (num 2))
13+
14+ ; Create some equality classes
15+ (union (num 1) (num 2))
16+
17+ (run-schedule (saturate (run)))
18+
19+ ; Get detailed statistics
20+ (egraph-detailed-stats)
You can’t perform that action at this time.
0 commit comments