2013-11-21 01:02:41 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Author: Leonardo de Moura
|
|
|
|
*/
|
|
|
|
#include "util/test.h"
|
2013-11-21 23:31:55 +00:00
|
|
|
#include "kernel/builtin.h"
|
|
|
|
#include "library/all/all.h"
|
2013-11-21 01:02:41 +00:00
|
|
|
#include "library/tactic/goal.h"
|
|
|
|
#include "library/tactic/proof_builder.h"
|
|
|
|
#include "library/tactic/justification_builder.h"
|
|
|
|
#include "library/tactic/proof_state.h"
|
|
|
|
#include "library/tactic/tactic.h"
|
|
|
|
using namespace lean;
|
|
|
|
|
2013-11-21 23:31:55 +00:00
|
|
|
static void tst1() {
|
|
|
|
environment env;
|
2013-11-22 00:44:31 +00:00
|
|
|
io_state io(options(), mk_simple_formatter());
|
2013-11-21 23:31:55 +00:00
|
|
|
import_all(env);
|
|
|
|
env.add_var("p", Bool);
|
|
|
|
env.add_var("q", Bool);
|
|
|
|
expr p = Const("p");
|
|
|
|
expr q = Const("q");
|
|
|
|
context ctx;
|
|
|
|
ctx = extend(ctx, "H1", p);
|
|
|
|
ctx = extend(ctx, "H2", q);
|
2013-11-22 00:44:31 +00:00
|
|
|
proof_state s = to_proof_state(env, ctx, p);
|
|
|
|
std::cout << s.pp(mk_simple_formatter(), options()) << "\n";
|
|
|
|
tactic t = then(assumption_tactic(), now_tactic());
|
|
|
|
std::cout << "proof: " << t.solve(env, io, s) << "\n";
|
2013-11-21 23:31:55 +00:00
|
|
|
}
|
|
|
|
|
2013-11-21 01:02:41 +00:00
|
|
|
int main() {
|
2013-11-21 23:31:55 +00:00
|
|
|
tst1();
|
2013-11-21 01:02:41 +00:00
|
|
|
return has_violations() ? 1 : 0;
|
|
|
|
}
|