mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
add and use new is_pattern recognizer
This commit is contained in:
parent
44c417904b
commit
d6fbfe401e
3 changed files with 22 additions and 2 deletions
|
@ -2326,6 +2326,22 @@ bool ast_manager::is_pattern(expr const * n) const {
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool ast_manager::is_pattern(expr const * n, ptr_vector<expr> &args) {
|
||||
if (!is_app_of(n, m_pattern_family_id, OP_PATTERN)) {
|
||||
return false;
|
||||
}
|
||||
for (unsigned i = 0; i < to_app(n)->get_num_args(); ++i) {
|
||||
expr *arg = to_app(n)->get_arg(i);
|
||||
if (!is_app(arg)) {
|
||||
return false;
|
||||
}
|
||||
args.push_back(arg);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
quantifier * ast_manager::mk_quantifier(bool forall, unsigned num_decls, sort * const * decl_sorts, symbol const * decl_names,
|
||||
expr * body, int weight , symbol const & qid, symbol const & skid,
|
||||
unsigned num_patterns, expr * const * patterns,
|
||||
|
|
|
@ -1840,6 +1840,8 @@ public:
|
|||
|
||||
bool is_pattern(expr const * n) const;
|
||||
|
||||
bool is_pattern(expr const *n, ptr_vector<expr> &args);
|
||||
|
||||
public:
|
||||
|
||||
quantifier * mk_quantifier(bool forall, unsigned num_decls, sort * const * decl_sorts, symbol const * decl_names, expr * body,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue