satisfiabilityApplet.tauTautology
Class Subcircuit

java.lang.Object
  extended bysatisfiabilityApplet.tauTautology.Subcircuit

public class Subcircuit
extends java.lang.Object

by Catherine Block id# 6319 Date: Dec 6, 2004 Time: 5:35:39 PM CS 180H For majority gate, only takes 2 inputs A Subcircuit is either a single variable input or a variable representing a nested subcircuit


Field Summary
static int number
           
 
Constructor Summary
Subcircuit(int i, boolean setToFalse)
          Constructor for integer {0,1} input
Subcircuit(Subcircuit lInput, Subcircuit rInput, Gate gate)
          Constructor for a two input circuit with a gate ('and' or 'or') Creates a unique variable name representing this circuit
Subcircuit(VariableModified v)
          Constructor used for a single variable input
 
Method Summary
 java.lang.Object clone()
           
 boolean isNegated()
          Is this subcirucuit negated?
 boolean isSingleInput()
          True if this subcircuit is just a single input (either negated or regular)
 void negate()
          negates this subcircuit (if it is already negated, this will un-negate
 java.lang.String oldToString()
          For testing only
 java.lang.String substitutionPrinter(int depth)
          TODO pretty printer to visually show depth of circuit
 java.lang.String toString()
          String representation of subcirucits in CNF format (recursive)
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

number

public static int number
Constructor Detail

Subcircuit

public Subcircuit(int i,
                  boolean setToFalse)
Constructor for integer {0,1} input

Parameters:
i - Integer input representing boolean value from {0,1}
setToFalse - Indicates that the truth value of this input should be set to false

Subcircuit

public Subcircuit(VariableModified v)
Constructor used for a single variable input

Parameters:
v - The variable input

Subcircuit

public Subcircuit(Subcircuit lInput,
                  Subcircuit rInput,
                  Gate gate)
Constructor for a two input circuit with a gate ('and' or 'or') Creates a unique variable name representing this circuit

Parameters:
lInput - The subcircuit representing the left input
rInput - The subcircuit representing the right input
gate - The logical gate for the circuit (must be Grammar.and or Grammar.or)
Method Detail

negate

public void negate()
negates this subcircuit (if it is already negated, this will un-negate


isNegated

public boolean isNegated()
Is this subcirucuit negated?

Returns:

isSingleInput

public boolean isSingleInput()
True if this subcircuit is just a single input (either negated or regular)

Returns:
True if single input, false otherwise

clone

public java.lang.Object clone()

toString

public java.lang.String toString()
String representation of subcirucits in CNF format (recursive)

Returns:
CNF format circuit

oldToString

public java.lang.String oldToString()
For testing only

Returns:

substitutionPrinter

public java.lang.String substitutionPrinter(int depth)
TODO pretty printer to visually show depth of circuit

Parameters:
depth -
Returns: