From 8748256b518f5ad4b1cefe46d9445b562199871c Mon Sep 17 00:00:00 2001 From: ajreynol Date: Fri, 14 Apr 2017 11:06:45 -0500 Subject: [PATCH] Fix for fmf-fun when the option is set by user command. --- src/smt/smt_engine.cpp | 10 +++------- test/regress/regress0/fmf/Makefile.am | 3 ++- .../regress0/fmf/bug-041417-set-options.cvc | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 test/regress/regress0/fmf/bug-041417-set-options.cvc diff --git a/src/smt/smt_engine.cpp b/src/smt/smt_engine.cpp index 94ff5d9b3..1407daadc 100644 --- a/src/smt/smt_engine.cpp +++ b/src/smt/smt_engine.cpp @@ -1042,9 +1042,7 @@ SmtEngine::SmtEngine(ExprManager* em) throw() : d_context->push(); d_definedFunctions = new(true) DefinedFunctionMap(d_userContext); - if( options::fmfFunWellDefined() || options::fmfFunWellDefinedRelevant() ){ - d_fmfRecFunctionsDefined = new(true) NodeList(d_userContext); - } + d_fmfRecFunctionsDefined = new(true) NodeList(d_userContext); d_modelCommands = new(true) smt::CommandList(d_userContext); } @@ -1191,10 +1189,7 @@ SmtEngine::~SmtEngine() throw() { } d_definedFunctions->deleteSelf(); - - if( d_fmfRecFunctionsDefined != NULL ){ - d_fmfRecFunctionsDefined->deleteSelf(); - } + d_fmfRecFunctionsDefined->deleteSelf(); delete d_theoryEngine; d_theoryEngine = NULL; @@ -4185,6 +4180,7 @@ void SmtEnginePrivate::processAssertions() { //fmf-fun : assume admissible functions, applying preprocessing reduction to FMF if( options::fmfFunWellDefined() ){ quantifiers::FunDefFmf fdf; + Assert( d_smt.d_fmfRecFunctionsDefined!=NULL ); //must carry over current definitions (for incremental) for( context::CDList::const_iterator fit = d_smt.d_fmfRecFunctionsDefined->begin(); fit != d_smt.d_fmfRecFunctionsDefined->end(); ++fit ) { diff --git a/test/regress/regress0/fmf/Makefile.am b/test/regress/regress0/fmf/Makefile.am index 730108ee7..0c13961cc 100644 --- a/test/regress/regress0/fmf/Makefile.am +++ b/test/regress/regress0/fmf/Makefile.am @@ -70,7 +70,8 @@ TESTS = \ bug652.smt2 \ bug782.smt2 \ quant_real_univ.cvc \ - constr-ground-to.smt2 + constr-ground-to.smt2 \ + bug-041417-set-options.cvc EXTRA_DIST = $(TESTS) diff --git a/test/regress/regress0/fmf/bug-041417-set-options.cvc b/test/regress/regress0/fmf/bug-041417-set-options.cvc new file mode 100644 index 000000000..16f59f78c --- /dev/null +++ b/test/regress/regress0/fmf/bug-041417-set-options.cvc @@ -0,0 +1,16 @@ +% EXPECT: invalid +OPTION "finite-model-find"; +OPTION "fmf-fun"; + +DATATYPE + Node = A | B +END; + +link, reach: (Node,Node,INT) -> BOOLEAN; + +ASSERT FORALL(x,y:Node, c:INT): + link(x,y,c) => reach(x,y,c); + +ASSERT link(A,B,1); + +QUERY reach(A,B,5); -- 2.30.2