/***********************************************************
 * PropSymbol data structure
 * Updated by Mark Goadrich 2/16/2008
 *
 * This class contains a boolean value and an integer index.
 * The index can be thought of as its name; rather than using
 * P, Q, and R as traditional in Propositional logic, it is 
 * easier and helpful in Java to use numbers.
 ***********************************************************/
public class PropSymbol {
    private boolean value;    // the truth value for this PropSymbol
    private int index;        // the "name" or where it is located in the array
    
    // The constructor initializes value and index
    public PropSymbol(boolean value, int index) {
	this.value = value;
	this.index = index;
    }

    // flip switches the value of the PropSymbol from true to false
    // and vice versa.  This is helpful in finding a clauses "neighbors"
    public void flip() {
	value = !value;
    }

    // returns the value of this PropSymbol
    public boolean booleanValue() {
	return value;
    }

    // returns the "name" of the PropSymbol
    public int getIndex() {
	return index;
    }

    // assigns a new value to the PropSymbol
    public void putValue(boolean value) {
	this.value = value;
    }
}
