Disable argument relevance for sygus by default (#2288)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Wed, 8 Aug 2018 22:09:18 +0000 (17:09 -0500)
committerGitHub <noreply@github.com>
Wed, 8 Aug 2018 22:09:18 +0000 (17:09 -0500)
src/options/quantifiers_options.toml
src/theory/quantifiers/sygus/sygus_process_conj.cpp
test/regress/regress1/sygus/process-10-vars.sy
test/regress/regress2/sygus/process-10-vars-2fun.sy
test/regress/regress2/sygus/process-arg-invariance.sy

index aac84e92c8936ed70b33dd28095c02a597101104..5f6638dceae52247c6fc5837c810589ba6b26703 100644 (file)
@@ -1175,6 +1175,14 @@ header = "options/quantifiers_options.h"
   default    = "true"
   help       = "use optimized approach for evaluation in sygus"
 
+[[option]]
+  name       = "sygusArgRelevant"
+  category   = "regular"
+  long       = "sygus-arg-relevant"
+  type       = "bool"
+  default    = "false"
+  help       = "static inference techniques for computing whether arguments of functions-to-synthesize are relevant"
+  
 # Internal uses of sygus
 
 [[option]]
index 76e484549113febb1a8e95a7feea81dfc4aaea18..b0b6159be44588f40ef9dc4a078571f515f3c1fb 100644 (file)
@@ -17,6 +17,7 @@
 #include <stack>
 
 #include "expr/datatype.h"
+#include "options/quantifiers_options.h"
 #include "theory/datatypes/datatypes_rewriter.h"
 #include "theory/quantifiers/sygus/term_database_sygus.h"
 #include "theory/quantifiers/term_util.h"
@@ -533,39 +534,43 @@ Node CegConjectureProcess::postSimplify(Node q)
   Trace("sygus-process") << "Post-simplify conjecture : " << q << std::endl;
   Assert(q.getKind() == FORALL);
 
-  // initialize the information about each function to synthesize
-  for (unsigned i = 0; i < q[0].getNumChildren(); i++)
+  if (options::sygusArgRelevant())
   {
-    Node f = q[0][i];
-    if (f.getType().isFunction())
+    // initialize the information about each function to synthesize
+    for (unsigned i = 0, size = q[0].getNumChildren(); i < size; i++)
     {
-      d_sf_info[f].init(f);
+      Node f = q[0][i];
+      if (f.getType().isFunction())
+      {
+        d_sf_info[f].init(f);
+      }
     }
-  }
 
-  // get the base on the conjecture
-  Node base = q[1];
-  std::unordered_set<Node, NodeHashFunction> synth_fv;
-  if (base.getKind() == NOT && base[0].getKind() == FORALL)
-  {
-    for (unsigned j = 0; j < base[0][0].getNumChildren(); j++)
+    // get the base on the conjecture
+    Node base = q[1];
+    std::unordered_set<Node, NodeHashFunction> synth_fv;
+    if (base.getKind() == NOT && base[0].getKind() == FORALL)
     {
-      synth_fv.insert(base[0][0][j]);
+      for (unsigned j = 0, size = base[0][0].getNumChildren(); j < size; j++)
+      {
+        synth_fv.insert(base[0][0][j]);
+      }
+      base = base[0][1];
     }
-    base = base[0][1];
-  }
-  std::vector<Node> conjuncts;
-  getComponentVector(AND, base, conjuncts);
+    std::vector<Node> conjuncts;
+    getComponentVector(AND, base, conjuncts);
 
-  // process the conjunctions
-  for (std::map<Node, CegConjectureProcessFun>::iterator it = d_sf_info.begin();
-       it != d_sf_info.end();
-       ++it)
-  {
-    Node f = it->first;
-    for (unsigned i = 0; i < conjuncts.size(); i++)
+    // process the conjunctions
+    for (std::map<Node, CegConjectureProcessFun>::iterator it =
+             d_sf_info.begin();
+         it != d_sf_info.end();
+         ++it)
     {
-      processConjunct(conjuncts[i], f, synth_fv);
+      Node f = it->first;
+      for (const Node& conj : conjuncts)
+      {
+        processConjunct(conj, f, synth_fv);
+      }
     }
   }
 
@@ -587,6 +592,10 @@ void CegConjectureProcess::initialize(Node n, std::vector<Node>& candidates)
 
 bool CegConjectureProcess::isArgRelevant(Node f, unsigned i)
 {
+  if (!options::sygusArgRelevant())
+  {
+    return true;
+  }
   std::map<Node, CegConjectureProcessFun>::iterator its = d_sf_info.find(f);
   if (its != d_sf_info.end())
   {
index 523abd70dc2e0dbca751fb1b55eaec7b68296bb6..77990473fbaffe0222684342d66bdbee3567817c 100644 (file)
@@ -1,4 +1,4 @@
-; COMMAND-LINE: --cegqi-si=none --sygus-out=status
+; COMMAND-LINE: --cegqi-si=none --sygus-out=status --sygus-arg-relevant
 ; EXPECT: unsat
 (set-logic LIA)
 
index a107fd88b78d99446202ffa683f0f8abf6da5245..214da82c8996a0119a8d01c237927ac44dd79f03 100644 (file)
@@ -1,4 +1,4 @@
-; COMMAND-LINE: --cegqi-si=none --sygus-out=status --no-sygus-repair-const
+; COMMAND-LINE: --cegqi-si=none --sygus-out=status --no-sygus-repair-const --sygus-arg-relevant
 ; EXPECT: unsat
 (set-logic LIA)
 
index 3c18b6c75d5e97c3e5e3f298c1e2117fd8e9f3f4..2f1b74ddfb7f65e921bdb111d5e4a86b7b39a25e 100644 (file)
@@ -1,4 +1,4 @@
-; COMMAND-LINE: --cegqi-si=none --sygus-out=status --no-sygus-add-const-grammar
+; COMMAND-LINE: --cegqi-si=none --sygus-out=status --no-sygus-add-const-grammar --sygus-arg-relevant
 ; EXPECT: unsat
 (set-logic LIA)