1919from devito .types .basic import Basic
2020
2121__all__ = ['CondEq' , 'CondNe' , 'BitwiseNot' , 'BitwiseXor' , 'BitwiseAnd' , # noqa
22- 'LeftShift' , 'RightShift' , 'IntDiv' , 'CallFromPointer' ,
22+ 'LeftShift' , 'RightShift' , 'IntDiv' , 'Terminal' , 'CallFromPointer' ,
2323 'CallFromComposite' , 'FieldFromPointer' , 'FieldFromComposite' ,
2424 'ListInitializer' , 'Byref' , 'IndexedPointer' , 'Cast' , 'DefFunction' ,
2525 'MathFunction' , 'InlineIf' , 'Reserved' , 'ReservedWord' , 'Keyword' ,
@@ -148,6 +148,17 @@ def __mul__(self, other):
148148 return super ().__mul__ (other )
149149
150150
151+ class Terminal :
152+
153+ """
154+ Abstract base class for all terminal objects, that is, those objects
155+ collected by `retrieve_terminals` in addition to all other SymPy atoms
156+ such as `Symbol`, `Number`, etc.
157+ """
158+
159+ pass
160+
161+
151162class BasicWrapperMixin :
152163
153164 """
@@ -189,7 +200,7 @@ def _sympystr(self, printer):
189200 return str (self )
190201
191202
192- class CallFromPointer (sympy . Expr , Pickable , BasicWrapperMixin ):
203+ class CallFromPointer (Expr , Pickable , BasicWrapperMixin , Terminal ):
193204
194205 """
195206 Symbolic representation of the C notation ``pointer->call(params)``.
@@ -257,7 +268,7 @@ def free_symbols(self):
257268 __reduce_ex__ = Pickable .__reduce_ex__
258269
259270
260- class CallFromComposite (CallFromPointer , Pickable ):
271+ class CallFromComposite (CallFromPointer ):
261272
262273 """
263274 Symbolic representation of the C notation ``composite.call(params)``.
@@ -270,7 +281,7 @@ def __str__(self):
270281 __repr__ = __str__
271282
272283
273- class FieldFromPointer (CallFromPointer , Pickable ):
284+ class FieldFromPointer (CallFromPointer ):
274285
275286 """
276287 Symbolic representation of the C notation ``pointer->field``.
@@ -291,7 +302,7 @@ def field(self):
291302 __repr__ = __str__
292303
293304
294- class FieldFromComposite (CallFromPointer , Pickable ):
305+ class FieldFromComposite (CallFromPointer ):
295306
296307 """
297308 Symbolic representation of the C notation ``composite.field``,
@@ -353,7 +364,7 @@ def is_numeric(self):
353364 __reduce_ex__ = Pickable .__reduce_ex__
354365
355366
356- class UnaryOp (sympy . Expr , Pickable , BasicWrapperMixin ):
367+ class UnaryOp (Expr , Pickable , BasicWrapperMixin ):
357368
358369 """
359370 Symbolic representation of a unary C operator.
@@ -486,7 +497,7 @@ def __str__(self):
486497 return f"{ self ._op } { self .base } "
487498
488499
489- class IndexedPointer (sympy . Expr , Pickable , BasicWrapperMixin ):
500+ class IndexedPointer (Expr , Pickable , BasicWrapperMixin , Terminal ):
490501
491502 """
492503 Symbolic representation of the C notation ``symbol[...]``
0 commit comments