blob: b3bbbce4a86a2a5b1ecc126d0fd40c6e17262781 (
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
78
|
/********************* */
/*! \file instantiation_engine.h
** \verbatim
** Original author: ajreynol
** Major contributors: none
** Minor contributors (to current version): mdeters
** This file is part of the CVC4 prototype.
** Copyright (c) 2009-2012 New York University and The University of Iowa
** See the file COPYING in the top-level source directory for licensing
** information.\endverbatim
**
** \brief Instantiation Engine classes
**/
#include "cvc4_private.h"
#ifndef __CVC4__THEORY__QUANTIFIERS__INSTANTIATION_ENGINE_H
#define __CVC4__THEORY__QUANTIFIERS__INSTANTIATION_ENGINE_H
#include "theory/quantifiers_engine.h"
#include "theory/quantifiers/theory_quantifiers.h"
namespace CVC4 {
namespace theory {
namespace quantifiers {
class InstantiationEngine : public QuantifiersModule
{
private:
typedef context::CDHashMap< Node, bool, NodeHashFunction > BoolMap;
/** status of instantiation round (one of InstStrategy::STATUS_*) */
int d_inst_round_status;
/** whether the instantiation engine should set incomplete if it cannot answer SAT */
bool d_setIncomplete;
/** inst round counter */
int d_ierCounter;
bool d_performCheck;
/** whether each quantifier is active */
std::map< Node, bool > d_quant_active;
/** whether we have added cbqi lemma */
std::map< Node, bool > d_added_cbqi_lemma;
private:
/** has added cbqi lemma */
bool hasAddedCbqiLemma( Node f ) { return d_added_cbqi_lemma.find( f )!=d_added_cbqi_lemma.end(); }
/** helper functions */
bool hasNonArithmeticVariable( Node f );
bool hasApplyUf( Node f );
/** whether to do CBQI for quantifier f */
bool doCbqi( Node f );
private:
/** do instantiation round */
bool doInstantiationRound( Theory::Effort effort );
/** register literals of n, f is the quantifier it belongs to */
//void registerLiterals( Node n, Node f );
private:
enum{
SAT_CBQI,
SAT_INST_STRATEGY,
};
/** debug sat */
void debugSat( int reason );
public:
InstantiationEngine( QuantifiersEngine* qe, bool setIncomplete = true );
~InstantiationEngine(){}
bool needsCheck( Theory::Effort e );
void check( Theory::Effort e );
void registerQuantifier( Node f );
void assertNode( Node f );
Node explain(TNode n){ return Node::null(); }
Node getNextDecisionRequest();
};/* class InstantiationEngine */
}/* CVC4::theory::quantifiers namespace */
}/* CVC4::theory namespace */
}/* CVC4 namespace */
#endif /* __CVC4__THEORY__QUANTIFIERS__INSTANTIATION_ENGINE_H */
|