refactor(library/congr_lemma_manager): API
This commit is contained in:
parent
2dd092069f
commit
f74e8288bd
2 changed files with 18 additions and 17 deletions
|
@ -1299,9 +1299,9 @@ static environment congr_lemma_cmd(parser & p) {
|
||||||
for (auto k : r->get_arg_kinds()) {
|
for (auto k : r->get_arg_kinds()) {
|
||||||
if (!first) out << ", "; else first = false;
|
if (!first) out << ", "; else first = false;
|
||||||
switch (k) {
|
switch (k) {
|
||||||
case congr_lemma_manager::congr_arg_kind::Fixed: out << "fixed"; break;
|
case congr_arg_kind::Fixed: out << "fixed"; break;
|
||||||
case congr_lemma_manager::congr_arg_kind::Eq: out << "eq"; break;
|
case congr_arg_kind::Eq: out << "eq"; break;
|
||||||
case congr_lemma_manager::congr_arg_kind::Cast: out << "cast"; break;
|
case congr_arg_kind::Cast: out << "cast"; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out << "]\n";
|
out << "]\n";
|
||||||
|
|
|
@ -10,6 +10,20 @@ Author: Leonardo de Moura
|
||||||
#include "library/fun_info_manager.h"
|
#include "library/fun_info_manager.h"
|
||||||
|
|
||||||
namespace lean {
|
namespace lean {
|
||||||
|
enum class congr_arg_kind { Fixed, Eq, Cast };
|
||||||
|
|
||||||
|
class congr_lemma {
|
||||||
|
expr m_type;
|
||||||
|
expr m_proof;
|
||||||
|
list<congr_arg_kind> m_arg_kinds;
|
||||||
|
public:
|
||||||
|
congr_lemma(expr const & type, expr const & proof, list<congr_arg_kind> const & ks):
|
||||||
|
m_type(type), m_proof(proof), m_arg_kinds(ks) {}
|
||||||
|
expr const & get_type() const { return m_type; }
|
||||||
|
expr const & get_proof() const { return m_proof; }
|
||||||
|
list<congr_arg_kind> const & get_arg_kinds() const { return m_arg_kinds; }
|
||||||
|
};
|
||||||
|
|
||||||
class congr_lemma_manager {
|
class congr_lemma_manager {
|
||||||
struct imp;
|
struct imp;
|
||||||
std::unique_ptr<imp> m_ptr;
|
std::unique_ptr<imp> m_ptr;
|
||||||
|
@ -23,20 +37,7 @@ public:
|
||||||
we want the argumet s to remain fixed. */
|
we want the argumet s to remain fixed. */
|
||||||
congr_lemma_manager(app_builder & b, fun_info_manager & fm, bool ignore_inst_implicit = true);
|
congr_lemma_manager(app_builder & b, fun_info_manager & fm, bool ignore_inst_implicit = true);
|
||||||
~congr_lemma_manager();
|
~congr_lemma_manager();
|
||||||
|
typedef congr_lemma result;
|
||||||
enum class congr_arg_kind { Fixed, Eq, Cast };
|
|
||||||
|
|
||||||
class result {
|
|
||||||
expr m_type;
|
|
||||||
expr m_proof;
|
|
||||||
list<congr_arg_kind> m_arg_kinds;
|
|
||||||
public:
|
|
||||||
result(expr const & type, expr const & proof, list<congr_arg_kind> const & ks):
|
|
||||||
m_type(type), m_proof(proof), m_arg_kinds(ks) {}
|
|
||||||
expr const & get_type() const { return m_type; }
|
|
||||||
expr const & get_proof() const { return m_proof; }
|
|
||||||
list<congr_arg_kind> const & get_arg_kinds() const { return m_arg_kinds; }
|
|
||||||
};
|
|
||||||
|
|
||||||
optional<result> mk_congr_simp(expr const & fn);
|
optional<result> mk_congr_simp(expr const & fn);
|
||||||
optional<result> mk_congr_simp(expr const & fn, unsigned nargs);
|
optional<result> mk_congr_simp(expr const & fn, unsigned nargs);
|
||||||
|
|
Loading…
Reference in a new issue