// Path: 3-sat-core/src/main/java/com/anjlab/sat3/Helper.java
// public static void prettyPrint(ITabularFormula formula)
// {
//     printLine('-', 50);
// 
//     StringBuilder builder = buildPrettyOutput(formula);
//     builder.insert(0, '\n');
// 
//     LOGGER.info(builder.toString());
// }
// 
// Path: 3-sat-core/src/main/java/com/anjlab/sat3/SimpleTripletValueFactory.java
// public static final ITripletValue _000_instance = new _000();
// 
// Path: 3-sat-core/src/main/java/com/anjlab/sat3/SimpleTripletValueFactory.java
// public static final ITripletValue _001_instance = new _001();
// 
// Path: 3-sat-core/src/main/java/com/anjlab/sat3/SimpleTripletValueFactory.java
// public static final ITripletValue _010_instance = new _010();
// 
// Path: 3-sat-core/src/main/java/com/anjlab/sat3/SimpleTripletValueFactory.java
// public static final ITripletValue _100_instance = new _100();
// 
// Path: 3-sat-core/src/main/java/com/anjlab/sat3/SimpleTripletValueFactory.java
// public static final ITripletValue _111_instance = new _111();


import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import junit.framework.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import static com.anjlab.sat3.Helper.prettyPrint;
import static com.anjlab.sat3.SimpleTripletValueFactory._000_instance;
import static com.anjlab.sat3.SimpleTripletValueFactory._001_instance;
import static com.anjlab.sat3.SimpleTripletValueFactory._010_instance;
import static com.anjlab.sat3.SimpleTripletValueFactory._100_instance;
import static com.anjlab.sat3.SimpleTripletValueFactory._111_instance;
import static org.junit.Assert.assertEquals;

        
        s2.cleanup();
        
        assertTrue(!s2.isEmpty());

        ICompactTripletsStructure s = (ICompactTripletsStructure)
                                        Helper.createFormula(1, 2, 3,
                                                               -2, 3, 4);

        s.cleanup();
        
        assertTrue(s.isEmpty());

        s2.union(s);
        
        assertEquals(2, s2.getClausesCount());
    }
    
    @Test
    public void testCleanupFormulaThatHasEmptyTier()
    {
        ICompactTripletsStructure s = (ICompactTripletsStructure)
            Helper.createFormula(
                new int[]
                    {             //        a b c d e                                 
                        1, 2, 3,  //        0 0 0                                     
                        2, 3, 4,  //            0 0 0                                 
                        3, 4, 5   //       VarCount: 5; ClausesCount: 2; TiersCount: 3
                    });
        

// Path: 3-sat-core/src/main/java/com/anjlab/sat3/Helper.java
// public static void prettyPrint(ITabularFormula formula)
// {
//     printLine('-', 50);
// 
//     StringBuilder builder = buildPrettyOutput(formula);
//     builder.insert(0, '\n');
// 
//     LOGGER.info(builder.toString());
// }
// 
// Path: 3-sat-core/src/main/java/com/anjlab/sat3/SimpleTripletValueFactory.java
// public static final ITripletValue _000_instance = new _000();
// 
// Path: 3-sat-core/src/main/java/com/anjlab/sat3/SimpleTripletValueFactory.java
// public static final ITripletValue _001_instance = new _001();
// 
// Path: 3-sat-core/src/main/java/com/anjlab/sat3/SimpleTripletValueFactory.java
// public static final ITripletValue _010_instance = new _010();
// 
// Path: 3-sat-core/src/main/java/com/anjlab/sat3/SimpleTripletValueFactory.java
// public static final ITripletValue _100_instance = new _100();
// 
// Path: 3-sat-core/src/main/java/com/anjlab/sat3/SimpleTripletValueFactory.java
// public static final ITripletValue _111_instance = new _111();


// Path: 3-sat-core/src/test/java/com/anjlab/sat3/TestCTSOperations.java
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import junit.framework.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
import static com.anjlab.sat3.Helper.prettyPrint;
import static com.anjlab.sat3.SimpleTripletValueFactory._000_instance;
import static com.anjlab.sat3.SimpleTripletValueFactory._001_instance;
import static com.anjlab.sat3.SimpleTripletValueFactory._010_instance;
import static com.anjlab.sat3.SimpleTripletValueFactory._100_instance;
import static com.anjlab.sat3.SimpleTripletValueFactory._111_instance;
import static org.junit.Assert.assertEquals;

        
        s2.cleanup();
        
        assertTrue(!s2.isEmpty());

        ICompactTripletsStructure s = (ICompactTripletsStructure)
                                        Helper.createFormula(1, 2, 3,
                                                               -2, 3, 4);

        s.cleanup();
        
        assertTrue(s.isEmpty());

        s2.union(s);
        
        assertEquals(2, s2.getClausesCount());
    }
    
    @Test
    public void testCleanupFormulaThatHasEmptyTier()
    {
        ICompactTripletsStructure s = (ICompactTripletsStructure)
            Helper.createFormula(
                new int[]
                    {             //        a b c d e                                 
                        1, 2, 3,  //        0 0 0                                     
                        2, 3, 4,  //            0 0 0                                 
                        3, 4, 5   //       VarCount: 5; ClausesCount: 2; TiersCount: 3
                    });
        

        s.getTier(1).remove(SimpleTripletValueFactory._000_instance);
