feat(frontends/lean/info_manager): add separator -- when displaying PROOF_STATE info

This feature was implemented to address issue #259
This commit is contained in:
Leonardo de Moura 2014-10-28 16:39:21 -07:00
parent 186e598bf8
commit 1c2bbcfebc
4 changed files with 24 additions and 1 deletions

View file

@ -267,7 +267,15 @@ public:
virtual bool is_cheap() const { return false; }
virtual void display(io_state_stream const & ios, unsigned line) const {
ios << "-- PROOF_STATE|" << line << "|" << get_column() << "\n";
ios << m_ps << endl;
bool first = true;
substitution s = m_ps.get_subst();
for (goal const & g : m_ps.get_goals()) {
if (first)
first = false;
else
ios << "--" << endl;
ios << g.instantiate(s) << endl;
}
ios << "-- ACK" << endl;
}
};

View file

@ -78,6 +78,11 @@ expr goal::mk_meta(name const & n, expr const & type) const {
return copy_tag(m_meta, mk_app(mvar, locals));
}
goal goal::instantiate(substitution const & s) const {
substitution s1(s);
return goal(s1.instantiate_all(m_meta), s1.instantiate_all(m_type));
}
static bool validate_locals(expr const & r, unsigned num_locals, expr const * locals) {
bool failed = false;
for_each(r, [&](expr const & e, unsigned) {
@ -122,6 +127,12 @@ list<expr> goal::to_context() const {
return to_list(locals.begin(), locals.end());
}
io_state_stream const & operator<<(io_state_stream const & out, goal const & g) {
options const & opts = out.get_options();
out.get_stream() << mk_pair(g.pp(out.get_formatter()), opts);
return out;
}
DECL_UDATA(goal)
static int mk_goal(lua_State * L) { return push_goal(L, goal(to_expr(L, 1), to_expr(L, 2))); }

View file

@ -71,6 +71,9 @@ public:
*/
list<expr> to_context() const;
/** \brief Apply given substitution to goal */
goal instantiate(substitution const & s) const;
format pp(formatter const & fmt, substitution const & s) const;
format pp(formatter const & fmt) const;
};

View file

@ -24,6 +24,7 @@ c : Prop,
Ha : a,
Hb : b
⊢ a
--
a : Prop,
b : Prop,
c : Prop,