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 : : * Enumerators for regular expressions. 11 : : */ 12 : : 13 : : #include "cvc5_private.h" 14 : : 15 : : #ifndef CVC5__THEORY__STRINGS__REGEXP_ENUMERATOR_H 16 : : #define CVC5__THEORY__STRINGS__REGEXP_ENUMERATOR_H 17 : : 18 : : #include <vector> 19 : : 20 : : #include "expr/node.h" 21 : : #include "expr/type_node.h" 22 : : #include "theory/strings/type_enumerator.h" 23 : : 24 : : namespace cvc5::internal { 25 : : namespace theory { 26 : : namespace strings { 27 : : 28 : : /** 29 : : * Simple regular expression enumerator, generates only singleton language 30 : : * regular expressions from a string enumeration, in other words: 31 : : * (str.to_re s1) ... (str.to_re sn) .... 32 : : * where s1 ... sn ... is the enumeration for strings. 33 : : */ 34 : : class RegExpEnumerator : public TypeEnumeratorBase<RegExpEnumerator> 35 : : { 36 : : public: 37 : : RegExpEnumerator(TypeNode type, TypeEnumeratorProperties* tep = nullptr); 38 : : RegExpEnumerator(const RegExpEnumerator& enumerator); 39 : 34 : ~RegExpEnumerator() {} 40 : : /** get the current term */ 41 : : Node operator*() override; 42 : : /** increment */ 43 : : RegExpEnumerator& operator++() override; 44 : : /** is this enumerator finished? */ 45 : : bool isFinished() override; 46 : : 47 : : private: 48 : : /** underlying string enumerator */ 49 : : StringEnumerator d_senum; 50 : : }; 51 : : 52 : : } // namespace strings 53 : : } // namespace theory 54 : : } // namespace cvc5::internal 55 : : 56 : : #endif /* CVC5__THEORY__STRINGS__TYPE_ENUMERATOR_H */