Debug
DebugImpl
Bases: Impl[R]
Debug implementation that does nothing but the sets at each call.
This implementation is primarily useful to trace the flow of set operations. In particular, it can be inherited from to create a debugging implementation with custom printing behavior. For example:
R = ... # Some set representation type
class MyImpl(Impl[R]):
...
class MyDebugger(DebugImpl[R], MyImpl[R]):
def debug_repr(self, inp: R) -> str:
return repr(inp) # or some custom string representation
impl = MyDebugger(...)
tlt.realize(impl) # This will print the input set at each call
It is recommended that custom implementations override the debug_repr method
to provide meaningful representations of the input sets. These should be concise
to avoid overwhelming output during debugging sessions.
debug_repr(inp)
Return a string representation of the input set for debugging.
This method can be overridden in subclasses to provide custom representations of the input set.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inp
|
R
|
The input set to represent. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
A string representation of the input set. |