org.sat4j.tools.encoding
Class Binary

java.lang.Object
  extended by org.sat4j.tools.encoding.EncodingStrategyAdapter
      extended by org.sat4j.tools.encoding.Binary

public class Binary
extends EncodingStrategyAdapter

For the case "at most one", we can use the binary encoding (also called birwise encoding) first described in A. M. Frisch, T. J. Peugniez, A. J. Dogget and P. Nightingale, "Solving Non-Boolean Satisfiability Problems With Stochastic Local Search: A Comparison of Encodings" in Journal of Automated Reasoning, vol. 35, n� 1-3, 2005

Since:
2.3.1
Author:
sroussel

Constructor Summary
Binary()
           
 
Method Summary
 IConstr addAtMost(ISolver solver, IVecInt literals, int degree)
           
 IConstr addAtMostOne(ISolver solver, IVecInt literals)
          p being the smaller integer greater than log_2(n), this encoding adds p variables and n*p clauses.
 
Methods inherited from class org.sat4j.tools.encoding.EncodingStrategyAdapter
addAtLeast, addAtLeastOne, addExactly, addExactlyOne, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Binary

public Binary()
Method Detail

addAtMostOne

public IConstr addAtMostOne(ISolver solver,
                            IVecInt literals)
                     throws ContradictionException
p being the smaller integer greater than log_2(n), this encoding adds p variables and n*p clauses.

Overrides:
addAtMostOne in class EncodingStrategyAdapter
Throws:
ContradictionException

addAtMost

public IConstr addAtMost(ISolver solver,
                         IVecInt literals,
                         int degree)
                  throws ContradictionException
Overrides:
addAtMost in class EncodingStrategyAdapter
Throws:
ContradictionException


Copyright © 2011 Centre de Recherche en Informatique de Lens (CRIL). All Rights Reserved.