mirror of
https://github.com/Z3Prover/z3
synced 2026-08-08 06:52:26 +00:00
include unary cases for associative regex operators in derivatives
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
3e1fd56ca2
commit
8d95ca4dc1
3 changed files with 24 additions and 2 deletions
|
|
@ -235,6 +235,19 @@ namespace seq {
|
|||
return mk_inter(d1, d2);
|
||||
}
|
||||
|
||||
// handle unary unsimplified cases of operators
|
||||
if (re().is_union(r, r1))
|
||||
return derive_rec(r1);
|
||||
|
||||
if (re().is_intersection(r, r1))
|
||||
return derive_rec(r1);
|
||||
|
||||
if (re().is_concat(r, r1))
|
||||
return derive_rec(r1);
|
||||
|
||||
if (re().is_xor(r, r1))
|
||||
return derive_rec(r1);
|
||||
|
||||
// δ(~r1) = ~δ(r1)
|
||||
if (re().is_complement(r, r1)) {
|
||||
expr_ref d1 = derive_rec(r1);
|
||||
|
|
|
|||
|
|
@ -29,12 +29,17 @@ TODOs:
|
|||
- coallesce the membership constraints into a single regex membership constraint of the intersection of regexes.
|
||||
- take into account shape of terms to prune the search space (e.g., if the term is xax, then retain the effect of
|
||||
intersecting with .*a.*).
|
||||
- use expr_ref in component and replace svector<component> by vector<component>, save on m_pin.
|
||||
- connect to semi-linear pruning, such as xx in (ab)*a is unsat due to parity
|
||||
- support units of non-values (element variables).
|
||||
Model construction would assign values to the elements.
|
||||
- make unsat core tracking less naive by tracking dependencies at a finer grain.
|
||||
- add statistics and use it from src/smt/seq_regex.cpp when extracting statistics from theory_seq.
|
||||
- add selective tracing TRACE(seq, ..).
|
||||
- revisit DFS to select next membership constraint to explore base on the current state.
|
||||
In the current state include current set of variable intersection membership constraints.
|
||||
The next membership constraint to explore is preferrably for a variable that was just
|
||||
explored and we can check the variable intersection membership constraints if the new
|
||||
expansion is feasible. Constant characters are consumed at the same time to also prune
|
||||
the choice.
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -593,6 +593,10 @@ public:
|
|||
MATCH_BINARY(is_diff);
|
||||
MATCH_BINARY(is_xor);
|
||||
MATCH_BINARY(is_range);
|
||||
MATCH_UNARY(is_concat);
|
||||
MATCH_UNARY(is_union);
|
||||
MATCH_UNARY(is_intersection);
|
||||
MATCH_UNARY(is_xor);
|
||||
MATCH_UNARY(is_complement);
|
||||
MATCH_UNARY(is_star);
|
||||
MATCH_UNARY(is_plus);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue