summaryrefslogtreecommitdiff
path: root/src/theory/bv/bv_subtheory_inequality.h
blob: d79ea6e1c5b57005decb2769b1b0ce148f7ddc0a (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*********************                                                        */
/*! \file bv_subtheory_inequality.h
 ** \verbatim
 ** Original author: lianah <lianahady@gmail.com>
 ** Major contributors: none
 ** Minor contributors (to current version): Liana Hadarean <lianahady@gmail.com>
 ** This file is part of the CVC4 project.
 ** Copyright (c) 2009-2013  New York University and The University of Iowa
 ** See the file COPYING in the top-level source directory for licensing
 ** information.\endverbatim
 **
 ** \brief Algebraic solver. 
 **
 ** Algebraic solver.
 **/

#include "cvc4_private.h"

#ifndef __CVC4__THEORY__BV__BV_SUBTHEORY__INEQUALITY_H
#define __CVC4__THEORY__BV__BV_SUBTHEORY__INEQUALITY_H

#include "theory/bv/bv_subtheory.h"
#include "theory/bv/bv_inequality_graph.h"
#include "context/cdhashset.h"

namespace CVC4 {
namespace theory {
namespace bv {

class InequalitySolver: public SubtheorySolver {
  struct Statistics {
    IntStat d_numCallstoCheck;
    Statistics();
    ~Statistics(); 
  }; 

  context::CDHashSet<Node, NodeHashFunction> d_assertionSet; 
  InequalityGraph d_inequalityGraph;
  context::CDHashMap<Node, TNode, NodeHashFunction> d_explanations; 
  context::CDO<bool> d_isComplete;
  __gnu_cxx::hash_map<TNode, bool, TNodeHashFunction> d_ineqTermCache; 
  bool isInequalityOnly(TNode node); 
  Statistics d_statistics; 
public:
  InequalitySolver(context::Context* c, TheoryBV* bv)
    : SubtheorySolver(c, bv),
      d_assertionSet(c),
      d_inequalityGraph(c),
      d_explanations(c),
      d_isComplete(c, true),
      d_ineqTermCache(),
      d_statistics()
  {}
  
  bool check(Theory::Effort e);
  void propagate(Theory::Effort e); 
  void explain(TNode literal, std::vector<TNode>& assumptions);
  bool isComplete() { return d_isComplete; }
  void collectModelInfo(TheoryModel* m); 
  Node getModelValue(TNode var); 
  EqualityStatus getEqualityStatus(TNode a, TNode b);
  void assertFact(TNode fact); 
}; 

}
}
}

#endif /* __CVC4__THEORY__BV__BV_SUBTHEORY__INEQUALITY_H */ 
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback