Class SPMMs
- java.lang.Object
-
- net.automatalib.util.automaton.procedural.SPMMs
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <I,O>
Map<I,Word<I>>computeAccessSequences(SPMM<?,I,?,O> spmm, ProceduralInputAlphabet<I> alphabet, Map<I,Word<I>> terminatingSequences)static <I,O>
ATSequences<I>computeATSequences(SPMM<?,I,?,O> spmm)Computes a set of access sequences and terminating sequences for a givenSPMM.static <I,O>
ATSequences<I>computeATSequences(SPMM<?,I,?,O> spmm, ProceduralInputAlphabet<I> alphabet)Computes a set of access sequences and return sequences for a givenSPMMlimited to the symbols of the givenProceduralInputAlphabet.static <I,O>
Map<I,Word<I>>computeTerminatingSequences(SPMM<?,I,?,O> spmm, ProceduralInputAlphabet<I> alphabet)static <I,O>
@Nullable Word<I>findSeparatingWord(SPMM<?,I,?,O> spmm1, SPMM<?,I,?,O> spmm2, ProceduralInputAlphabet<I> alphabet)Computes a separating word for the two givenSPMMs, if existent.static <I,O>
booleanisValid(SPMM<?,I,?,O> spmm)Checks whether the givenSPMMis valid, This is a convenience method forisValid(SPMM, ProceduralInputAlphabet)that uses theinput alphabetof the givenSPMM.static <I,O>
booleanisValid(SPMM<?,I,?,O> spmm, ProceduralInputAlphabet<I> alphabet)Checks whether the givenSPMMis valid with respect to the givenProceduralInputAlphabet, i.e., whether itsproceduresare error-closed, return-closed, and call-closed.static <I,O>
booleantestEquivalence(SPMM<?,I,?,O> spmm1, SPMM<?,I,?,O> spmm2, ProceduralInputAlphabet<I> alphabet)Checks if the two givenSPMMs are equivalent, i.e. whether there exists aseparating wordfor them.
-
-
-
Method Detail
-
computeATSequences
public static <I,O> ATSequences<I> computeATSequences(SPMM<?,I,?,O> spmm)
Computes a set of access sequences and terminating sequences for a givenSPMM. This is a convenience method forcomputeATSequences(SPMM, ProceduralInputAlphabet)that automatically uses theinput alphabetof the givenspmm.- Type Parameters:
I- input symbol type- Parameters:
spmm- theSPMMfor which the sequences should be computed- Returns:
- an
ATSequencesobject which contains the respective sequences. - See Also:
computeATSequences(SPMM, ProceduralInputAlphabet)
-
computeATSequences
public static <I,O> ATSequences<I> computeATSequences(SPMM<?,I,?,O> spmm, ProceduralInputAlphabet<I> alphabet)
Computes a set of access sequences and return sequences for a givenSPMMlimited to the symbols of the givenProceduralInputAlphabet.- Type Parameters:
I- input symbol typeO- output symbol type- Parameters:
spmm- theSPMMfor which the sequences should be computedalphabet- theProceduralInputAlphabetwhose symbols should be used for computing the respective sequences- Returns:
- an
ATSequencesobject which contains the respective sequences. - See Also:
computeAccessSequences(SPMM, ProceduralInputAlphabet, Map),computeTerminatingSequences(SPMM, ProceduralInputAlphabet)
-
computeTerminatingSequences
public static <I,O> Map<I,Word<I>> computeTerminatingSequences(SPMM<?,I,?,O> spmm, ProceduralInputAlphabet<I> alphabet)
Computes for a givenSPMMthe set of terminating sequences using the givenalphabet. Terminating sequences transfer a procedure from its initial state to a returnable state. This method furthermore checks that the hierarchy of calls is well-defined, i.e. it only includes procedural invocations p for determining a terminating sequence if p has a valid terminating sequence itself.- Type Parameters:
I- input symbol typeO- output symbol type- Parameters:
spmm- theSPMMto analyzealphabet- theProceduralInputAlphabetwhose symbols should be used for computing the terminating sequences- Returns:
- A map from procedures (restricted to the call symbols of the given alphabet) to the terminating sequences. This map may be partial as some procedures may not have a well-defined terminating sequence for the given alphabet.
-
computeAccessSequences
public static <I,O> Map<I,Word<I>> computeAccessSequences(SPMM<?,I,?,O> spmm, ProceduralInputAlphabet<I> alphabet, Map<I,Word<I>> terminatingSequences)
Computes for a givenSPMMa set of access sequences using the SPMMalphabet. An access sequence (for procedure p) transfers anSPMMfrom its initial state to a state that is able to successfully execute a run of p. This method furthermore checks that potentially nested calls are well-defined, i.e. it only includes procedural invocations p for determining access sequences if p has a valid terminating sequence and therefore can be expanded correctly.- Type Parameters:
I- input symbol typeO- output symbol type- Parameters:
spmm- theSPMMto analyzealphabet- theProceduralInputAlphabetwhose symbols should be used for computing the access sequencesterminatingSequences- aMapof call symbols to terminating sequences used to expand nested invocations in access sequences- Returns:
- A map from procedures (restricted to the call symbols of the given alphabet) to the access sequences. This map may be partial as some procedures may not have well-defined access sequences for the given alphabet.
-
isValid
public static <I,O> boolean isValid(SPMM<?,I,?,O> spmm)
Checks whether the givenSPMMis valid, This is a convenience method forisValid(SPMM, ProceduralInputAlphabet)that uses theinput alphabetof the givenSPMM.- Type Parameters:
I- input symbol typeO- output symbol type- Parameters:
spmm- theSPMMto analyze- Returns:
trueifspmmis valid,falseotherwise.- See Also:
isValid(SPMM, ProceduralInputAlphabet)
-
isValid
public static <I,O> boolean isValid(SPMM<?,I,?,O> spmm, ProceduralInputAlphabet<I> alphabet)
Checks whether the givenSPMMis valid with respect to the givenProceduralInputAlphabet, i.e., whether itsproceduresare error-closed, return-closed, and call-closed.A procedure is considered error-closed iff any transition that emits an
error outputtransitions the procedure into a sink state that continues to output theerror output.A procedure is considered return-closed iff the
return symboltransitions the procedure into a sink state that continues to output theerror output.A procedure is considered call-closed iff any transition labeled with a non-terminating
call symboltransitions the procedure into a sink state that continues to output theerror output.- Type Parameters:
I- input symbol typeO- output symbol type- Parameters:
spmm- theSPMMto analyzealphabet- theProceduralInputAlphabetwhose symbols should be used for checking validity- Returns:
trueifspmmis valid,falseotherwise.
-
testEquivalence
public static <I,O> boolean testEquivalence(SPMM<?,I,?,O> spmm1, SPMM<?,I,?,O> spmm2, ProceduralInputAlphabet<I> alphabet)
Checks if the two givenSPMMs are equivalent, i.e. whether there exists aseparating wordfor them.- Type Parameters:
I- input symbol typeO- output symbol type- Parameters:
spmm1- the firstSPMMspmm2- the secondSPMMalphabet- theProceduralInputAlphabetwhose symbols should be used for checking equivalence- Returns:
trueif the twoSPMMs are equivalent,falseotherwise.- See Also:
findSeparatingWord(SPMM, SPMM, ProceduralInputAlphabet)
-
findSeparatingWord
public static <I,O> @Nullable Word<I> findSeparatingWord(SPMM<?,I,?,O> spmm1, SPMM<?,I,?,O> spmm2, ProceduralInputAlphabet<I> alphabet)
Computes a separating word for the two givenSPMMs, if existent. A separating word is aWordsuch that oneSPMMbehavesdifferent from the other.- Type Parameters:
I- input symbol typeO- output symbol type- Parameters:
spmm1- the firstSPMMspmm2- the secondSPMMalphabet- theProceduralInputAlphabetwhose symbols should be used for computing the separating word- Returns:
- a separating word, if existent,
nullotherwise.
-
-