3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-29 11:55:51 +00:00

z3str3: add bitvector model construction algorithm

This commit is contained in:
Murphy Berzish 2020-01-16 15:27:32 -05:00 committed by Nikolaj Bjorner
parent ff6b3304f8
commit faf3934749
6 changed files with 1427 additions and 35 deletions

View file

@ -62,6 +62,7 @@ void smt_params::updt_params(params_ref const & p) {
theory_pb_params::updt_params(p);
// theory_array_params::updt_params(p);
theory_datatype_params::updt_params(p);
theory_str_params::updt_params(p);
updt_local_params(p);
}
@ -81,6 +82,7 @@ void smt_params::display(std::ostream & out) const {
theory_bv_params::display(out);
theory_pb_params::display(out);
theory_datatype_params::display(out);
theory_str_params::display(out);
DISPLAY_PARAM(m_display_proof);
DISPLAY_PARAM(m_display_dot_proof);
@ -139,6 +141,7 @@ void smt_params::display(std::ostream & out) const {
DISPLAY_PARAM(m_smtlib_dump_lemmas);
DISPLAY_PARAM(m_logic);
DISPLAY_PARAM(m_string_solver);
DISPLAY_PARAM(m_profile_res_sub);
DISPLAY_PARAM(m_display_bool_var2expr);

View file

@ -90,6 +90,8 @@ def_module_params(module_name='smt',
('str.regex_automata_failed_automaton_threshold', UINT, 10, 'number of failed automaton construction attempts after which a full automaton is automatically built'),
('str.regex_automata_failed_intersection_threshold', UINT, 10, 'number of failed automaton intersection attempts after which intersection is always computed'),
('str.regex_automata_length_attempt_threshold', UINT, 10, 'number of length/path constraint attempts before checking unsatisfiability of regex terms'),
('str.fixed_length_models', BOOL, True, 'use fixed-length equation solver to construct models (Z3str3 only)'),
('str.fixed_length_refinement', BOOL, False, 'use abstraction refinement in fixed-length equation solver (Z3str3 only)'),
('core.minimize', BOOL, False, 'minimize unsat core produced by SMT context'),
('core.extend_patterns', BOOL, False, 'extend unsat core with literals that trigger (potential) quantifier instances'),
('core.extend_patterns.max_distance', UINT, UINT_MAX, 'limits the distance of a pattern-extended unsat core'),

View file

@ -37,4 +37,28 @@ void theory_str_params::updt_params(params_ref const & _p) {
m_RegexAutomata_FailedAutomatonThreshold = p.str_regex_automata_failed_automaton_threshold();
m_RegexAutomata_FailedIntersectionThreshold = p.str_regex_automata_failed_intersection_threshold();
m_RegexAutomata_LengthAttemptThreshold = p.str_regex_automata_length_attempt_threshold();
m_FixedLengthModels = p.str_fixed_length_models();
m_FixedLengthRefinement = p.str_fixed_length_refinement();
}
#define DISPLAY_PARAM(X) out << #X"=" << X << std::endl;
void theory_str_params::display(std::ostream & out) const {
DISPLAY_PARAM(m_StrongArrangements);
DISPLAY_PARAM(m_AggressiveLengthTesting);
DISPLAY_PARAM(m_AggressiveValueTesting);
DISPLAY_PARAM(m_AggressiveUnrollTesting);
DISPLAY_PARAM(m_UseFastLengthTesterCache);
DISPLAY_PARAM(m_UseFastValueTesterCache);
DISPLAY_PARAM(m_StringConstantCache);
DISPLAY_PARAM(m_UseBinarySearch);
DISPLAY_PARAM(m_BinarySearchInitialUpperBound);
DISPLAY_PARAM(m_OverlapTheoryAwarePriority);
DISPLAY_PARAM(m_RegexAutomata);
DISPLAY_PARAM(m_RegexAutomata_DifficultyThreshold);
DISPLAY_PARAM(m_RegexAutomata_IntersectionDifficultyThreshold);
DISPLAY_PARAM(m_RegexAutomata_FailedAutomatonThreshold);
DISPLAY_PARAM(m_RegexAutomata_FailedIntersectionThreshold);
DISPLAY_PARAM(m_RegexAutomata_LengthAttemptThreshold);
DISPLAY_PARAM(m_FixedLengthModels);
}

View file

@ -116,6 +116,19 @@ struct theory_str_params {
* before which we begin checking unsatisfiability of a regex term.
*/
unsigned m_RegexAutomata_LengthAttemptThreshold;
/*
* If FixedLengthModels is true, Z3str3 will use a fixed-length equation solver to construct models in final_check.
* If false, Z3str3 will use the legacy length tester and value tester procedure.
*/
bool m_FixedLengthModels;
/*
* If FixedLengthRefinement is true and the fixed-length equation solver is enabled,
* Z3str3 will use abstraction refinement to handle formulas that would result in disjunctions or expensive
* reductions to fixed-length formulas.
*/
bool m_FixedLengthRefinement;
theory_str_params(params_ref const & p = params_ref()):
m_StrongArrangements(true),
@ -134,12 +147,15 @@ struct theory_str_params {
m_RegexAutomata_IntersectionDifficultyThreshold(1000),
m_RegexAutomata_FailedAutomatonThreshold(10),
m_RegexAutomata_FailedIntersectionThreshold(10),
m_RegexAutomata_LengthAttemptThreshold(10)
m_RegexAutomata_LengthAttemptThreshold(10),
m_FixedLengthModels(true),
m_FixedLengthRefinement(false)
{
updt_params(p);
}
void updt_params(params_ref const & p);
void display(std::ostream & out) const;
};
#endif /* THEORY_STR_PARAMS_H */