I - input symbol typeD - output domain typepublic final class GenericObservationTable<I,D> extends Object implements MutableObservationTable<I,D>, Serializable
An observation table (OT) is the central data structure used by Angluin's L* algorithm, as described in the paper "Learning Regular Sets from Queries and Counterexamples".
An observation table is a two-dimensional table, with rows indexed by prefixes, and columns indexed by suffixes. For
a prefix u and a suffix v, the respective cell contains the result of the membership query
(u, v).
The set of prefixes (row labels) is divided into two disjoint sets: short and long prefixes. Each long prefix is a one-letter extension of a short prefix; conversely, every time a prefix is added to the set of short prefixes, all possible one-letter extensions are added to the set of long prefixes.
In order to derive a well-defined hypothesis from an observation table, it must satisfy two properties: closedness and consistency.
u there exists
a short prefix u' such that the row contents for both prefixes are equal. u and u' with identical row contents,
it
holds that for every input symbol a the rows indexed by ua and u'a also have
identical contents. NO_DISTINGUISHING_SUFFIX| Constructor and Description |
|---|
GenericObservationTable(Alphabet<I> alphabet)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
List<List<Row<I>>> |
addAlphabetSymbol(I symbol,
MembershipOracle<I,D> oracle) |
List<List<Row<I>>> |
addShortPrefixes(List<? extends Word<I>> shortPrefixes,
MembershipOracle<I,D> oracle) |
List<List<Row<I>>> |
addSuffix(Word<I> suffix,
MembershipOracle<I,D> oracle)
Adds a suffix to the list of distinguishing suffixes.
|
List<List<Row<I>>> |
addSuffixes(Collection<? extends Word<I>> newSuffixes,
MembershipOracle<I,D> oracle)
Adds suffixes to the list of distinguishing suffixes.
|
Alphabet<I> |
getInputAlphabet()
Retrieves the input alphabet used in this observation table.
|
Collection<Row<I>> |
getLongPrefixRows() |
de.learnlib.datastructure.observationtable.RowImpl<I> |
getRow(int rowId)
Returns the specified row of the observation table.
|
List<Row<I>> |
getShortPrefixRows() |
List<Word<I>> |
getSuffixes()
Retrieves all suffixes in the table.
|
List<List<Row<I>>> |
initialize(List<Word<I>> initialShortPrefixes,
List<Word<I>> initialSuffixes,
MembershipOracle<I,D> oracle)
Initializes an observation table using a specified set of suffixes.
|
boolean |
isAccessSequence(Word<I> word) |
boolean |
isInitialConsistencyCheckRequired() |
boolean |
isInitialized()
Checks whether this observation table has been initialized yet (i.e., contains any rows).
|
int |
numberOfDistinctRows()
Returns the number of distinct (regarding row values) rows in this observation table.
|
int |
numberOfRows()
Returns the total number of rows in this observation table.
|
List<D> |
rowContents(Row<I> row) |
void |
setInputAlphabet(Alphabet<I> alphabet)
This is an internal method used for de-serializing.
|
List<List<Row<I>>> |
toShortPrefixes(List<Row<I>> lpRows,
MembershipOracle<I,D> oracle)
Moves the specified rows to the set of short prefix rows.
|
Word<I> |
transformAccessSequence(Word<I> word) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcellContents, findDistinguishingSuffix, findDistinguishingSuffix, findDistinguishingSuffixIndex, findDistinguishingSuffixIndex, findInconsistency, findUnclosedRow, getAllPrefixes, getAllRows, getLongPrefixes, getRow, getRowSuccessor, getShortPrefixes, getSuffix, isClosed, isConsistent, numberOfLongPrefixRows, numberOfShortPrefixRows, numberOfSuffixeslongestASPrefixpublic List<List<Row<I>>> initialize(List<Word<I>> initialShortPrefixes, List<Word<I>> initialSuffixes, MembershipOracle<I,D> oracle)
MutableObservationTableinitialize in interface MutableObservationTable<I,D>initialSuffixes - the set of initial column labels.oracle - the MembershipOracle to use for performing queriespublic int numberOfDistinctRows()
ObservationTablenumberOfDistinctRows in interface ObservationTable<I,D>Row.getRowContentId()public List<List<Row<I>>> addSuffix(Word<I> suffix, MembershipOracle<I,D> oracle)
MutableObservationTableaddSufixes(Collections.singletonList(suffix), oracle).addSuffix in interface MutableObservationTable<I,D>suffix - the suffix to addoracle - the membership oraclepublic List<List<Row<I>>> addSuffixes(Collection<? extends Word<I>> newSuffixes, MembershipOracle<I,D> oracle)
MutableObservationTableaddSuffixes in interface MutableObservationTable<I,D>newSuffixes - the suffixes to addoracle - the membership oraclepublic boolean isInitialConsistencyCheckRequired()
isInitialConsistencyCheckRequired in interface MutableObservationTable<I,D>public List<List<Row<I>>> addShortPrefixes(List<? extends Word<I>> shortPrefixes, MembershipOracle<I,D> oracle)
addShortPrefixes in interface MutableObservationTable<I,D>public List<List<Row<I>>> toShortPrefixes(List<Row<I>> lpRows, MembershipOracle<I,D> oracle)
MutableObservationTabletoShortPrefixes in interface MutableObservationTable<I,D>lpRows - the rows to move to the set of short prefix rowsoracle - the membership oraclepublic List<D> rowContents(Row<I> row)
rowContents in interface ObservationTable<I,D>public de.learnlib.datastructure.observationtable.RowImpl<I> getRow(int rowId)
ObservationTablegetRow in interface ObservationTable<I,D>rowId - the index of the rowpublic int numberOfRows()
ObservationTablenumberOfRows in interface ObservationTable<I,D>Row.getRowId()public List<Word<I>> getSuffixes()
ObservationTablegetSuffixes in interface ObservationTable<I,D>public boolean isInitialized()
MutableObservationTableisInitialized in interface MutableObservationTable<I,D>true iff the table has been initializedpublic Alphabet<I> getInputAlphabet()
ObservationTablegetInputAlphabet in interface ObservationTable<I,D>public void setInputAlphabet(Alphabet<I> alphabet)
alphabet - the input alphabet corresponding to the previously serialized one.public Word<I> transformAccessSequence(Word<I> word)
transformAccessSequence in interface AccessSequenceTransformer<I>public boolean isAccessSequence(Word<I> word)
isAccessSequence in interface AccessSequenceTransformer<I>public List<List<Row<I>>> addAlphabetSymbol(I symbol, MembershipOracle<I,D> oracle)
addAlphabetSymbol in interface MutableObservationTable<I,D>public List<Row<I>> getShortPrefixRows()
getShortPrefixRows in interface ObservationTable<I,D>public Collection<Row<I>> getLongPrefixRows()
getLongPrefixRows in interface ObservationTable<I,D>Copyright © 2020. All rights reserved.