File tree Expand file tree Collapse file tree 1 file changed +2
-16
lines changed Expand file tree Collapse file tree 1 file changed +2
-16
lines changed Original file line number Diff line number Diff line change @@ -1369,31 +1369,17 @@ def saturate(
13691369 Saturate the egraph, running the given schedule until the egraph is saturated.
13701370 It serializes the egraph at each step and returns a widget to visualize the egraph.
13711371 """
1372- # from .visualizer_widget import VisualizerWidget
1373-
1374- last_expr = None
1375- index = 0
1376- exprs = []
1372+ from .visualizer_widget import VisualizerWidget
13771373
13781374 def to_json () -> str :
1379- nonlocal last_expr , index
1380- if expr is not None :
1381- extracted = self .extract (expr )
1382- # s = str(extracted)
1383- if extracted .__egg_typed_expr__ != last_expr :
1384- exprs .append (extracted )
1385- last_expr = extracted .__egg_typed_expr__
1386- print (f"# { index } :\n " , str (extracted ), "\n " )
1387- index += 1
13881375 return self ._serialize (** kwargs ).to_json ()
13891376
13901377 egraphs = [to_json ()]
13911378 i = 0
13921379 while self .run (schedule or 1 ).updated and i < max :
13931380 i += 1
13941381 egraphs .append (to_json ())
1395- # VisualizerWidget(egraphs=egraphs).display_or_open()
1396- return exprs
1382+ VisualizerWidget (egraphs = egraphs ).display_or_open ()
13971383
13981384 @classmethod
13991385 def current (cls ) -> EGraph :
You can’t perform that action at this time.
0 commit comments