3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-19 15:16:29 +00:00
Commit graph

7 commits

Author SHA1 Message Date
Nikolaj Bjorner
0f50702c9e Address PR review: subsumption, is_value, simplify_ite fixes
- Add lightweight structural is_subset for union/inter simplification
- Use m.is_value instead of is_const_char for swap checks
- Move eval_cond to beginning of simplify_ite_rec
- Use path.shrink(sz) instead of copying extended_path
- Fix normalize_reverse stuck case to return mk_reverse(r)
- Expose subsumes() in public API

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-10 15:23:57 -07:00
Nikolaj Bjorner
2e3dd32b90 Address PR review comments: cache, simplify_ite_rec, itos
- Cache now indexes by (ele, r) pair using obj_pair_map
- Remove eval() function; operator()(ele, r) handles all cases
- Rewrite simplify_ite_rec with path vector of signed conditions
- Add range-based simplification: (lo <= x, false) + (x <= hi, false)
  eliminates ite(x = v, t, e) when v is outside [lo, hi]
- Add is_itos case in derive_to_re: guards on n >= 0, digit range,
  and first character match
- Port is_reverse normalization (previous commit)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-10 15:23:56 -07:00
Nikolaj Bjorner
3a22994b80 Port reverse normalization into derive class
Instead of treating reverse(r) as stuck (returning symbolic mk_derivative),
normalize it by pushing reverse inward through the regex structure, then
compute the derivative of the normalized result. Mirrors mk_re_reverse logic.

Handles: concat, union, intersection, diff, ite, opt, complement, star,
plus, loop, to_re (string literals, units, concats), and symmetric cases.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-10 15:23:56 -07:00
Nikolaj Bjorner
2b06d6ddb2 Add simplify_ite_rec and eval for two-phase derivative
- Add simplify_ite post-processing in operator() to simplify ITE conditions
- Add simplify_ite_rec(cond, sign, r) for propagating condition truth values
- Handles c == cond, x=ch1 vs x=ch2 with different constants
- Add eval(ele, d) for efficient two-phase: symbolic derivative + concrete eval
- mk_derivative uses two-phase pattern: m_derive(r) then m_derive.eval(ele, d)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-10 15:23:55 -07:00
Nikolaj Bjorner
a59a7296fb make reset private 2026-06-10 15:23:54 -07:00
Nikolaj Bjorner
8eb6491e6c updates per PR comments 2026-06-10 15:23:54 -07:00
Nikolaj Bjorner
e74d2d2151 move seq_derive and fix include paths, remove antimirov code 2026-06-10 15:23:46 -07:00
Renamed from src/ast/seq_derive.cpp (Browse further)