3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-19 23:26:30 +00:00
Commit graph

1 commit

Author SHA1 Message Date
Margus Veanes
292a925826 Add OP_RE_CHARCLASS to collapse boolean combinations of char-class regexes
Introduces a first-class AST kind OP_RE_CHARCLASS for ground char-class
regexes, encoded as a nullary op with 2N int parameters that name the
sorted, disjoint, non-adjacent ranges of its predicate. The seq decl
plugin owns the construction and validation; seq_rewriter lifts existing
re.range / re.empty / re.full_char into CHARCLASS and collapses
union/intersection/difference of CHARCLASS-like operands into a single
node via seq::range_predicate.

Highlights:
* Move range_predicate.{h,cpp} from ast/rewriter/ into ast/ so the seq
  plugin can use it.
* mk_re_union / mk_re_inter / mk_re_diff and mk_regex_union_normalize /
  mk_regex_inter_normalize all short-circuit to a single CHARCLASS when
  both operands are charclass-like.
* mk_re_range lifts concrete-bounded ranges at construction.
* mk_antimirov_deriv_rec and mk_derivative_rec both handle the CHARCLASS
  case so derivatives reduce normally during simplification and bisim.
* is_nullable_rec, get_info_rec, can_skip_parenth, and the rex pretty
  printer all recognise the new kind.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-06-14 21:46:20 -07:00
Renamed from src/ast/rewriter/range_predicate.cpp (Browse further)