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
28 package org.sat4j.minisat.constraints.cnf;
29
30 import org.sat4j.minisat.core.Constr;
31 import org.sat4j.minisat.core.UnitPropagationListener;
32 import org.sat4j.specs.IVecInt;
33
34
35
36
37 public class UnitClauses implements Constr {
38
39 protected final int[] literals;
40
41 public UnitClauses(IVecInt values) {
42 literals = new int[values.size()];
43 values.copyTo(literals);
44 }
45
46 public void assertConstraint(UnitPropagationListener s) {
47 for (int p : literals) {
48 s.enqueue(p, this);
49 }
50 }
51
52 public void calcReason(int p, IVecInt outReason) {
53 throw new UnsupportedOperationException();
54
55 }
56
57 public double getActivity() {
58 throw new UnsupportedOperationException();
59 }
60
61 public void incActivity(double claInc) {
62
63 }
64
65 public boolean locked() {
66 throw new UnsupportedOperationException();
67 }
68
69 public void register() {
70 throw new UnsupportedOperationException();
71 }
72
73 public void remove(UnitPropagationListener upl) {
74 for (int i = literals.length - 1; i >= 0; i--) {
75 upl.unset(literals[i]);
76 }
77 }
78
79 public void rescaleBy(double d) {
80 throw new UnsupportedOperationException();
81 }
82
83 public void setLearnt() {
84 throw new UnsupportedOperationException();
85 }
86
87 public boolean simplify() {
88 throw new UnsupportedOperationException();
89 }
90
91 public boolean propagate(UnitPropagationListener s, int p) {
92 throw new UnsupportedOperationException();
93 }
94
95 public int get(int i) {
96 throw new UnsupportedOperationException();
97 }
98
99 public boolean learnt() {
100 throw new UnsupportedOperationException();
101 }
102
103 public int size() {
104 throw new UnsupportedOperationException();
105 }
106
107 public void forwardActivity(double claInc) {
108
109 }
110
111 public boolean canBePropagatedMultipleTimes() {
112 return false;
113 }
114 }