1 /******************************************************************************
2 * Top contributors (to current version):
3 * Andrew Reynolds, Andres Noetzli, Yoni Zohar
5 * This file is part of the cvc5 project.
7 * Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
8 * in the top-level source directory and their institutional affiliations.
9 * All rights reserved. See the file COPYING in the top-level source
10 * directory for licensing information.
11 * ****************************************************************************
13 * Type for rewrites for strings.
16 #include "cvc5_private.h"
18 #ifndef CVC5__THEORY__STRINGS__REWRITES_H
19 #define CVC5__THEORY__STRINGS__REWRITES_H
27 /** Types of rewrites used by strings
29 * This rewrites are documented where they are used in the rewriter.
31 enum class Rewrite
: uint32_t
41 CTN_NCONST_CTN_CONCAT
,
44 CTN_REPL_CNSTS_TO_CTN
,
46 CTN_REPL_LEN_ONE_TO_CTN
,
74 IDOF_STRIP_CNST_ENDPTS
,
78 INDEXOF_RE_INVALID_INDEX
,
84 RE_ANDOR_INC_CONFLICT
,
85 RE_INTER_CONST_CONST_CONFLICT
,
86 RE_INTER_CONST_RE_CONFLICT
,
91 RE_CONCAT_PURE_ALLCHAR
,
92 RE_CONCAT_TO_CONTAINS
,
96 RE_IN_CHAR_MODULUS_STAR
,
103 RE_STAR_EMPTY_STRING
,
106 REPL_CHAR_NCONTRIB_FIND
,
108 REPL_REPL_SHORT_CIRCUIT
,
137 SS_CONST_LEN_MAX_OOB
,
138 SS_CONST_LEN_NON_POS
,
140 SS_CONST_START_MAX_OOB
,
145 SS_GEQ_ZERO_START_ENTAILS_EMP_S
,
149 SS_NON_ZERO_LEN_ENTAILS_OOB
,
150 SS_START_ENTAILS_ZERO_LEN
,
158 UPD_CONST_INDEX_MAX_OOB
,
168 STR_CONV_MINSCOPE_CONCAT
,
173 STR_EMP_SUBSTR_LEQ_LEN
,
174 STR_EMP_SUBSTR_LEQ_Z
,
175 STR_EQ_CONJ_LEN_ENTAIL
,
189 STR_REV_MINSCOPE_CONCAT
,
194 SUF_PREFIX_EMPTY_CONST
,
236 * Converts an rewrite to a string. Note: This function is also used in
237 * `safe_print()`. Changing this functions name or signature will result in
238 * `safe_print()` printing "<unsupported>" instead of the proper strings for
241 * @param r The rewrite
242 * @return The name of the rewrite
244 const char* toString(Rewrite r
);
247 * Writes an rewrite name to a stream.
249 * @param out The stream to write to
250 * @param r The rewrite to write to the stream
253 std::ostream
& operator<<(std::ostream
& out
, Rewrite r
);
255 } // namespace strings
256 } // namespace theory
259 #endif /* CVC5__THEORY__STRINGS__REWRITES_H */