Interface ObservableSUL<S,​I,​O>

  • Type Parameters:
    S - the state type
    I - the input type
    O - the output type
    All Superinterfaces:
    SUL<I,​O>
    All Known Implementing Classes:
    ObservableMealySimulatorSUL, ResetCounterObservableSUL, SymbolCounterObservableSUL

    public interface ObservableSUL<S,​I,​O>
    extends SUL<I,​O>
    A System Under Learning (SUL) where at any point in time the internal state can be observed.

    The main purpose of this interface is to check whether infinite words are accepted by the SUL.

    • Method Detail

      • fork

        default ObservableSUL<S,​I,​O> fork()
        Description copied from interface: SUL
        Forks this SUL, if possible. The fork of a SUL is a copy which behaves exactly the same as this SUL. This method should always return a reseted SUL, regardless of whether this call is made between a call to SUL.pre() and SUL.post().

        If SUL.canFork() returns true, this method must return a non-null object, which should behave exactly like this SUL (in particular, it must be forkable as well). Otherwise, a UnsupportedOperationException must be thrown.

        Implementation note: if resetting a SUL changes the internal state of this object in a non-trivial way (e.g., incrementing a counter to ensure independent sessions), care must be taken that forks of this SUL manipulate the same internal state.

        Specified by:
        fork in interface SUL<S,​I>
        Returns:
        a fork of this SUL.
      • getState

        S getState()
        Returns the current state of the system.

        Implementation note: it is important that the returned Object has a well-defined Object.equals(Object) method, and a good Object.hashCode() function.

        Returns:
        the current state of the system.
      • deepCopies

        default boolean deepCopies()
        Returns whether each state retrieved with getState() is a deep copy.

        A state is a deep copy if calls to either SUL.step(Object), SUL.pre(), or SUL.post() do not modify any state previously obtained with getState().

        More formally (assuming a perfect hash function): the result must be false if there is a case where in the following statements the assertion does not hold: Object o = getState(); int hc = o.hashCode(); [step(...)|pre()|post()]; assert o.hashCode() == hc; Furthermore, if states can be retrieved, but each state is not a deep copy, then this SUL must be forkable, i.e. if !deepCopies() then SUL.canFork() must hold.

        Returns:
        whether each state is a deep copy.