/********************* */ /*! \file eager_solver.h ** \verbatim ** Top contributors (to current version): ** Andrew Reynolds, Tianyi Liang, Morgan Deters ** This file is part of the CVC4 project. ** Copyright (c) 2009-2021 by the authors listed in the file AUTHORS ** in the top-level source directory and their institutional affiliations. ** All rights reserved. See the file COPYING in the top-level source ** directory for licensing information.\endverbatim ** ** \brief The eager solver **/ #include "cvc4_private.h" #ifndef CVC4__THEORY__STRINGS__EAGER_SOLVER_H #define CVC4__THEORY__STRINGS__EAGER_SOLVER_H #include #include "expr/node.h" #include "theory/strings/eqc_info.h" #include "theory/strings/solver_state.h" namespace CVC4 { namespace theory { namespace strings { /** * Eager solver, which is responsible for tracking of eager information and * reporting conflicts to the solver state. */ class EagerSolver { public: EagerSolver(SolverState& state); ~EagerSolver(); /** called when a new equivalence class is created */ void eqNotifyNewClass(TNode t); /** called when two equivalence classes merge */ void eqNotifyMerge(TNode t1, TNode t2); /** called when two equivalence classes are made disequal */ void eqNotifyDisequal(TNode t1, TNode t2, TNode reason); /** notify fact, called when a fact is asserted to theory of strings */ void notifyFact(TNode atom, bool polarity, TNode fact, bool isInternal); private: /** add endpoints to eqc info * * This method is called when term t is the explanation for why equivalence * class eqc may have a constant endpoint due to a concatentation term concat. * For example, we may call this method on: * t := (str.++ x y), concat := (str.++ x y), eqc * for some eqc that is currently equal to t. Another example is: * t := (str.in.re z (re.++ r s)), concat := (re.++ r s), eqc * for some eqc that is currently equal to z. */ void addEndpointsToEqcInfo(Node t, Node concat, Node eqc); /** Reference to the solver state */ SolverState& d_state; }; } // namespace strings } // namespace theory } // namespace CVC4 #endif /* CVC4__THEORY__STRINGS__EAGER_SOLVER_H */