From 511337a4e92e85909866dc830350300d7dfa8511 Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Tue, 10 Nov 2015 17:00:26 -0800 Subject: [PATCH] fix(library/blast): missing file --- src/library/blast/action_result.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/library/blast/action_result.h diff --git a/src/library/blast/action_result.h b/src/library/blast/action_result.h new file mode 100644 index 000000000..0af916797 --- /dev/null +++ b/src/library/blast/action_result.h @@ -0,0 +1,29 @@ +/* +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 +#include "kernel/expr.h" + +namespace lean { +namespace blast { +class action_result { +public: + enum kind { Failed, Solved, NewBranch }; +private: + kind m_kind; + expr m_proof; + action_result(bool b = true):m_kind(b ? NewBranch : Failed) {} + action_result(expr const & pr):m_kind(Solved), m_proof(pr) {} +public: + kind get_kind() const { return m_kind; } + expr get_proof() const { lean_assert(m_kind == Solved); return m_proof; } + static action_result failed() { return action_result(false); } + static action_result new_branch() { return action_result(true); } + static action_result solved(expr const & pr) { return action_result(pr); } +}; + +inline bool failed(action_result const & r) { return r.get_kind() == action_result::Failed; } +}}