File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 22
33
44class Stateful (ABC ):
5- """Mixin adding a reset method."""
5+ r"""
6+ Mixin for stateful mappings.
7+
8+ A maping implements `Stateful` **if and only if** its behavior depends on an internal
9+ state.
10+
11+ Formally, a stateless mapping is a function :math:`f : x \mapsto y` whereas a stateful
12+ maping is a transition map :math:`A : (x, s) \mapsto (y, s')` where :math:`s` is the
13+ internal state, :math:`s'` the updated state, and :math:`y` the output.
14+ There exists an initial state :math:`s_0`, and the method `reset()` restores the state to
15+ :math:`s_0`. A `Stateful` mapping must be constructed with the intial state :math:`s_0`.
16+ """
617
718 @abstractmethod
819 def reset (self ) -> None :
9- """Resets the internal state."""
20+ """Resets the internal state :math:`s_0` ."""
You can’t perform that action at this time.
0 commit comments