From: ajreynol Date: Fri, 29 Aug 2014 14:06:50 +0000 (+0200) Subject: Set instantiation level on skolemized bodies of quantifiers. Rename inst-level attri... X-Git-Tag: cvc5-1.0.0~6639 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e9fb730333b2719cddaa0a9209aa7953d7f30b0b;p=cvc5.git Set instantiation level on skolemized bodies of quantifiers. Rename inst-level attribute to quant-inst-max-level --- diff --git a/src/parser/smt2/Smt2.g b/src/parser/smt2/Smt2.g index 2adad092e..9f4b19c47 100644 --- a/src/parser/smt2/Smt2.g +++ b/src/parser/smt2/Smt2.g @@ -1182,7 +1182,7 @@ attribute[CVC4::Expr& expr,CVC4::Expr& retExpr, std::string& attr] Expr n = MK_CONST( AntlrInput::tokenToInteger($INTEGER_LITERAL) ); std::vector values; values.push_back( n ); - std::string attr_name("inst-level"); + std::string attr_name("quant-inst-max-level"); Command* c = new SetUserAttributeCommand( attr_name, expr, values ); c->setMuted(true); PARSER_STATE->preemptCommand(c); @@ -1722,7 +1722,7 @@ INCLUDE_TOK : 'include'; ATTRIBUTE_PATTERN_TOK : ':pattern'; ATTRIBUTE_NO_PATTERN_TOK : ':no-pattern'; ATTRIBUTE_NAMED_TOK : ':named'; -ATTRIBUTE_INST_LEVEL : ':inst-level'; +ATTRIBUTE_INST_LEVEL : ':quant-inst-max-level'; ATTRIBUTE_RR_PRIORITY : ':rr-priority'; // operators (NOTE: theory symbols go here) diff --git a/src/theory/quantifiers/quantifiers_attributes.cpp b/src/theory/quantifiers/quantifiers_attributes.cpp index b41987923..8d479c29e 100644 --- a/src/theory/quantifiers/quantifiers_attributes.cpp +++ b/src/theory/quantifiers/quantifiers_attributes.cpp @@ -34,7 +34,7 @@ void QuantifiersAttributes::setUserAttribute( const std::string& attr, Node n, s Trace("quant-attr") << "Set conjecture " << n << std::endl; ConjectureAttribute ca; n.setAttribute( ca, true ); - }else if( attr=="inst-level" ){ + }else if( attr=="quant-inst-max-level" ){ Assert( node_values.size()==1 ); uint64_t lvl = node_values[0].getConst().getNumerator().getLong(); Trace("quant-attr") << "Set instantiation level " << n << " to " << lvl << std::endl; diff --git a/src/theory/quantifiers/term_database.cpp b/src/theory/quantifiers/term_database.cpp index 5cc79b9b6..cf68c198e 100644 --- a/src/theory/quantifiers/term_database.cpp +++ b/src/theory/quantifiers/term_database.cpp @@ -685,6 +685,10 @@ Node TermDb::mkSkolemizedBody( Node f, Node n, std::vector< TypeNode >& argTypes ret = NodeManager::currentNM()->mkNode( OR, nret, n_str_ind ); } Trace("quantifiers-sk") << "mkSkolem body for " << f << " returns : " << ret << std::endl; + //if it has an instantiation level, set the skolemized body to that level + if( f.hasAttribute(InstLevelAttribute()) ){ + theory::QuantifiersEngine::setInstantiationLevelAttr( ret, f.getAttribute(InstLevelAttribute()) ); + } return ret; } diff --git a/src/theory/quantifiers_engine.cpp b/src/theory/quantifiers_engine.cpp index d6bd8e574..a00592e8b 100644 --- a/src/theory/quantifiers_engine.cpp +++ b/src/theory/quantifiers_engine.cpp @@ -446,8 +446,11 @@ void QuantifiersEngine::setInstantiationLevelAttr( Node n, Node qn, uint64_t lev } void QuantifiersEngine::setInstantiationLevelAttr( Node n, uint64_t level ){ - InstLevelAttribute ila; - n.setAttribute(ila,level); + if( !n.hasAttribute(InstLevelAttribute()) ){ + InstLevelAttribute ila; + n.setAttribute(ila,level); + Trace("inst-level-debug") << "Set instantiation level " << n << " to " << level << std::endl; + } for( int i=0; i<(int)n.getNumChildren(); i++ ){ setInstantiationLevelAttr( n[i], level ); }