5 public class Constraint {
7 private static int count = 1;
10 boolean crash = false;
11 SymbolTable st = new SymbolTable();
12 Vector quantifiers = new Vector();
13 LogicStatement logicstatement = null;
14 DNFConstraint dnfconstraint;
19 label = new String("c" + count++);
26 public String getLabel() {
30 public SymbolTable getSymbolTable() {
34 public void addQuantifier(Quantifier q) {
35 quantifiers.addElement(q);
38 public void setLogicStatement(LogicStatement ls) {
40 // Construct DNF form for analysis
41 dnfconstraint=logicstatement.constructDNF();
44 public LogicStatement getLogicStatement() {
45 return logicstatement;
48 public void setCrash(boolean crash) {
52 public ListIterator quantifiers() {
53 return quantifiers.listIterator();
56 public Set getRequiredDescriptorsFromQuantifiers() {
58 HashSet topdescriptors = new HashSet();
60 for (int i = 0; i < quantifiers.size(); i++) {
61 Quantifier q = (Quantifier) quantifiers.elementAt(i);
62 topdescriptors.addAll(q.getRequiredDescriptors());
65 return SetDescriptor.expand(topdescriptors);
68 public Set getRequiredDescriptorsFromLogicStatement() {
70 HashSet topdescriptors = new HashSet();
72 topdescriptors.addAll(logicstatement.getRequiredDescriptors());
74 return SetDescriptor.expand(topdescriptors);
77 public Set getRequiredDescriptors() {
78 Set set = getRequiredDescriptorsFromQuantifiers();
79 set.addAll(getRequiredDescriptorsFromLogicStatement());