90 #ifndef ALGO_H_INCLUDED 91 #define ALGO_H_INCLUDED 147 std::function<
bool(Expr
const&)>
const& f,
165 std::function<
bool(Expr
const&)>
const& f,
184 std::function<
bool(Expr
const&)>
const& f,
187 std::function<
bool(Expr_info)>
const& f,
206 std::function<
bool(Expr
const&)>
const& f,
209 std::function<
bool(Expr_info)>
const& f,
228 std::function<
bool(Expr
const&)>
const& f,
231 std::function<
bool(Expr_info)>
const& f,
250 std::function<
bool(Expr
const&)>
const& f,
253 std::function<
bool(Expr_info)>
const& f,
269 std::function<
void(Expr
const&)>
const& f,
271 void VisitEachNodeReversed(Expr
const &init,
272 std::function<
void(Expr
const&)>
const& f,
275 std::function<
void(Expr_info)>
const& f,
291 std::function<
void(Expr
const&)>
const& f,
294 std::function<
void(Expr_info)>
const& f,
314 std::function<
bool(Expr
const&)>
const& f,
318 std::function<
bool(Expr_info)>
const& f,
326 std::function<
bool(
csl::Expr const&)>
const &f
329 size_t CountNodes(Expr
const &init);
330 size_t CountLeafs(Expr
const &init);
346 std::function<
void(Expr&)>
const& f,
348 void ForEachNodeReversed(Expr & init,
349 std::function<
void(Expr&)>
const& f,
366 std::function<
void(Expr&)>
const& f,
387 std::function<
bool(Expr&)>
const& f,
407 std::function<
bool(Expr&)>
const& f);
426 std::function<
bool(Expr&)>
const& f);
428 bool VisitFirstOfNode(Expr
const& init,
429 std::function<
bool(Expr
const&)>
const& f);
430 bool VisitFirstOfLeaf(Expr
const& init,
431 std::function<
bool(Expr
const&)>
const& f);
450 std::function<
bool(Expr&)>
const& f,
Namespace for csl library.
Definition: abreviation.h:34
Expr FindIfLeaf(Expr const &init, std::function< bool(Expr const &)> const &f, size_t depth=-1)
Searches and returns an expression in another.
Definition: algo.cpp:55
void ForEachNode(Expr &init, std::function< void(Expr &)> const &f, int depth=-1)
Applies a user function on each node of an expression. The expression may be modified.
Definition: algo.cpp:336
void ForEachLeaf(Expr &init, std::function< void(Expr &)> const &f, int depth=-1)
Applies a user function on each leaf of an expression. The expression may be modified.
Definition: algo.cpp:370
bool AnyOfNodes(Expr const &init, std::function< bool(Expr const &)> const &f, int depth=-1)
Tells if any of the nodes of an expression respect a certain condition given by the user...
Definition: algo.cpp:158
void VisitEachNodeCut(Expr const &init, std::function< bool(Expr const &)> const &f, int depth=-1)
Visits all nodes of an expression, applying a function on it without modifying it. When the user function returns true on one node, the underlying branch (if there is) is not explored.
Definition: algo.cpp:255
void ForEachNodeCut(Expr &init, std::function< bool(Expr &)> const &f, int depth=-1)
Applies a user function on each node of an expression. The expression may be modified.
Definition: algo.cpp:358
bool AllOfLeafs(Expr const &init, std::function< bool(Expr const &)> const &f, int depth=-1)
Tells if all of the leafs of an expression respect a certain condition given by the user...
Definition: algo.cpp:130
Expr FindNode(Expr const &init, Expr const &node, size_t depth=-1)
Searches and returns an expression in another.
Definition: algo.cpp:40
void VisitEachNode(Expr const &init, std::function< void(Expr const &)> const &f, int depth=-1)
Visits all nodes of an expression, applying a function on it without modifying it.
Definition: algo.cpp:200
Base classes for all exprs in the program.
bool AllOfNodes(Expr const &init, std::function< bool(Expr const &)> const &f, int depth=-1)
Tells if all of the nodes of an expression respect a certain condition given by the user...
Definition: algo.cpp:172
Expr FindIfNode(Expr const &init, std::function< bool(Expr const &)> const &f, size_t depth=-1)
Searches and returns an expression in another.
Definition: algo.cpp:73
bool AnyOfLeafs(Expr const &init, std::function< bool(Expr const &)> const &f, int depth=-1)
Tells if any of the leafs of an expression respect a certain condition given by the user...
Definition: algo.cpp:102
bool Transform(Expr &init, std::function< bool(Expr &)> const &f, int depth=-1)
Applies a user function on each node of an expression. The expression may be modified. If it is, the expression is refreshed.
Definition: algo.cpp:445
Expr FindLeaf(Expr const &init, Expr const &value, size_t depth=-1)
Searches and returns an expression in another.
Definition: algo.cpp:22
bool FirstOfNode(Expr &init, std::function< bool(Expr &)> const &f)
Tells if any of the nodes of an expression respect a certain condition given by the user...
Definition: algo.cpp:400
bool FirstOfLeaf(Expr &init, std::function< bool(Expr &)> const &f)
Tells if any of the leafs of an expression respect a certain condition given by the user...
Definition: algo.cpp:411
Expression type/.
Definition: abstract.h:1573
void VisitEachLeaf(Expr const &init, std::function< void(Expr const &)> const &f, int depth=-1)
Visits all leafs of an expression, applying a function on it without modifying it.
Definition: algo.cpp:232