/* Copyright (c) 2014 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura */ #pragma once #include "util/lazy_list.h" #include "kernel/constraint.h" namespace lean { /** \brief Abstract (helper) class for creating lazy_list */ class choice_iterator { bool m_ignore_failure; public: choice_iterator(bool ignore_failure = false):m_ignore_failure(ignore_failure) {} virtual ~choice_iterator() {} virtual optional next() = 0; bool ignore_failure() const { return m_ignore_failure; } }; /** \brief Convert a choice_iterator into a lazy_list The lazy list is generated by invoking the method \c choice_iterator::next. If c->ignore_failure() is true AND \c c does not produce any result, then the singleton lazy_list is produced with an empty set of constraints. */ lazy_list choose(std::shared_ptr c); }