From cf5376c18d8e4d6b3ed2d7b341279cf65fc16418 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Tue, 17 Aug 2021 12:07:00 -0500 Subject: [PATCH] Fix policy for eliminating quantified formulas (#7017) This also consolidates the option strictTriggers into userPatMode. Fixes #6996. --- src/options/quantifiers_options.toml | 11 +++-------- src/smt/set_defaults.cpp | 7 ------- .../ematching/inst_strategy_e_matching.cpp | 5 ++++- .../quantifiers/ematching/instantiation_engine.cpp | 10 +++++++--- src/theory/quantifiers/quantifiers_attributes.cpp | 3 +-- src/theory/quantifiers/quantifiers_attributes.h | 3 +-- src/theory/quantifiers/quantifiers_rewriter.cpp | 2 +- test/regress/CMakeLists.txt | 1 + .../regress0/quantifiers/issue6996-trivial-elim.smt2 | 6 ++++++ 9 files changed, 24 insertions(+), 24 deletions(-) create mode 100644 test/regress/regress0/quantifiers/issue6996-trivial-elim.smt2 diff --git a/src/options/quantifiers_options.toml b/src/options/quantifiers_options.toml index 58632aafc..ad74e4ab9 100644 --- a/src/options/quantifiers_options.toml +++ b/src/options/quantifiers_options.toml @@ -226,14 +226,6 @@ name = "Quantifiers" default = "false" help = "consider ground terms within bodies of quantified formulas for matching" -[[option]] - name = "strictTriggers" - category = "regular" - long = "strict-triggers" - type = "bool" - default = "false" - help = "only instantiate quantifiers with user patterns based on triggers" - [[option]] name = "relevantTriggers" category = "regular" @@ -388,6 +380,9 @@ name = "Quantifiers" [[option.mode.TRUST]] name = "trust" help = "When provided, use only user-provided patterns for a quantified formula." +[[option.mode.STRICT]] + name = "trust" + help = "When provided, use only user-provided patterns for a quantified formula, and do not use any other instantiation techniques." [[option.mode.RESORT]] name = "resort" help = "Use user-provided patterns only after auto-generated patterns saturate." diff --git a/src/smt/set_defaults.cpp b/src/smt/set_defaults.cpp index 6fd2a3f68..12433d8ac 100644 --- a/src/smt/set_defaults.cpp +++ b/src/smt/set_defaults.cpp @@ -1104,13 +1104,6 @@ void SetDefaults::setDefaults(LogicInfo& logic, Options& opts) } } // implied options... - if (opts.quantifiers.strictTriggers) - { - if (!opts.quantifiers.userPatternsQuantWasSetByUser) - { - opts.quantifiers.userPatternsQuant = options::UserPatMode::TRUST; - } - } if (opts.quantifiers.qcfModeWasSetByUser || opts.quantifiers.qcfTConstraint) { opts.quantifiers.quantConflictFind = true; diff --git a/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp b/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp index ab237fc6c..8901ec314 100644 --- a/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp +++ b/src/theory/quantifiers/ematching/inst_strategy_e_matching.cpp @@ -111,7 +111,10 @@ InstStrategyStatus InstStrategyAutoGenTriggers::process(Node f, int e) { options::UserPatMode upMode = getInstUserPatMode(); - if (hasUserPatterns(f) && upMode == options::UserPatMode::TRUST) + // we don't auto-generate triggers if the mode is trust or strict + if (hasUserPatterns(f) + && (upMode == options::UserPatMode::TRUST + || upMode == options::UserPatMode::STRICT)) { return InstStrategyStatus::STATUS_UNKNOWN; } diff --git a/src/theory/quantifiers/ematching/instantiation_engine.cpp b/src/theory/quantifiers/ematching/instantiation_engine.cpp index d490dce83..d9bec820c 100644 --- a/src/theory/quantifiers/ematching/instantiation_engine.cpp +++ b/src/theory/quantifiers/ematching/instantiation_engine.cpp @@ -200,11 +200,15 @@ bool InstantiationEngine::checkCompleteFor( Node q ) { void InstantiationEngine::checkOwnership(Node q) { - if( options::strictTriggers() && q.getNumChildren()==3 ){ + if (options::userPatternsQuant() == options::UserPatMode::STRICT + && q.getNumChildren() == 3) + { //if strict triggers, take ownership of this quantified formula bool hasPat = false; - for( unsigned i=0; i