/* Copyright (c) 2013 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura */ #include "kernel/occurs.h" #include "kernel/find_fn.h" namespace lean { bool occurs(expr const & n, expr const & m) { return static_cast(find(m, [&](expr const & e) { return n == e; })); } bool occurs(name const & n, expr const & m) { return static_cast(find(m, [&](expr const & e) { return is_constant(e) && const_name(e) == n; })); } }