2015-11-10 19:44:18 +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
|
|
|
|
*/
|
|
|
|
#include "library/blast/blast.h"
|
|
|
|
#include "library/blast/options.h"
|
|
|
|
#include "library/blast/choice_point.h"
|
2015-11-13 23:21:26 +00:00
|
|
|
#include "library/blast/proof_expr.h"
|
2015-12-04 18:00:04 +00:00
|
|
|
#include "library/blast/strategy.h"
|
|
|
|
#include "library/blast/trace.h"
|
|
|
|
#include "library/blast/simplifier/simplifier_actions.h"
|
2015-11-18 23:41:44 +00:00
|
|
|
#include "library/blast/backward/backward_action.h"
|
|
|
|
#include "library/blast/backward/backward_strategy.h"
|
2015-11-23 21:15:04 +00:00
|
|
|
#include "library/blast/forward/forward_actions.h"
|
2015-11-30 14:19:23 +00:00
|
|
|
#include "library/blast/forward/ematch.h"
|
2015-11-29 02:12:25 +00:00
|
|
|
#include "library/blast/unit/unit_actions.h"
|
2015-12-04 18:00:04 +00:00
|
|
|
#include "library/blast/actions/simple_actions.h"
|
|
|
|
#include "library/blast/actions/intros_action.h"
|
|
|
|
#include "library/blast/actions/subst_action.h"
|
|
|
|
#include "library/blast/actions/recursor_action.h"
|
2015-12-05 04:19:05 +00:00
|
|
|
#include "library/blast/actions/by_contradiction_action.h"
|
2015-12-04 18:00:04 +00:00
|
|
|
#include "library/blast/actions/assert_cc_action.h"
|
|
|
|
#include "library/blast/actions/no_confusion_action.h"
|
2015-11-10 19:44:18 +00:00
|
|
|
|
|
|
|
namespace lean {
|
|
|
|
namespace blast {
|
|
|
|
/** \brief Implement a simple proof strategy for blast.
|
|
|
|
We use it mainly for testing new actions and the whole blast infra-structure. */
|
2015-12-05 21:25:20 +00:00
|
|
|
class simple_strategy_fn : public strategy_fn {
|
2015-12-06 00:55:04 +00:00
|
|
|
virtual action_result hypothesis_pre_activation(hypothesis_idx hidx) override {
|
2015-11-23 02:22:26 +00:00
|
|
|
Try(assumption_contradiction_actions(hidx));
|
|
|
|
Try(simplify_hypothesis_action(hidx));
|
2015-11-29 02:12:25 +00:00
|
|
|
Try(unit_preprocess(hidx));
|
2015-11-23 02:22:26 +00:00
|
|
|
Try(no_confusion_action(hidx));
|
|
|
|
TrySolve(assert_cc_action(hidx));
|
|
|
|
Try(discard_action(hidx));
|
|
|
|
Try(subst_action(hidx));
|
|
|
|
return action_result::new_branch();
|
|
|
|
}
|
2015-11-15 22:30:24 +00:00
|
|
|
|
2015-12-06 00:55:04 +00:00
|
|
|
virtual action_result hypothesis_post_activation(hypothesis_idx hidx) override {
|
2015-11-29 02:12:25 +00:00
|
|
|
Try(unit_propagate(hidx));
|
2015-11-23 02:22:26 +00:00
|
|
|
Try(recursor_preprocess_action(hidx));
|
2015-11-15 22:30:24 +00:00
|
|
|
return action_result::new_branch();
|
2015-11-10 19:44:18 +00:00
|
|
|
}
|
|
|
|
|
2015-11-23 02:22:26 +00:00
|
|
|
virtual action_result next_action() override {
|
2015-11-18 20:27:24 +00:00
|
|
|
Try(intros_action());
|
2015-12-06 00:55:04 +00:00
|
|
|
Try(activate_hypothesis());
|
2015-11-18 20:27:24 +00:00
|
|
|
Try(trivial_action());
|
|
|
|
Try(assumption_action());
|
|
|
|
Try(recursor_action());
|
2015-11-30 14:19:23 +00:00
|
|
|
Try(ematch_action());
|
2015-12-06 03:43:48 +00:00
|
|
|
Try(constructor_action());
|
2015-12-05 04:19:05 +00:00
|
|
|
Try(by_contradiction_action());
|
2015-12-05 21:25:20 +00:00
|
|
|
TryStrategy(mk_backward_strategy());
|
2015-11-23 21:15:04 +00:00
|
|
|
Try(qfc_action(list<gexpr>()));
|
2015-11-11 00:57:57 +00:00
|
|
|
return action_result::failed();
|
2015-11-10 19:44:18 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2015-12-05 21:25:20 +00:00
|
|
|
strategy mk_simple_strategy() {
|
|
|
|
return []() { return simple_strategy_fn()(); };
|
2015-11-10 19:44:18 +00:00
|
|
|
}
|
|
|
|
}}
|