@@ -31,6 +31,9 @@ __all__ = [
3131 "Fact" ,
3232 "Fail" ,
3333 "Float" ,
34+ "FrozenEGraph" ,
35+ "FrozenFunction" ,
36+ "FrozenRow" ,
3437 "Function" ,
3538 "FunctionCommand" ,
3639 "FusedIntersect" ,
@@ -55,6 +58,9 @@ __all__ = [
5558 "PrintFunctionSize" ,
5659 "PrintOverallStatistics" ,
5760 "PrintSize" ,
61+ "Prove" ,
62+ "ProveExists" ,
63+ "ProveExistsOutput" ,
5864 "Push" ,
5965 "Relation" ,
6066 "Repeat" ,
@@ -269,6 +275,7 @@ class TermApp:
269275 def __new__ (cls , name : str , args : list [int ]) -> TermApp : ...
270276
271277_Term : TypeAlias = TermLit | TermVar | TermApp
278+ _TermId : TypeAlias = int
272279
273280##
274281# Facts
@@ -531,15 +538,20 @@ class PrintAllFunctionsSize:
531538@final
532539class ExtractVariants :
533540 termdag : TermDag
534- terms : list [_Term ]
535- def __new__ (cls , termdag : TermDag , terms : list [_Term ]) -> ExtractVariants : ...
541+ terms : list [_TermId ]
542+ def __new__ (cls , termdag : TermDag , terms : list [_TermId ]) -> ExtractVariants : ...
536543
537544@final
538545class ExtractBest :
539546 termdag : TermDag
540547 cost : int
541- term : _Term
542- def __new__ (cls , termdag : TermDag , cost : int , term : _Term ) -> ExtractBest : ...
548+ term : _TermId
549+ def __new__ (cls , termdag : TermDag , cost : int , term : _TermId ) -> ExtractBest : ...
550+
551+ @final
552+ class ProveExistsOutput :
553+ proof : str
554+ def __new__ (cls , proof : str ) -> ProveExistsOutput : ...
543555
544556@final
545557class OverallStatistics :
@@ -555,10 +567,10 @@ class RunScheduleOutput:
555567class PrintFunctionOutput :
556568 function : Function
557569 termdag : TermDag
558- terms : list [tuple [_Term , _Term ]]
570+ terms : list [tuple [_TermId , _TermId ]]
559571 mode : _PrintFunctionMode
560572 def __new__ (
561- cls , function : Function , termdag : TermDag , terms : list [tuple [_Term , _Term ]], mode : _PrintFunctionMode
573+ cls , function : Function , termdag : TermDag , terms : list [tuple [_TermId , _TermId ]], mode : _PrintFunctionMode
562574 ) -> PrintFunctionOutput : ...
563575
564576@final
@@ -571,6 +583,7 @@ _CommandOutput: TypeAlias = (
571583 | PrintAllFunctionsSize
572584 | ExtractVariants
573585 | ExtractBest
586+ | ProveExistsOutput
574587 | OverallStatistics
575588 | RunScheduleOutput
576589 | PrintFunctionOutput
@@ -718,6 +731,18 @@ class Check:
718731 facts : list [_Fact ]
719732 def __new__ (cls , span : _Span , facts : list [_Fact ]) -> Check : ...
720733
734+ @final
735+ class Prove :
736+ span : _Span
737+ facts : list [_Fact ]
738+ def __new__ (cls , span : _Span , facts : list [_Fact ]) -> Prove : ...
739+
740+ @final
741+ class ProveExists :
742+ span : _Span
743+ expr : str
744+ def __new__ (cls , span : _Span , expr : str ) -> ProveExists : ...
745+
721746@final
722747class PrintFunction :
723748 span : _Span
@@ -823,6 +848,8 @@ _Command: TypeAlias = (
823848 | RunSchedule
824849 | Extract
825850 | Check
851+ | Prove
852+ | ProveExists
826853 | PrintFunction
827854 | PrintSize
828855 | Output
@@ -845,14 +872,14 @@ _Command: TypeAlias = (
845872@final
846873class TermDag :
847874 def size (self ) -> int : ...
848- def lookup (self , node : _Term ) -> int : ...
849- def get (self , id : int ) -> _Term : ...
850- def app (self , sym : str , children : list [int ]) -> _Term : ...
851- def lit (self , lit : _Literal ) -> _Term : ...
852- def var (self , sym : str ) -> _Term : ...
853- def expr_to_term (self , expr : _Expr ) -> _Term : ...
854- def term_to_expr (self , term : _Term , span : _Span ) -> _Expr : ...
855- def to_string (self , term : _Term ) -> str : ...
875+ def lookup (self , node : _Term ) -> _TermId : ...
876+ def get (self , id : _TermId ) -> _Term : ...
877+ def app (self , sym : str , children : list [_TermId ]) -> _TermId : ...
878+ def lit (self , lit : _Literal ) -> _TermId : ...
879+ def var (self , sym : str ) -> _TermId : ...
880+ def expr_to_term (self , expr : _Expr ) -> _TermId : ...
881+ def term_to_expr (self , term : _TermId , span : _Span ) -> _Expr : ...
882+ def to_string (self , term : _TermId ) -> str : ...
856883
857884##
858885# Extraction
@@ -882,10 +909,10 @@ class Extractor(Generic[_COST]):
882909 def __new__ (
883910 cls , rootsorts : list [str ] | None , egraph : EGraph , cost_model : CostModel [_COST , Any ]
884911 ) -> Extractor [_COST ]: ...
885- def extract_best (self , egraph : EGraph , termdag : TermDag , value : Value , sort : str ) -> tuple [_COST , _Term ]: ...
912+ def extract_best (self , egraph : EGraph , termdag : TermDag , value : Value , sort : str ) -> tuple [_COST , _TermId ]: ...
886913 def extract_variants (
887914 self , egraph : EGraph , termdag : TermDag , value : Value , nvariants : int , sort : str
888- ) -> list [tuple [_COST , _Term ]]: ...
915+ ) -> list [tuple [_COST , _TermId ]]: ...
889916
890917##
891918# Frozen
0 commit comments