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