lean2/src/library/rewriter/fo_match.h

34 lines
1.3 KiB
C
Raw Normal View History

/*
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: Soonho Kong
*/
#pragma once
2013-09-27 08:44:05 +00:00
#include "util/scoped_map.h"
#include "kernel/expr.h"
#include "kernel/context.h"
#include "library/printer.h"
namespace lean {
2013-09-27 08:44:05 +00:00
using subst_map = scoped_map<unsigned, expr>;
class fo_match {
private:
2013-09-19 19:21:29 +00:00
bool match_var(expr const & p, expr const & t, unsigned o, subst_map & s);
bool match_constant(expr const & p, expr const & t, unsigned o, subst_map & s);
bool match_value(expr const & p, expr const & t, unsigned o, subst_map & s);
bool match_app(expr const & p, expr const & t, unsigned o, subst_map & s);
bool match_lambda(expr const & p, expr const & t, unsigned o, subst_map & s);
bool match_pi(expr const & p, expr const & t, unsigned o, subst_map & s);
bool match_type(expr const & p, expr const & t, unsigned o, subst_map & s);
bool match_let(expr const & p, expr const & t, unsigned o, subst_map & s);
bool match_metavar(expr const & p, expr const & t, unsigned o, subst_map & s);
2013-09-27 08:44:05 +00:00
bool match_main(expr const & p, expr const & t, unsigned o, subst_map & s);
bool match_main(optional<expr> const & p, optional<expr> const & t, unsigned o, subst_map & s);
2013-09-19 19:21:29 +00:00
public:
2013-09-19 19:21:29 +00:00
bool match(expr const & p, expr const & t, unsigned o, subst_map & s);
};
}