1818from devito .types .basic import Basic
1919
2020__all__ = ['CondEq' , 'CondNe' , 'BitwiseNot' , 'BitwiseXor' , 'IntDiv' , # noqa
21- 'CallFromPointer' , 'CallFromComposite' , 'FieldFromPointer' ,
21+ 'Terminal' , ' CallFromPointer' , 'CallFromComposite' , 'FieldFromPointer' ,
2222 'FieldFromComposite' , 'ListInitializer' , 'Byref' , 'IndexedPointer' ,
2323 'Cast' , 'DefFunction' , 'MathFunction' , 'InlineIf' , 'Reserved' ,
2424 'ReservedWord' , 'Keyword' , 'String' , 'Macro' , 'Class' , 'MacroArgument' ,
@@ -129,6 +129,17 @@ def __mul__(self, other):
129129 return super ().__mul__ (other )
130130
131131
132+ class Terminal :
133+
134+ """
135+ Abstract base class for all terminal objects, that is, those objects
136+ collected by `retrieve_terminals` in addition to all other SymPy atoms
137+ such as `Symbol`, `Number`, etc.
138+ """
139+
140+ pass
141+
142+
132143class BasicWrapperMixin :
133144
134145 """
@@ -170,7 +181,7 @@ def _sympystr(self, printer):
170181 return str (self )
171182
172183
173- class CallFromPointer (sympy . Expr , Pickable , BasicWrapperMixin ):
184+ class CallFromPointer (Expr , Pickable , BasicWrapperMixin , Terminal ):
174185
175186 """
176187 Symbolic representation of the C notation ``pointer->call(params)``.
@@ -238,7 +249,7 @@ def free_symbols(self):
238249 __reduce_ex__ = Pickable .__reduce_ex__
239250
240251
241- class CallFromComposite (CallFromPointer , Pickable ):
252+ class CallFromComposite (CallFromPointer ):
242253
243254 """
244255 Symbolic representation of the C notation ``composite.call(params)``.
@@ -251,7 +262,7 @@ def __str__(self):
251262 __repr__ = __str__
252263
253264
254- class FieldFromPointer (CallFromPointer , Pickable ):
265+ class FieldFromPointer (CallFromPointer ):
255266
256267 """
257268 Symbolic representation of the C notation ``pointer->field``.
@@ -272,7 +283,7 @@ def field(self):
272283 __repr__ = __str__
273284
274285
275- class FieldFromComposite (CallFromPointer , Pickable ):
286+ class FieldFromComposite (CallFromPointer ):
276287
277288 """
278289 Symbolic representation of the C notation ``composite.field``,
@@ -334,7 +345,7 @@ def is_numeric(self):
334345 __reduce_ex__ = Pickable .__reduce_ex__
335346
336347
337- class UnaryOp (sympy . Expr , Pickable , BasicWrapperMixin ):
348+ class UnaryOp (Expr , Pickable , BasicWrapperMixin ):
338349
339350 """
340351 Symbolic representation of a unary C operator.
@@ -472,7 +483,7 @@ def __str__(self):
472483 return f"{ self ._op } { self .base } "
473484
474485
475- class IndexedPointer (sympy . Expr , Pickable , BasicWrapperMixin ):
486+ class IndexedPointer (Expr , Pickable , BasicWrapperMixin , Terminal ):
476487
477488 """
478489 Symbolic representation of the C notation ``symbol[...]``
0 commit comments