I
- input symbol typeD
- observation (output) domain type@ParametersAreNonnullByDefault public interface ObservationTable<I,D>
Instances implementing this interface can be obtained from learning algorithms implementing
the observation table feature
(or OTLearner
s.
Basically, an observation table is a two-dimensional table, where both rows and columns
are indexed by Word
s. The row indices are called prefixes, whereas
the column indexes are referred to as suffixes. The table is further vertically
divided into two halves: the prefixes in the upper half are referred to as
short prefixes (these usually correspond to states in learned hypothesis automata),
whereas the prefixes in the lower half are referred to as long prefixes. Long
prefixes must be one-letter extensions of short prefixes; they refer to transitions
in the hypothesis automaton. We refer to rows as short prefix rows or long prefix
row, depending on whether they occur in the upper or lower half of the table respectively.
The cells of the table are filled with observations for a given prefix and suffix combination.
The type of observations is generic and can be specified using the type parameter O
.
There are two important properties of observation tables, which usually have to be satisfied in order to be able to generate an automaton from an observation table: it must be both closed and consistent.
In a closed observation table, the contents of each long prefix row equal the contents of at least one short prefix rows. Consistency, on the other hand, is satisfied when for every two distinct short prefix rows, all rows indexed by one-letter extensions of the corresponding prefix with any input symbol also have the same content.
Modifier and Type | Interface and Description |
---|---|
static class |
ObservationTable.AbstractRow<I,D> |
static class |
ObservationTable.DefaultInconsistency<I,D> |
static interface |
ObservationTable.Inconsistency<I,D>
Representation of an inconsistency in the observation table.
|
static interface |
ObservationTable.Row<I,D>
A single row in the observation table.
|
Modifier and Type | Field and Description |
---|---|
static int |
NO_DISTINGUISHING_SUFFIX
Used to indicate that no distinguishing suffix exists in
findDistinguishingSuffixIndex(Inconsistency) and
findDistinguishingSuffixIndex(Row, Row) . |
static final int NO_DISTINGUISHING_SUFFIX
findDistinguishingSuffixIndex(Inconsistency)
and
findDistinguishingSuffixIndex(Row, Row)
.@Nonnull default Collection<? extends Word<I>> getShortPrefixes()
@Nonnull default Collection<? extends Word<I>> getLongPrefixes()
@Nonnull default Collection<? extends Word<I>> getAllPrefixes()
@Nonnull default Collection<? extends ObservationTable.Row<I,D>> getAllRows()
default boolean isClosed()
@Nullable default ObservationTable.Row<I,D> findUnclosedRow()
@Nullable default ObservationTable.Inconsistency<I,D> findInconsistency(Collection<? extends I> inputs)
@Nonnull default Word<I> getSuffix(int index)
index
- IndexOutOfBoundsException
@Signed default int findDistinguishingSuffixIndex(ObservationTable.Inconsistency<I,D> inconsistency)
inconsistency
- #NO_DISTINGUISHING_SUFFIX
if the contents of the rows are equal.NoSuchRowException
- if the@Nullable default Word<I> findDistinguishingSuffix(ObservationTable.Inconsistency<I,D> inconsistency)
@Nullable default Word<I> findDistinguishingSuffix(ObservationTable.Row<I,D> row1, ObservationTable.Row<I,D> row2)
row1
- the first rowrow2
- the second rowInvalidRowException
- if the rows do not belong to this observation table@Signed default int findDistinguishingSuffixIndex(ObservationTable.Row<I,D> row1, ObservationTable.Row<I,D> row2)
row1
- the first rowrow2
- the second row#NO_DISTINGUISHING_SUFFIX
if the contents of the rows are equal.InvalidRowException
- if the rows do not belong to this observation tabledefault boolean isConsistent(Collection<? extends I> inputs)
@Nonnull List<? extends Word<I>> getSuffixes()
@Nonnull Collection<? extends ObservationTable.Row<I,D>> getShortPrefixRows()
@Nonnull Collection<? extends ObservationTable.Row<I,D>> getLongPrefixRows()
@Nullable ObservationTable.Row<I,D> getSuccessorRow(ObservationTable.Row<I,D> spRow, @Nullable I symbol) throws InvalidRowException
InvalidRowException
Copyright © 2015. All rights reserved.