@@ -27,9 +27,9 @@ def head(cls):
2727 return cls
2828
2929 @classmethod
30- def make_term (cls , head , * args ):
31- """Creates a term with the given head and arguments."""
32- return head (* args )
30+ def make_term (cls , * args ):
31+ """Creates a term of the given cls type and with arguments."""
32+ return cls (* args )
3333
3434
3535@dataclass (eq = True , frozen = True )
@@ -191,6 +191,10 @@ def children(self):
191191 """Returns the children of the node."""
192192 return [self .op , * self .args ]
193193
194+ @classmethod
195+ def make_term (cls , op , * args ):
196+ return cls (op , args )
197+
194198
195199@dataclass (eq = True , frozen = True )
196200class Aggregate (LogicNode ):
@@ -361,6 +365,10 @@ def children(self):
361365 """Returns the children of the node."""
362366 return [self .lhs , self .rhs ]
363367
368+ @classmethod
369+ def make_term (cls , lhs , rhs ):
370+ return cls (lhs , rhs )
371+
364372
365373@dataclass (eq = True , frozen = True )
366374class Produces (LogicNode ):
@@ -412,3 +420,7 @@ def is_stateful():
412420 def children (self ):
413421 """Returns the children of the node."""
414422 return [* self .bodies ]
423+
424+ @classmethod
425+ def make_term (cls , * val ):
426+ return cls (val )
0 commit comments