Branch data Line data Source code
1 : : /****************************************************************************** 2 : : * This file is part of the cvc5 project. 3 : : * 4 : : * Copyright (c) 2009-2026 by the authors listed in the file AUTHORS 5 : : * in the top-level source directory and their institutional affiliations. 6 : : * All rights reserved. See the file COPYING in the top-level source 7 : : * directory for licensing information. 8 : : * **************************************************************************** 9 : : * 10 : : * Subsolver for handling code points 11 : : */ 12 : : 13 : : #include "cvc5_private.h" 14 : : 15 : : #ifndef CVC5__THEORY__STRINGS__CODE_POINT_SOLVER_H 16 : : #define CVC5__THEORY__STRINGS__CODE_POINT_SOLVER_H 17 : : 18 : : #include "smt/env_obj.h" 19 : : 20 : : namespace cvc5::internal { 21 : : namespace theory { 22 : : namespace strings { 23 : : 24 : : class BaseSolver; 25 : : class CoreSolver; 26 : : class InferenceManager; 27 : : class TermRegistry; 28 : : class SolverState; 29 : : 30 : : /** 31 : : * Subsolver for handling code points, see "A Decision Procedure for String to 32 : : * Code Point Conversion", Reynolds et al IJCAR 2020. 33 : : */ 34 : : class CodePointSolver : protected EnvObj 35 : : { 36 : : public: 37 : : CodePointSolver(Env& env, 38 : : SolverState& s, 39 : : InferenceManager& im, 40 : : TermRegistry& tr, 41 : : BaseSolver& bs, 42 : : CoreSolver& cs); 43 : 27709 : ~CodePointSolver() {} 44 : : /** check codes 45 : : * 46 : : * This inference schema ensures that constraints between str.code terms 47 : : * are satisfied by models that correspond to extensions of the current 48 : : * assignment. In particular, this method ensures that str.code can be 49 : : * given an interpretation that is injective for string arguments with length 50 : : * one. It may add lemmas of the form: 51 : : * str.code(x) == -1 V str.code(x) != str.code(y) V x == y 52 : : */ 53 : : void checkCodes(); 54 : : 55 : : protected: 56 : : /** The solver state object */ 57 : : SolverState& d_state; 58 : : /** The (custom) output channel of the theory of strings */ 59 : : InferenceManager& d_im; 60 : : /** Reference to the term registry of theory of strings */ 61 : : TermRegistry& d_termReg; 62 : : /** reference to the base solver, used for certain queries */ 63 : : BaseSolver& d_bsolver; 64 : : /** The core solver */ 65 : : CoreSolver& d_csolver; 66 : : /** Commonly used constants */ 67 : : Node d_negOne; 68 : : }; 69 : : 70 : : } // namespace strings 71 : : } // namespace theory 72 : : } // namespace cvc5::internal 73 : : 74 : : #endif /* CVC5__THEORY__STRINGS__CODE_POINT_SOLVER_H */