Problemadvanced
Incompletely specified FSM minimization
Also called state reduction with don't-cares, ISFSM state minimization.
Find a machine with fewest states that covers an incompletely specified FSM. It is NP-hard, unlike DFA minimization, and is solved by compatibles and covering.
Incompletely specified FSM minimization asks for a finite state machine with the fewest states that behaves like a given machine wherever the given machine is specified. Some next states and some outputs of the given machine are left open, as don't-cares. For a completely specified machine, equivalent states form a partition, and DFA minimization finds the unique smallest machine in polynomial time. With don't-cares, the relation "these two states can be merged" is not transitive, a minimum machine may need a state to sit in two merged groups, and the problem is NP-hard. The classical exact method lists the compatible sets of states and then selects a smallest closed cover, which is a binate covering problem.
In plain words
A controller is described by a table: in this state, on this input, go to that state and give that output. Some entries are blank, because the designer knows the case never happens or does not care. Fewer states mean fewer flip-flops and smaller logic, so you want to merge states. Two states can be merged if no input sequence makes them give clearly different outputs. With blanks, A may fit with B and B with C while A does not fit with C. So the groups of merged states can overlap, and you must also make sure that wherever a group goes on an input, the result lies inside some group you chose. Choosing the fewest such groups is a hard search problem.
Definition
Input. A Mealy machine with finite sets of states , inputs and outputs , a partial next state map , and a partial output map . (A Moore machine is the special case where the output depends on the state only.)
Specified behavior. For a state and an input sequence , run from while the next states are specified. The specified outputs along the run are the outputs that promises on . Once a next state is unspecified, nothing more is promised.
Feasible solutions. A machine covers when for every state of there is a state of such that, for every input sequence, from gives every output that from promises, at the same positions. may be completely specified.
Objective. Minimize the number of states of .
Decision version. Given and , is there a machine with at most states that covers ?
Compatibles. Two states are compatible when no input sequence makes both promise different outputs at the same position. A set of states is a compatible when its states are pairwise compatible. A compatible implies, for each input , the set of specified next states. A set of compatibles is closed when every implied set of every member lies inside some member. Paull and Unger (1959) showed that the minimum number of states of a covering machine is the least size of a closed set of compatibles that covers , a minimum closed cover.
Variants
- Completely specified. All entries are given. Compatibility is equivalence, the closed cover is the partition into equivalence classes, and Hopcroft's algorithm solves it in time.
- Unspecified outputs only. All next states are given and some outputs are open. The problem stays NP-hard, since the reduction below has all next states specified.
- Unspecified next states only. All outputs are given and some next states are open. Compatibility is still not transitive in general, because a state with an open next state can be compatible with two states that are not compatible with each other.
- Moore machines. Outputs on states. The same theory applies, with output conflicts tested per state.
- Input don't-cares from the environment. Some input sequences never occur, because of the circuit around the machine. These sequential don't-cares give another form of incomplete specification.
- Nondeterministic specifications. If a state may move to any of a set of next states, the problem is close to NFA minimization, which is PSPACE-hard.
Examples
Take a Mealy machine with states , one input bit , and one output bit. A dash is a don't-care.
| state | next, | next, | out, | out, |
|---|---|---|---|---|
| 0 | − | |||
| − | 0 | |||
| 1 | − | |||
| − | − | 1 |
Pairs. and conflict on , and and conflict on . The pair implies on , so it is incompatible too. The compatible pairs are , which implies ; , which implies and ; and , which implies . No triple is compatible, so the maximal compatibles are , and .
Covers. covers all four states with two classes, but it is not closed, since implies . The only closed cover with three classes is , and the classes overlap at and at . No partition of the states into three classes is closed. An exhaustive search over all machines with 1, 2 and 3 states confirms that no machine with 1 or 2 states covers , and that 12 machines with 3 states do.
A minimum machine. With , and :
| state | next, | next, | out, | out, |
|---|---|---|---|---|
| 0 | 0 | |||
| 1 | 0 | |||
| 1 | 1 |
For example, on goes to and must output 1, because promises 1. State of is covered by , by or , by or , and by . The covering problem for this example is worked out on the binate covering page.
Known algorithms
- Compatibles and closed covers. Paull and Unger (1959). Find the incompatible pairs by a fixed point on implied pairs, list the compatibles, and search for a minimum closed cover. The search is exponential in the worst case.
- Prime compatibles and binate covering. Grasselli and Luccio (1965). A compatible is prime when no larger compatible implies only a subfamily of its implied sets. Some minimum closed cover uses only prime compatibles. The selection is a binate covering problem with one variable per prime compatible, clauses "some chosen compatible contains " for each state, and closure clauses "if is chosen, some chosen compatible contains ". Branch and bound, BDD-based, or 0-1 programming solvers then select the cover.
- Maximal compatibles. The maximal compatibles are the maximal cliques of the graph of compatible pairs, listed for example by Bron-Kerbosch. When no compatible implies anything, a minimum cover by maximal compatibles is a minimum clique cover.
- Implicit methods. Represent the sets of compatibles and the covering table by BDDs, to handle machines with very many compatibles.
- Heuristics. Merge compatible states greedily, or choose a closed cover without an optimality proof, for large machines.
Bounds
Upper bounds (proved).
- The decision version is in NP: a machine with at most states and, for each state of , a covering state are a certificate, and the covering can be checked in polynomial time on the product of the two machines.
- The exact method by compatibles takes time exponential in , since there can be compatibles.
- The incompatible pairs can be found in polynomial time, by a fixed point that marks a pair when its outputs conflict or when it implies a marked pair.
Lower bounds (proved, as hardness).
- The decision version is NP-complete (Pfleeger 1973). A short proof from graph coloring: for a graph , build a machine with one state per vertex, one input symbol per edge, and one output bit. On the input of the edge , state outputs 0, state outputs 1, and the other states leave the output open. Every state goes to itself on every input. Two states are compatible exactly when their vertices are not adjacent, and a compatible implies only itself, so every set of compatibles is closed. So a minimum covering machine has states, the chromatic number of .
- In contrast, the completely specified case has a unique minimum machine, found in time.
Measured. No measured figures are quoted here. The covering table has one column per prime compatible, and that number can be exponential in the number of states, so it is the size that the exact tools must handle in practice.
Reductions
- From graph coloring. As above. The same construction shows that the minimum can be far from the lower bound given by a largest set of pairwise incompatible states.
- To binate covering. The selection of a minimum closed cover from the prime compatibles is a binate covering problem, and so it can be given to a MaxSAT or 0-1 programming solver.
- From and to DFA minimization. A completely specified machine is a deterministic automaton with output, and the problem becomes DFA minimization, with equivalence in the role of compatibility.
Applications
- Controller synthesis. State tables written by hand, or derived from protocols and flow charts, leave many entries open. State reduction before state assignment gives fewer flip-flops and smaller next-state logic.
- Sequential don't-cares. A machine that drives or is driven by another machine sees only some input sequences. The unused behavior becomes don't-cares, and minimization uses them.
- Asynchronous circuits. Flow tables of asynchronous circuits are often incompletely specified, and the same method reduces them.
References
- Minimizing the number of states in incompletely specified sequential switching functions, compatible states, implied pairs, closed covers, and the example that a minimum machine may need overlapping classes
- A method for minimizing the number of internal states in incompletely specified sequential networks, prime compatibles, and the selection of a minimum closed cover as a covering problem with closure conditions
- Charles P. Pfleeger, State reduction in incompletely specified finite-state machines, IEEE Transactions on Computers, 1973, the NP-completeness of state reduction for incompletely specified machines
- Giovanni De Micheli, Synthesis and Optimization of Digital Circuits, McGraw-Hill, 1994, Chapter 9, Sequential Logic Optimization (state minimization of completely and incompletely specified machines)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag 4BRYXV Edit this page History Report an error Markdown