290N: The Unknown Component Problem

290N: The Unknown Component
Problem
Lecture 10
Computing with Finite Automata
(part 2)
Outline

Reachability analysis
 Product computation (“product”)
 Verification by language containment (“check”)
 Determinization by subset construction (“determinize”)
 Don’t-care minimization (“dcmin”)
Image Computation

Given a mapping of minterms
from one Boolean space
(input space) into another
Boolean space (output space)

Input space
For a set of minterms in the input
space
• The image of this set is the set
of corresponding minterms in
the output space

Output space
For a set of minterms in the
output space
• The pre-image of this set is the
set of corresponding minterms in
the input space
Image
Pre-image
Implicit Image Computation


Implements formula: Image(Y) = x [R(X,Y) & C(X)]
Implicit methods by far outperform explicit ones


Operations & and  are basic Boolean manipulations


Successfully computing images with more than 2^100 minterms in
the input/output spaces
They are efficiently implemented in the BDD package
To avoid large intermediate results (during and after the product
computation), operation AND-EXIST can be used, which performs
product and quantification simultaneously (in one pass over the
BDDs)
Improvements to Image Computation

Represent the transition relation as a set of partitions


Different approaches to computing the image (Coudert, 1989)




Input splitting
Output splitting
Quantification scheduling
Hybrid methods






Natural when the FSM (automaton) is represented by the circuit
Use partition clustering in addition to quantification scheduling
(Berkeley, IWLS 95)
Use non-linear quantification scheduling (CMU, ICCAD 01)
Partitioning (OR-decomposition) of the transition relation
“To split, or to conjoin” (mix the quantification scheduling and
input/output splitting) (Somenzi, DAC 2000)
“The far side of image computation” (Somenzi, ICCAD 2003)
Tricks and speed-ups


Disjoint decomposition
Caching of intermediate results, etc
Reachability Analysis



Many applications explore the reachable state space
Given an FSM (automaton) with the transition relation, find all the
states reachable from the initial state
Apply image computation repeatedly to compute the sets of reachable
states in the next iteration (“onion rings”) until convergence
ReachedStates = InitialState;
while ( there are new states )
ReachedStatesNew = Image( TransitionRelation, ReachedStates );
if (ReachedStatesNew = ReachedStates ) stop;
ReachedStates = ReachedStatesNew ;


Reachability analysis uses sophisticated methods of image
computation
Relies on numerous improvements



Simplification using don’t-cares
Iterative squaring
Approximations, etc
Outline

Reachability analysis
 Product computation (“product”)
 Verification by language containment (“check”)
 Determinization by subset construction (“determinize”)
 Don’t-care minimization (“dcmin”)
Product Computation

Starting from the initial states, run two automata “in
parallel” and create a new automaton (product
automaton) whose states are labeled by the pairs of
states: one state from each automaton


A state of the product is accepting iff both component states are
accepting
The maximum number of states in the product automaton
is equal to the product of the number of states of the
argument

However, many of these states may not be reachable from the
initial state
Explicit Algorithm

The two automata



Additional data structures



The linked lists of states {s} and {t}
The accepting states are marked
Q: The FIFO queue of reached product states
H: The hash table hashing two component states into the product state
Initialization
Create the initial state of the product automaton (s0,t0) by putting
together the initial states of the argument automata, s0 and t0
insert this state into Q and H

Computation
while Q is not empty, extract one product state (s,t) from Q
for all product states (s’,t’) reachable in one transition from (s,t)
if (s’,t’) is not in H (that is, (s’,t’) has not been visited)
create the new product state (s’,t’)
insert (s’,t’) into Q and into H
else find (s’,t’) using the hash table H
add the transition from (s,t) into (s’,t’)
Example of Product
Verification by Language
Containment



Works for deterministic, complete automata
Create the product of two automata, S and T
While visiting product states, keep track of the
acceptance attribute of the component states



Case 1: If we reach product state (s,t), in which s  S is
accepting while t  T is non-accepting, the language of T cannot
contain the language of S
Case 2: A symmetric case applies when the language of S
cannot contain the language of T
If we encounter both Case 1 and Case 2, there is no language
containment among S and T
• Can terminate the product computation immediately

If we do not encounter either Case 1 or Case 2, the languages
accepted by S and T are identical
• Need to complete the product computation to prove this
Example of Language Containment
Check
Determinization by Subset
Construction

Assume that ND transitions in the ND automaton happen
at the same time



It means that, at any moment, the ND automaton is in a subset
of its states
The subset may contain more than one state
The point of determinization is to enumerate through all
the subsets of states reachable from the initial state
under any possible inputs


Each subset of states of the ND automaton becomes a single
state of the new deterministic automaton
The languages accepted by the ND automaton and its
determinized version are the same
Determinization Algorithm

The automaton


Additional data structures



The linked lists of states {s}, with the accepting states marked
Q: The FIFO queue of reached subsets of states Sk
H: The hash table mapping each reached subsets of states Sk into the
corresponding state of the determinized automaton
Initialization
Create the initial state of the determinized automaton by creating the
subset of states {s0} composed of the initial state of the ND automaton
insert {s0} into Q and H

Computation
while Q is not empty, extract one subset of states Si from Q
for all subsets of states Sj reachable in one transition from Si
if Sj is not in H (that is, Sj has not been visited)
create the new state of the determinized automaton
make the new state accepting if some state of Sj is accepting
insert Sj into Q and into H
else find the new state corresponding to Sj using the hash table H
add the transition from Si into Sj
Example of Determinization
Regular expression: 0*100*1(00*1)*
Computing Reachable Subsets


Given a subset of states, what are other subsets of states that can be
reached in one transition from the given subset?
Naïve explicit approach (using STG)




Enumerate the minterms of the Boolean space of conditions
For each minterm, find the subset of states reachable from the given
subset in one iteration
Collect unique subsets
Better explicit approach (using STG)

Compute partitioning on the condition space defined by all the states from
the given subset
• Start by considering the partition defined by one state and gradually refine it by
adding other states



Each partition corresponds to one subset of next states
Collect unique subsets
This approach does not require enumerating through the minterms
Computing Reachable Subsets
(continued)

Implicit approach (using the monolithic relation)


Restrict the monolithic transition relation Ri(x,cs,ns) to the given
subset of states Si(cs): Ri(x,s) = cs [Ri(x,cs,ns) & Si(cs)]ns s
Given a state subset Si and its transition relation Ri(x,s), while
Ri(x,s) is not empty, enumerate through reachable subsets:
•
•
•
•
•

Extract one minterm m(x,s) from Ri(x,s)
Restrict m(x,s) to only input variables x (call it m(x))
Find Sj reachable from Si under m(x): Sj(s) = x[Ri(x,s) & m(x)]
Find Cij(x) labeling transition Si  Sj: Cij(x)=s[Ri(x,s)  Sj(s)]
Subtract this transition from Ri(x,s): Ri(x,s) = Ri(x,s) & NOT(Cij(x))
Hybrid approach (using state transition relations)


Pre-compute BDDs of the transition relations for each state
Given a state subset Si and its transition relation Ri(x,s), while
Ri(x,s) is not empty, proceed as described above…
Don’t-Care Minimization

State minimization of pseudo-non-deterministic FSMs is
a complex problem


NP-complete, solved exactly for small FSMs only
A fast heuristic minimization is possible (“dcmin”)

Requires an accepting don’t-care state to be present
• It is the case for most solutions to language equations

Computation



Complete with non-accepting state (if not complete)
Define the don’t-care condition of each state to be the condition
of its transition into the accepting DC state
Create the incompatibility graph
• One vertex for each state
• An edge exists between the two vertices if the care conditions of the
two states do not overlap


Color the incompatibility graph
Collapse the states, which have the same color
Example