Skip to content

Commit

Permalink
add match for foldli
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolajBjorner committed Sep 10, 2022
1 parent 660bdc3 commit 0629353
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/ast/ast.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,13 @@ class ast {
#endif
};

#define MATCH_QUATARY(_MATCHER_) \
bool _MATCHER_(expr const* n, expr*& a1, expr*& a2, expr *& a3, expr *& a4) const { \
if (_MATCHER_(n) && to_app(n)->get_num_args() == 4) { \
a1 = to_app(n)->get_arg(0); a2 = to_app(n)->get_arg(1); a3 = to_app(n)->get_arg(2); a4 = to_app(n)->get_arg(3); return true; } \
return false; \
}

#define MATCH_TERNARY(_MATCHER_) \
bool _MATCHER_(expr const* n, expr*& a1, expr*& a2, expr *& a3) const { \
if (_MATCHER_(n) && to_app(n)->get_num_args() == 3) { \
Expand Down
1 change: 1 addition & 0 deletions src/ast/seq_decl_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ class seq_util {
MATCH_BINARY(is_map);
MATCH_TERNARY(is_mapi);
MATCH_TERNARY(is_foldl);
MATCH_QUATARY(is_foldli);
MATCH_BINARY(is_last_index);
MATCH_TERNARY(is_replace);
MATCH_TERNARY(is_replace_re);
Expand Down

0 comments on commit 0629353

Please sign in to comment.