1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 package org.sat4j.minisat;
28
29 import java.io.Serializable;
30
31 import org.sat4j.core.ASolverFactory;
32 import org.sat4j.minisat.constraints.CardinalityDataStructure;
33 import org.sat4j.minisat.constraints.ClausalDataStructureCB;
34 import org.sat4j.minisat.constraints.ClausalDataStructureCBWL;
35 import org.sat4j.minisat.constraints.MixedDataStructureDaniel;
36 import org.sat4j.minisat.constraints.MixedDataStructureDanielCBWL;
37 import org.sat4j.minisat.constraints.MixedDataStructureWithBinary;
38 import org.sat4j.minisat.constraints.MixedDataStructureWithBinaryAndTernary;
39 import org.sat4j.minisat.constraints.PBMaxCBClauseCardConstrDataStructure;
40 import org.sat4j.minisat.constraints.PBMaxClauseAtLeastConstrDataStructure;
41 import org.sat4j.minisat.constraints.PBMaxClauseCardConstrDataStructure;
42 import org.sat4j.minisat.constraints.PBMaxDataStructure;
43 import org.sat4j.minisat.constraints.PBMinClauseCardConstrDataStructure;
44 import org.sat4j.minisat.constraints.PBMinDataStructure;
45 import org.sat4j.minisat.constraints.PuebloPBMinClauseAtLeastConstrDataStructure;
46 import org.sat4j.minisat.constraints.PuebloPBMinClauseCardConstrDataStructure;
47 import org.sat4j.minisat.constraints.PuebloPBMinDataStructure;
48 import org.sat4j.minisat.constraints.pb.PBSolver;
49 import org.sat4j.minisat.constraints.pb.PBSolverClause;
50 import org.sat4j.minisat.constraints.pb.PBSolverMerging;
51 import org.sat4j.minisat.constraints.pb.PBSolverWithImpliedClause;
52 import org.sat4j.minisat.core.DataStructureFactory;
53 import org.sat4j.minisat.core.ILits;
54 import org.sat4j.minisat.core.ILits2;
55 import org.sat4j.minisat.core.ILits23;
56 import org.sat4j.minisat.core.IOrder;
57 import org.sat4j.minisat.core.SearchParams;
58 import org.sat4j.minisat.core.Solver;
59 import org.sat4j.minisat.learning.ActiveLearning;
60 import org.sat4j.minisat.learning.ClauseOnlyLearning;
61 import org.sat4j.minisat.learning.FixedLengthLearning;
62 import org.sat4j.minisat.learning.LimitedLearning;
63 import org.sat4j.minisat.learning.MiniSATLearning;
64 import org.sat4j.minisat.learning.NoLearningButHeuristics;
65 import org.sat4j.minisat.learning.PercentLengthLearning;
66 import org.sat4j.minisat.orders.JWOrder;
67 import org.sat4j.minisat.orders.MyOrder;
68 import org.sat4j.minisat.orders.PureOrder;
69 import org.sat4j.minisat.orders.VarOrder;
70 import org.sat4j.minisat.orders.VarOrderHeap;
71 import org.sat4j.minisat.orders.VarOrderHeapObjective;
72 import org.sat4j.minisat.orders.VarOrderHeapRsat;
73 import org.sat4j.minisat.restarts.ArminRestarts;
74 import org.sat4j.minisat.restarts.LubyRestarts;
75 import org.sat4j.minisat.restarts.MiniSATRestarts;
76 import org.sat4j.minisat.uip.DecisionUIP;
77 import org.sat4j.minisat.uip.FirstUIP;
78 import org.sat4j.specs.ISolver;
79 import org.sat4j.tools.DimacsOutputSolver;
80
81
82
83
84
85
86 public class SolverFactory extends ASolverFactory implements Serializable {
87
88
89
90
91 private static final long serialVersionUID = 1L;
92
93
94 private static SolverFactory instance;
95
96
97
98
99
100
101 private SolverFactory() {
102 super();
103 }
104
105 private static synchronized void createInstance() {
106 if (instance == null) {
107 instance = new SolverFactory();
108 }
109 }
110
111
112
113
114
115
116 public static SolverFactory instance() {
117 if (instance == null) {
118 createInstance();
119 }
120 return instance;
121 }
122
123
124
125
126
127 public static Solver<ILits> newMiniLearning() {
128 return newMiniLearning(10);
129 }
130
131
132
133
134
135
136 public static Solver<ILits> newMiniLearningHeap() {
137 return newMiniLearningHeap(new MixedDataStructureDaniel());
138 }
139
140 public static Solver<ILits> newMiniLearningHeapEZSimp() {
141 Solver<ILits> solver = newMiniLearningHeap();
142 solver.setSimplifier(solver.SIMPLE_SIMPLIFICATION);
143 return solver;
144 }
145
146 public static Solver<ILits> newMiniLearningHeapExpSimp() {
147 Solver<ILits> solver = newMiniLearningHeap();
148 solver.setSimplifier(solver.EXPENSIVE_SIMPLIFICATION);
149 return solver;
150 }
151
152 public static Solver<ILits> newMiniLearningHeapRsatExpSimp() {
153 Solver<ILits> solver = newMiniLearningHeapExpSimp();
154 solver.setOrder(new VarOrderHeapRsat());
155 return solver;
156 }
157
158 public static Solver<ILits> newMiniLearningHeapRsatExpSimpBiere() {
159 Solver<ILits> solver = newMiniLearningHeapRsatExpSimp();
160 solver.setRestartStrategy(new ArminRestarts());
161 solver.setSearchParams(new SearchParams(1.1, 100));
162 return solver;
163 }
164
165 public static Solver<ILits> newMiniLearningHeapRsatExpSimpLuby() {
166 Solver<ILits> solver = newMiniLearningHeapRsatExpSimp();
167 solver.setRestartStrategy(new LubyRestarts());
168 return solver;
169 }
170
171
172
173
174
175
176
177
178 public static Solver<ILits> newMiniLearning(int n) {
179 return newMiniLearning(new MixedDataStructureDaniel(), n);
180 }
181
182
183
184
185
186
187
188
189 public static <L extends ILits> Solver<L> newMiniLearning(
190 DataStructureFactory<L> dsf) {
191 return newMiniLearning(dsf, 10);
192 }
193
194
195
196
197
198
199
200
201 public static <L extends ILits> Solver<L> newMiniLearningHeap(
202 DataStructureFactory<L> dsf) {
203 return newMiniLearning(dsf, new VarOrderHeap<L>());
204 }
205
206
207
208
209
210
211 public static Solver<ILits2> newMiniLearning2() {
212 return newMiniLearning(new MixedDataStructureWithBinary());
213 }
214
215 public static Solver<ILits2> newMiniLearning2Heap() {
216 return newMiniLearningHeap(new MixedDataStructureWithBinary());
217 }
218
219
220
221
222
223
224
225 public static Solver<ILits23> newMiniLearning23() {
226 return newMiniLearning(new MixedDataStructureWithBinaryAndTernary());
227 }
228
229
230
231
232
233 public static Solver<ILits> newMiniLearningCB() {
234 return newMiniLearning(new ClausalDataStructureCB());
235 }
236
237
238
239
240
241
242
243 public static Solver<ILits> newMiniLearningCBWL() {
244 return newMiniLearning(new ClausalDataStructureCBWL());
245 }
246
247 public static Solver<ILits2> newMiniLearning2NewOrder() {
248 return newMiniLearning(new MixedDataStructureWithBinary(),
249 new MyOrder());
250 }
251
252
253
254
255
256
257
258
259 public static Solver<ILits> newMiniLearningPure() {
260 return newMiniLearning(new MixedDataStructureDaniel(), new PureOrder());
261 }
262
263
264
265
266
267 public static Solver<ILits> newMiniLearningCBWLPure() {
268 return newMiniLearning(new ClausalDataStructureCBWL(), new PureOrder());
269 }
270
271
272
273
274
275
276
277
278
279
280
281
282 public static <L extends ILits> Solver<L> newMiniLearning(
283 DataStructureFactory<L> dsf, int n) {
284 LimitedLearning<L> learning = new PercentLengthLearning<L>(n);
285 Solver<L> solver = new Solver<L>(new FirstUIP(), learning, dsf,
286 new VarOrder<L>(), new MiniSATRestarts());
287 learning.setSolver(solver);
288 return solver;
289 }
290
291
292
293
294
295
296
297
298
299
300
301
302 public static <L extends ILits> Solver<L> newMiniLearning(
303 DataStructureFactory<L> dsf, IOrder<L> order) {
304 LimitedLearning<L> learning = new PercentLengthLearning<L>(10);
305 Solver<L> solver = new Solver<L>(new FirstUIP(), learning, dsf, order,
306 new MiniSATRestarts());
307 learning.setSolver(solver);
308 return solver;
309 }
310
311 public static Solver<ILits> newMiniLearningEZSimp() {
312 return newMiniLearningEZSimp(new MixedDataStructureDaniel());
313 }
314
315
316
317
318
319 public static <L extends ILits> Solver<L> newMiniLearningEZSimp(
320 DataStructureFactory<L> dsf) {
321 LimitedLearning<L> learning = new PercentLengthLearning<L>(10);
322 Solver<L> solver = new Solver<L>(new FirstUIP(), learning, dsf,
323 new VarOrder<L>(), new MiniSATRestarts());
324 learning.setSolver(solver);
325 solver.setSimplifier(solver.SIMPLE_SIMPLIFICATION);
326 return solver;
327 }
328
329
330
331
332 public static Solver<ILits> newMiniLearningHeapEZSimpNoRestarts() {
333 LimitedLearning<ILits> learning = new PercentLengthLearning<ILits>(10);
334 Solver<ILits> solver = new Solver<ILits>(new FirstUIP(), learning,
335 new MixedDataStructureDaniel(), new SearchParams(
336 Integer.MAX_VALUE), new VarOrderHeap<ILits>(),
337 new MiniSATRestarts());
338 learning.setSolver(solver);
339 solver.setSimplifier(solver.SIMPLE_SIMPLIFICATION);
340 return solver;
341 }
342
343
344
345
346 public static Solver<ILits> newMiniLearningHeapEZSimpLongRestarts() {
347 LimitedLearning<ILits> learning = new PercentLengthLearning<ILits>(10);
348 Solver<ILits> solver = new Solver<ILits>(new FirstUIP(), learning,
349 new MixedDataStructureDaniel(), new SearchParams(1000),
350 new VarOrderHeap<ILits>(), new MiniSATRestarts());
351 learning.setSolver(solver);
352 solver.setSimplifier(solver.SIMPLE_SIMPLIFICATION);
353 return solver;
354 }
355
356
357
358
359
360
361
362 public static Solver<ILits> newActiveLearning() {
363 ActiveLearning<ILits> learning = new ActiveLearning<ILits>();
364 Solver<ILits> s = new Solver<ILits>(new FirstUIP(), learning,
365 new MixedDataStructureDaniel(), new VarOrder<ILits>(),
366 new MiniSATRestarts());
367 learning.setOrder(s.getOrder());
368 learning.setSolver(s);
369 return s;
370 }
371
372
373
374
375 public static Solver<ILits> newMiniSAT() {
376 return newMiniSAT(new MixedDataStructureDaniel());
377 }
378
379
380
381
382 public static Solver<ILits> newMiniSATNoRestarts() {
383 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
384 Solver<ILits> solver = new Solver<ILits>(new FirstUIP(), learning,
385 new MixedDataStructureDaniel(), new SearchParams(
386 Integer.MAX_VALUE), new VarOrder<ILits>(),
387 new MiniSATRestarts());
388 learning.setDataStructureFactory(solver.getDSFactory());
389 learning.setVarActivityListener(solver);
390 return solver;
391
392 }
393
394
395
396
397
398 public static Solver<ILits2> newMiniSAT2() {
399 return newMiniSAT(new MixedDataStructureWithBinary());
400 }
401
402
403
404
405
406 public static Solver<ILits23> newMiniSAT23() {
407 return newMiniSAT(new MixedDataStructureWithBinaryAndTernary());
408 }
409
410
411
412
413
414
415 public static <L extends ILits> Solver<L> newMiniSAT(
416 DataStructureFactory<L> dsf) {
417 MiniSATLearning<L> learning = new MiniSATLearning<L>();
418 Solver<L> solver = new Solver<L>(new FirstUIP(), learning, dsf,
419 new VarOrder<L>(), new MiniSATRestarts());
420 learning.setDataStructureFactory(solver.getDSFactory());
421 learning.setVarActivityListener(solver);
422 return solver;
423 }
424
425
426
427
428 public static Solver<ILits> newMiniSATHeap() {
429 return newMiniSATHeap(new MixedDataStructureDaniel());
430 }
431
432
433
434
435
436 public static Solver<ILits> newMiniSATHeapEZSimp() {
437 Solver<ILits> solver = newMiniSATHeap();
438 solver.setSimplifier(solver.SIMPLE_SIMPLIFICATION);
439 return solver;
440 }
441
442 public static Solver<ILits> newMiniSATHeapExpSimp() {
443 Solver<ILits> solver = newMiniSATHeap();
444 solver.setSimplifier(solver.EXPENSIVE_SIMPLIFICATION);
445 return solver;
446 }
447
448
449
450
451
452 public static Solver<ILits2> newMiniSAT2Heap() {
453 return newMiniSATHeap(new MixedDataStructureWithBinary());
454 }
455
456
457
458
459
460 public static Solver<ILits23> newMiniSAT23Heap() {
461 return newMiniSATHeap(new MixedDataStructureWithBinaryAndTernary());
462 }
463
464 public static <L extends ILits> Solver<L> newMiniSATHeap(
465 DataStructureFactory<L> dsf) {
466 MiniSATLearning<L> learning = new MiniSATLearning<L>();
467 Solver<L> solver = new Solver<L>(new FirstUIP(), learning, dsf,
468 new VarOrderHeap<L>(), new MiniSATRestarts());
469 learning.setDataStructureFactory(solver.getDSFactory());
470 learning.setVarActivityListener(solver);
471 return solver;
472 }
473
474
475
476
477 public static Solver<ILits> newMiniCard() {
478 return newMiniSAT(new CardinalityDataStructure());
479 }
480
481
482
483
484
485 public static Solver<ILits> newMinimalOPBMax() {
486 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
487 Solver<ILits> solver = new Solver<ILits>(new FirstUIP(), learning,
488 new PBMaxDataStructure(), new VarOrderHeap<ILits>(),
489 new MiniSATRestarts());
490 learning.setDataStructureFactory(solver.getDSFactory());
491 learning.setVarActivityListener(solver);
492 return solver;
493 }
494
495
496
497
498
499 public static Solver<ILits> newMiniOPBMax() {
500 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
501 Solver<ILits> solver = new PBSolver<ILits>(new FirstUIP(), learning,
502 new PBMaxDataStructure(), new VarOrderHeap<ILits>());
503 learning.setDataStructureFactory(solver.getDSFactory());
504 learning.setVarActivityListener(solver);
505 return solver;
506 }
507
508
509
510
511
512
513 public static Solver<ILits> newMiniOPBClauseCardConstrMax() {
514 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
515 Solver<ILits> solver = new PBSolver<ILits>(new FirstUIP(), learning,
516 new PBMaxClauseCardConstrDataStructure(),
517 new VarOrderHeap<ILits>());
518 learning.setDataStructureFactory(solver.getDSFactory());
519 learning.setVarActivityListener(solver);
520 return solver;
521 }
522
523
524
525
526
527
528
529 public static Solver<ILits> newMiniOPBClauseCardConstrMaxSpecificOrder() {
530 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
531 Solver<ILits> solver = new PBSolver<ILits>(new FirstUIP(), learning,
532 new PBMaxClauseCardConstrDataStructure(),
533 new VarOrderHeapObjective());
534 learning.setDataStructureFactory(solver.getDSFactory());
535 learning.setVarActivityListener(solver);
536 return solver;
537 }
538
539
540
541
542
543
544
545
546 public static Solver<ILits> newMiniLearningOPBClauseCardConstrMaxSpecificOrderIncremental() {
547
548 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
549
550 Solver<ILits> solver = new PBSolver<ILits>(new FirstUIP(), learning,
551 new PBMaxClauseCardConstrDataStructure(),
552 new VarOrderHeapObjective());
553 learning.setDataStructureFactory(solver.getDSFactory());
554 learning.setVarActivityListener(solver);
555 return solver;
556 }
557
558
559
560
561
562
563
564
565
566 public static Solver<ILits> newMiniLearningOPBClauseCardConstrMaxSpecificOrderIncrementalLearnJustClauses() {
567 ClauseOnlyLearning<ILits> learning = new ClauseOnlyLearning<ILits>();
568 Solver<ILits> solver = new PBSolver<ILits>(new FirstUIP(), learning,
569 new PBMaxClauseCardConstrDataStructure(),
570 new VarOrderHeapObjective());
571 learning.setSolver(solver);
572 return solver;
573 }
574
575
576
577
578
579
580
581
582 public static Solver<ILits> newMiniLearningOPBClauseCardConstrMaxSpecificOrderIncrementalReductionToClause() {
583
584 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
585
586 Solver<ILits> solver = new PBSolverClause(new FirstUIP(), learning,
587 new PBMaxClauseCardConstrDataStructure(),
588 new VarOrderHeapObjective());
589 learning.setDataStructureFactory(solver.getDSFactory());
590 learning.setVarActivityListener(solver);
591 return solver;
592 }
593
594
595
596
597
598
599
600
601 public static Solver<ILits> newMiniLearningOPBClauseCardConstrMaxSpecificOrderIncrementalNoLearning() {
602 NoLearningButHeuristics<ILits> learning = new NoLearningButHeuristics<ILits>();
603
604 Solver<ILits> solver = new PBSolver<ILits>(new FirstUIP(), learning,
605 new PBMaxClauseCardConstrDataStructure(),
606 new VarOrderHeapObjective());
607 learning.setSolver(solver);
608 learning.setVarActivityListener(solver);
609 return solver;
610 }
611
612
613
614
615
616
617
618
619 public static Solver<ILits> newMiniLearningOPBClauseCardConstrMaxSpecificOrderIncrementalMerging() {
620
621 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
622
623 Solver<ILits> solver = new PBSolverMerging(new FirstUIP(), learning,
624 new PBMaxClauseCardConstrDataStructure(),
625 new VarOrderHeapObjective());
626 learning.setDataStructureFactory(solver.getDSFactory());
627 learning.setVarActivityListener(solver);
628 return solver;
629 }
630
631 public static Solver<ILits> newMinimalOPBClauseCardConstrMaxSpecificOrder() {
632 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
633 Solver<ILits> solver = new Solver<ILits>(new FirstUIP(), learning,
634 new PBMaxClauseCardConstrDataStructure(),
635 new VarOrderHeapObjective(), new MiniSATRestarts());
636 learning.setDataStructureFactory(solver.getDSFactory());
637 learning.setVarActivityListener(solver);
638 return solver;
639 }
640
641
642
643
644
645
646
647
648 public static Solver<ILits> newMiniOPBClauseCardConstrMaxReduceToClause() {
649 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
650 Solver<ILits> solver = new PBSolverClause(new FirstUIP(), learning,
651 new PBMaxClauseCardConstrDataStructure(),
652 new VarOrderHeap<ILits>());
653 learning.setDataStructureFactory(solver.getDSFactory());
654 learning.setVarActivityListener(solver);
655 return solver;
656 }
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679 public static Solver<ILits> newMiniOPBClauseCardConstrMaxImplied() {
680 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
681 Solver<ILits> solver = new PBSolverWithImpliedClause(new FirstUIP(),
682 learning, new PBMaxClauseCardConstrDataStructure(),
683 new VarOrderHeap<ILits>());
684 learning.setDataStructureFactory(solver.getDSFactory());
685 learning.setVarActivityListener(solver);
686 return solver;
687 }
688
689
690
691
692
693
694
695
696 public static Solver<ILits> newMiniOPBClauseAtLeastConstrMax() {
697 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
698 Solver<ILits> solver = new PBSolver<ILits>(new FirstUIP(), learning,
699 new PBMaxClauseAtLeastConstrDataStructure(),
700 new VarOrderHeap<ILits>());
701 learning.setDataStructureFactory(solver.getDSFactory());
702 learning.setVarActivityListener(solver);
703 return solver;
704 }
705
706
707
708
709
710 public static Solver<ILits> newMiniOPBCounterBasedClauseCardConstrMax() {
711 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
712 Solver<ILits> solver = new PBSolver<ILits>(new FirstUIP(), learning,
713 new PBMaxCBClauseCardConstrDataStructure(),
714 new VarOrderHeap<ILits>());
715 learning.setDataStructureFactory(solver.getDSFactory());
716 learning.setVarActivityListener(solver);
717 return solver;
718 }
719
720
721
722
723
724 public static Solver<ILits> newMinimalOPBMin() {
725 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
726 Solver<ILits> solver = new Solver<ILits>(new FirstUIP(), learning,
727 new PBMinDataStructure(), new VarOrderHeap<ILits>(),
728 new MiniSATRestarts());
729 learning.setDataStructureFactory(solver.getDSFactory());
730 learning.setVarActivityListener(solver);
731 return solver;
732 }
733
734
735
736
737
738 public static Solver<ILits> newMiniOPBMin() {
739 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
740 Solver<ILits> solver = new PBSolver<ILits>(new FirstUIP(), learning,
741 new PBMinDataStructure(), new VarOrderHeap<ILits>());
742 learning.setDataStructureFactory(solver.getDSFactory());
743 learning.setVarActivityListener(solver);
744 return solver;
745 }
746
747
748
749
750
751 public static Solver<ILits> newMinimalOPBMinPueblo() {
752 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
753 Solver<ILits> solver = new Solver<ILits>(new FirstUIP(), learning,
754 new PuebloPBMinDataStructure(), new VarOrderHeap<ILits>(),
755 new MiniSATRestarts());
756 learning.setDataStructureFactory(solver.getDSFactory());
757 learning.setVarActivityListener(solver);
758 return solver;
759 }
760
761
762
763
764
765 public static Solver<ILits> newMiniOPBMinPueblo() {
766 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
767 Solver<ILits> solver = new PBSolver<ILits>(new FirstUIP(), learning,
768 new PuebloPBMinDataStructure(), new VarOrderHeap<ILits>());
769 learning.setDataStructureFactory(solver.getDSFactory());
770 learning.setVarActivityListener(solver);
771 return solver;
772 }
773
774
775
776
777
778 public static Solver<ILits> newMiniOPBClauseCardMinPueblo() {
779 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
780 Solver<ILits> solver = new PBSolver<ILits>(new FirstUIP(), learning,
781 new PuebloPBMinClauseCardConstrDataStructure(),
782 new VarOrderHeap<ILits>());
783 learning.setDataStructureFactory(solver.getDSFactory());
784 learning.setVarActivityListener(solver);
785 return solver;
786 }
787
788
789
790
791
792 public static Solver<ILits> newMiniOPBClauseCardMin() {
793 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
794 Solver<ILits> solver = new PBSolver<ILits>(new FirstUIP(), learning,
795 new PBMinClauseCardConstrDataStructure(),
796 new VarOrderHeap<ILits>());
797 learning.setDataStructureFactory(solver.getDSFactory());
798 learning.setVarActivityListener(solver);
799 return solver;
800 }
801
802
803
804
805
806 public static Solver<ILits> newMiniOPBClauseAtLeastMinPueblo() {
807 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
808 Solver<ILits> solver = new PBSolver<ILits>(new FirstUIP(), learning,
809 new PuebloPBMinClauseAtLeastConstrDataStructure(),
810 new VarOrderHeap<ILits>());
811 learning.setDataStructureFactory(solver.getDSFactory());
812 learning.setVarActivityListener(solver);
813 return solver;
814 }
815
816
817
818
819 public static Solver<ILits> newRelsat() {
820 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
821 Solver<ILits> solver = new Solver<ILits>(new DecisionUIP(), learning,
822 new MixedDataStructureDaniel(), new VarOrderHeap<ILits>(),
823 new MiniSATRestarts());
824 learning.setDataStructureFactory(solver.getDSFactory());
825 learning.setVarActivityListener(solver);
826 return solver;
827 }
828
829
830
831
832
833 public static Solver<ILits> newBackjumping() {
834 NoLearningButHeuristics<ILits> learning = new NoLearningButHeuristics<ILits>();
835 Solver<ILits> solver = new Solver<ILits>(new FirstUIP(), learning,
836 new MixedDataStructureDaniel(), new VarOrderHeap<ILits>(),
837 new MiniSATRestarts());
838 learning.setVarActivityListener(solver);
839 return solver;
840 }
841
842
843
844
845
846
847
848 public static Solver<ILits23> newMini3SAT() {
849 LimitedLearning<ILits23> learning = new FixedLengthLearning<ILits23>(3);
850 Solver<ILits23> solver = new Solver<ILits23>(new FirstUIP(), learning,
851 new MixedDataStructureWithBinaryAndTernary(), new SearchParams(
852 Integer.MAX_VALUE), new JWOrder(),
853 new MiniSATRestarts());
854 learning.setSolver(solver);
855 return solver;
856 }
857
858
859
860
861
862 public static Solver<ILits23> newMini3SATb() {
863 MiniSATLearning<ILits23> learning = new MiniSATLearning<ILits23>();
864 Solver<ILits23> solver = new Solver<ILits23>(new FirstUIP(), learning,
865 new MixedDataStructureWithBinaryAndTernary(), new SearchParams(
866 Integer.MAX_VALUE), new JWOrder(),
867 new MiniSATRestarts());
868 learning.setDataStructureFactory(solver.getDSFactory());
869 learning.setVarActivityListener(solver);
870 return solver;
871 }
872
873
874
875
876
877
878
879 public static Solver<ILits> newMiniMaxSAT() {
880 MiniSATLearning<ILits> learning = new MiniSATLearning<ILits>();
881 Solver<ILits> solver = new Solver<ILits>(new FirstUIP(), learning,
882 new MixedDataStructureDanielCBWL(), new SearchParams(1.2,
883 100000), new VarOrderHeap<ILits>(),
884 new MiniSATRestarts());
885 learning.setDataStructureFactory(solver.getDSFactory());
886 learning.setVarActivityListener(solver);
887 return solver;
888 }
889
890
891
892
893
894
895
896
897
898 public static ISolver newDefault() {
899 return newMiniLearningHeapRsatExpSimpBiere();
900 }
901
902 @Override
903 public ISolver defaultSolver() {
904 return newDefault();
905 }
906
907
908
909
910
911
912
913
914 public static ISolver newLight() {
915 return newMini3SAT();
916 }
917
918 @Override
919 public ISolver lightSolver() {
920 return newLight();
921 }
922
923 public static ISolver newDimacsOutput() {
924 return new DimacsOutputSolver();
925 }
926
927 }