net.automatalib.util.automata.fsa

## Class DFAs

• ```public abstract class DFAs
extends Object```
Operations on `DFA`s.

Note that the methods provided by this class do not modify their input arguments. Such methods are instead provided by the `MutableDFAs` class.

Author:
Malte Isberner
• ### Method Summary

All Methods
Modifier and Type Method and Description
`static <I> CompactDFA<I>` ```and(DFA<?,I> dfa1, DFA<?,I> dfa2, Alphabet<I> inputAlphabet)```
Calculates the conjunction ("and") of two DFA, and returns the result as a new DFA.
`static <I,S,A extends MutableDFA<S,I>>A` ```and(DFA<?,I> dfa1, DFA<?,I> dfa2, Collection<? extends I> inputs, A out)```
Calculates the conjunction ("and") of two DFA, and stores the result in a given mutable DFA.
`static <I> CompactDFA<I>` ```combine(DFA<?,I> dfa1, DFA<?,I> dfa2, Alphabet<I> inputAlphabet, AcceptanceCombiner combiner)```
Most general way of combining two DFAs.
`static <I,S,A extends MutableDFA<S,I>>A` ```combine(DFA<?,I> dfa1, DFA<?,I> dfa2, Collection<? extends I> inputs, A out, AcceptanceCombiner combiner)```
Most general way of combining two DFAs.
`static <I> CompactDFA<I>` ```complement(DFA<?,I> dfa, Alphabet<I> inputAlphabet)```
Calculates the complement (negation) of a DFA, and returns the result as a new DFA.
`static <I,S,A extends MutableDFA<S,I>>A` ```complement(DFA<?,I> dfa, Collection<? extends I> inputs, A out)```
Calculates the complement (negation) of a DFA, and stores the result in a given mutable DFA.
`static <I> CompactDFA<I>` ```complete(DFA<?,I> dfa, Alphabet<I> inputs)```
`static <I,S,A extends MutableDFA<S,I>>A` ```complete(DFA<?,I> dfa, Collection<? extends I> inputs, A out)```
`static <I> CompactDFA<I>` ```equiv(DFA<?,I> dfa1, DFA<?,I> dfa2, Alphabet<I> inputAlphabet)```
Calculates the equivalence ("<=>") of two DFA, and returns the result as a new DFA.
`static <I,S,A extends MutableDFA<S,I>>A` ```equiv(DFA<?,I> dfa1, DFA<?,I> dfa2, Collection<? extends I> inputs, A out)```
Calculates the equivalence ("<=>") of two DFA, and stores the result in a given mutable DFA.
`static <I> CompactDFA<I>` ```impl(DFA<?,I> dfa1, DFA<?,I> dfa2, Alphabet<I> inputAlphabet)```
Calculates the implication ("=>") of two DFA, and returns the result as a new DFA.
`static <I,S,A extends MutableDFA<S,I>>A` ```impl(DFA<?,I> dfa1, DFA<?,I> dfa2, Collection<? extends I> inputs, A out)```
Calculates the implication ("=>") of two DFA, and stores the result in a given mutable DFA.
`static <I> CompactDFA<I>` ```or(DFA<?,I> dfa1, DFA<?,I> dfa2, Alphabet<I> inputAlphabet)```
Calculates the disjunction ("or") of two DFA, and returns the result as a new DFA.
`static <I,S,A extends MutableDFA<S,I>>A` ```or(DFA<?,I> dfa1, DFA<?,I> dfa2, Collection<? extends I> inputs, A out)```
Calculates the disjunction ("or") of two DFA, and stores the result in a given mutable DFA.
`static <I> CompactDFA<I>` ```xor(DFA<?,I> dfa1, DFA<?,I> dfa2, Alphabet<I> inputAlphabet)```
Calculates the exclusive-or ("xor") of two DFA, and returns the result as a new DFA.
`static <I,S,A extends MutableDFA<S,I>>A` ```xor(DFA<?,I> dfa1, DFA<?,I> dfa2, Collection<? extends I> inputs, A out)```
Calculates the exclusive-or ("xor") of two DFA, and stores the result in a given mutable DFA.
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Method Detail

• #### combine

```public static <I,S,A extends MutableDFA<S,I>> A combine(DFA<?,I> dfa1,
DFA<?,I> dfa2,
Collection<? extends I> inputs,
A out,
AcceptanceCombiner combiner)```
Most general way of combining two DFAs. The `AcceptanceCombiner` specified via the `combiner` parameter specifies how acceptance values of the DFAs will be combined to an acceptance value in the result DFA.
Parameters:
`dfa1` - the first DFA
`dfa2` - the second DFA
`inputs` - the input symbols to consider
`out` - the mutable DFA for storing the result
`combiner` - combination method for acceptance values
Returns:
`out`, for convenience
• #### combine

```public static <I> CompactDFA<I> combine(DFA<?,I> dfa1,
DFA<?,I> dfa2,
Alphabet<I> inputAlphabet,
AcceptanceCombiner combiner)```
Most general way of combining two DFAs. The behavior is the same as of the above `combine(DFA, DFA, Collection, MutableDFA, AcceptanceCombiner)`, but the result automaton is automatically created as a `CompactDFA`.
Parameters:
`dfa1` - the first DFA
`dfa2` - the second DFA
`inputAlphabet` - the input alphabet
`combiner` - combination method for acceptance values
Returns:
a new DFA representing the combination of the specified DFA
• #### and

```public static <I,S,A extends MutableDFA<S,I>> A and(DFA<?,I> dfa1,
DFA<?,I> dfa2,
Collection<? extends I> inputs,
A out)```
Calculates the conjunction ("and") of two DFA, and stores the result in a given mutable DFA.
Parameters:
`dfa1` - the first DFA
`dfa2` - the second DFA
`inputs` - the input symbols to consider
`out` - a mutable DFA for storing the result
Returns:
`out`, for convenience
• #### and

```public static <I> CompactDFA<I> and(DFA<?,I> dfa1,
DFA<?,I> dfa2,
Alphabet<I> inputAlphabet)```
Calculates the conjunction ("and") of two DFA, and returns the result as a new DFA.
Parameters:
`dfa1` - the first DFA
`dfa2` - the second DFA
`inputAlphabet` - the input alphabet
Returns:
a new DFA representing the conjunction of the specified DFA
• #### or

```public static <I,S,A extends MutableDFA<S,I>> A or(DFA<?,I> dfa1,
DFA<?,I> dfa2,
Collection<? extends I> inputs,
A out)```
Calculates the disjunction ("or") of two DFA, and stores the result in a given mutable DFA.
Parameters:
`dfa1` - the first DFA
`dfa2` - the second DFA
`inputs` - the input symbols to consider
`out` - a mutable DFA for storing the result
Returns:
`out`, for convenience
• #### or

```public static <I> CompactDFA<I> or(DFA<?,I> dfa1,
DFA<?,I> dfa2,
Alphabet<I> inputAlphabet)```
Calculates the disjunction ("or") of two DFA, and returns the result as a new DFA.
Parameters:
`dfa1` - the first DFA
`dfa2` - the second DFA
`inputAlphabet` - the input alphabet
Returns:
a new DFA representing the conjunction of the specified DFA
• #### xor

```public static <I,S,A extends MutableDFA<S,I>> A xor(DFA<?,I> dfa1,
DFA<?,I> dfa2,
Collection<? extends I> inputs,
A out)```
Calculates the exclusive-or ("xor") of two DFA, and stores the result in a given mutable DFA.
Parameters:
`dfa1` - the first DFA
`dfa2` - the second DFA
`inputs` - the input symbols to consider
`out` - a mutable DFA for storing the result
Returns:
`out`, for convenience
• #### xor

```public static <I> CompactDFA<I> xor(DFA<?,I> dfa1,
DFA<?,I> dfa2,
Alphabet<I> inputAlphabet)```
Calculates the exclusive-or ("xor") of two DFA, and returns the result as a new DFA.
Parameters:
`dfa1` - the first DFA
`dfa2` - the second DFA
`inputAlphabet` - the input alphabet
Returns:
a new DFA representing the conjunction of the specified DFA
• #### equiv

```public static <I,S,A extends MutableDFA<S,I>> A equiv(DFA<?,I> dfa1,
DFA<?,I> dfa2,
Collection<? extends I> inputs,
A out)```
Calculates the equivalence ("<=>") of two DFA, and stores the result in a given mutable DFA.
Parameters:
`dfa1` - the first DFA
`dfa2` - the second DFA
`inputs` - the input symbols to consider
`out` - a mutable DFA for storing the result
Returns:
`out`, for convenience
• #### equiv

```public static <I> CompactDFA<I> equiv(DFA<?,I> dfa1,
DFA<?,I> dfa2,
Alphabet<I> inputAlphabet)```
Calculates the equivalence ("<=>") of two DFA, and returns the result as a new DFA.
Parameters:
`dfa1` - the first DFA
`dfa2` - the second DFA
`inputAlphabet` - the input alphabet
Returns:
a new DFA representing the conjunction of the specified DFA
• #### impl

```public static <I,S,A extends MutableDFA<S,I>> A impl(DFA<?,I> dfa1,
DFA<?,I> dfa2,
Collection<? extends I> inputs,
A out)```
Calculates the implication ("=>") of two DFA, and stores the result in a given mutable DFA.
Parameters:
`dfa1` - the first DFA
`dfa2` - the second DFA
`inputs` - the input symbols to consider
`out` - a mutable DFA for storing the result
Returns:
`out`, for convenience
• #### impl

```public static <I> CompactDFA<I> impl(DFA<?,I> dfa1,
DFA<?,I> dfa2,
Alphabet<I> inputAlphabet)```
Calculates the implication ("=>") of two DFA, and returns the result as a new DFA.
Parameters:
`dfa1` - the first DFA
`dfa2` - the second DFA
`inputAlphabet` - the input alphabet
Returns:
a new DFA representing the conjunction of the specified DFA
• #### complement

```public static <I,S,A extends MutableDFA<S,I>> A complement(DFA<?,I> dfa,
Collection<? extends I> inputs,
A out)```
Calculates the complement (negation) of a DFA, and stores the result in a given mutable DFA.

Note that unlike `MutableFSA.flipAcceptance()`, undefined transitions are treated as leading to a rejecting sink state (and are thus turned into an accepting sink).

Parameters:
`dfa` - the DFA to complement
`inputs` - the input symbols to consider
`out` - a mutable DFA for storing the result
Returns:
`out`, for convenience
• #### complement

```public static <I> CompactDFA<I> complement(DFA<?,I> dfa,
Alphabet<I> inputAlphabet)```
Calculates the complement (negation) of a DFA, and returns the result as a new DFA.

Note that unlike `MutableFSA.flipAcceptance()`, undefined transitions are treated as leading to a rejecting sink state (and are thus turned into an accepting sink).

Parameters:
`dfa` - the DFA to complement
`inputAlphabet` - the input alphabet
Returns:
a new DFA representing the complement of the specified DFA
• #### complete

```public static <I,S,A extends MutableDFA<S,I>> A complete(DFA<?,I> dfa,
Collection<? extends I> inputs,
A out)```
• #### complete

```public static <I> CompactDFA<I> complete(DFA<?,I> dfa,
Alphabet<I> inputs)```