2015-09-16 14:49:39 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2015 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Author: Leonardo de Moura
|
|
|
|
*/
|
|
|
|
#pragma once
|
2015-09-24 01:13:18 +00:00
|
|
|
#include "util/rb_map.h"
|
2015-09-16 14:49:39 +00:00
|
|
|
#include "kernel/expr.h"
|
2015-09-24 01:13:18 +00:00
|
|
|
#include "library/blast/hypothesis.h"
|
2015-09-25 21:43:42 +00:00
|
|
|
#include "library/blast/branch.h"
|
2015-09-24 01:13:18 +00:00
|
|
|
|
2015-09-16 14:49:39 +00:00
|
|
|
namespace lean {
|
|
|
|
namespace blast {
|
2015-09-24 01:13:18 +00:00
|
|
|
class metavar_decl {
|
|
|
|
hypothesis_set m_context;
|
|
|
|
expr m_type;
|
2015-09-25 21:43:42 +00:00
|
|
|
public:
|
|
|
|
metavar_decl() {}
|
|
|
|
metavar_decl(hypothesis_set const & c, expr const & t):m_context(c), m_type(t) {}
|
2015-09-24 01:13:18 +00:00
|
|
|
};
|
|
|
|
|
2015-09-16 14:49:39 +00:00
|
|
|
class state {
|
2015-09-25 21:43:42 +00:00
|
|
|
friend class context;
|
|
|
|
unsigned m_next_mref_index;
|
2015-09-24 01:13:18 +00:00
|
|
|
typedef rb_map<unsigned, metavar_decl, unsigned_cmp> metavar_decls;
|
2015-09-25 19:45:16 +00:00
|
|
|
typedef rb_map<unsigned, expr, unsigned_cmp> assignment;
|
2015-09-24 01:13:18 +00:00
|
|
|
metavar_decls m_metavar_decls;
|
2015-09-25 19:45:16 +00:00
|
|
|
assignment m_assignment;
|
2015-09-25 21:43:42 +00:00
|
|
|
public:
|
|
|
|
state();
|
|
|
|
unsigned add_metavar_decl(metavar_decl const & decl);
|
|
|
|
metavar_decl const * get_metavar_decl(unsigned idx) const { return m_metavar_decls.find(idx); }
|
|
|
|
metavar_decl const * get_metavar_decl(expr const & e) const { return get_metavar_decl(mref_index(e)); }
|
2015-09-16 14:49:39 +00:00
|
|
|
};
|
|
|
|
}}
|