net.sf.javabdd
Class BDD.BDDIterator

java.lang.Object
  extended bynet.sf.javabdd.BDD.BDDIterator
All Implemented Interfaces:
Iterator
Enclosing class:
BDD

public static class BDD.BDDIterator
extends Object
implements Iterator

BDDIterator is used to iterate through the satisfying assignments of a BDD. It includes the ability to check if bits are dont-cares and skip them.

Version:
$Id: BDD.java,v 1.2 2004/10/19 11:11:35 joewhaley Exp $
Author:
jwhaley

Field Summary
protected  BDDFactory factory
           
protected  int[] levels
           
protected  boolean more
           
protected  BDD[] nodes
           
protected  boolean[] values
           
 
Constructor Summary
BDD.BDDIterator(BDD dis, BDD var)
          Construct a new BDDIterator on the given BDD.
 
Method Summary
protected  BDD buildAndIncrement()
           
 void fastForward(int var)
          Fast-forward the iteration such that the given variable number is true.
protected  void fastForward0(int var)
           
protected  void fillInSatisfyingAssignment(BDD node, int i)
           
protected  boolean findNextSatisfyingAssignment()
           
protected  void free()
           
 boolean hasNext()
           
protected  void increment()
           
 boolean isDontCare(BDDDomain d)
          Returns true if the BDD variables in the given BDD domain are all dont-care's.
 boolean isDontCare(int var)
          Returns true if the given BDD variable number is a dont-care.
 Object next()
           
 void remove()
           
 void skipDontCare(BDDDomain d)
          Assuming d is a dont-care, skip to the end of the iteration for d
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factory

protected BDDFactory factory

levels

protected int[] levels

values

protected boolean[] values

nodes

protected BDD[] nodes

more

protected boolean more
Constructor Detail

BDD.BDDIterator

public BDD.BDDIterator(BDD dis,
                       BDD var)

Construct a new BDDIterator on the given BDD. The var argument is the set of variables that will be mentioned in the result.

Parameters:
dis - BDD to iterate over
var - variable set to mention in result
Method Detail

fillInSatisfyingAssignment

protected void fillInSatisfyingAssignment(BDD node,
                                          int i)

findNextSatisfyingAssignment

protected boolean findNextSatisfyingAssignment()

increment

protected void increment()

buildAndIncrement

protected BDD buildAndIncrement()

free

protected void free()

next

public Object next()
Specified by:
next in interface Iterator

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator

remove

public void remove()
Specified by:
remove in interface Iterator

isDontCare

public boolean isDontCare(int var)

Returns true if the given BDD variable number is a dont-care. var must be a variable in the iteration set.

Parameters:
var - variable number to check
Returns:
if the given variable is a dont-care
Throws:
BDDException - if var is not in the iteration set

isDontCare

public boolean isDontCare(BDDDomain d)

Returns true if the BDD variables in the given BDD domain are all dont-care's.

Parameters:
d - domain to check
Returns:
if the variables are all dont-cares
Throws:
BDDException - if d is not in the iteration set

fastForward0

protected void fastForward0(int var)

fastForward

public void fastForward(int var)
Fast-forward the iteration such that the given variable number is true.

Parameters:
var - number of variable

skipDontCare

public void skipDontCare(BDDDomain d)
Assuming d is a dont-care, skip to the end of the iteration for d

Parameters:
d - BDD domain to fast-forward past


Copyright © 2003-2004 John Whaley. All Rights Reserved.