summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers_engine.cpp
diff options
context:
space:
mode:
authorKshitij Bansal <kshitij@cs.nyu.edu>2014-07-10 16:20:42 -0400
committerKshitij Bansal <kshitij@cs.nyu.edu>2014-07-10 16:20:42 -0400
commitc30a3426c7c2cbaff88b5183b8d8c368a393ac4d (patch)
treebd621f3766d2ae330a6c11499fe0a49958afa95d /src/theory/quantifiers_engine.cpp
parentd4f76fdfaed04bf63bb609a5fd26b0d45a9e94f4 (diff)
parente926fd162c6cee95d31044305e3b4df90b59f9fc (diff)
Merge remote-tracking branch 'origin/master' into segfaultfix
Diffstat (limited to 'src/theory/quantifiers_engine.cpp')
-rw-r--r--src/theory/quantifiers_engine.cpp41
1 files changed, 36 insertions, 5 deletions
diff --git a/src/theory/quantifiers_engine.cpp b/src/theory/quantifiers_engine.cpp
index 66d8f9326..c55ffa2a6 100644
--- a/src/theory/quantifiers_engine.cpp
+++ b/src/theory/quantifiers_engine.cpp
@@ -5,7 +5,7 @@
** Major contributors: Andrew Reynolds
** Minor contributors (to current version): Francois Bobot
** This file is part of the CVC4 project.
- ** Copyright (c) 2009-2013 New York University and The University of Iowa
+ ** 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
**
@@ -265,10 +265,31 @@ void QuantifiersEngine::registerPattern( std::vector<Node> & pattern) {
}
}
-void QuantifiersEngine::assertNode( Node f ){
- d_model->assertQuantifier( f );
- for( int i=0; i<(int)d_modules.size(); i++ ){
- d_modules[i]->assertNode( f );
+void QuantifiersEngine::assertQuantifier( Node f, bool pol ){
+ if( !pol ){
+ //do skolemization
+ if( d_skolemized.find( f )==d_skolemized.end() ){
+ Node body = d_term_db->getSkolemizedBody( f );
+ NodeBuilder<> nb(kind::OR);
+ nb << f << body.notNode();
+ Node lem = nb;
+ if( Trace.isOn("quantifiers-sk") ){
+ Node slem = Rewriter::rewrite( lem );
+ Trace("quantifiers-sk") << "Skolemize lemma : " << slem << std::endl;
+ }
+ getOutputChannel().lemma( lem, false, true );
+ d_skolemized[f] = true;
+ }
+ }
+ //assert to modules TODO : handle !pol
+ if( pol ){
+ //register the quantifier
+ registerQuantifier( f );
+ //assert it to each module
+ d_model->assertQuantifier( f );
+ for( int i=0; i<(int)d_modules.size(); i++ ){
+ d_modules[i]->assertNode( f );
+ }
}
}
@@ -629,6 +650,16 @@ void QuantifiersEngine::getPhaseReqTerms( Node f, std::vector< Node >& nodes ){
}
void QuantifiersEngine::printInstantiations( std::ostream& out ) {
+ for( std::map< Node, bool >::iterator it = d_skolemized.begin(); it != d_skolemized.end(); ++it ){
+ out << "Skolem constants of " << it->first << " : " << std::endl;
+ out << " ( ";
+ for( unsigned i=0; i<d_term_db->d_skolem_constants[it->first].size(); i++ ){
+ if( i>0 ){ out << ", "; }
+ out << d_term_db->d_skolem_constants[it->first][i];
+ }
+ out << " )" << std::endl;
+ out << std::endl;
+ }
if( options::incrementalSolving() ){
for( std::map< Node, inst::CDInstMatchTrie* >::iterator it = d_c_inst_match_trie.begin(); it != d_c_inst_match_trie.end(); ++it ){
out << "Instantiations of " << it->first << " : " << std::endl;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback