Disable prenex by default when using fmf bound int, minor improvement to datatypes...
authorajreynol <andrew.j.reynolds@gmail.com>
Sun, 28 Dec 2014 04:42:28 +0000 (05:42 +0100)
committerajreynol <andrew.j.reynolds@gmail.com>
Sun, 28 Dec 2014 04:43:31 +0000 (05:43 +0100)
src/smt/smt_engine.cpp
src/theory/datatypes/datatypes_rewriter.h
src/theory/quantifiers/options
test/regress/regress0/bug590.smt2.expect

index 918d6f30d1f88eb626517ff7f4d9bf9c6b9e8e77..d039377a1ecbfce37ed6a1d66380fb0c53d4626a 100644 (file)
@@ -1279,7 +1279,7 @@ void SmtEngine::setDefaults() {
     options::decisionMode.set(decMode);
     options::decisionStopOnly.set(stoponly);
   }
-  //local theory extensions 
+  //local theory extensions
   if( options::localTheoryExt() ){
     //no E-matching?
     if( !options::instMaxLevel.wasSetByUser() ){
@@ -1305,6 +1305,9 @@ void SmtEngine::setDefaults() {
       //if bounded integers are set, use no MBQI by default
       options::mbqiMode.set( quantifiers::MBQI_NONE );
     }
+    if( ! options::prenexQuant.wasSetByUser() ){
+      options::prenexQuant.set( quantifiers::PRENEX_NONE );
+    }
   }
   if( options::ufssSymBreak() ){
     options::sortInference.set( true );
@@ -1314,7 +1317,7 @@ void SmtEngine::setDefaults() {
       options::finiteModelFind.set( true );
     }
   }
-  
+
   //now, have determined whether finite model find is on/off
   //apply finite model finding options
   if( options::finiteModelFind() ){
@@ -1340,7 +1343,7 @@ void SmtEngine::setDefaults() {
       }
     }
   }
-  
+
   //implied options...
   if( options::recurseCbqi() ){
     options::cbqi.set( true );
index 02339dc26e36d1d9ae84d5762fcad01247f51ae5..90703774be38fc1d20347cdfd5a168b69fb08c32 100644 (file)
@@ -139,24 +139,32 @@ public:
         return RewriteResponse(REWRITE_DONE, in[0][selectorIndex]);
       }else{
         //typically should not be called
+        TypeNode tn = in.getType();
         Node gt;
-        if( in.getType().isSort() ){
-          TypeEnumerator te(in.getType());
+        if( tn.isSort() ){
+          TypeEnumerator te(tn);
           gt = *te;
-        }else if( dt.isWellFounded() || in[0].isConst() ){
-          gt = in.getType().mkGroundTerm();
+        }else{
+          //check whether well-founded
+          bool isWellFounded = true;
+          if( isTypeDatatype( tn ) ){
+            const Datatype& dta = ((DatatypeType)(tn).toType()).getDatatype();
+            isWellFounded = dta.isWellFounded();
+          }
+          if( isWellFounded || in[0].isConst() ){
+            gt = tn.mkGroundTerm();
+          }
         }
         if( !gt.isNull() ){
-          TypeNode gtt = gt.getType();
           //Assert( gtt.isDatatype() || gtt.isParametricDatatype() );
-          if( gtt.isDatatype() && !gtt.isInstantiatedDatatype() ){
+          if( tn.isDatatype() && !tn.isInstantiatedDatatype() ){
             gt = NodeManager::currentNM()->mkNode(kind::APPLY_TYPE_ASCRIPTION,
-                                                  NodeManager::currentNM()->mkConst(AscriptionType(in.getType().toType())), gt);
+                                                  NodeManager::currentNM()->mkConst(AscriptionType(tn.toType())), gt);
           }
           Trace("datatypes-rewrite") << "DatatypesRewriter::postRewrite: "
                                      << "Rewrite trivial selector " << in
                                      << " to distinguished ground term "
-                                     << in.getType().mkGroundTerm() << std::endl;
+                                     << gt << std::endl;
           return RewriteResponse(REWRITE_DONE,gt );
         }
       }
index a48b009c27b60a1d4e57c4cddf1cc4de62963668..8c43453d7147ba42f1ebf292e91825b0dbb88d93 100644 (file)
@@ -21,7 +21,7 @@ option miniscopeQuantFreeVar /--disable-miniscope-quant-fv bool :default true
  disable miniscope quantifiers for ground subformulas
 
 # Whether to prenex (nested universal) quantifiers
-option prenexQuant --prenex-quant=MODE CVC4::theory::quantifiers::PrenexQuantMode :default CVC4::theory::quantifiers::PRENEX_NO_USER_PAT :include "theory/quantifiers/modes.h" :handler CVC4::theory::quantifiers::stringToPrenexQuantMode :handler-include "theory/quantifiers/options_handlers.h"
+option prenexQuant --prenex-quant=MODE CVC4::theory::quantifiers::PrenexQuantMode :default CVC4::theory::quantifiers::PRENEX_NO_USER_PAT :include "theory/quantifiers/modes.h" :read-write :handler CVC4::theory::quantifiers::stringToPrenexQuantMode :handler-include "theory/quantifiers/options_handlers.h"
  disable prenexing of quantified formulas
 
 # Whether to variable-eliminate quantifiers.
index 987ace1505bb612862929b1c996cbaa6c205d258..b24a807f7871eb1063b3fb3fbce65edb80c935be 100644 (file)
@@ -1,2 +1,2 @@
 % EXPECT: unknown
-% EXPECT: ((charlst2 (store ((as const (Array Int String)) "C") 0 "&gt;")))
+% EXPECT: ((charlst2 ((as const (Array Int String)) "")))