blob: 4a69431196d7ee9cf184c81f87264813fd5cfd16 (
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
70
71
72
73
74
75
76
77
|
/********************* */
/*! \file equality_infer.h
** \verbatim
** Original author: Andrew Reynolds
** Major contributors: none
** Minor contributors (to current version): none
** This file is part of the CVC4 project.
** Copyright (c) 2009-2014 New York University and The University of Iowa
** See the file COPYING in the top-level source directory for licensing
** information.\endverbatim
**
** \brief additional inference for equalities
**/
#include "cvc4_private.h"
#ifndef EQUALITY_INFER_H
#define EQUALITY_INFER_H
#include <ext/hash_set>
#include <iostream>
#include <map>
#include <vector>
#include "context/context.h"
#include "context/context_mm.h"
#include "context/cdhashmap.h"
#include "context/cdchunk_list.h"
#include "context/cdhashset.h"
#include "theory/theory.h"
namespace CVC4 {
namespace theory {
namespace quantifiers {
class EqualityInference
{
typedef context::CDHashMap< Node, Node, NodeHashFunction > NodeMap;
typedef context::CDHashMap< Node, bool, NodeHashFunction > BoolMap;
typedef context::CDChunkList<Node> NodeList;
typedef context::CDHashMap< Node, NodeList *, NodeHashFunction > NodeListMap;
private:
context::Context * d_c;
Node d_one;
class EqcInfo {
public:
EqcInfo(context::Context* c);
~EqcInfo(){}
context::CDO< Node > d_rep;
context::CDO< bool > d_valid;
};
/** information necessary for equivalence classes */
NodeMap d_elim_vars;
std::map< Node, EqcInfo * > d_eqci;
NodeMap d_rep_to_eqc;
/** set eqc rep */
void setEqcRep( Node t, Node r, EqcInfo * eqci );
/** use list */
NodeListMap d_uselist;
void addToUseList( Node used, Node eqc );
public:
EqualityInference(context::Context* c);
virtual ~EqualityInference();
/** notification when equality engine is updated */
void eqNotifyNewClass(TNode t);
void eqNotifyMerge(TNode t1, TNode t2);
NodeList d_pending_merges;
};
}
}
}
#endif
|