feat(frontends/lean): add basic tactics
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
3aa59cebb5
commit
1e39a21823
3 changed files with 17 additions and 10 deletions
|
@ -4,17 +4,24 @@ Released under Apache 2.0 license as described in the file LICENSE.
|
|||
|
||||
Author: Leonardo de Moura
|
||||
*/
|
||||
#include "library/tactic/tactic.h"
|
||||
#include "frontends/lean/parser.h"
|
||||
|
||||
namespace lean {
|
||||
tactic parse_skip_tactic(parser &) {
|
||||
// TODO(Leo): this is just for testing
|
||||
return tactic();
|
||||
}
|
||||
tactic parse_fail_tactic(parser &) { return fail_tactic(); }
|
||||
tactic parse_id_tactic(parser &) { return id_tactic(); }
|
||||
tactic parse_assumption_tactic(parser &) { return assumption_tactic(); }
|
||||
|
||||
void add_tactic(tactic_cmd_table & t, tactic_cmd_info && info) { t.insert(info.get_name(), info); }
|
||||
|
||||
tactic_cmd_table get_builtin_tactic_cmds() {
|
||||
tactic_cmd_table t;
|
||||
t.insert("skip", tactic_cmd_info("skip", "dummy tactic", parse_skip_tactic));
|
||||
add_tactic(t, tactic_cmd_info("fail", "always fail tactic", parse_fail_tactic));
|
||||
add_tactic(t, tactic_cmd_info("id", "do nothing tactic", parse_id_tactic));
|
||||
add_tactic(t, tactic_cmd_info("assumption", "solve goal if there is an assumption that is identical to the conclusion",
|
||||
parse_assumption_tactic));
|
||||
add_tactic(t, tactic_cmd_info("exact", "solve goal if there is an assumption that is identical to the conclusion",
|
||||
parse_assumption_tactic));
|
||||
return t;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@ axiom Ha : a
|
|||
axiom Hb : b
|
||||
axiom Hc : c
|
||||
print raw
|
||||
have H1 : a, by skip,
|
||||
then have H2 : b, by skip,
|
||||
have H3 : c, by skip,
|
||||
then have H4 : d, by skip,
|
||||
have H1 : a, by id,
|
||||
then have H2 : b, by id,
|
||||
have H3 : c, by id,
|
||||
then have H4 : d, by id,
|
||||
H4
|
|
@ -1 +1 @@
|
|||
print raw (by skip)
|
||||
print raw (by id)
|
Loading…
Add table
Reference in a new issue