OW2 Consortium
Search OW2 Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | sat4j-dev List | March 2007 Index

<--  Date Index     <--  Thread Index    

Internal code update with Generics


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear all,

I committed last Friday some changes to SAT4J internal code that should
prevent developers to build SAT solvers with incompatible options.

It is based on the strategy design pattern with generics presented in:
http://www.javaspecialists.eu/archive/newsletter.do?issue=123&print=yes&locale=en_US

I applied it to the IOrder strategy (variable heuristics).

Some of the heuristics needed information about binary and ternary
clauses, only available in ILits2 and ILits23 interfaces.

Before introducing generics, it was possible to compile a solver with
simple variable representation and using a specific heuristics using
binary clause information. A ClassCastException was launched when
running that solver.

Now the compilation will abort.

The resulting code might be more difficult to read for people not used
to generics.

A solver is now created like this:

public static ISolver newMiniLearningHeapEZSimpNoRestarts() {
   LimitedLearning<ILits> learning = new LimitedLearning<ILits>(10);
   Solver<ILits> solver = new Solver<ILits>(new FirstUIP(), learning,
                new MixedDataStructureDaniel(), new SearchParams(
                        Integer.MAX_VALUE), new VarOrderHeap<ILits>());
   learning.setSolver(solver);
   solver.setSimplifier(solver.SIMPLE_SIMPLIFICATION);
   return solver;
}

However, it should not affect regular SAT4J user since it only applies
in SAT4J internals.

There is still one unsafe configuration: reason simplification only
works with plain clauses, not with cardinality constraints and PB
constraints.

I made clearer in the javadoc the distinction between user level API and
developer level one.
http://www.sat4j.org/doc/

Let me know your feeling about it.

Cheers,

        Daniel

- --
             Daniel Le Berre mailto:leberre@xxxxxxxxxxxxxxxxxxx
             MCF,    CRIL-CNRS FRE 2499,    Universite d'Artois
             http://www.cril.univ-artois.fr/~leberre
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFGB+jkqVioN+Yc2ggRAoCiAJ4payE6yxT26n3Gny4qv517dU7SEACeJ5LB
3NR6RBxpU/ZwD3Rq1euy9+I=
=2OdZ
-----END PGP SIGNATURE-----



<--  Date Index     <--  Thread Index    

Reply via email to:

Powered by MHonArc.

Copyright © 2006-2007, OW2 Consortium | contact | webmaster.