// 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;

    }
    
    @Test
    public void testCompleteCTF2CTS() throws Exception
    {
        ITabularFormula formula = Helper.createFormula(
                new int[] {
                        1, 2, 3,
                        1, -2, 3,
                        -1, 2, 3,
                        2, 3, 4,
                        2, -3, 4,
                        -2, -3, -4
                });
        
        Helper.prettyPrint(formula);
        
        formula.complete(SimplePermutation.createPermutation(
                new int[] {1, 2, 3, 4, 5, 6}));
        
        assertEquals(6, formula.getVarCount());

        Helper.prettyPrint(formula);

        assertTrue(!formula.getTier(0).contains(_000_instance));
        assertTrue(!formula.getTier(0).contains(_010_instance));
        assertTrue(!formula.getTier(0).contains(_100_instance));
        assertEquals(5, formula.getTier(0).size());
        assertTrue(!formula.getTier(1).contains(_000_instance));
        assertTrue(!formula.getTier(1).contains(_010_instance));

// 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;

    }
    
    @Test
    public void testCompleteCTF2CTS() throws Exception
    {
        ITabularFormula formula = Helper.createFormula(
                new int[] {
                        1, 2, 3,
                        1, -2, 3,
                        -1, 2, 3,
                        2, 3, 4,
                        2, -3, 4,
                        -2, -3, -4
                });
        
        Helper.prettyPrint(formula);
        
        formula.complete(SimplePermutation.createPermutation(
                new int[] {1, 2, 3, 4, 5, 6}));
        
        assertEquals(6, formula.getVarCount());

        Helper.prettyPrint(formula);

        assertTrue(!formula.getTier(0).contains(_000_instance));
        assertTrue(!formula.getTier(0).contains(_010_instance));
        assertTrue(!formula.getTier(0).contains(_100_instance));
        assertEquals(5, formula.getTier(0).size());
        assertTrue(!formula.getTier(1).contains(_000_instance));
        assertTrue(!formula.getTier(1).contains(_010_instance));

        assertTrue(!formula.getTier(1).contains(_111_instance));
