Also corrects an issue with the text interface. When get-model is used with model cores, we do not currently filter the output. This ensures that we do.
"check-sat was interrupted?";
throw RecoverableModalException(ss.str().c_str());
}
+ // compute the model core if necessary and not done so already
+ const Options& opts = d_env->getOptions();
+ if (opts.smt.modelCoresMode != options::ModelCoresMode::NONE
+ && !m->isUsingModelCore())
+ {
+ // If we enabled model cores, we compute a model core for m based on our
+ // (expanded) assertions using the model core builder utility. Notice that
+ // we get the assertions using the getAssertionsInternal, which does not
+ // impact whether we are in "sat" mode
+ std::vector<Node> asserts = getAssertionsInternal();
+ d_smtSolver->getPreprocessor()->expandDefinitions(asserts);
+ ModelCoreBuilder mcb(*d_env.get());
+ mcb.setModelCore(asserts, m, opts.smt.modelCoresMode);
+ }
return m;
}
return true;
}
TheoryModel* tm = getAvailableModel("isModelCoreSymbol");
- // compute the model core if not done so already
- if (!tm->isUsingModelCore())
- {
- // If we enabled model cores, we compute a model core for m based on our
- // (expanded) assertions using the model core builder utility. Notice that
- // we get the assertions using the getAssertionsInternal, which does not
- // impact whether we are in "sat" mode
- std::vector<Node> asserts = getAssertionsInternal();
- d_smtSolver->getPreprocessor()->expandDefinitions(asserts);
- ModelCoreBuilder mcb(*d_env.get());
- mcb.setModelCore(asserts, tm, opts.smt.modelCoresMode);
- }
return tm->isModelCoreSymbol(n);
}
return std::make_pair(heap, nil);
}
-std::vector<Node> SolverEngine::getAssertionsInternal()
+std::vector<Node> SolverEngine::getAssertionsInternal() const
{
Assert(d_state->isFullyInited());
const CDList<Node>& al = d_asserts->getAssertionList();
* or getExpandedAssertions, which may trigger initialization and SMT state
* changes.
*/
- std::vector<Node> getAssertionsInternal();
+ std::vector<Node> getAssertionsInternal() const;
/**
* Return a reference to options like for `EnvObj`.
regress0/logops.04.cvc.smt2
regress0/logops.05.cvc.smt2
regress0/model-core.smt2
+ regress0/model-core-non-implied.smt2
regress0/models-print-1.smt2
regress0/models-print-2.smt2
regress0/named-expr-use.smt2
regress1/sygus/fg_polynomial3.sy
regress1/sygus/find_inv_eq_bvmul_4bit_withoutgrammar-v2.sy
regress1/sygus/find_sc_bvult_bvnot.sy
+ regress1/sygus/grammar_norm.sy
regress1/sygus/ground-ite-free-constant-si.sy
regress1/sygus/hd-01-d1-prog.sy
regress1/sygus/hd-19-d1-prog-dup-op.sy
--- /dev/null
+; COMMAND-LINE: --produce-models --model-cores=non-implied
+; SCRUBBER: sed 's/(define-fun.*/define-fun/g'
+; EXPECT: sat
+; EXPECT: (
+; EXPECT: define-fun
+; EXPECT: )
+(set-logic QF_LIA)
+(declare-fun x () Int)
+(declare-fun y () Int)
+(declare-fun z () Int)
+(declare-fun w () Int)
+(declare-fun u () Int)
+(declare-fun v () Int)
+(assert (and (= x y) (= y z) (= y w) (= (+ u 1) w)))
+; a single value for a variable implies the others
+(check-sat)
+(get-model)
; COMMAND-LINE: --produce-models --model-cores=simple
-; COMMAND-LINE: --produce-models --model-core=non-implied
+; SCRUBBER: sed 's/(define-fun.*/define-fun/g'
; EXPECT: sat
+; EXPECT: (
+; EXPECT: define-fun
+; EXPECT: define-fun
+; EXPECT: )
(set-logic QF_UFLIA)
(declare-fun x () Int)
(declare-fun y () Int)
(assert (= (f x) 0))
(assert (or (> z 5) (> y 5)))
(check-sat)
+(get-model)
-; COMMAND-LINE: --incremental
+; COMMAND-LINE: --incremental --use-soi
; EXPECT: sat
; EXPECT: sat
; EXPECT: sat
-; COMMAND-LINE: --incremental
+; COMMAND-LINE: --incremental --use-soi
; EXPECT: sat
; EXPECT: sat
; EXPECT: sat
--- /dev/null
+; EXPECT: feasible
+; COMMAND-LINE: --lang=sygus2 --sygus-si=all --sygus-out=status
+; COMMAND-LINE: --lang=sygus2 --sygus-si=all --sygus-out=status --sygus-grammar-norm
+(set-logic LIA)
+
+(synth-fun f ((x Int)) Int
+ ((Start Int) (StartBool Bool))
+ ((Start Int (0 1 x
+ (+ Start Start)
+ (- Start Start)
+ (ite StartBool Start Start)))
+ (StartBool Bool ((and StartBool StartBool)
+ (not StartBool)
+ (<= Start Start)))))
+
+(declare-var x Int)
+
+(constraint (= (f x) (* 2 x)))
+
+(check-synth)
+; COMMAND-LINE: --use-soi
+; EXPECT: unsat
(set-option :incremental false)
(set-info :source "Fully parameterized specification and verification of a synchronizer
circuit modeling metastability at various levels of refinement.
; COMMAND-LINE: --sygus-query-gen=unsat --sygus-abort-size=2
+; COMMAND-LINE: --sygus-query-gen=sample-sat --sygus-abort-size=2
+; COMMAND-LINE: --sygus-query-gen=basic --sygus-abort-size=2
; EXPECT: (error "Maximum term size (2) for enumerative SyGuS exceeded.")
; SCRUBBER: grep -v -E '(\(define-fun|\(query)'
; EXIT: 1